@dynamic-labs-sdk/react-ui 0.0.0 → 1.51.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 (1061) hide show
  1. package/README.md +71 -0
  2. package/dist/components/Badge/Badge.d.ts +33 -0
  3. package/dist/components/Badge/Badge.d.ts.map +1 -0
  4. package/dist/components/Badge/index.d.ts +3 -0
  5. package/dist/components/Badge/index.d.ts.map +1 -0
  6. package/dist/components/Button/Button.d.ts +65 -0
  7. package/dist/components/Button/Button.d.ts.map +1 -0
  8. package/dist/components/Button/index.d.ts +3 -0
  9. package/dist/components/Button/index.d.ts.map +1 -0
  10. package/dist/components/Checkbox/Checkbox.d.ts +56 -0
  11. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
  12. package/dist/components/Checkbox/index.d.ts +3 -0
  13. package/dist/components/Checkbox/index.d.ts.map +1 -0
  14. package/dist/components/CheckboxField/CheckboxField.d.ts +63 -0
  15. package/dist/components/CheckboxField/CheckboxField.d.ts.map +1 -0
  16. package/dist/components/CheckboxField/index.d.ts +3 -0
  17. package/dist/components/CheckboxField/index.d.ts.map +1 -0
  18. package/dist/components/CopyButton/CopyButton.d.ts +48 -0
  19. package/dist/components/CopyButton/CopyButton.d.ts.map +1 -0
  20. package/dist/components/CopyButton/CopyButton.text.d.ts +12 -0
  21. package/dist/components/CopyButton/CopyButton.text.d.ts.map +1 -0
  22. package/dist/components/CopyButton/index.d.ts +3 -0
  23. package/dist/components/CopyButton/index.d.ts.map +1 -0
  24. package/dist/components/CopyField/CopyField.d.ts +57 -0
  25. package/dist/components/CopyField/CopyField.d.ts.map +1 -0
  26. package/dist/components/CopyField/CopyField.text.d.ts +13 -0
  27. package/dist/components/CopyField/CopyField.text.d.ts.map +1 -0
  28. package/dist/components/CopyField/index.d.ts +3 -0
  29. package/dist/components/CopyField/index.d.ts.map +1 -0
  30. package/dist/components/CopyMorphIcon/CopyMorphIcon.d.ts +38 -0
  31. package/dist/components/CopyMorphIcon/CopyMorphIcon.d.ts.map +1 -0
  32. package/dist/components/CopyMorphIcon/index.d.ts +3 -0
  33. package/dist/components/CopyMorphIcon/index.d.ts.map +1 -0
  34. package/dist/components/CopyText/CopyText.d.ts +50 -0
  35. package/dist/components/CopyText/CopyText.d.ts.map +1 -0
  36. package/dist/components/CopyText/CopyText.text.d.ts +13 -0
  37. package/dist/components/CopyText/CopyText.text.d.ts.map +1 -0
  38. package/dist/components/CopyText/index.d.ts +3 -0
  39. package/dist/components/CopyText/index.d.ts.map +1 -0
  40. package/dist/components/DynamicUiProvider/DynamicUiProvider.d.ts +49 -0
  41. package/dist/components/DynamicUiProvider/DynamicUiProvider.d.ts.map +1 -0
  42. package/dist/components/DynamicUiProvider/index.d.ts +3 -0
  43. package/dist/components/DynamicUiProvider/index.d.ts.map +1 -0
  44. package/dist/components/Panel/Panel.d.ts +50 -0
  45. package/dist/components/Panel/Panel.d.ts.map +1 -0
  46. package/dist/components/Panel/index.d.ts +3 -0
  47. package/dist/components/Panel/index.d.ts.map +1 -0
  48. package/dist/components/Panel/usePanel/index.d.ts +3 -0
  49. package/dist/components/Panel/usePanel/index.d.ts.map +1 -0
  50. package/dist/components/Panel/usePanel/usePanel.d.ts +30 -0
  51. package/dist/components/Panel/usePanel/usePanel.d.ts.map +1 -0
  52. package/dist/components/PanelHeader/PanelHeader.d.ts +50 -0
  53. package/dist/components/PanelHeader/PanelHeader.d.ts.map +1 -0
  54. package/dist/components/PanelHeader/PanelHeader.text.d.ts +12 -0
  55. package/dist/components/PanelHeader/PanelHeader.text.d.ts.map +1 -0
  56. package/dist/components/PanelHeader/index.d.ts +3 -0
  57. package/dist/components/PanelHeader/index.d.ts.map +1 -0
  58. package/dist/components/PanelHeader/usePanelHeader/index.d.ts +3 -0
  59. package/dist/components/PanelHeader/usePanelHeader/index.d.ts.map +1 -0
  60. package/dist/components/PanelHeader/usePanelHeader/usePanelHeader.d.ts +33 -0
  61. package/dist/components/PanelHeader/usePanelHeader/usePanelHeader.d.ts.map +1 -0
  62. package/dist/components/PanelHost/PanelHost.d.ts +48 -0
  63. package/dist/components/PanelHost/PanelHost.d.ts.map +1 -0
  64. package/dist/components/PanelHost/PanelHostCard/PanelHostCard.d.ts +37 -0
  65. package/dist/components/PanelHost/PanelHostCard/PanelHostCard.d.ts.map +1 -0
  66. package/dist/components/PanelHost/PanelHostCard/index.d.ts +3 -0
  67. package/dist/components/PanelHost/PanelHostCard/index.d.ts.map +1 -0
  68. package/dist/components/PanelHost/PanelHostContext/PanelHostContext.d.ts +49 -0
  69. package/dist/components/PanelHost/PanelHostContext/PanelHostContext.d.ts.map +1 -0
  70. package/dist/components/PanelHost/PanelHostContext/index.d.ts +3 -0
  71. package/dist/components/PanelHost/PanelHostContext/index.d.ts.map +1 -0
  72. package/dist/components/PanelHost/findChoice/findChoice.d.ts +27 -0
  73. package/dist/components/PanelHost/findChoice/findChoice.d.ts.map +1 -0
  74. package/dist/components/PanelHost/findChoice/index.d.ts +3 -0
  75. package/dist/components/PanelHost/findChoice/index.d.ts.map +1 -0
  76. package/dist/components/PanelHost/focusAfterScreenChange/focusAfterScreenChange.d.ts +38 -0
  77. package/dist/components/PanelHost/focusAfterScreenChange/focusAfterScreenChange.d.ts.map +1 -0
  78. package/dist/components/PanelHost/focusAfterScreenChange/index.d.ts +3 -0
  79. package/dist/components/PanelHost/focusAfterScreenChange/index.d.ts.map +1 -0
  80. package/dist/components/PanelHost/getChoiceLabel/getChoiceLabel.d.ts +21 -0
  81. package/dist/components/PanelHost/getChoiceLabel/getChoiceLabel.d.ts.map +1 -0
  82. package/dist/components/PanelHost/getChoiceLabel/index.d.ts +3 -0
  83. package/dist/components/PanelHost/getChoiceLabel/index.d.ts.map +1 -0
  84. package/dist/components/PanelHost/getFocusableElements/getFocusableElements.d.ts +22 -0
  85. package/dist/components/PanelHost/getFocusableElements/getFocusableElements.d.ts.map +1 -0
  86. package/dist/components/PanelHost/getFocusableElements/index.d.ts +3 -0
  87. package/dist/components/PanelHost/getFocusableElements/index.d.ts.map +1 -0
  88. package/dist/components/PanelHost/getFocusedChoice/getFocusedChoice.d.ts +33 -0
  89. package/dist/components/PanelHost/getFocusedChoice/getFocusedChoice.d.ts.map +1 -0
  90. package/dist/components/PanelHost/getFocusedChoice/index.d.ts +3 -0
  91. package/dist/components/PanelHost/getFocusedChoice/index.d.ts.map +1 -0
  92. package/dist/components/PanelHost/index.d.ts +3 -0
  93. package/dist/components/PanelHost/index.d.ts.map +1 -0
  94. package/dist/components/PanelHost/isFilledSearchField/index.d.ts +3 -0
  95. package/dist/components/PanelHost/isFilledSearchField/index.d.ts.map +1 -0
  96. package/dist/components/PanelHost/isFilledSearchField/isFilledSearchField.d.ts +22 -0
  97. package/dist/components/PanelHost/isFilledSearchField/isFilledSearchField.d.ts.map +1 -0
  98. package/dist/components/PanelHost/observeCardHeight/index.d.ts +3 -0
  99. package/dist/components/PanelHost/observeCardHeight/index.d.ts.map +1 -0
  100. package/dist/components/PanelHost/observeCardHeight/observeCardHeight.d.ts +29 -0
  101. package/dist/components/PanelHost/observeCardHeight/observeCardHeight.d.ts.map +1 -0
  102. package/dist/components/PanelHost/popChoiceForTitle/index.d.ts +3 -0
  103. package/dist/components/PanelHost/popChoiceForTitle/index.d.ts.map +1 -0
  104. package/dist/components/PanelHost/popChoiceForTitle/popChoiceForTitle.d.ts +39 -0
  105. package/dist/components/PanelHost/popChoiceForTitle/popChoiceForTitle.d.ts.map +1 -0
  106. package/dist/components/PanelHost/useCardHeight/index.d.ts +3 -0
  107. package/dist/components/PanelHost/useCardHeight/index.d.ts.map +1 -0
  108. package/dist/components/PanelHost/useCardHeight/useCardHeight.d.ts +29 -0
  109. package/dist/components/PanelHost/useCardHeight/useCardHeight.d.ts.map +1 -0
  110. package/dist/components/PanelHost/useNavigationGate/index.d.ts +3 -0
  111. package/dist/components/PanelHost/useNavigationGate/index.d.ts.map +1 -0
  112. package/dist/components/PanelHost/useNavigationGate/useNavigationGate.d.ts +22 -0
  113. package/dist/components/PanelHost/useNavigationGate/useNavigationGate.d.ts.map +1 -0
  114. package/dist/components/PanelHost/usePanelHost/index.d.ts +3 -0
  115. package/dist/components/PanelHost/usePanelHost/index.d.ts.map +1 -0
  116. package/dist/components/PanelHost/usePanelHost/usePanelHost.d.ts +48 -0
  117. package/dist/components/PanelHost/usePanelHost/usePanelHost.d.ts.map +1 -0
  118. package/dist/components/PanelHost/useScreenFocus/index.d.ts +3 -0
  119. package/dist/components/PanelHost/useScreenFocus/index.d.ts.map +1 -0
  120. package/dist/components/PanelHost/useScreenFocus/useScreenFocus.d.ts +45 -0
  121. package/dist/components/PanelHost/useScreenFocus/useScreenFocus.d.ts.map +1 -0
  122. package/dist/components/ProviderIcon/ProviderIcon.d.ts +48 -0
  123. package/dist/components/ProviderIcon/ProviderIcon.d.ts.map +1 -0
  124. package/dist/components/ProviderIcon/index.d.ts +3 -0
  125. package/dist/components/ProviderIcon/index.d.ts.map +1 -0
  126. package/dist/components/ProviderOption/ProviderOption.d.ts +56 -0
  127. package/dist/components/ProviderOption/ProviderOption.d.ts.map +1 -0
  128. package/dist/components/ProviderOption/index.d.ts +3 -0
  129. package/dist/components/ProviderOption/index.d.ts.map +1 -0
  130. package/dist/components/QRCode/QRCode.constants.d.ts +45 -0
  131. package/dist/components/QRCode/QRCode.constants.d.ts.map +1 -0
  132. package/dist/components/QRCode/QRCode.d.ts +86 -0
  133. package/dist/components/QRCode/QRCode.d.ts.map +1 -0
  134. package/dist/components/QRCode/QRCode.text.d.ts +16 -0
  135. package/dist/components/QRCode/QRCode.text.d.ts.map +1 -0
  136. package/dist/components/QRCode/buildQrCodeOptions/buildQrCodeOptions.d.ts +31 -0
  137. package/dist/components/QRCode/buildQrCodeOptions/buildQrCodeOptions.d.ts.map +1 -0
  138. package/dist/components/QRCode/buildQrCodeOptions/index.d.ts +3 -0
  139. package/dist/components/QRCode/buildQrCodeOptions/index.d.ts.map +1 -0
  140. package/dist/components/QRCode/decorateQrReveal/decorateQrReveal.d.ts +20 -0
  141. package/dist/components/QRCode/decorateQrReveal/decorateQrReveal.d.ts.map +1 -0
  142. package/dist/components/QRCode/decorateQrReveal/index.d.ts +2 -0
  143. package/dist/components/QRCode/decorateQrReveal/index.d.ts.map +1 -0
  144. package/dist/components/QRCode/index.d.ts +3 -0
  145. package/dist/components/QRCode/index.d.ts.map +1 -0
  146. package/dist/components/QRCode/logoOverlayPx/index.d.ts +3 -0
  147. package/dist/components/QRCode/logoOverlayPx/index.d.ts.map +1 -0
  148. package/dist/components/QRCode/logoOverlayPx/logoOverlayPx.d.ts +28 -0
  149. package/dist/components/QRCode/logoOverlayPx/logoOverlayPx.d.ts.map +1 -0
  150. package/dist/components/QRCode/pollForQrReveal/index.d.ts +3 -0
  151. package/dist/components/QRCode/pollForQrReveal/index.d.ts.map +1 -0
  152. package/dist/components/QRCode/pollForQrReveal/pollForQrReveal.d.ts +39 -0
  153. package/dist/components/QRCode/pollForQrReveal/pollForQrReveal.d.ts.map +1 -0
  154. package/dist/components/QRCode/snapQrGeometry/index.d.ts +3 -0
  155. package/dist/components/QRCode/snapQrGeometry/index.d.ts.map +1 -0
  156. package/dist/components/QRCode/snapQrGeometry/snapQrGeometry.d.ts +35 -0
  157. package/dist/components/QRCode/snapQrGeometry/snapQrGeometry.d.ts.map +1 -0
  158. package/dist/components/QRCode/useQrCode/index.d.ts +3 -0
  159. package/dist/components/QRCode/useQrCode/index.d.ts.map +1 -0
  160. package/dist/components/QRCode/useQrCode/useQrCode.d.ts +55 -0
  161. package/dist/components/QRCode/useQrCode/useQrCode.d.ts.map +1 -0
  162. package/dist/components/SearchBar/SearchBar.d.ts +56 -0
  163. package/dist/components/SearchBar/SearchBar.d.ts.map +1 -0
  164. package/dist/components/SearchBar/SearchBar.text.d.ts +12 -0
  165. package/dist/components/SearchBar/SearchBar.text.d.ts.map +1 -0
  166. package/dist/components/SearchBar/index.d.ts +3 -0
  167. package/dist/components/SearchBar/index.d.ts.map +1 -0
  168. package/dist/components/Select/Select.d.ts +88 -0
  169. package/dist/components/Select/Select.d.ts.map +1 -0
  170. package/dist/components/Select/Select.text.d.ts +13 -0
  171. package/dist/components/Select/Select.text.d.ts.map +1 -0
  172. package/dist/components/Select/SelectPopover/SelectPopover.d.ts +116 -0
  173. package/dist/components/Select/SelectPopover/SelectPopover.d.ts.map +1 -0
  174. package/dist/components/Select/SelectPopover/index.d.ts +3 -0
  175. package/dist/components/Select/SelectPopover/index.d.ts.map +1 -0
  176. package/dist/components/Select/index.d.ts +3 -0
  177. package/dist/components/Select/index.d.ts.map +1 -0
  178. package/dist/components/Select/useSelect/index.d.ts +3 -0
  179. package/dist/components/Select/useSelect/index.d.ts.map +1 -0
  180. package/dist/components/Select/useSelect/useSelect.d.ts +106 -0
  181. package/dist/components/Select/useSelect/useSelect.d.ts.map +1 -0
  182. package/dist/components/TokenBalanceOption/TokenBalanceOption.d.ts +64 -0
  183. package/dist/components/TokenBalanceOption/TokenBalanceOption.d.ts.map +1 -0
  184. package/dist/components/TokenBalanceOption/index.d.ts +3 -0
  185. package/dist/components/TokenBalanceOption/index.d.ts.map +1 -0
  186. package/dist/components/TokenMark/TokenMark.d.ts +52 -0
  187. package/dist/components/TokenMark/TokenMark.d.ts.map +1 -0
  188. package/dist/components/TokenMark/index.d.ts +3 -0
  189. package/dist/components/TokenMark/index.d.ts.map +1 -0
  190. package/dist/components/TokenMark/useTokenMark/index.d.ts +3 -0
  191. package/dist/components/TokenMark/useTokenMark/index.d.ts.map +1 -0
  192. package/dist/components/TokenMark/useTokenMark/useTokenMark.d.ts +40 -0
  193. package/dist/components/TokenMark/useTokenMark/useTokenMark.d.ts.map +1 -0
  194. package/dist/exports/flow.d.ts +10 -0
  195. package/dist/exports/flow.d.ts.map +1 -0
  196. package/dist/exports/index.d.ts +58 -0
  197. package/dist/exports/index.d.ts.map +1 -0
  198. package/dist/flow/components/FlowErrorBanner/FlowErrorBanner.d.ts +52 -0
  199. package/dist/flow/components/FlowErrorBanner/FlowErrorBanner.d.ts.map +1 -0
  200. package/dist/flow/components/FlowErrorBanner/index.d.ts +3 -0
  201. package/dist/flow/components/FlowErrorBanner/index.d.ts.map +1 -0
  202. package/dist/flow/components/FlowLoader/FlowLoader.constants.d.ts +3 -0
  203. package/dist/flow/components/FlowLoader/FlowLoader.constants.d.ts.map +1 -0
  204. package/dist/flow/components/FlowLoader/FlowLoader.d.ts +51 -0
  205. package/dist/flow/components/FlowLoader/FlowLoader.d.ts.map +1 -0
  206. package/dist/flow/components/FlowLoader/index.d.ts +3 -0
  207. package/dist/flow/components/FlowLoader/index.d.ts.map +1 -0
  208. package/dist/flow/components/FlowPaymentLedger/FlowPaymentLedger.d.ts +72 -0
  209. package/dist/flow/components/FlowPaymentLedger/FlowPaymentLedger.d.ts.map +1 -0
  210. package/dist/flow/components/FlowPaymentLedger/index.d.ts +3 -0
  211. package/dist/flow/components/FlowPaymentLedger/index.d.ts.map +1 -0
  212. package/dist/flow/components/FlowPaymentMethodOption/FlowPaymentMethodOption.d.ts +63 -0
  213. package/dist/flow/components/FlowPaymentMethodOption/FlowPaymentMethodOption.d.ts.map +1 -0
  214. package/dist/flow/components/FlowPaymentMethodOption/index.d.ts +3 -0
  215. package/dist/flow/components/FlowPaymentMethodOption/index.d.ts.map +1 -0
  216. package/dist/flow/components/FlowPaymentStepTracker/FlowPaymentStepTracker.d.ts +56 -0
  217. package/dist/flow/components/FlowPaymentStepTracker/FlowPaymentStepTracker.d.ts.map +1 -0
  218. package/dist/flow/components/FlowPaymentStepTracker/FlowPaymentStepTracker.text.d.ts +16 -0
  219. package/dist/flow/components/FlowPaymentStepTracker/FlowPaymentStepTracker.text.d.ts.map +1 -0
  220. package/dist/flow/components/FlowPaymentStepTracker/getStepState/getStepState.d.ts +36 -0
  221. package/dist/flow/components/FlowPaymentStepTracker/getStepState/getStepState.d.ts.map +1 -0
  222. package/dist/flow/components/FlowPaymentStepTracker/getStepState/index.d.ts +3 -0
  223. package/dist/flow/components/FlowPaymentStepTracker/getStepState/index.d.ts.map +1 -0
  224. package/dist/flow/components/FlowPaymentStepTracker/index.d.ts +3 -0
  225. package/dist/flow/components/FlowPaymentStepTracker/index.d.ts.map +1 -0
  226. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepClockIcon/StepClockIcon.d.ts +19 -0
  227. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepClockIcon/StepClockIcon.d.ts.map +1 -0
  228. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepClockIcon/index.d.ts +2 -0
  229. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepClockIcon/index.d.ts.map +1 -0
  230. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepDoneIcon/StepDoneIcon.d.ts +18 -0
  231. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepDoneIcon/StepDoneIcon.d.ts.map +1 -0
  232. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepDoneIcon/index.d.ts +2 -0
  233. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepDoneIcon/index.d.ts.map +1 -0
  234. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepDotIcon/StepDotIcon.d.ts +17 -0
  235. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepDotIcon/StepDotIcon.d.ts.map +1 -0
  236. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepDotIcon/index.d.ts +2 -0
  237. package/dist/flow/components/FlowPaymentStepTracker/stepIcons/StepDotIcon/index.d.ts.map +1 -0
  238. package/dist/flow/components/FlowPaymentSwapTile/FlowPaymentSwapTile.d.ts +38 -0
  239. package/dist/flow/components/FlowPaymentSwapTile/FlowPaymentSwapTile.d.ts.map +1 -0
  240. package/dist/flow/components/FlowPaymentSwapTile/FlowPaymentSwapTile.text.d.ts +13 -0
  241. package/dist/flow/components/FlowPaymentSwapTile/FlowPaymentSwapTile.text.d.ts.map +1 -0
  242. package/dist/flow/components/FlowPaymentSwapTile/index.d.ts +3 -0
  243. package/dist/flow/components/FlowPaymentSwapTile/index.d.ts.map +1 -0
  244. package/dist/flow/components/FlowPill/FlowPill.d.ts +36 -0
  245. package/dist/flow/components/FlowPill/FlowPill.d.ts.map +1 -0
  246. package/dist/flow/components/FlowPill/index.d.ts +3 -0
  247. package/dist/flow/components/FlowPill/index.d.ts.map +1 -0
  248. package/dist/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet.constants.d.ts +11 -0
  249. package/dist/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet.constants.d.ts.map +1 -0
  250. package/dist/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet.d.ts +62 -0
  251. package/dist/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet.d.ts.map +1 -0
  252. package/dist/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet.text.d.ts +20 -0
  253. package/dist/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet.text.d.ts.map +1 -0
  254. package/dist/flow/components/FlowRefundAddressSheet/index.d.ts +3 -0
  255. package/dist/flow/components/FlowRefundAddressSheet/index.d.ts.map +1 -0
  256. package/dist/flow/components/FlowRefundAddressSheet/useFlowRefundAddressSheet/index.d.ts +3 -0
  257. package/dist/flow/components/FlowRefundAddressSheet/useFlowRefundAddressSheet/index.d.ts.map +1 -0
  258. package/dist/flow/components/FlowRefundAddressSheet/useFlowRefundAddressSheet/useFlowRefundAddressSheet.d.ts +61 -0
  259. package/dist/flow/components/FlowRefundAddressSheet/useFlowRefundAddressSheet/useFlowRefundAddressSheet.d.ts.map +1 -0
  260. package/dist/flow/components/FlowStatusBar/FlowStatusBar.d.ts +42 -0
  261. package/dist/flow/components/FlowStatusBar/FlowStatusBar.d.ts.map +1 -0
  262. package/dist/flow/components/FlowStatusBar/index.d.ts +3 -0
  263. package/dist/flow/components/FlowStatusBar/index.d.ts.map +1 -0
  264. package/dist/flow/components/FlowStatusHero/FlowStatusHero.d.ts +74 -0
  265. package/dist/flow/components/FlowStatusHero/FlowStatusHero.d.ts.map +1 -0
  266. package/dist/flow/components/FlowStatusHero/index.d.ts +3 -0
  267. package/dist/flow/components/FlowStatusHero/index.d.ts.map +1 -0
  268. package/dist/flow/components/FlowStatusTray/FlowStatusTray.constants.d.ts +6 -0
  269. package/dist/flow/components/FlowStatusTray/FlowStatusTray.constants.d.ts.map +1 -0
  270. package/dist/flow/components/FlowStatusTray/FlowStatusTray.d.ts +49 -0
  271. package/dist/flow/components/FlowStatusTray/FlowStatusTray.d.ts.map +1 -0
  272. package/dist/flow/components/FlowStatusTray/index.d.ts +3 -0
  273. package/dist/flow/components/FlowStatusTray/index.d.ts.map +1 -0
  274. package/dist/flow/components/FlowStatusTray/useFlowStatusTray/index.d.ts +3 -0
  275. package/dist/flow/components/FlowStatusTray/useFlowStatusTray/index.d.ts.map +1 -0
  276. package/dist/flow/components/FlowStatusTray/useFlowStatusTray/useFlowStatusTray.d.ts +37 -0
  277. package/dist/flow/components/FlowStatusTray/useFlowStatusTray/useFlowStatusTray.d.ts.map +1 -0
  278. package/dist/flow/components/FlowSwapTile/FlowSwapTile.d.ts +55 -0
  279. package/dist/flow/components/FlowSwapTile/FlowSwapTile.d.ts.map +1 -0
  280. package/dist/flow/components/FlowSwapTile/FlowSwapTile.text.d.ts +14 -0
  281. package/dist/flow/components/FlowSwapTile/FlowSwapTile.text.d.ts.map +1 -0
  282. package/dist/flow/components/FlowSwapTile/FlowSwapTileSide/FlowSwapTileSide.d.ts +50 -0
  283. package/dist/flow/components/FlowSwapTile/FlowSwapTileSide/FlowSwapTileSide.d.ts.map +1 -0
  284. package/dist/flow/components/FlowSwapTile/FlowSwapTileSide/index.d.ts +3 -0
  285. package/dist/flow/components/FlowSwapTile/FlowSwapTileSide/index.d.ts.map +1 -0
  286. package/dist/flow/components/FlowSwapTile/index.d.ts +4 -0
  287. package/dist/flow/components/FlowSwapTile/index.d.ts.map +1 -0
  288. package/dist/flow/constants.d.ts +22 -0
  289. package/dist/flow/constants.d.ts.map +1 -0
  290. package/dist/flow/flow.types.d.ts +129 -0
  291. package/dist/flow/flow.types.d.ts.map +1 -0
  292. package/dist/flow/hooks/useFlowUiSettings/FlowUiSettingsContext/FlowUiSettingsContext.d.ts +15 -0
  293. package/dist/flow/hooks/useFlowUiSettings/FlowUiSettingsContext/FlowUiSettingsContext.d.ts.map +1 -0
  294. package/dist/flow/hooks/useFlowUiSettings/FlowUiSettingsContext/index.d.ts +2 -0
  295. package/dist/flow/hooks/useFlowUiSettings/FlowUiSettingsContext/index.d.ts.map +1 -0
  296. package/dist/flow/hooks/useFlowUiSettings/index.d.ts +3 -0
  297. package/dist/flow/hooks/useFlowUiSettings/index.d.ts.map +1 -0
  298. package/dist/flow/hooks/useFlowUiSettings/useFlowUiSettings.d.ts +23 -0
  299. package/dist/flow/hooks/useFlowUiSettings/useFlowUiSettings.d.ts.map +1 -0
  300. package/dist/flow/utils/formatFlowAmount/formatFlowAmount.d.ts +21 -0
  301. package/dist/flow/utils/formatFlowAmount/formatFlowAmount.d.ts.map +1 -0
  302. package/dist/flow/utils/formatFlowAmount/index.d.ts +3 -0
  303. package/dist/flow/utils/formatFlowAmount/index.d.ts.map +1 -0
  304. package/dist/flow/utils/formatFlowEstimate/formatFlowEstimate.d.ts +20 -0
  305. package/dist/flow/utils/formatFlowEstimate/formatFlowEstimate.d.ts.map +1 -0
  306. package/dist/flow/utils/formatFlowEstimate/index.d.ts +3 -0
  307. package/dist/flow/utils/formatFlowEstimate/index.d.ts.map +1 -0
  308. package/dist/flow/utils/formatFlowOrderTotal/formatFlowOrderTotal.d.ts +21 -0
  309. package/dist/flow/utils/formatFlowOrderTotal/formatFlowOrderTotal.d.ts.map +1 -0
  310. package/dist/flow/utils/formatFlowOrderTotal/index.d.ts +3 -0
  311. package/dist/flow/utils/formatFlowOrderTotal/index.d.ts.map +1 -0
  312. package/dist/flow/utils/formatFlowPayment/formatFlowPayment.d.ts +42 -0
  313. package/dist/flow/utils/formatFlowPayment/formatFlowPayment.d.ts.map +1 -0
  314. package/dist/flow/utils/formatFlowPayment/index.d.ts +3 -0
  315. package/dist/flow/utils/formatFlowPayment/index.d.ts.map +1 -0
  316. package/dist/flow/utils/getExchangeAttachErrorKind/getExchangeAttachErrorKind.constants.d.ts +4 -0
  317. package/dist/flow/utils/getExchangeAttachErrorKind/getExchangeAttachErrorKind.constants.d.ts.map +1 -0
  318. package/dist/flow/utils/getExchangeAttachErrorKind/getExchangeAttachErrorKind.d.ts +29 -0
  319. package/dist/flow/utils/getExchangeAttachErrorKind/getExchangeAttachErrorKind.d.ts.map +1 -0
  320. package/dist/flow/utils/getExchangeAttachErrorKind/index.d.ts +3 -0
  321. package/dist/flow/utils/getExchangeAttachErrorKind/index.d.ts.map +1 -0
  322. package/dist/flow/utils/getFlowAmountUsd/getFlowAmountUsd.d.ts +21 -0
  323. package/dist/flow/utils/getFlowAmountUsd/getFlowAmountUsd.d.ts.map +1 -0
  324. package/dist/flow/utils/getFlowAmountUsd/index.d.ts +3 -0
  325. package/dist/flow/utils/getFlowAmountUsd/index.d.ts.map +1 -0
  326. package/dist/flow/utils/getFlowDepositAddressSourceTokenOptions/getFlowDepositAddressSourceTokenOptions.d.ts +33 -0
  327. package/dist/flow/utils/getFlowDepositAddressSourceTokenOptions/getFlowDepositAddressSourceTokenOptions.d.ts.map +1 -0
  328. package/dist/flow/utils/getFlowDepositAddressSourceTokenOptions/index.d.ts +3 -0
  329. package/dist/flow/utils/getFlowDepositAddressSourceTokenOptions/index.d.ts.map +1 -0
  330. package/dist/flow/utils/getFlowExchangeUrl/getFlowExchangeUrl.d.ts +31 -0
  331. package/dist/flow/utils/getFlowExchangeUrl/getFlowExchangeUrl.d.ts.map +1 -0
  332. package/dist/flow/utils/getFlowExchangeUrl/index.d.ts +3 -0
  333. package/dist/flow/utils/getFlowExchangeUrl/index.d.ts.map +1 -0
  334. package/dist/flow/utils/getFlowMerchantLogoUrl/getFlowMerchantLogoUrl.d.ts +23 -0
  335. package/dist/flow/utils/getFlowMerchantLogoUrl/getFlowMerchantLogoUrl.d.ts.map +1 -0
  336. package/dist/flow/utils/getFlowMerchantLogoUrl/index.d.ts +3 -0
  337. package/dist/flow/utils/getFlowMerchantLogoUrl/index.d.ts.map +1 -0
  338. package/dist/flow/utils/getFlowPaymentMethods/getFlowPaymentMethods.d.ts +23 -0
  339. package/dist/flow/utils/getFlowPaymentMethods/getFlowPaymentMethods.d.ts.map +1 -0
  340. package/dist/flow/utils/getFlowPaymentMethods/index.d.ts +3 -0
  341. package/dist/flow/utils/getFlowPaymentMethods/index.d.ts.map +1 -0
  342. package/dist/flow/utils/getFlowPaymentTotal/getFlowPaymentTotal.d.ts +24 -0
  343. package/dist/flow/utils/getFlowPaymentTotal/getFlowPaymentTotal.d.ts.map +1 -0
  344. package/dist/flow/utils/getFlowPaymentTotal/index.d.ts +3 -0
  345. package/dist/flow/utils/getFlowPaymentTotal/index.d.ts.map +1 -0
  346. package/dist/flow/utils/getFlowSourceNetworkKey/getFlowSourceNetworkKey.d.ts +27 -0
  347. package/dist/flow/utils/getFlowSourceNetworkKey/getFlowSourceNetworkKey.d.ts.map +1 -0
  348. package/dist/flow/utils/getFlowSourceNetworkKey/index.d.ts +3 -0
  349. package/dist/flow/utils/getFlowSourceNetworkKey/index.d.ts.map +1 -0
  350. package/dist/flow/utils/getSubmitTransactionErrorType/getSubmitTransactionErrorType.d.ts +26 -0
  351. package/dist/flow/utils/getSubmitTransactionErrorType/getSubmitTransactionErrorType.d.ts.map +1 -0
  352. package/dist/flow/utils/getSubmitTransactionErrorType/index.d.ts +3 -0
  353. package/dist/flow/utils/getSubmitTransactionErrorType/index.d.ts.map +1 -0
  354. package/dist/flow/utils/getWalletAttachErrorType/getWalletAttachErrorType.d.ts +21 -0
  355. package/dist/flow/utils/getWalletAttachErrorType/getWalletAttachErrorType.d.ts.map +1 -0
  356. package/dist/flow/utils/getWalletAttachErrorType/index.d.ts +3 -0
  357. package/dist/flow/utils/getWalletAttachErrorType/index.d.ts.map +1 -0
  358. package/dist/flow/utils/isRefundAddressValid/index.d.ts +3 -0
  359. package/dist/flow/utils/isRefundAddressValid/index.d.ts.map +1 -0
  360. package/dist/flow/utils/isRefundAddressValid/isRefundAddressValid.constants.d.ts +11 -0
  361. package/dist/flow/utils/isRefundAddressValid/isRefundAddressValid.constants.d.ts.map +1 -0
  362. package/dist/flow/utils/isRefundAddressValid/isRefundAddressValid.d.ts +33 -0
  363. package/dist/flow/utils/isRefundAddressValid/isRefundAddressValid.d.ts.map +1 -0
  364. package/dist/flow/utils/openFlowExchangeUrl/index.d.ts +3 -0
  365. package/dist/flow/utils/openFlowExchangeUrl/index.d.ts.map +1 -0
  366. package/dist/flow/utils/openFlowExchangeUrl/openFlowExchangeUrl.d.ts +29 -0
  367. package/dist/flow/utils/openFlowExchangeUrl/openFlowExchangeUrl.d.ts.map +1 -0
  368. package/dist/flow/utils/resolveFlowPhase/index.d.ts +3 -0
  369. package/dist/flow/utils/resolveFlowPhase/index.d.ts.map +1 -0
  370. package/dist/flow/utils/resolveFlowPhase/resolveFlowPhase.d.ts +35 -0
  371. package/dist/flow/utils/resolveFlowPhase/resolveFlowPhase.d.ts.map +1 -0
  372. package/dist/flow/views/FlowAlreadyPaid/FlowAlreadyPaid.d.ts +50 -0
  373. package/dist/flow/views/FlowAlreadyPaid/FlowAlreadyPaid.d.ts.map +1 -0
  374. package/dist/flow/views/FlowAlreadyPaid/FlowAlreadyPaid.text.d.ts +19 -0
  375. package/dist/flow/views/FlowAlreadyPaid/FlowAlreadyPaid.text.d.ts.map +1 -0
  376. package/dist/flow/views/FlowAlreadyPaid/getFlowAlreadyPaidDetails/getFlowAlreadyPaidDetails.d.ts +54 -0
  377. package/dist/flow/views/FlowAlreadyPaid/getFlowAlreadyPaidDetails/getFlowAlreadyPaidDetails.d.ts.map +1 -0
  378. package/dist/flow/views/FlowAlreadyPaid/getFlowAlreadyPaidDetails/index.d.ts +3 -0
  379. package/dist/flow/views/FlowAlreadyPaid/getFlowAlreadyPaidDetails/index.d.ts.map +1 -0
  380. package/dist/flow/views/FlowAlreadyPaid/index.d.ts +3 -0
  381. package/dist/flow/views/FlowAlreadyPaid/index.d.ts.map +1 -0
  382. package/dist/flow/views/FlowChooseExchangeView/FlowChooseExchangeView.constants.d.ts +10 -0
  383. package/dist/flow/views/FlowChooseExchangeView/FlowChooseExchangeView.constants.d.ts.map +1 -0
  384. package/dist/flow/views/FlowChooseExchangeView/FlowChooseExchangeView.d.ts +73 -0
  385. package/dist/flow/views/FlowChooseExchangeView/FlowChooseExchangeView.d.ts.map +1 -0
  386. package/dist/flow/views/FlowChooseExchangeView/FlowChooseExchangeView.text.d.ts +18 -0
  387. package/dist/flow/views/FlowChooseExchangeView/FlowChooseExchangeView.text.d.ts.map +1 -0
  388. package/dist/flow/views/FlowChooseExchangeView/index.d.ts +3 -0
  389. package/dist/flow/views/FlowChooseExchangeView/index.d.ts.map +1 -0
  390. package/dist/flow/views/FlowChoosePaymentSourceView/FlowChoosePaymentSourceView.d.ts +61 -0
  391. package/dist/flow/views/FlowChoosePaymentSourceView/FlowChoosePaymentSourceView.d.ts.map +1 -0
  392. package/dist/flow/views/FlowChoosePaymentSourceView/FlowChoosePaymentSourceView.text.d.ts +18 -0
  393. package/dist/flow/views/FlowChoosePaymentSourceView/FlowChoosePaymentSourceView.text.d.ts.map +1 -0
  394. package/dist/flow/views/FlowChoosePaymentSourceView/index.d.ts +3 -0
  395. package/dist/flow/views/FlowChoosePaymentSourceView/index.d.ts.map +1 -0
  396. package/dist/flow/views/FlowChooseTokenView/FlowChooseTokenView.d.ts +68 -0
  397. package/dist/flow/views/FlowChooseTokenView/FlowChooseTokenView.d.ts.map +1 -0
  398. package/dist/flow/views/FlowChooseTokenView/FlowChooseTokenView.text.d.ts +17 -0
  399. package/dist/flow/views/FlowChooseTokenView/FlowChooseTokenView.text.d.ts.map +1 -0
  400. package/dist/flow/views/FlowChooseTokenView/index.d.ts +3 -0
  401. package/dist/flow/views/FlowChooseTokenView/index.d.ts.map +1 -0
  402. package/dist/flow/views/FlowChooseTokenView/useFlowChooseTokenView/index.d.ts +3 -0
  403. package/dist/flow/views/FlowChooseTokenView/useFlowChooseTokenView/index.d.ts.map +1 -0
  404. package/dist/flow/views/FlowChooseTokenView/useFlowChooseTokenView/useFlowChooseTokenView.d.ts +48 -0
  405. package/dist/flow/views/FlowChooseTokenView/useFlowChooseTokenView/useFlowChooseTokenView.d.ts.map +1 -0
  406. package/dist/flow/views/FlowDepositAddressView/FlowDepositAddressView.d.ts +111 -0
  407. package/dist/flow/views/FlowDepositAddressView/FlowDepositAddressView.d.ts.map +1 -0
  408. package/dist/flow/views/FlowDepositAddressView/FlowDepositAddressView.text.d.ts +26 -0
  409. package/dist/flow/views/FlowDepositAddressView/FlowDepositAddressView.text.d.ts.map +1 -0
  410. package/dist/flow/views/FlowDepositAddressView/buildFlowDepositUri/buildFlowDepositUri.constants.d.ts +13 -0
  411. package/dist/flow/views/FlowDepositAddressView/buildFlowDepositUri/buildFlowDepositUri.constants.d.ts.map +1 -0
  412. package/dist/flow/views/FlowDepositAddressView/buildFlowDepositUri/buildFlowDepositUri.d.ts +60 -0
  413. package/dist/flow/views/FlowDepositAddressView/buildFlowDepositUri/buildFlowDepositUri.d.ts.map +1 -0
  414. package/dist/flow/views/FlowDepositAddressView/buildFlowDepositUri/index.d.ts +3 -0
  415. package/dist/flow/views/FlowDepositAddressView/buildFlowDepositUri/index.d.ts.map +1 -0
  416. package/dist/flow/views/FlowDepositAddressView/getFlowDepositSourceKey/getFlowDepositSourceKey.d.ts +37 -0
  417. package/dist/flow/views/FlowDepositAddressView/getFlowDepositSourceKey/getFlowDepositSourceKey.d.ts.map +1 -0
  418. package/dist/flow/views/FlowDepositAddressView/getFlowDepositSourceKey/index.d.ts +3 -0
  419. package/dist/flow/views/FlowDepositAddressView/getFlowDepositSourceKey/index.d.ts.map +1 -0
  420. package/dist/flow/views/FlowDepositAddressView/index.d.ts +4 -0
  421. package/dist/flow/views/FlowDepositAddressView/index.d.ts.map +1 -0
  422. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressDetails/index.d.ts +3 -0
  423. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressDetails/index.d.ts.map +1 -0
  424. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressDetails/resolveFlowDepositAddressDetails.d.ts +73 -0
  425. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressDetails/resolveFlowDepositAddressDetails.d.ts.map +1 -0
  426. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressRefund/index.d.ts +3 -0
  427. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressRefund/index.d.ts.map +1 -0
  428. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressRefund/resolveFlowDepositAddressRefund.d.ts +41 -0
  429. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressRefund/resolveFlowDepositAddressRefund.d.ts.map +1 -0
  430. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressSelection/index.d.ts +3 -0
  431. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressSelection/index.d.ts.map +1 -0
  432. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressSelection/resolveFlowDepositAddressSelection.d.ts +49 -0
  433. package/dist/flow/views/FlowDepositAddressView/resolveFlowDepositAddressSelection/resolveFlowDepositAddressSelection.d.ts.map +1 -0
  434. package/dist/flow/views/FlowDepositAddressView/useFlowDepositAddressView/index.d.ts +3 -0
  435. package/dist/flow/views/FlowDepositAddressView/useFlowDepositAddressView/index.d.ts.map +1 -0
  436. package/dist/flow/views/FlowDepositAddressView/useFlowDepositAddressView/useFlowDepositAddressView.d.ts +107 -0
  437. package/dist/flow/views/FlowDepositAddressView/useFlowDepositAddressView/useFlowDepositAddressView.d.ts.map +1 -0
  438. package/dist/flow/views/FlowExchangeView/FlowExchangeView.constants.d.ts +3 -0
  439. package/dist/flow/views/FlowExchangeView/FlowExchangeView.constants.d.ts.map +1 -0
  440. package/dist/flow/views/FlowExchangeView/FlowExchangeView.d.ts +81 -0
  441. package/dist/flow/views/FlowExchangeView/FlowExchangeView.d.ts.map +1 -0
  442. package/dist/flow/views/FlowExchangeView/FlowExchangeView.text.d.ts +21 -0
  443. package/dist/flow/views/FlowExchangeView/FlowExchangeView.text.d.ts.map +1 -0
  444. package/dist/flow/views/FlowExchangeView/getFlowExchangeViewStatusKey/getFlowExchangeViewStatusKey.d.ts +33 -0
  445. package/dist/flow/views/FlowExchangeView/getFlowExchangeViewStatusKey/getFlowExchangeViewStatusKey.d.ts.map +1 -0
  446. package/dist/flow/views/FlowExchangeView/getFlowExchangeViewStatusKey/index.d.ts +3 -0
  447. package/dist/flow/views/FlowExchangeView/getFlowExchangeViewStatusKey/index.d.ts.map +1 -0
  448. package/dist/flow/views/FlowExchangeView/index.d.ts +3 -0
  449. package/dist/flow/views/FlowExchangeView/index.d.ts.map +1 -0
  450. package/dist/flow/views/FlowExpired/FlowExpired.d.ts +49 -0
  451. package/dist/flow/views/FlowExpired/FlowExpired.d.ts.map +1 -0
  452. package/dist/flow/views/FlowExpired/FlowExpired.text.d.ts +19 -0
  453. package/dist/flow/views/FlowExpired/FlowExpired.text.d.ts.map +1 -0
  454. package/dist/flow/views/FlowExpired/getFlowExpiredDetails/getFlowExpiredDetails.d.ts +48 -0
  455. package/dist/flow/views/FlowExpired/getFlowExpiredDetails/getFlowExpiredDetails.d.ts.map +1 -0
  456. package/dist/flow/views/FlowExpired/getFlowExpiredDetails/index.d.ts +3 -0
  457. package/dist/flow/views/FlowExpired/getFlowExpiredDetails/index.d.ts.map +1 -0
  458. package/dist/flow/views/FlowExpired/index.d.ts +3 -0
  459. package/dist/flow/views/FlowExpired/index.d.ts.map +1 -0
  460. package/dist/flow/views/FlowLeaveDepositAddressView/FlowLeaveDepositAddressView.d.ts +54 -0
  461. package/dist/flow/views/FlowLeaveDepositAddressView/FlowLeaveDepositAddressView.d.ts.map +1 -0
  462. package/dist/flow/views/FlowLeaveDepositAddressView/FlowLeaveDepositAddressView.text.d.ts +21 -0
  463. package/dist/flow/views/FlowLeaveDepositAddressView/FlowLeaveDepositAddressView.text.d.ts.map +1 -0
  464. package/dist/flow/views/FlowLeaveDepositAddressView/index.d.ts +3 -0
  465. package/dist/flow/views/FlowLeaveDepositAddressView/index.d.ts.map +1 -0
  466. package/dist/flow/views/FlowLeaveExchangeView/FlowLeaveExchangeView.d.ts +59 -0
  467. package/dist/flow/views/FlowLeaveExchangeView/FlowLeaveExchangeView.d.ts.map +1 -0
  468. package/dist/flow/views/FlowLeaveExchangeView/FlowLeaveExchangeView.text.d.ts +14 -0
  469. package/dist/flow/views/FlowLeaveExchangeView/FlowLeaveExchangeView.text.d.ts.map +1 -0
  470. package/dist/flow/views/FlowLeaveExchangeView/index.d.ts +3 -0
  471. package/dist/flow/views/FlowLeaveExchangeView/index.d.ts.map +1 -0
  472. package/dist/flow/views/FlowLoadError/FlowLoadError.d.ts +49 -0
  473. package/dist/flow/views/FlowLoadError/FlowLoadError.d.ts.map +1 -0
  474. package/dist/flow/views/FlowLoadError/FlowLoadError.text.d.ts +27 -0
  475. package/dist/flow/views/FlowLoadError/FlowLoadError.text.d.ts.map +1 -0
  476. package/dist/flow/views/FlowLoadError/index.d.ts +3 -0
  477. package/dist/flow/views/FlowLoadError/index.d.ts.map +1 -0
  478. package/dist/flow/views/FlowLoadingView/FlowLoadingView.d.ts +33 -0
  479. package/dist/flow/views/FlowLoadingView/FlowLoadingView.d.ts.map +1 -0
  480. package/dist/flow/views/FlowLoadingView/FlowLoadingView.text.d.ts +13 -0
  481. package/dist/flow/views/FlowLoadingView/FlowLoadingView.text.d.ts.map +1 -0
  482. package/dist/flow/views/FlowLoadingView/index.d.ts +3 -0
  483. package/dist/flow/views/FlowLoadingView/index.d.ts.map +1 -0
  484. package/dist/flow/views/FlowPaymentCancelled/FlowPaymentCancelled.d.ts +41 -0
  485. package/dist/flow/views/FlowPaymentCancelled/FlowPaymentCancelled.d.ts.map +1 -0
  486. package/dist/flow/views/FlowPaymentCancelled/FlowPaymentCancelled.text.d.ts +19 -0
  487. package/dist/flow/views/FlowPaymentCancelled/FlowPaymentCancelled.text.d.ts.map +1 -0
  488. package/dist/flow/views/FlowPaymentCancelled/getFlowPaymentCancelledDetails/getFlowPaymentCancelledDetails.d.ts +34 -0
  489. package/dist/flow/views/FlowPaymentCancelled/getFlowPaymentCancelledDetails/getFlowPaymentCancelledDetails.d.ts.map +1 -0
  490. package/dist/flow/views/FlowPaymentCancelled/getFlowPaymentCancelledDetails/index.d.ts +3 -0
  491. package/dist/flow/views/FlowPaymentCancelled/getFlowPaymentCancelledDetails/index.d.ts.map +1 -0
  492. package/dist/flow/views/FlowPaymentCancelled/index.d.ts +3 -0
  493. package/dist/flow/views/FlowPaymentCancelled/index.d.ts.map +1 -0
  494. package/dist/flow/views/FlowPaymentComplete/FlowPaymentComplete.d.ts +65 -0
  495. package/dist/flow/views/FlowPaymentComplete/FlowPaymentComplete.d.ts.map +1 -0
  496. package/dist/flow/views/FlowPaymentComplete/FlowPaymentComplete.text.d.ts +35 -0
  497. package/dist/flow/views/FlowPaymentComplete/FlowPaymentComplete.text.d.ts.map +1 -0
  498. package/dist/flow/views/FlowPaymentComplete/getFlowPaymentCompleteDetails/getFlowPaymentCompleteDetails.d.ts +89 -0
  499. package/dist/flow/views/FlowPaymentComplete/getFlowPaymentCompleteDetails/getFlowPaymentCompleteDetails.d.ts.map +1 -0
  500. package/dist/flow/views/FlowPaymentComplete/getFlowPaymentCompleteDetails/index.d.ts +3 -0
  501. package/dist/flow/views/FlowPaymentComplete/getFlowPaymentCompleteDetails/index.d.ts.map +1 -0
  502. package/dist/flow/views/FlowPaymentComplete/index.d.ts +3 -0
  503. package/dist/flow/views/FlowPaymentComplete/index.d.ts.map +1 -0
  504. package/dist/flow/views/FlowPaymentFailed/FlowPaymentFailed.d.ts +40 -0
  505. package/dist/flow/views/FlowPaymentFailed/FlowPaymentFailed.d.ts.map +1 -0
  506. package/dist/flow/views/FlowPaymentFailed/FlowPaymentFailed.text.d.ts +19 -0
  507. package/dist/flow/views/FlowPaymentFailed/FlowPaymentFailed.text.d.ts.map +1 -0
  508. package/dist/flow/views/FlowPaymentFailed/getFlowPaymentFailedDetails/getFlowPaymentFailedDetails.d.ts +42 -0
  509. package/dist/flow/views/FlowPaymentFailed/getFlowPaymentFailedDetails/getFlowPaymentFailedDetails.d.ts.map +1 -0
  510. package/dist/flow/views/FlowPaymentFailed/getFlowPaymentFailedDetails/index.d.ts +3 -0
  511. package/dist/flow/views/FlowPaymentFailed/getFlowPaymentFailedDetails/index.d.ts.map +1 -0
  512. package/dist/flow/views/FlowPaymentFailed/index.d.ts +3 -0
  513. package/dist/flow/views/FlowPaymentFailed/index.d.ts.map +1 -0
  514. package/dist/flow/views/FlowPaymentNotApproved/FlowPaymentNotApproved.d.ts +79 -0
  515. package/dist/flow/views/FlowPaymentNotApproved/FlowPaymentNotApproved.d.ts.map +1 -0
  516. package/dist/flow/views/FlowPaymentNotApproved/FlowPaymentNotApproved.text.d.ts +38 -0
  517. package/dist/flow/views/FlowPaymentNotApproved/FlowPaymentNotApproved.text.d.ts.map +1 -0
  518. package/dist/flow/views/FlowPaymentNotApproved/index.d.ts +3 -0
  519. package/dist/flow/views/FlowPaymentNotApproved/index.d.ts.map +1 -0
  520. package/dist/flow/views/FlowPaymentRefunded/FlowPaymentRefunded.d.ts +41 -0
  521. package/dist/flow/views/FlowPaymentRefunded/FlowPaymentRefunded.d.ts.map +1 -0
  522. package/dist/flow/views/FlowPaymentRefunded/FlowPaymentRefunded.text.d.ts +19 -0
  523. package/dist/flow/views/FlowPaymentRefunded/FlowPaymentRefunded.text.d.ts.map +1 -0
  524. package/dist/flow/views/FlowPaymentRefunded/index.d.ts +3 -0
  525. package/dist/flow/views/FlowPaymentRefunded/index.d.ts.map +1 -0
  526. package/dist/flow/views/FlowProcessingPayment/FlowProcessingPayment.constants.d.ts +7 -0
  527. package/dist/flow/views/FlowProcessingPayment/FlowProcessingPayment.constants.d.ts.map +1 -0
  528. package/dist/flow/views/FlowProcessingPayment/FlowProcessingPayment.d.ts +41 -0
  529. package/dist/flow/views/FlowProcessingPayment/FlowProcessingPayment.d.ts.map +1 -0
  530. package/dist/flow/views/FlowProcessingPayment/FlowProcessingPayment.text.d.ts +13 -0
  531. package/dist/flow/views/FlowProcessingPayment/FlowProcessingPayment.text.d.ts.map +1 -0
  532. package/dist/flow/views/FlowProcessingPayment/getFlowProcessingPaymentDetails/getFlowProcessingPaymentDetails.d.ts +52 -0
  533. package/dist/flow/views/FlowProcessingPayment/getFlowProcessingPaymentDetails/getFlowProcessingPaymentDetails.d.ts.map +1 -0
  534. package/dist/flow/views/FlowProcessingPayment/getFlowProcessingPaymentDetails/index.d.ts +4 -0
  535. package/dist/flow/views/FlowProcessingPayment/getFlowProcessingPaymentDetails/index.d.ts.map +1 -0
  536. package/dist/flow/views/FlowProcessingPayment/getFlowProcessingStep/getFlowProcessingStep.d.ts +29 -0
  537. package/dist/flow/views/FlowProcessingPayment/getFlowProcessingStep/getFlowProcessingStep.d.ts.map +1 -0
  538. package/dist/flow/views/FlowProcessingPayment/getFlowProcessingStep/index.d.ts +3 -0
  539. package/dist/flow/views/FlowProcessingPayment/getFlowProcessingStep/index.d.ts.map +1 -0
  540. package/dist/flow/views/FlowProcessingPayment/index.d.ts +3 -0
  541. package/dist/flow/views/FlowProcessingPayment/index.d.ts.map +1 -0
  542. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.constants.d.ts +15 -0
  543. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.constants.d.ts.map +1 -0
  544. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.d.ts +80 -0
  545. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.d.ts.map +1 -0
  546. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.text.d.ts +35 -0
  547. package/dist/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.text.d.ts.map +1 -0
  548. package/dist/flow/views/FlowReviewPaymentView/formatQuoteTimeLeft/formatQuoteTimeLeft.d.ts +20 -0
  549. package/dist/flow/views/FlowReviewPaymentView/formatQuoteTimeLeft/formatQuoteTimeLeft.d.ts.map +1 -0
  550. package/dist/flow/views/FlowReviewPaymentView/formatQuoteTimeLeft/index.d.ts +3 -0
  551. package/dist/flow/views/FlowReviewPaymentView/formatQuoteTimeLeft/index.d.ts.map +1 -0
  552. package/dist/flow/views/FlowReviewPaymentView/index.d.ts +3 -0
  553. package/dist/flow/views/FlowReviewPaymentView/index.d.ts.map +1 -0
  554. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/index.d.ts +3 -0
  555. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/index.d.ts.map +1 -0
  556. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useFlowReviewPaymentView.d.ts +72 -0
  557. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useFlowReviewPaymentView.d.ts.map +1 -0
  558. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useQuoteCountdown/index.d.ts +3 -0
  559. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useQuoteCountdown/index.d.ts.map +1 -0
  560. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useQuoteCountdown/useQuoteCountdown.constants.d.ts +10 -0
  561. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useQuoteCountdown/useQuoteCountdown.constants.d.ts.map +1 -0
  562. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useQuoteCountdown/useQuoteCountdown.d.ts +30 -0
  563. package/dist/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useQuoteCountdown/useQuoteCountdown.d.ts.map +1 -0
  564. package/dist/flow/views/FlowWalletConnectionView/FlowWalletAttachErrorBanner/FlowWalletAttachErrorBanner.d.ts +38 -0
  565. package/dist/flow/views/FlowWalletConnectionView/FlowWalletAttachErrorBanner/FlowWalletAttachErrorBanner.d.ts.map +1 -0
  566. package/dist/flow/views/FlowWalletConnectionView/FlowWalletAttachErrorBanner/FlowWalletAttachErrorBanner.text.d.ts +15 -0
  567. package/dist/flow/views/FlowWalletConnectionView/FlowWalletAttachErrorBanner/FlowWalletAttachErrorBanner.text.d.ts.map +1 -0
  568. package/dist/flow/views/FlowWalletConnectionView/FlowWalletAttachErrorBanner/index.d.ts +3 -0
  569. package/dist/flow/views/FlowWalletConnectionView/FlowWalletAttachErrorBanner/index.d.ts.map +1 -0
  570. package/dist/flow/views/FlowWalletConnectionView/FlowWalletConnectionView.d.ts +61 -0
  571. package/dist/flow/views/FlowWalletConnectionView/FlowWalletConnectionView.d.ts.map +1 -0
  572. package/dist/flow/views/FlowWalletConnectionView/FlowWalletConnectionView.text.d.ts +23 -0
  573. package/dist/flow/views/FlowWalletConnectionView/FlowWalletConnectionView.text.d.ts.map +1 -0
  574. package/dist/flow/views/FlowWalletConnectionView/index.d.ts +3 -0
  575. package/dist/flow/views/FlowWalletConnectionView/index.d.ts.map +1 -0
  576. package/dist/flow/widgets/FlowDepositAddressWidget/FlowDepositAddressWidget.d.ts +72 -0
  577. package/dist/flow/widgets/FlowDepositAddressWidget/FlowDepositAddressWidget.d.ts.map +1 -0
  578. package/dist/flow/widgets/FlowDepositAddressWidget/FlowDepositAddressWidgetContent/FlowDepositAddressWidgetContent.d.ts +39 -0
  579. package/dist/flow/widgets/FlowDepositAddressWidget/FlowDepositAddressWidgetContent/FlowDepositAddressWidgetContent.d.ts.map +1 -0
  580. package/dist/flow/widgets/FlowDepositAddressWidget/FlowDepositAddressWidgetContent/index.d.ts +3 -0
  581. package/dist/flow/widgets/FlowDepositAddressWidget/FlowDepositAddressWidgetContent/index.d.ts.map +1 -0
  582. package/dist/flow/widgets/FlowDepositAddressWidget/index.d.ts +3 -0
  583. package/dist/flow/widgets/FlowDepositAddressWidget/index.d.ts.map +1 -0
  584. package/dist/flow/widgets/FlowDepositAddressWidget/renderFlowDepositAddressRoute/index.d.ts +3 -0
  585. package/dist/flow/widgets/FlowDepositAddressWidget/renderFlowDepositAddressRoute/index.d.ts.map +1 -0
  586. package/dist/flow/widgets/FlowDepositAddressWidget/renderFlowDepositAddressRoute/renderFlowDepositAddressRoute.d.ts +29 -0
  587. package/dist/flow/widgets/FlowDepositAddressWidget/renderFlowDepositAddressRoute/renderFlowDepositAddressRoute.d.ts.map +1 -0
  588. package/dist/flow/widgets/FlowDepositAddressWidget/routes/depositAddressRoute/depositAddressRoute.d.ts +16 -0
  589. package/dist/flow/widgets/FlowDepositAddressWidget/routes/depositAddressRoute/depositAddressRoute.d.ts.map +1 -0
  590. package/dist/flow/widgets/FlowDepositAddressWidget/routes/depositAddressRoute/index.d.ts +3 -0
  591. package/dist/flow/widgets/FlowDepositAddressWidget/routes/depositAddressRoute/index.d.ts.map +1 -0
  592. package/dist/flow/widgets/FlowDepositAddressWidget/routes/flowDepositAddressRoutes.d.ts +13 -0
  593. package/dist/flow/widgets/FlowDepositAddressWidget/routes/flowDepositAddressRoutes.d.ts.map +1 -0
  594. package/dist/flow/widgets/FlowDepositAddressWidget/routes/flowDepositAddressRoutes.types.d.ts +38 -0
  595. package/dist/flow/widgets/FlowDepositAddressWidget/routes/flowDepositAddressRoutes.types.d.ts.map +1 -0
  596. package/dist/flow/widgets/FlowDepositAddressWidget/routes/leaveDepositAddressRoute/index.d.ts +3 -0
  597. package/dist/flow/widgets/FlowDepositAddressWidget/routes/leaveDepositAddressRoute/index.d.ts.map +1 -0
  598. package/dist/flow/widgets/FlowDepositAddressWidget/routes/leaveDepositAddressRoute/leaveDepositAddressRoute.d.ts +16 -0
  599. package/dist/flow/widgets/FlowDepositAddressWidget/routes/leaveDepositAddressRoute/leaveDepositAddressRoute.d.ts.map +1 -0
  600. package/dist/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/index.d.ts +3 -0
  601. package/dist/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/index.d.ts.map +1 -0
  602. package/dist/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/resolveFlowDepositAddressBack/index.d.ts +3 -0
  603. package/dist/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/resolveFlowDepositAddressBack/index.d.ts.map +1 -0
  604. package/dist/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/resolveFlowDepositAddressBack/resolveFlowDepositAddressBack.d.ts +41 -0
  605. package/dist/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/resolveFlowDepositAddressBack/resolveFlowDepositAddressBack.d.ts.map +1 -0
  606. package/dist/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/useFlowDepositAddressWidget.d.ts +75 -0
  607. package/dist/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/useFlowDepositAddressWidget.d.ts.map +1 -0
  608. package/dist/flow/widgets/FlowOutcomeBoundary/FlowOutcomeBoundary.d.ts +45 -0
  609. package/dist/flow/widgets/FlowOutcomeBoundary/FlowOutcomeBoundary.d.ts.map +1 -0
  610. package/dist/flow/widgets/FlowOutcomeBoundary/FlowOutcomeBoundary.types.d.ts +18 -0
  611. package/dist/flow/widgets/FlowOutcomeBoundary/FlowOutcomeBoundary.types.d.ts.map +1 -0
  612. package/dist/flow/widgets/FlowOutcomeBoundary/FlowOutcomeOwnerContext/FlowOutcomeOwnerContext.d.ts +14 -0
  613. package/dist/flow/widgets/FlowOutcomeBoundary/FlowOutcomeOwnerContext/FlowOutcomeOwnerContext.d.ts.map +1 -0
  614. package/dist/flow/widgets/FlowOutcomeBoundary/FlowOutcomeOwnerContext/index.d.ts +2 -0
  615. package/dist/flow/widgets/FlowOutcomeBoundary/FlowOutcomeOwnerContext/index.d.ts.map +1 -0
  616. package/dist/flow/widgets/FlowOutcomeBoundary/index.d.ts +3 -0
  617. package/dist/flow/widgets/FlowOutcomeBoundary/index.d.ts.map +1 -0
  618. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcome/index.d.ts +3 -0
  619. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcome/index.d.ts.map +1 -0
  620. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcome/useFlowOutcome.d.ts +25 -0
  621. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcome/useFlowOutcome.d.ts.map +1 -0
  622. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/index.d.ts +3 -0
  623. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/index.d.ts.map +1 -0
  624. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useFlowOutcomeBoundary.d.ts +49 -0
  625. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useFlowOutcomeBoundary.d.ts.map +1 -0
  626. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useResumedPaymentPending/index.d.ts +3 -0
  627. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useResumedPaymentPending/index.d.ts.map +1 -0
  628. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useResumedPaymentPending/useResumedPaymentPending.constants.d.ts +7 -0
  629. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useResumedPaymentPending/useResumedPaymentPending.constants.d.ts.map +1 -0
  630. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useResumedPaymentPending/useResumedPaymentPending.d.ts +28 -0
  631. package/dist/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useResumedPaymentPending/useResumedPaymentPending.d.ts.map +1 -0
  632. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidget.d.ts +63 -0
  633. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidget.d.ts.map +1 -0
  634. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetContent/FlowPayWithExchangeWidgetContent.d.ts +45 -0
  635. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetContent/FlowPayWithExchangeWidgetContent.d.ts.map +1 -0
  636. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetContent/index.d.ts +3 -0
  637. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetContent/index.d.ts.map +1 -0
  638. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetScreen/FlowPayWithExchangeWidgetScreen.d.ts +38 -0
  639. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetScreen/FlowPayWithExchangeWidgetScreen.d.ts.map +1 -0
  640. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetScreen/index.d.ts +3 -0
  641. package/dist/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetScreen/index.d.ts.map +1 -0
  642. package/dist/flow/widgets/FlowPayWithExchangeWidget/index.d.ts +3 -0
  643. package/dist/flow/widgets/FlowPayWithExchangeWidget/index.d.ts.map +1 -0
  644. package/dist/flow/widgets/FlowPayWithExchangeWidget/renderFlowPayWithExchangeRoute/index.d.ts +3 -0
  645. package/dist/flow/widgets/FlowPayWithExchangeWidget/renderFlowPayWithExchangeRoute/index.d.ts.map +1 -0
  646. package/dist/flow/widgets/FlowPayWithExchangeWidget/renderFlowPayWithExchangeRoute/renderFlowPayWithExchangeRoute.d.ts +29 -0
  647. package/dist/flow/widgets/FlowPayWithExchangeWidget/renderFlowPayWithExchangeRoute/renderFlowPayWithExchangeRoute.d.ts.map +1 -0
  648. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/chooseExchangeRoute/chooseExchangeRoute.d.ts +15 -0
  649. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/chooseExchangeRoute/chooseExchangeRoute.d.ts.map +1 -0
  650. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/chooseExchangeRoute/index.d.ts +3 -0
  651. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/chooseExchangeRoute/index.d.ts.map +1 -0
  652. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/exchangeRoute/exchangeRoute.d.ts +21 -0
  653. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/exchangeRoute/exchangeRoute.d.ts.map +1 -0
  654. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/exchangeRoute/index.d.ts +3 -0
  655. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/exchangeRoute/index.d.ts.map +1 -0
  656. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/flowPayWithExchangeRoutes.d.ts +14 -0
  657. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/flowPayWithExchangeRoutes.d.ts.map +1 -0
  658. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/flowPayWithExchangeRoutes.types.d.ts +38 -0
  659. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/flowPayWithExchangeRoutes.types.d.ts.map +1 -0
  660. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/leaveExchangeRoute/index.d.ts +3 -0
  661. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/leaveExchangeRoute/index.d.ts.map +1 -0
  662. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/leaveExchangeRoute/leaveExchangeRoute.d.ts +21 -0
  663. package/dist/flow/widgets/FlowPayWithExchangeWidget/routes/leaveExchangeRoute/leaveExchangeRoute.d.ts.map +1 -0
  664. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowExchangeList/index.d.ts +3 -0
  665. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowExchangeList/index.d.ts.map +1 -0
  666. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowExchangeList/useFlowExchangeList.d.ts +42 -0
  667. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowExchangeList/useFlowExchangeList.d.ts.map +1 -0
  668. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/getRouterParams/getRouterParams.d.ts +25 -0
  669. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/getRouterParams/getRouterParams.d.ts.map +1 -0
  670. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/getRouterParams/index.d.ts +3 -0
  671. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/getRouterParams/index.d.ts.map +1 -0
  672. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/index.d.ts +4 -0
  673. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/index.d.ts.map +1 -0
  674. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/resolveFlowExchangeBack/index.d.ts +3 -0
  675. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/resolveFlowExchangeBack/index.d.ts.map +1 -0
  676. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/resolveFlowExchangeBack/resolveFlowExchangeBack.d.ts +54 -0
  677. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/resolveFlowExchangeBack/resolveFlowExchangeBack.d.ts.map +1 -0
  678. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useAttachFlowExchange/index.d.ts +3 -0
  679. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useAttachFlowExchange/index.d.ts.map +1 -0
  680. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useAttachFlowExchange/useAttachFlowExchange.d.ts +64 -0
  681. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useAttachFlowExchange/useAttachFlowExchange.d.ts.map +1 -0
  682. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useFlowPayWithExchangeWidget.d.ts +44 -0
  683. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useFlowPayWithExchangeWidget.d.ts.map +1 -0
  684. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useFlowPayWithExchangeWidget.types.d.ts +40 -0
  685. package/dist/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useFlowPayWithExchangeWidget.types.d.ts.map +1 -0
  686. package/dist/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/getWaitingFlowExchangeId/getWaitingFlowExchangeId.d.ts +30 -0
  687. package/dist/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/getWaitingFlowExchangeId/getWaitingFlowExchangeId.d.ts.map +1 -0
  688. package/dist/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/getWaitingFlowExchangeId/index.d.ts +3 -0
  689. package/dist/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/getWaitingFlowExchangeId/index.d.ts.map +1 -0
  690. package/dist/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/index.d.ts +3 -0
  691. package/dist/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/index.d.ts.map +1 -0
  692. package/dist/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/useResumedFlowExchange.d.ts +41 -0
  693. package/dist/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/useResumedFlowExchange.d.ts.map +1 -0
  694. package/dist/flow/widgets/FlowPayWithWalletWidget/FlowPayWithWalletWidget.d.ts +80 -0
  695. package/dist/flow/widgets/FlowPayWithWalletWidget/FlowPayWithWalletWidget.d.ts.map +1 -0
  696. package/dist/flow/widgets/FlowPayWithWalletWidget/FlowPayWithWalletWidgetContent/FlowPayWithWalletWidgetContent.d.ts +30 -0
  697. package/dist/flow/widgets/FlowPayWithWalletWidget/FlowPayWithWalletWidgetContent/FlowPayWithWalletWidgetContent.d.ts.map +1 -0
  698. package/dist/flow/widgets/FlowPayWithWalletWidget/FlowPayWithWalletWidgetContent/index.d.ts +3 -0
  699. package/dist/flow/widgets/FlowPayWithWalletWidget/FlowPayWithWalletWidgetContent/index.d.ts.map +1 -0
  700. package/dist/flow/widgets/FlowPayWithWalletWidget/index.d.ts +3 -0
  701. package/dist/flow/widgets/FlowPayWithWalletWidget/index.d.ts.map +1 -0
  702. package/dist/flow/widgets/FlowPayWithWalletWidget/renderFlowPayWithWalletRoute/index.d.ts +3 -0
  703. package/dist/flow/widgets/FlowPayWithWalletWidget/renderFlowPayWithWalletRoute/index.d.ts.map +1 -0
  704. package/dist/flow/widgets/FlowPayWithWalletWidget/renderFlowPayWithWalletRoute/renderFlowPayWithWalletRoute.d.ts +29 -0
  705. package/dist/flow/widgets/FlowPayWithWalletWidget/renderFlowPayWithWalletRoute/renderFlowPayWithWalletRoute.d.ts.map +1 -0
  706. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/chooseTokenRoute/ChooseTokenRouteView.d.ts +56 -0
  707. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/chooseTokenRoute/ChooseTokenRouteView.d.ts.map +1 -0
  708. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/chooseTokenRoute/chooseTokenRoute.d.ts +23 -0
  709. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/chooseTokenRoute/chooseTokenRoute.d.ts.map +1 -0
  710. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/chooseTokenRoute/index.d.ts +3 -0
  711. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/chooseTokenRoute/index.d.ts.map +1 -0
  712. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/connectWalletRoute/ConnectWalletRouteView.d.ts +58 -0
  713. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/connectWalletRoute/ConnectWalletRouteView.d.ts.map +1 -0
  714. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/connectWalletRoute/connectWalletRoute.d.ts +18 -0
  715. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/connectWalletRoute/connectWalletRoute.d.ts.map +1 -0
  716. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/connectWalletRoute/index.d.ts +3 -0
  717. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/connectWalletRoute/index.d.ts.map +1 -0
  718. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/flowPayWithWalletRoutes.d.ts +14 -0
  719. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/flowPayWithWalletRoutes.d.ts.map +1 -0
  720. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/flowPayWithWalletRoutes.types.d.ts +63 -0
  721. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/flowPayWithWalletRoutes.types.d.ts.map +1 -0
  722. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentNotApprovedRoute/PaymentNotApprovedRouteView.d.ts +57 -0
  723. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentNotApprovedRoute/PaymentNotApprovedRouteView.d.ts.map +1 -0
  724. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentNotApprovedRoute/index.d.ts +3 -0
  725. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentNotApprovedRoute/index.d.ts.map +1 -0
  726. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentNotApprovedRoute/paymentNotApprovedRoute.d.ts +19 -0
  727. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentNotApprovedRoute/paymentNotApprovedRoute.d.ts.map +1 -0
  728. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentSentRoute/PaymentSentRouteView.d.ts +31 -0
  729. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentSentRoute/PaymentSentRouteView.d.ts.map +1 -0
  730. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentSentRoute/index.d.ts +3 -0
  731. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentSentRoute/index.d.ts.map +1 -0
  732. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentSentRoute/paymentSentRoute.d.ts +20 -0
  733. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/paymentSentRoute/paymentSentRoute.d.ts.map +1 -0
  734. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/reviewPaymentRoute/ReviewPaymentRouteView.d.ts +64 -0
  735. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/reviewPaymentRoute/ReviewPaymentRouteView.d.ts.map +1 -0
  736. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/reviewPaymentRoute/index.d.ts +3 -0
  737. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/reviewPaymentRoute/index.d.ts.map +1 -0
  738. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/reviewPaymentRoute/reviewPaymentRoute.d.ts +19 -0
  739. package/dist/flow/widgets/FlowPayWithWalletWidget/routes/reviewPaymentRoute/reviewPaymentRoute.d.ts.map +1 -0
  740. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/findResumableWalletAccount/findResumableWalletAccount.d.ts +31 -0
  741. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/findResumableWalletAccount/findResumableWalletAccount.d.ts.map +1 -0
  742. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/findResumableWalletAccount/index.d.ts +3 -0
  743. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/findResumableWalletAccount/index.d.ts.map +1 -0
  744. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getRouterParams/getRouterParams.d.ts +26 -0
  745. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getRouterParams/getRouterParams.d.ts.map +1 -0
  746. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getRouterParams/index.d.ts +3 -0
  747. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getRouterParams/index.d.ts.map +1 -0
  748. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getSubmitErrorAction/getSubmitErrorAction.d.ts +41 -0
  749. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getSubmitErrorAction/getSubmitErrorAction.d.ts.map +1 -0
  750. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getSubmitErrorAction/index.d.ts +3 -0
  751. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getSubmitErrorAction/index.d.ts.map +1 -0
  752. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/index.d.ts +3 -0
  753. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/index.d.ts.map +1 -0
  754. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useAttachWalletSource/index.d.ts +3 -0
  755. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useAttachWalletSource/index.d.ts.map +1 -0
  756. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useAttachWalletSource/useAttachWalletSource.d.ts +52 -0
  757. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useAttachWalletSource/useAttachWalletSource.d.ts.map +1 -0
  758. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useFlowPayWithWalletWidget.d.ts +97 -0
  759. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useFlowPayWithWalletWidget.d.ts.map +1 -0
  760. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/index.d.ts +3 -0
  761. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/index.d.ts.map +1 -0
  762. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/useSubmitErrorState/index.d.ts +3 -0
  763. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/useSubmitErrorState/index.d.ts.map +1 -0
  764. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/useSubmitErrorState/useSubmitErrorState.d.ts +33 -0
  765. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/useSubmitErrorState/useSubmitErrorState.d.ts.map +1 -0
  766. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/useSubmitPayment.d.ts +66 -0
  767. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/useSubmitPayment.d.ts.map +1 -0
  768. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useTokenPick/index.d.ts +3 -0
  769. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useTokenPick/index.d.ts.map +1 -0
  770. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useTokenPick/useTokenPick.d.ts +57 -0
  771. package/dist/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useTokenPick/useTokenPick.d.ts.map +1 -0
  772. package/dist/flow/widgets/FlowWidget/FlowWidget.d.ts +71 -0
  773. package/dist/flow/widgets/FlowWidget/FlowWidget.d.ts.map +1 -0
  774. package/dist/flow/widgets/FlowWidget/FlowWidgetContent/FlowWidgetContent.d.ts +35 -0
  775. package/dist/flow/widgets/FlowWidget/FlowWidgetContent/FlowWidgetContent.d.ts.map +1 -0
  776. package/dist/flow/widgets/FlowWidget/FlowWidgetContent/index.d.ts +3 -0
  777. package/dist/flow/widgets/FlowWidget/FlowWidgetContent/index.d.ts.map +1 -0
  778. package/dist/flow/widgets/FlowWidget/index.d.ts +3 -0
  779. package/dist/flow/widgets/FlowWidget/index.d.ts.map +1 -0
  780. package/dist/flow/widgets/FlowWidget/renderFlowWidgetRoute/index.d.ts +3 -0
  781. package/dist/flow/widgets/FlowWidget/renderFlowWidgetRoute/index.d.ts.map +1 -0
  782. package/dist/flow/widgets/FlowWidget/renderFlowWidgetRoute/renderFlowWidgetRoute.d.ts +29 -0
  783. package/dist/flow/widgets/FlowWidget/renderFlowWidgetRoute/renderFlowWidgetRoute.d.ts.map +1 -0
  784. package/dist/flow/widgets/FlowWidget/routes/choosePaymentMethodRoute/choosePaymentMethodRoute.d.ts +16 -0
  785. package/dist/flow/widgets/FlowWidget/routes/choosePaymentMethodRoute/choosePaymentMethodRoute.d.ts.map +1 -0
  786. package/dist/flow/widgets/FlowWidget/routes/choosePaymentMethodRoute/index.d.ts +3 -0
  787. package/dist/flow/widgets/FlowWidget/routes/choosePaymentMethodRoute/index.d.ts.map +1 -0
  788. package/dist/flow/widgets/FlowWidget/routes/flowWidgetRoutes.constants.d.ts +10 -0
  789. package/dist/flow/widgets/FlowWidget/routes/flowWidgetRoutes.constants.d.ts.map +1 -0
  790. package/dist/flow/widgets/FlowWidget/routes/flowWidgetRoutes.d.ts +13 -0
  791. package/dist/flow/widgets/FlowWidget/routes/flowWidgetRoutes.d.ts.map +1 -0
  792. package/dist/flow/widgets/FlowWidget/routes/flowWidgetRoutes.types.d.ts +40 -0
  793. package/dist/flow/widgets/FlowWidget/routes/flowWidgetRoutes.types.d.ts.map +1 -0
  794. package/dist/flow/widgets/FlowWidget/routes/payWithDepositAddressRoute/index.d.ts +3 -0
  795. package/dist/flow/widgets/FlowWidget/routes/payWithDepositAddressRoute/index.d.ts.map +1 -0
  796. package/dist/flow/widgets/FlowWidget/routes/payWithDepositAddressRoute/payWithDepositAddressRoute.d.ts +17 -0
  797. package/dist/flow/widgets/FlowWidget/routes/payWithDepositAddressRoute/payWithDepositAddressRoute.d.ts.map +1 -0
  798. package/dist/flow/widgets/FlowWidget/routes/payWithExchangeRoute/index.d.ts +3 -0
  799. package/dist/flow/widgets/FlowWidget/routes/payWithExchangeRoute/index.d.ts.map +1 -0
  800. package/dist/flow/widgets/FlowWidget/routes/payWithExchangeRoute/payWithExchangeRoute.d.ts +19 -0
  801. package/dist/flow/widgets/FlowWidget/routes/payWithExchangeRoute/payWithExchangeRoute.d.ts.map +1 -0
  802. package/dist/flow/widgets/FlowWidget/routes/payWithWalletRoute/index.d.ts +3 -0
  803. package/dist/flow/widgets/FlowWidget/routes/payWithWalletRoute/index.d.ts.map +1 -0
  804. package/dist/flow/widgets/FlowWidget/routes/payWithWalletRoute/payWithWalletRoute.d.ts +17 -0
  805. package/dist/flow/widgets/FlowWidget/routes/payWithWalletRoute/payWithWalletRoute.d.ts.map +1 -0
  806. package/dist/flow/widgets/FlowWidget/useFlowWidget/getResumedFlowPaymentMethod/getResumedFlowPaymentMethod.d.ts +24 -0
  807. package/dist/flow/widgets/FlowWidget/useFlowWidget/getResumedFlowPaymentMethod/getResumedFlowPaymentMethod.d.ts.map +1 -0
  808. package/dist/flow/widgets/FlowWidget/useFlowWidget/getResumedFlowPaymentMethod/index.d.ts +3 -0
  809. package/dist/flow/widgets/FlowWidget/useFlowWidget/getResumedFlowPaymentMethod/index.d.ts.map +1 -0
  810. package/dist/flow/widgets/FlowWidget/useFlowWidget/getRouterParams/getRouterParams.d.ts +29 -0
  811. package/dist/flow/widgets/FlowWidget/useFlowWidget/getRouterParams/getRouterParams.d.ts.map +1 -0
  812. package/dist/flow/widgets/FlowWidget/useFlowWidget/getRouterParams/index.d.ts +3 -0
  813. package/dist/flow/widgets/FlowWidget/useFlowWidget/getRouterParams/index.d.ts.map +1 -0
  814. package/dist/flow/widgets/FlowWidget/useFlowWidget/index.d.ts +3 -0
  815. package/dist/flow/widgets/FlowWidget/useFlowWidget/index.d.ts.map +1 -0
  816. package/dist/flow/widgets/FlowWidget/useFlowWidget/useFlowWidget.d.ts +53 -0
  817. package/dist/flow/widgets/FlowWidget/useFlowWidget/useFlowWidget.d.ts.map +1 -0
  818. package/dist/flow.cjs +7097 -0
  819. package/dist/flow.cjs.map +1 -0
  820. package/dist/flow.css +1 -0
  821. package/dist/flow.esm.js +7094 -0
  822. package/dist/flow.esm.js.map +1 -0
  823. package/dist/i18n/TextProvider/TextProvider.d.ts +49 -0
  824. package/dist/i18n/TextProvider/TextProvider.d.ts.map +1 -0
  825. package/dist/i18n/TextProvider/index.d.ts +3 -0
  826. package/dist/i18n/TextProvider/index.d.ts.map +1 -0
  827. package/dist/i18n/interpolateText/index.d.ts +3 -0
  828. package/dist/i18n/interpolateText/index.d.ts.map +1 -0
  829. package/dist/i18n/interpolateText/interpolateText.d.ts +44 -0
  830. package/dist/i18n/interpolateText/interpolateText.d.ts.map +1 -0
  831. package/dist/i18n/text.types.d.ts +32 -0
  832. package/dist/i18n/text.types.d.ts.map +1 -0
  833. package/dist/i18n/useText/index.d.ts +3 -0
  834. package/dist/i18n/useText/index.d.ts.map +1 -0
  835. package/dist/i18n/useText/useText.d.ts +39 -0
  836. package/dist/i18n/useText/useText.d.ts.map +1 -0
  837. package/dist/icons/ArrowLeftIcon/ArrowLeftIcon.d.ts +24 -0
  838. package/dist/icons/ArrowLeftIcon/ArrowLeftIcon.d.ts.map +1 -0
  839. package/dist/icons/ArrowLeftIcon/index.d.ts +2 -0
  840. package/dist/icons/ArrowLeftIcon/index.d.ts.map +1 -0
  841. package/dist/icons/BankIcon/BankIcon.d.ts +23 -0
  842. package/dist/icons/BankIcon/BankIcon.d.ts.map +1 -0
  843. package/dist/icons/BankIcon/index.d.ts +2 -0
  844. package/dist/icons/BankIcon/index.d.ts.map +1 -0
  845. package/dist/icons/ChevronDownIcon/ChevronDownIcon.d.ts +22 -0
  846. package/dist/icons/ChevronDownIcon/ChevronDownIcon.d.ts.map +1 -0
  847. package/dist/icons/ChevronDownIcon/index.d.ts +2 -0
  848. package/dist/icons/ChevronDownIcon/index.d.ts.map +1 -0
  849. package/dist/icons/CopyIcon/CopyIcon.d.ts +19 -0
  850. package/dist/icons/CopyIcon/CopyIcon.d.ts.map +1 -0
  851. package/dist/icons/CopyIcon/index.d.ts +2 -0
  852. package/dist/icons/CopyIcon/index.d.ts.map +1 -0
  853. package/dist/icons/QrCodeIcon/QrCodeIcon.d.ts +23 -0
  854. package/dist/icons/QrCodeIcon/QrCodeIcon.d.ts.map +1 -0
  855. package/dist/icons/QrCodeIcon/index.d.ts +2 -0
  856. package/dist/icons/QrCodeIcon/index.d.ts.map +1 -0
  857. package/dist/icons/SearchIcon/SearchIcon.d.ts +23 -0
  858. package/dist/icons/SearchIcon/SearchIcon.d.ts.map +1 -0
  859. package/dist/icons/SearchIcon/index.d.ts +2 -0
  860. package/dist/icons/SearchIcon/index.d.ts.map +1 -0
  861. package/dist/icons/UnknownTokenIcon/UnknownTokenIcon.d.ts +21 -0
  862. package/dist/icons/UnknownTokenIcon/UnknownTokenIcon.d.ts.map +1 -0
  863. package/dist/icons/UnknownTokenIcon/index.d.ts +2 -0
  864. package/dist/icons/UnknownTokenIcon/index.d.ts.map +1 -0
  865. package/dist/icons/WalletIcon/WalletIcon.d.ts +23 -0
  866. package/dist/icons/WalletIcon/WalletIcon.d.ts.map +1 -0
  867. package/dist/icons/WalletIcon/index.d.ts +2 -0
  868. package/dist/icons/WalletIcon/index.d.ts.map +1 -0
  869. package/dist/icons/icon.types.d.ts +7 -0
  870. package/dist/icons/icon.types.d.ts.map +1 -0
  871. package/dist/index.cjs +106 -0
  872. package/dist/index.cjs.map +1 -0
  873. package/dist/index.css +1 -0
  874. package/dist/index.esm.js +80 -0
  875. package/dist/index.esm.js.map +1 -0
  876. package/dist/motion/MotionProvider/MotionProvider.d.ts +22 -0
  877. package/dist/motion/MotionProvider/MotionProvider.d.ts.map +1 -0
  878. package/dist/motion/MotionProvider/index.d.ts +2 -0
  879. package/dist/motion/MotionProvider/index.d.ts.map +1 -0
  880. package/dist/motion/motionTokens.d.ts +63 -0
  881. package/dist/motion/motionTokens.d.ts.map +1 -0
  882. package/dist/package-BtQHztmi.cjs +4821 -0
  883. package/dist/package-BtQHztmi.cjs.map +1 -0
  884. package/dist/package-jOFC3RJg.esm.js +4606 -0
  885. package/dist/package-jOFC3RJg.esm.js.map +1 -0
  886. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  887. package/dist/utils/assertValidNonNegativeDecimalString/assertValidNonNegativeDecimalString.d.ts +23 -0
  888. package/dist/utils/assertValidNonNegativeDecimalString/assertValidNonNegativeDecimalString.d.ts.map +1 -0
  889. package/dist/utils/assertValidNonNegativeDecimalString/index.d.ts +3 -0
  890. package/dist/utils/assertValidNonNegativeDecimalString/index.d.ts.map +1 -0
  891. package/dist/utils/formatFiatAmount/formatFiatAmount.d.ts +30 -0
  892. package/dist/utils/formatFiatAmount/formatFiatAmount.d.ts.map +1 -0
  893. package/dist/utils/formatFiatAmount/index.d.ts +3 -0
  894. package/dist/utils/formatFiatAmount/index.d.ts.map +1 -0
  895. package/dist/utils/getChainInfo/getChainInfo.d.ts +31 -0
  896. package/dist/utils/getChainInfo/getChainInfo.d.ts.map +1 -0
  897. package/dist/utils/getChainInfo/index.d.ts +3 -0
  898. package/dist/utils/getChainInfo/index.d.ts.map +1 -0
  899. package/dist/utils/hooks/useCopyToClipboard/index.d.ts +3 -0
  900. package/dist/utils/hooks/useCopyToClipboard/index.d.ts.map +1 -0
  901. package/dist/utils/hooks/useCopyToClipboard/useCopyToClipboard.d.ts +32 -0
  902. package/dist/utils/hooks/useCopyToClipboard/useCopyToClipboard.d.ts.map +1 -0
  903. package/dist/utils/hooks/useGetWalletName/index.d.ts +3 -0
  904. package/dist/utils/hooks/useGetWalletName/index.d.ts.map +1 -0
  905. package/dist/utils/hooks/useGetWalletName/useGetWalletName.d.ts +33 -0
  906. package/dist/utils/hooks/useGetWalletName/useGetWalletName.d.ts.map +1 -0
  907. package/dist/utils/hooks/useIsomorphicLayoutEffect/index.d.ts +2 -0
  908. package/dist/utils/hooks/useIsomorphicLayoutEffect/index.d.ts.map +1 -0
  909. package/dist/utils/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +21 -0
  910. package/dist/utils/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts.map +1 -0
  911. package/dist/utils/hooks/useViewRouter/index.d.ts +3 -0
  912. package/dist/utils/hooks/useViewRouter/index.d.ts.map +1 -0
  913. package/dist/utils/hooks/useViewRouter/useViewRouter.d.ts +83 -0
  914. package/dist/utils/hooks/useViewRouter/useViewRouter.d.ts.map +1 -0
  915. package/dist/utils/isValidImageSource/index.d.ts +2 -0
  916. package/dist/utils/isValidImageSource/index.d.ts.map +1 -0
  917. package/dist/utils/isValidImageSource/isValidImageSource.d.ts +21 -0
  918. package/dist/utils/isValidImageSource/isValidImageSource.d.ts.map +1 -0
  919. package/dist/utils/truncateWalletAddress/index.d.ts +3 -0
  920. package/dist/utils/truncateWalletAddress/index.d.ts.map +1 -0
  921. package/dist/utils/truncateWalletAddress/truncateWalletAddress.d.ts +23 -0
  922. package/dist/utils/truncateWalletAddress/truncateWalletAddress.d.ts.map +1 -0
  923. package/dist/views/BalancesList/BalancesList.d.ts +84 -0
  924. package/dist/views/BalancesList/BalancesList.d.ts.map +1 -0
  925. package/dist/views/BalancesList/BalancesList.text.d.ts +12 -0
  926. package/dist/views/BalancesList/BalancesList.text.d.ts.map +1 -0
  927. package/dist/views/BalancesList/index.d.ts +3 -0
  928. package/dist/views/BalancesList/index.d.ts.map +1 -0
  929. package/dist/views/ProviderList/ProviderList.d.ts +115 -0
  930. package/dist/views/ProviderList/ProviderList.d.ts.map +1 -0
  931. package/dist/views/ProviderList/ProviderList.text.d.ts +20 -0
  932. package/dist/views/ProviderList/ProviderList.text.d.ts.map +1 -0
  933. package/dist/views/ProviderList/getProviderMatchRank/getProviderMatchRank.d.ts +25 -0
  934. package/dist/views/ProviderList/getProviderMatchRank/getProviderMatchRank.d.ts.map +1 -0
  935. package/dist/views/ProviderList/getProviderMatchRank/index.d.ts +3 -0
  936. package/dist/views/ProviderList/getProviderMatchRank/index.d.ts.map +1 -0
  937. package/dist/views/ProviderList/index.d.ts +3 -0
  938. package/dist/views/ProviderList/index.d.ts.map +1 -0
  939. package/dist/views/ProviderList/rankProviderMatches/index.d.ts +3 -0
  940. package/dist/views/ProviderList/rankProviderMatches/index.d.ts.map +1 -0
  941. package/dist/views/ProviderList/rankProviderMatches/rankProviderMatches.d.ts +29 -0
  942. package/dist/views/ProviderList/rankProviderMatches/rankProviderMatches.d.ts.map +1 -0
  943. package/dist/views/WalletAccountBalances/WalletAccountBalances.d.ts +62 -0
  944. package/dist/views/WalletAccountBalances/WalletAccountBalances.d.ts.map +1 -0
  945. package/dist/views/WalletAccountBalances/WalletAccountBalances.text.d.ts +13 -0
  946. package/dist/views/WalletAccountBalances/WalletAccountBalances.text.d.ts.map +1 -0
  947. package/dist/views/WalletAccountBalances/index.d.ts +3 -0
  948. package/dist/views/WalletAccountBalances/index.d.ts.map +1 -0
  949. package/dist/views/WalletAccountBalances/orderBalancesByTokenMarketValueDesc/index.d.ts +3 -0
  950. package/dist/views/WalletAccountBalances/orderBalancesByTokenMarketValueDesc/index.d.ts.map +1 -0
  951. package/dist/views/WalletAccountBalances/orderBalancesByTokenMarketValueDesc/orderBalancesByTokenMarketValueDesc.d.ts +31 -0
  952. package/dist/views/WalletAccountBalances/orderBalancesByTokenMarketValueDesc/orderBalancesByTokenMarketValueDesc.d.ts.map +1 -0
  953. package/dist/views/WalletAccountBalances/toTokenBalanceRow/index.d.ts +3 -0
  954. package/dist/views/WalletAccountBalances/toTokenBalanceRow/index.d.ts.map +1 -0
  955. package/dist/views/WalletAccountBalances/toTokenBalanceRow/toTokenBalanceRow.d.ts +69 -0
  956. package/dist/views/WalletAccountBalances/toTokenBalanceRow/toTokenBalanceRow.d.ts.map +1 -0
  957. package/dist/views/WalletAccountBalances/useWalletAccountBalances/index.d.ts +3 -0
  958. package/dist/views/WalletAccountBalances/useWalletAccountBalances/index.d.ts.map +1 -0
  959. package/dist/views/WalletAccountBalances/useWalletAccountBalances/useWalletAccountBalances.d.ts +67 -0
  960. package/dist/views/WalletAccountBalances/useWalletAccountBalances/useWalletAccountBalances.d.ts.map +1 -0
  961. package/dist/views/WalletChainList/WalletChainList.d.ts +59 -0
  962. package/dist/views/WalletChainList/WalletChainList.d.ts.map +1 -0
  963. package/dist/views/WalletChainList/WalletChainList.text.d.ts +12 -0
  964. package/dist/views/WalletChainList/WalletChainList.text.d.ts.map +1 -0
  965. package/dist/views/WalletChainList/index.d.ts +3 -0
  966. package/dist/views/WalletChainList/index.d.ts.map +1 -0
  967. package/dist/views/WalletConnectQrCode/WalletConnectQrCode.d.ts +53 -0
  968. package/dist/views/WalletConnectQrCode/WalletConnectQrCode.d.ts.map +1 -0
  969. package/dist/views/WalletConnectQrCode/WalletConnectQrCode.text.d.ts +28 -0
  970. package/dist/views/WalletConnectQrCode/WalletConnectQrCode.text.d.ts.map +1 -0
  971. package/dist/views/WalletConnectQrCode/index.d.ts +3 -0
  972. package/dist/views/WalletConnectQrCode/index.d.ts.map +1 -0
  973. package/dist/views/WalletConnectionStatus/WalletConnectionStatus.d.ts +72 -0
  974. package/dist/views/WalletConnectionStatus/WalletConnectionStatus.d.ts.map +1 -0
  975. package/dist/views/WalletConnectionStatus/index.d.ts +3 -0
  976. package/dist/views/WalletConnectionStatus/index.d.ts.map +1 -0
  977. package/dist/views/WalletList/WalletList.d.ts +58 -0
  978. package/dist/views/WalletList/WalletList.d.ts.map +1 -0
  979. package/dist/views/WalletList/WalletList.text.d.ts +16 -0
  980. package/dist/views/WalletList/WalletList.text.d.ts.map +1 -0
  981. package/dist/views/WalletList/index.d.ts +3 -0
  982. package/dist/views/WalletList/index.d.ts.map +1 -0
  983. package/dist/widgets/ConnectWalletOptionWidget/ConnectWalletOptionWidget.d.ts +99 -0
  984. package/dist/widgets/ConnectWalletOptionWidget/ConnectWalletOptionWidget.d.ts.map +1 -0
  985. package/dist/widgets/ConnectWalletOptionWidget/ConnectWalletOptionWidget.text.d.ts +30 -0
  986. package/dist/widgets/ConnectWalletOptionWidget/ConnectWalletOptionWidget.text.d.ts.map +1 -0
  987. package/dist/widgets/ConnectWalletOptionWidget/getConnectWalletRouteTitle/getConnectWalletRouteTitle.d.ts +27 -0
  988. package/dist/widgets/ConnectWalletOptionWidget/getConnectWalletRouteTitle/getConnectWalletRouteTitle.d.ts.map +1 -0
  989. package/dist/widgets/ConnectWalletOptionWidget/getConnectWalletRouteTitle/index.d.ts +3 -0
  990. package/dist/widgets/ConnectWalletOptionWidget/getConnectWalletRouteTitle/index.d.ts.map +1 -0
  991. package/dist/widgets/ConnectWalletOptionWidget/index.d.ts +3 -0
  992. package/dist/widgets/ConnectWalletOptionWidget/index.d.ts.map +1 -0
  993. package/dist/widgets/ConnectWalletOptionWidget/renderConnectWalletRoute/index.d.ts +3 -0
  994. package/dist/widgets/ConnectWalletOptionWidget/renderConnectWalletRoute/index.d.ts.map +1 -0
  995. package/dist/widgets/ConnectWalletOptionWidget/renderConnectWalletRoute/renderConnectWalletRoute.d.ts +30 -0
  996. package/dist/widgets/ConnectWalletOptionWidget/renderConnectWalletRoute/renderConnectWalletRoute.d.ts.map +1 -0
  997. package/dist/widgets/ConnectWalletOptionWidget/routes/chainPickerRoute/ChainPickerRouteView.d.ts +42 -0
  998. package/dist/widgets/ConnectWalletOptionWidget/routes/chainPickerRoute/ChainPickerRouteView.d.ts.map +1 -0
  999. package/dist/widgets/ConnectWalletOptionWidget/routes/chainPickerRoute/ChainPickerRouteView.text.d.ts +8 -0
  1000. package/dist/widgets/ConnectWalletOptionWidget/routes/chainPickerRoute/ChainPickerRouteView.text.d.ts.map +1 -0
  1001. package/dist/widgets/ConnectWalletOptionWidget/routes/chainPickerRoute/chainPickerRoute.d.ts +24 -0
  1002. package/dist/widgets/ConnectWalletOptionWidget/routes/chainPickerRoute/chainPickerRoute.d.ts.map +1 -0
  1003. package/dist/widgets/ConnectWalletOptionWidget/routes/chainPickerRoute/index.d.ts +3 -0
  1004. package/dist/widgets/ConnectWalletOptionWidget/routes/chainPickerRoute/index.d.ts.map +1 -0
  1005. package/dist/widgets/ConnectWalletOptionWidget/routes/connectWalletRoutes.d.ts +14 -0
  1006. package/dist/widgets/ConnectWalletOptionWidget/routes/connectWalletRoutes.d.ts.map +1 -0
  1007. package/dist/widgets/ConnectWalletOptionWidget/routes/connectWalletRoutes.types.d.ts +108 -0
  1008. package/dist/widgets/ConnectWalletOptionWidget/routes/connectWalletRoutes.types.d.ts.map +1 -0
  1009. package/dist/widgets/ConnectWalletOptionWidget/routes/connectedRoute/ConnectedRouteView.d.ts +33 -0
  1010. package/dist/widgets/ConnectWalletOptionWidget/routes/connectedRoute/ConnectedRouteView.d.ts.map +1 -0
  1011. package/dist/widgets/ConnectWalletOptionWidget/routes/connectedRoute/ConnectedRouteView.text.d.ts +16 -0
  1012. package/dist/widgets/ConnectWalletOptionWidget/routes/connectedRoute/ConnectedRouteView.text.d.ts.map +1 -0
  1013. package/dist/widgets/ConnectWalletOptionWidget/routes/connectedRoute/connectedRoute.d.ts +22 -0
  1014. package/dist/widgets/ConnectWalletOptionWidget/routes/connectedRoute/connectedRoute.d.ts.map +1 -0
  1015. package/dist/widgets/ConnectWalletOptionWidget/routes/connectedRoute/index.d.ts +3 -0
  1016. package/dist/widgets/ConnectWalletOptionWidget/routes/connectedRoute/index.d.ts.map +1 -0
  1017. package/dist/widgets/ConnectWalletOptionWidget/routes/connectingRoute/ConnectingRouteView.d.ts +33 -0
  1018. package/dist/widgets/ConnectWalletOptionWidget/routes/connectingRoute/ConnectingRouteView.d.ts.map +1 -0
  1019. package/dist/widgets/ConnectWalletOptionWidget/routes/connectingRoute/ConnectingRouteView.text.d.ts +17 -0
  1020. package/dist/widgets/ConnectWalletOptionWidget/routes/connectingRoute/ConnectingRouteView.text.d.ts.map +1 -0
  1021. package/dist/widgets/ConnectWalletOptionWidget/routes/connectingRoute/connectingRoute.d.ts +23 -0
  1022. package/dist/widgets/ConnectWalletOptionWidget/routes/connectingRoute/connectingRoute.d.ts.map +1 -0
  1023. package/dist/widgets/ConnectWalletOptionWidget/routes/connectingRoute/index.d.ts +3 -0
  1024. package/dist/widgets/ConnectWalletOptionWidget/routes/connectingRoute/index.d.ts.map +1 -0
  1025. package/dist/widgets/ConnectWalletOptionWidget/routes/errorRoute/ErrorRouteView.d.ts +44 -0
  1026. package/dist/widgets/ConnectWalletOptionWidget/routes/errorRoute/ErrorRouteView.d.ts.map +1 -0
  1027. package/dist/widgets/ConnectWalletOptionWidget/routes/errorRoute/ErrorRouteView.text.d.ts +15 -0
  1028. package/dist/widgets/ConnectWalletOptionWidget/routes/errorRoute/ErrorRouteView.text.d.ts.map +1 -0
  1029. package/dist/widgets/ConnectWalletOptionWidget/routes/errorRoute/errorRoute.d.ts +24 -0
  1030. package/dist/widgets/ConnectWalletOptionWidget/routes/errorRoute/errorRoute.d.ts.map +1 -0
  1031. package/dist/widgets/ConnectWalletOptionWidget/routes/errorRoute/index.d.ts +3 -0
  1032. package/dist/widgets/ConnectWalletOptionWidget/routes/errorRoute/index.d.ts.map +1 -0
  1033. package/dist/widgets/ConnectWalletOptionWidget/routes/listRoute/ListRouteView.d.ts +29 -0
  1034. package/dist/widgets/ConnectWalletOptionWidget/routes/listRoute/ListRouteView.d.ts.map +1 -0
  1035. package/dist/widgets/ConnectWalletOptionWidget/routes/listRoute/ListRouteView.text.d.ts +8 -0
  1036. package/dist/widgets/ConnectWalletOptionWidget/routes/listRoute/ListRouteView.text.d.ts.map +1 -0
  1037. package/dist/widgets/ConnectWalletOptionWidget/routes/listRoute/index.d.ts +3 -0
  1038. package/dist/widgets/ConnectWalletOptionWidget/routes/listRoute/index.d.ts.map +1 -0
  1039. package/dist/widgets/ConnectWalletOptionWidget/routes/listRoute/listRoute.d.ts +20 -0
  1040. package/dist/widgets/ConnectWalletOptionWidget/routes/listRoute/listRoute.d.ts.map +1 -0
  1041. package/dist/widgets/ConnectWalletOptionWidget/routes/qrCodeRoute/QrCodeRouteView.d.ts +32 -0
  1042. package/dist/widgets/ConnectWalletOptionWidget/routes/qrCodeRoute/QrCodeRouteView.d.ts.map +1 -0
  1043. package/dist/widgets/ConnectWalletOptionWidget/routes/qrCodeRoute/QrCodeRouteView.text.d.ts +11 -0
  1044. package/dist/widgets/ConnectWalletOptionWidget/routes/qrCodeRoute/QrCodeRouteView.text.d.ts.map +1 -0
  1045. package/dist/widgets/ConnectWalletOptionWidget/routes/qrCodeRoute/index.d.ts +3 -0
  1046. package/dist/widgets/ConnectWalletOptionWidget/routes/qrCodeRoute/index.d.ts.map +1 -0
  1047. package/dist/widgets/ConnectWalletOptionWidget/routes/qrCodeRoute/qrCodeRoute.d.ts +24 -0
  1048. package/dist/widgets/ConnectWalletOptionWidget/routes/qrCodeRoute/qrCodeRoute.d.ts.map +1 -0
  1049. package/dist/widgets/ConnectWalletOptionWidget/routes/redirectingRoute/RedirectingRouteView.d.ts +34 -0
  1050. package/dist/widgets/ConnectWalletOptionWidget/routes/redirectingRoute/RedirectingRouteView.d.ts.map +1 -0
  1051. package/dist/widgets/ConnectWalletOptionWidget/routes/redirectingRoute/RedirectingRouteView.text.d.ts +17 -0
  1052. package/dist/widgets/ConnectWalletOptionWidget/routes/redirectingRoute/RedirectingRouteView.text.d.ts.map +1 -0
  1053. package/dist/widgets/ConnectWalletOptionWidget/routes/redirectingRoute/index.d.ts +3 -0
  1054. package/dist/widgets/ConnectWalletOptionWidget/routes/redirectingRoute/index.d.ts.map +1 -0
  1055. package/dist/widgets/ConnectWalletOptionWidget/routes/redirectingRoute/redirectingRoute.d.ts +24 -0
  1056. package/dist/widgets/ConnectWalletOptionWidget/routes/redirectingRoute/redirectingRoute.d.ts.map +1 -0
  1057. package/dist/widgets/ConnectWalletOptionWidget/useConnectWalletOptionWidget/index.d.ts +3 -0
  1058. package/dist/widgets/ConnectWalletOptionWidget/useConnectWalletOptionWidget/index.d.ts.map +1 -0
  1059. package/dist/widgets/ConnectWalletOptionWidget/useConnectWalletOptionWidget/useConnectWalletOptionWidget.d.ts +89 -0
  1060. package/dist/widgets/ConnectWalletOptionWidget/useConnectWalletOptionWidget/useConnectWalletOptionWidget.d.ts.map +1 -0
  1061. package/package.json +73 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow.cjs","names":["FlowStatusHero: FC<FlowStatusHeroProps>","markPath: string","m","SPRING","isValidImageSource","interpolateText","FlowAlreadyPaid: FC<FlowAlreadyPaidProps>","useText","mark: ReactNode | undefined","Panel","interpolateText","FlowExpired: FC<FlowExpiredProps>","useText","mark: ReactNode | undefined","Panel","FlowLoader: FC<FlowLoaderProps>","FlowStatusBar: FC<FlowStatusBarProps>","PanelHostContext","FlowStatusTray: FC<FlowStatusTrayProps>","FlowLoadError: FC<FlowLoadErrorProps>","useText","Panel","Button","FlowLoadingView: FC<FlowLoadingViewProps>","useText","Panel","interpolateText","FlowPaymentCancelled: FC<FlowPaymentCancelledProps>","useText","mark: ReactNode | undefined","Panel","CopyText: FC<CopyTextProps>","useText","useCopyToClipboard","interpolateText","CopyMorphIcon","FlowPaymentLedger: FC<FlowPaymentLedgerProps>","FlowPill: FC<FlowPillProps>","FLOW_DEPOSIT_ADDRESS_SUPPORTED_CHAINS: readonly FlowDepositAddressSupportedChains[]","FLOW_PAYMENT_METHODS: readonly FlowPaymentMethod[]","InvalidParamError","InvalidParamError","name","InvalidParamError","ledgerLines: FlowPaymentLedgerLine[]","receivedAmount: string | undefined","interpolateText","FlowPaymentComplete: FC<FlowPaymentCompleteProps>","useText","Panel","Button","FlowPaymentFailed: FC<FlowPaymentFailedProps>","useText","mark: ReactNode | undefined","Panel","FlowPaymentRefunded: FC<FlowPaymentRefundedProps>","useText","mark: ReactNode | undefined","Panel","StepClockIcon: FC","StepDoneIcon: FC","m","SPRING","StepDotIcon: FC","FlowPaymentStepTracker: FC<FlowPaymentStepTrackerProps>","useText","interpolateText","FlowSwapTileSide: FC<FlowSwapTileSideProps>","name","FlowSwapTile: FC<FlowSwapTileProps>","useText","FlowPaymentSwapTile: FC<FlowPaymentSwapTileProps>","useText","TokenMark","WALLET_PROCESSING: ProcessingStepMap","DEPOSIT_PROCESSING: ProcessingStepMap","FlowProcessingPayment: FC<FlowProcessingPaymentProps>","useText","Panel","AWAITING_PAYMENT_EXECUTION_STATES: ReadonlySet<FlowExecutionState>","FAILED_PHASES: ReadonlySet<FlowPhase>","UNSETTLED_PHASES: ReadonlySet<FlowPhase>","FlowNotFoundError","FlowOutcomeBoundary: FC<FlowOutcomeBoundaryProps>","FlowErrorBanner: FC<FlowErrorBannerProps>","FlowRefundAddressSheet: FC<FlowRefundAddressSheetProps>","useText","interpolateText","m","SPRING","Button","name","selection: FlowDepositAddressSelection","refundPrompt: UseFlowDepositAddressViewResult['refundPrompt']","readySourceKey: string | undefined","FlowDepositAddressView: FC<FlowDepositAddressViewProps>","useText","networkOptions: SelectOption[]","TokenMark","tokenOptions: SelectOption[]","ledgerLines: FlowPaymentLedgerLine[]","interpolateText","Panel","Select","QRCode","CopyField","AnimatePresence","depositAddressRoute: FlowDepositAddressRouteModule<DepositAddressRoute>","QrCodeIcon: FC<IconProps>","FlowLeaveDepositAddressView: FC<\n FlowLeaveDepositAddressViewProps\n>","useText","Panel","Button","leaveDepositAddressRoute: FlowDepositAddressRouteModule<LeaveDepositAddressRoute>","flowDepositAddressRoutes: {\n [Name in FlowDepositAddressRouteName]: FlowDepositAddressRouteModule<\n FlowDepositAddressRouteByName[Name]\n >;\n}","useViewRouter","FlowDepositAddressWidgetContent: FC<\n FlowDepositAddressWidgetContentProps\n>","FlowDepositAddressWidget: FC<FlowDepositAddressWidgetProps>","PanelHost","FlowChooseExchangeView: FC<FlowChooseExchangeViewProps>","useText","interpolateText","Panel","ProviderOption","ProviderIcon","chooseExchangeRoute: FlowPayWithExchangeRouteModule<ChooseExchangeRoute>","FlowExchangeView: FC<FlowExchangeViewProps>","useText","interpolateText","Panel","ProviderIcon","Button","exchangeRoute: FlowPayWithExchangeRouteModule<ExchangeRoute>","FlowLeaveExchangeView: FC<FlowLeaveExchangeViewProps>","useText","interpolateText","Panel","ProviderIcon","Button","leaveExchangeRoute: FlowPayWithExchangeRouteModule<LeaveExchangeRoute>","flowPayWithExchangeRoutes: {\n [Name in FlowPayWithExchangeRouteName]: FlowPayWithExchangeRouteModule<\n FlowPayWithExchangeRouteByName[Name]\n >;\n}","getRouterParams","EXCHANGE_ATTACH_ERROR_KIND_BY_CODE: Readonly<\n Partial<Record<string, FlowExchangeAttachErrorKind>>\n>","BaseError","useViewRouter","getRouterParams","FlowPayWithExchangeWidgetScreen: FC<\n FlowPayWithExchangeWidgetScreenProps\n>","FlowPayWithExchangeWidgetContent: FC<\n FlowPayWithExchangeWidgetContentProps\n>","FlowPayWithExchangeWidget: FC<FlowPayWithExchangeWidgetProps>","PanelHost","networkIcons: Record<string, string>","networkIds: number[]","FlowChooseTokenView: FC<FlowChooseTokenViewProps>","useText","Panel","ProviderIcon","WalletAccountBalances","ChooseTokenRouteView: FC<ChooseTokenRouteViewProps>","chooseTokenRoute: FlowPayWithWalletRouteModule<ChooseTokenRoute>","FlowWalletAttachErrorBanner: FC<\n FlowWalletAttachErrorBannerProps\n>","useText","FLOW_WALLET_CONNECTION_VIEW_WIDGET_COPY: Partial<\n typeof CONNECT_WALLET_WIDGET_TEXT\n>","FlowWalletConnectionView: FC<FlowWalletConnectionViewProps>","TextContext","useText","TextProvider","ConnectWalletOptionWidget","ConnectWalletRouteView: FC<ConnectWalletRouteViewProps>","connectWalletRoute: FlowPayWithWalletRouteModule<ConnectWalletRoute>","FlowPaymentNotApproved: FC<FlowPaymentNotApprovedProps>","useText","interpolateText","Panel","Button","PaymentNotApprovedRouteView: FC<\n PaymentNotApprovedRouteViewProps\n>","paymentNotApprovedRoute: FlowPayWithWalletRouteModule<PaymentNotApprovedRoute>","PaymentSentRouteView: FC<PaymentSentRouteViewProps>","paymentSentRoute: FlowPayWithWalletRouteModule<PaymentSentRoute>","termsUrl: string | undefined","FlowReviewPaymentView: FC<FlowReviewPaymentViewProps>","useText","interpolateText","Panel","CheckboxField","Button","ReviewPaymentRouteView: FC<ReviewPaymentRouteViewProps>","reviewPaymentRoute: FlowPayWithWalletRouteModule<ReviewPaymentRoute>","flowPayWithWalletRoutes: {\n [Name in FlowPayWithWalletRouteName]: FlowPayWithWalletRouteModule<\n FlowPayWithWalletRouteByName[Name]\n >;\n}","getRouterParams","FlowSourceBlockedError","FlowPrepareSigningError","UserRejectedError","useViewRouter","getRouterParams","useGetWalletName","FlowPayWithWalletWidgetContent: FC<\n FlowPayWithWalletWidgetContentProps\n>","FlowPayWithWalletWidget: FC<FlowPayWithWalletWidgetProps>","PanelHost","BankIcon: FC<IconProps>","WalletIcon: FC<IconProps>","FlowPaymentMethodOption: FC<FlowPaymentMethodOptionProps>","m","PRESS_SCALE","name","FlowChoosePaymentSourceView: FC<\n FlowChoosePaymentSourceViewProps\n>","useText","Panel","choosePaymentMethodRoute: FlowWidgetRouteModule<ChoosePaymentMethodRoute>","payWithDepositAddressRoute: FlowWidgetRouteModule<PayWithDepositAddressRoute>","payWithExchangeRoute: FlowWidgetRouteModule<PayWithExchangeRoute>","payWithWalletRoute: FlowWidgetRouteModule<PayWithWalletRoute>","flowWidgetRoutes: {\n [Name in FlowWidgetRouteName]: FlowWidgetRouteModule<\n FlowWidgetRouteByName[Name]\n >;\n}","FLOW_PAYMENT_METHOD_ROUTES: Record<\n FlowPaymentMethod,\n PayWithDepositAddressRoute | PayWithExchangeRoute | PayWithWalletRoute\n>","choiceStack: FlowWidgetRoute[]","useViewRouter","FlowWidgetContent: FC<FlowWidgetContentProps>","FlowWidget: FC<FlowWidgetProps>","PanelHost","packageName","packageVersion"],"sources":["../src/flow/components/FlowStatusHero/FlowStatusHero.tsx","../src/flow/hooks/useFlowUiSettings/FlowUiSettingsContext/FlowUiSettingsContext.ts","../src/flow/hooks/useFlowUiSettings/useFlowUiSettings.ts","../src/flow/views/FlowAlreadyPaid/FlowAlreadyPaid.text.ts","../src/flow/utils/getFlowMerchantLogoUrl/getFlowMerchantLogoUrl.ts","../src/flow/views/FlowAlreadyPaid/getFlowAlreadyPaidDetails/getFlowAlreadyPaidDetails.ts","../src/flow/views/FlowAlreadyPaid/FlowAlreadyPaid.tsx","../src/flow/views/FlowExpired/FlowExpired.text.ts","../src/flow/views/FlowExpired/getFlowExpiredDetails/getFlowExpiredDetails.ts","../src/flow/views/FlowExpired/FlowExpired.tsx","../src/flow/components/FlowLoader/FlowLoader.constants.ts","../src/flow/components/FlowLoader/FlowLoader.tsx","../src/flow/components/FlowStatusBar/FlowStatusBar.tsx","../src/flow/components/FlowStatusTray/FlowStatusTray.constants.ts","../src/flow/components/FlowStatusTray/useFlowStatusTray/useFlowStatusTray.ts","../src/flow/components/FlowStatusTray/FlowStatusTray.tsx","../src/flow/views/FlowLoadError/FlowLoadError.text.ts","../src/flow/views/FlowLoadError/FlowLoadError.tsx","../src/flow/views/FlowLoadingView/FlowLoadingView.text.ts","../src/flow/views/FlowLoadingView/FlowLoadingView.tsx","../src/flow/views/FlowPaymentCancelled/FlowPaymentCancelled.text.ts","../src/flow/views/FlowPaymentCancelled/getFlowPaymentCancelledDetails/getFlowPaymentCancelledDetails.ts","../src/flow/views/FlowPaymentCancelled/FlowPaymentCancelled.tsx","../src/components/CopyText/CopyText.text.ts","../src/components/CopyText/CopyText.tsx","../src/flow/components/FlowPaymentLedger/FlowPaymentLedger.tsx","../src/flow/components/FlowPill/FlowPill.tsx","../src/flow/views/FlowPaymentComplete/FlowPaymentComplete.text.ts","../src/flow/constants.ts","../src/utils/formatFiatAmount/formatFiatAmount.ts","../src/flow/utils/formatFlowAmount/formatFlowAmount.ts","../src/flow/utils/formatFlowEstimate/formatFlowEstimate.ts","../src/flow/utils/getFlowAmountUsd/getFlowAmountUsd.ts","../src/flow/utils/formatFlowOrderTotal/formatFlowOrderTotal.ts","../src/utils/assertValidNonNegativeDecimalString/assertValidNonNegativeDecimalString.ts","../src/flow/utils/getFlowPaymentTotal/getFlowPaymentTotal.ts","../src/flow/utils/formatFlowPayment/formatFlowPayment.ts","../src/flow/views/FlowPaymentComplete/getFlowPaymentCompleteDetails/getFlowPaymentCompleteDetails.ts","../src/flow/views/FlowPaymentComplete/FlowPaymentComplete.tsx","../src/flow/views/FlowPaymentFailed/FlowPaymentFailed.text.ts","../src/flow/views/FlowPaymentFailed/getFlowPaymentFailedDetails/getFlowPaymentFailedDetails.ts","../src/flow/views/FlowPaymentFailed/FlowPaymentFailed.tsx","../src/flow/views/FlowPaymentRefunded/FlowPaymentRefunded.text.ts","../src/flow/views/FlowPaymentRefunded/FlowPaymentRefunded.tsx","../src/flow/components/FlowPaymentStepTracker/getStepState/getStepState.ts","../src/flow/components/FlowPaymentStepTracker/stepIcons/StepClockIcon/StepClockIcon.tsx","../src/flow/components/FlowPaymentStepTracker/stepIcons/StepDoneIcon/StepDoneIcon.tsx","../src/flow/components/FlowPaymentStepTracker/stepIcons/StepDotIcon/StepDotIcon.tsx","../src/flow/components/FlowPaymentStepTracker/FlowPaymentStepTracker.text.ts","../src/flow/components/FlowPaymentStepTracker/FlowPaymentStepTracker.tsx","../src/flow/components/FlowSwapTile/FlowSwapTileSide/FlowSwapTileSide.tsx","../src/flow/components/FlowSwapTile/FlowSwapTile.text.ts","../src/flow/components/FlowSwapTile/FlowSwapTile.tsx","../src/flow/components/FlowPaymentSwapTile/FlowPaymentSwapTile.text.ts","../src/flow/components/FlowPaymentSwapTile/FlowPaymentSwapTile.tsx","../src/flow/views/FlowProcessingPayment/FlowProcessingPayment.text.ts","../src/flow/views/FlowProcessingPayment/FlowProcessingPayment.constants.ts","../src/flow/views/FlowProcessingPayment/getFlowProcessingStep/getFlowProcessingStep.ts","../src/flow/views/FlowProcessingPayment/getFlowProcessingPaymentDetails/getFlowProcessingPaymentDetails.ts","../src/flow/views/FlowProcessingPayment/FlowProcessingPayment.tsx","../src/flow/widgets/FlowOutcomeBoundary/FlowOutcomeOwnerContext/FlowOutcomeOwnerContext.ts","../src/flow/utils/resolveFlowPhase/resolveFlowPhase.ts","../src/flow/widgets/FlowOutcomeBoundary/useFlowOutcome/useFlowOutcome.ts","../src/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useResumedPaymentPending/useResumedPaymentPending.constants.ts","../src/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useResumedPaymentPending/useResumedPaymentPending.ts","../src/flow/widgets/FlowOutcomeBoundary/useFlowOutcomeBoundary/useFlowOutcomeBoundary.ts","../src/flow/widgets/FlowOutcomeBoundary/FlowOutcomeBoundary.tsx","../src/flow/components/FlowErrorBanner/FlowErrorBanner.tsx","../src/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet.constants.ts","../src/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet.text.ts","../src/flow/utils/isRefundAddressValid/isRefundAddressValid.constants.ts","../src/flow/utils/isRefundAddressValid/isRefundAddressValid.ts","../src/flow/components/FlowRefundAddressSheet/useFlowRefundAddressSheet/useFlowRefundAddressSheet.ts","../src/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet.tsx","../src/flow/utils/getFlowSourceNetworkKey/getFlowSourceNetworkKey.ts","../src/flow/views/FlowDepositAddressView/FlowDepositAddressView.text.ts","../src/flow/utils/getFlowDepositAddressSourceTokenOptions/getFlowDepositAddressSourceTokenOptions.ts","../src/flow/views/FlowDepositAddressView/getFlowDepositSourceKey/getFlowDepositSourceKey.ts","../src/flow/views/FlowDepositAddressView/buildFlowDepositUri/buildFlowDepositUri.constants.ts","../src/flow/views/FlowDepositAddressView/buildFlowDepositUri/buildFlowDepositUri.ts","../src/flow/views/FlowDepositAddressView/resolveFlowDepositAddressDetails/resolveFlowDepositAddressDetails.ts","../src/flow/views/FlowDepositAddressView/resolveFlowDepositAddressRefund/resolveFlowDepositAddressRefund.ts","../src/flow/views/FlowDepositAddressView/resolveFlowDepositAddressSelection/resolveFlowDepositAddressSelection.ts","../src/flow/views/FlowDepositAddressView/useFlowDepositAddressView/useFlowDepositAddressView.ts","../src/flow/views/FlowDepositAddressView/FlowDepositAddressView.tsx","../src/flow/widgets/FlowDepositAddressWidget/routes/depositAddressRoute/depositAddressRoute.tsx","../src/icons/QrCodeIcon/QrCodeIcon.tsx","../src/flow/views/FlowLeaveDepositAddressView/FlowLeaveDepositAddressView.text.ts","../src/flow/views/FlowLeaveDepositAddressView/FlowLeaveDepositAddressView.tsx","../src/flow/widgets/FlowDepositAddressWidget/routes/leaveDepositAddressRoute/leaveDepositAddressRoute.tsx","../src/flow/widgets/FlowDepositAddressWidget/routes/flowDepositAddressRoutes.ts","../src/flow/widgets/FlowDepositAddressWidget/renderFlowDepositAddressRoute/renderFlowDepositAddressRoute.ts","../src/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/resolveFlowDepositAddressBack/resolveFlowDepositAddressBack.ts","../src/flow/widgets/FlowDepositAddressWidget/useFlowDepositAddressWidget/useFlowDepositAddressWidget.ts","../src/flow/widgets/FlowDepositAddressWidget/FlowDepositAddressWidgetContent/FlowDepositAddressWidgetContent.tsx","../src/flow/widgets/FlowDepositAddressWidget/FlowDepositAddressWidget.tsx","../src/flow/views/FlowChooseExchangeView/FlowChooseExchangeView.constants.ts","../src/flow/views/FlowChooseExchangeView/FlowChooseExchangeView.text.ts","../src/flow/views/FlowChooseExchangeView/FlowChooseExchangeView.tsx","../src/flow/widgets/FlowPayWithExchangeWidget/routes/chooseExchangeRoute/chooseExchangeRoute.tsx","../src/flow/views/FlowExchangeView/FlowExchangeView.constants.ts","../src/flow/views/FlowExchangeView/getFlowExchangeViewStatusKey/getFlowExchangeViewStatusKey.ts","../src/flow/views/FlowExchangeView/FlowExchangeView.text.ts","../src/flow/views/FlowExchangeView/FlowExchangeView.tsx","../src/flow/widgets/FlowPayWithExchangeWidget/routes/exchangeRoute/exchangeRoute.tsx","../src/flow/views/FlowLeaveExchangeView/FlowLeaveExchangeView.text.ts","../src/flow/views/FlowLeaveExchangeView/FlowLeaveExchangeView.tsx","../src/flow/widgets/FlowPayWithExchangeWidget/routes/leaveExchangeRoute/leaveExchangeRoute.tsx","../src/flow/widgets/FlowPayWithExchangeWidget/routes/flowPayWithExchangeRoutes.ts","../src/flow/widgets/FlowPayWithExchangeWidget/renderFlowPayWithExchangeRoute/renderFlowPayWithExchangeRoute.ts","../src/flow/utils/getFlowExchangeUrl/getFlowExchangeUrl.ts","../src/flow/utils/openFlowExchangeUrl/openFlowExchangeUrl.ts","../src/flow/widgets/FlowPayWithExchangeWidget/useFlowExchangeList/useFlowExchangeList.ts","../src/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/getRouterParams/getRouterParams.ts","../src/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/resolveFlowExchangeBack/resolveFlowExchangeBack.ts","../src/flow/utils/getExchangeAttachErrorKind/getExchangeAttachErrorKind.constants.ts","../src/flow/utils/getExchangeAttachErrorKind/getExchangeAttachErrorKind.ts","../src/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useAttachFlowExchange/useAttachFlowExchange.ts","../src/flow/widgets/FlowPayWithExchangeWidget/useFlowPayWithExchangeWidget/useFlowPayWithExchangeWidget.ts","../src/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetScreen/FlowPayWithExchangeWidgetScreen.tsx","../src/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/getWaitingFlowExchangeId/getWaitingFlowExchangeId.ts","../src/flow/widgets/FlowPayWithExchangeWidget/useResumedFlowExchange/useResumedFlowExchange.ts","../src/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetContent/FlowPayWithExchangeWidgetContent.tsx","../src/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidget.tsx","../src/utils/truncateWalletAddress/truncateWalletAddress.ts","../src/flow/views/FlowChooseTokenView/FlowChooseTokenView.text.ts","../src/flow/views/FlowChooseTokenView/useFlowChooseTokenView/useFlowChooseTokenView.ts","../src/flow/views/FlowChooseTokenView/FlowChooseTokenView.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/chooseTokenRoute/ChooseTokenRouteView.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/chooseTokenRoute/chooseTokenRoute.tsx","../src/flow/views/FlowWalletConnectionView/FlowWalletAttachErrorBanner/FlowWalletAttachErrorBanner.text.ts","../src/flow/views/FlowWalletConnectionView/FlowWalletAttachErrorBanner/FlowWalletAttachErrorBanner.tsx","../src/flow/views/FlowWalletConnectionView/FlowWalletConnectionView.text.ts","../src/flow/views/FlowWalletConnectionView/FlowWalletConnectionView.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/connectWalletRoute/ConnectWalletRouteView.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/connectWalletRoute/connectWalletRoute.tsx","../src/flow/views/FlowPaymentNotApproved/FlowPaymentNotApproved.text.ts","../src/flow/views/FlowPaymentNotApproved/FlowPaymentNotApproved.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/paymentNotApprovedRoute/PaymentNotApprovedRouteView.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/paymentNotApprovedRoute/paymentNotApprovedRoute.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/paymentSentRoute/PaymentSentRouteView.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/paymentSentRoute/paymentSentRoute.tsx","../src/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.constants.ts","../src/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.text.ts","../src/flow/views/FlowReviewPaymentView/formatQuoteTimeLeft/formatQuoteTimeLeft.ts","../src/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useQuoteCountdown/useQuoteCountdown.constants.ts","../src/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useQuoteCountdown/useQuoteCountdown.ts","../src/flow/views/FlowReviewPaymentView/useFlowReviewPaymentView/useFlowReviewPaymentView.ts","../src/flow/views/FlowReviewPaymentView/FlowReviewPaymentView.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/reviewPaymentRoute/ReviewPaymentRouteView.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/reviewPaymentRoute/reviewPaymentRoute.tsx","../src/flow/widgets/FlowPayWithWalletWidget/routes/flowPayWithWalletRoutes.ts","../src/flow/widgets/FlowPayWithWalletWidget/renderFlowPayWithWalletRoute/renderFlowPayWithWalletRoute.ts","../src/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/findResumableWalletAccount/findResumableWalletAccount.ts","../src/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getRouterParams/getRouterParams.ts","../src/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/getSubmitErrorAction/getSubmitErrorAction.ts","../src/flow/utils/getWalletAttachErrorType/getWalletAttachErrorType.ts","../src/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useAttachWalletSource/useAttachWalletSource.ts","../src/flow/utils/getSubmitTransactionErrorType/getSubmitTransactionErrorType.ts","../src/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/useSubmitErrorState/useSubmitErrorState.ts","../src/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useSubmitPayment/useSubmitPayment.ts","../src/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useTokenPick/useTokenPick.ts","../src/flow/widgets/FlowPayWithWalletWidget/useFlowPayWithWalletWidget/useFlowPayWithWalletWidget.ts","../src/flow/widgets/FlowPayWithWalletWidget/FlowPayWithWalletWidgetContent/FlowPayWithWalletWidgetContent.tsx","../src/flow/widgets/FlowPayWithWalletWidget/FlowPayWithWalletWidget.tsx","../src/icons/BankIcon/BankIcon.tsx","../src/icons/WalletIcon/WalletIcon.tsx","../src/flow/components/FlowPaymentMethodOption/FlowPaymentMethodOption.tsx","../src/flow/views/FlowChoosePaymentSourceView/FlowChoosePaymentSourceView.text.ts","../src/flow/views/FlowChoosePaymentSourceView/FlowChoosePaymentSourceView.tsx","../src/flow/widgets/FlowWidget/routes/choosePaymentMethodRoute/choosePaymentMethodRoute.tsx","../src/flow/widgets/FlowWidget/routes/payWithDepositAddressRoute/payWithDepositAddressRoute.tsx","../src/flow/widgets/FlowWidget/routes/payWithExchangeRoute/payWithExchangeRoute.tsx","../src/flow/widgets/FlowWidget/routes/payWithWalletRoute/payWithWalletRoute.tsx","../src/flow/widgets/FlowWidget/routes/flowWidgetRoutes.ts","../src/flow/widgets/FlowWidget/renderFlowWidgetRoute/renderFlowWidgetRoute.ts","../src/flow/utils/getFlowPaymentMethods/getFlowPaymentMethods.ts","../src/flow/widgets/FlowWidget/routes/flowWidgetRoutes.constants.ts","../src/flow/widgets/FlowWidget/useFlowWidget/getResumedFlowPaymentMethod/getResumedFlowPaymentMethod.ts","../src/flow/widgets/FlowWidget/useFlowWidget/getRouterParams/getRouterParams.ts","../src/flow/widgets/FlowWidget/useFlowWidget/useFlowWidget.ts","../src/flow/widgets/FlowWidget/FlowWidgetContent/FlowWidgetContent.tsx","../src/flow/widgets/FlowWidget/FlowWidget.tsx","../src/exports/flow.ts"],"sourcesContent":["'use client';\n\nimport { m } from 'motion/react';\nimport type { FC, ReactNode } from 'react';\n\nimport { SPRING } from '../../../motion/motionTokens';\n\n/**\n * The outcome the hero announces: `success` pops a tick, `danger` pops a\n * cross — same geometry, same pop, different color, so a paired result pair\n * (paid / not approved) reads as one system.\n *\n * @example\n * ```tsx\n * const variant: FlowStatusHeroVariant = 'danger';\n * ```\n * @see FlowStatusHero\n * @see FlowStatusHeroProps\n */\nexport type FlowStatusHeroVariant = 'danger' | 'success';\n\n/**\n * Props for {@link FlowStatusHero}.\n *\n * @example\n * ```tsx\n * const props: FlowStatusHeroProps = {\n * description: 'The request was declined in MetaMask.',\n * heading: 'Nothing was sent',\n * variant: 'danger',\n * };\n * ```\n * @see FlowStatusHero\n * @see FlowStatusHeroVariant\n */\nexport type FlowStatusHeroProps = {\n className?: string;\n /** The secondary line under the heading. */\n description?: string;\n /** The boldest line — the one fact that matters about the outcome. */\n heading: string;\n /**\n * A custom mark that replaces the outcome glyph inside the popping circle —\n * a merchant logo, for example. Owns its own styling; no variant tone applies.\n */\n mark?: ReactNode;\n /** The outcome mark's tone. Defaults to `'success'`. Ignored when `mark` is set. */\n variant?: FlowStatusHeroVariant;\n};\n\n/**\n * The centered hero shared by the Flow outcome screens — paid, not approved,\n * and their siblings: a colored mark that pops in on the house spring above\n * a bold heading and a muted reason line. The mark is `aria-hidden`; views\n * announce the outcome themselves in a live region, so the hero stays\n * presentation only.\n *\n * @example\n * ```tsx\n * import { FlowStatusHero } from '@/flow/components/FlowStatusHero/FlowStatusHero';\n *\n * const App = () => (\n * <FlowStatusHero\n * description=\"The request was declined in MetaMask.\"\n * heading=\"Nothing was sent\"\n * variant=\"danger\"\n * />\n * );\n * ```\n * @param params.className - Extra class names for the hero element.\n * @param params.description - The secondary line under the heading.\n * @param params.heading - The boldest line of the outcome.\n * @param params.mark - A custom mark replacing the outcome glyph inside the circle.\n * @param params.variant - The outcome mark's tone. Defaults to `'success'`.\n * @returns The status hero.\n * @see FlowStatusHeroProps\n * @see FlowStatusHeroVariant\n * @see Panel\n * @notInstrumented\n */\nexport const FlowStatusHero: FC<FlowStatusHeroProps> = ({\n className,\n description,\n heading,\n mark,\n variant = 'success',\n}) => {\n let markPath: string;\n if (variant === 'danger') {\n markPath = 'M2 2L8 8M8 2L2 8';\n } else {\n markPath = 'M1.5 5.5L4 8L8.5 2.5';\n }\n\n return (\n <div className={className} data-slot=\"dyn-flow-status-hero\">\n <m.span\n animate={{ opacity: 1, scale: 1 }}\n aria-hidden=\"true\"\n data-slot=\"dyn-flow-status-hero-mark\"\n data-variant={mark === undefined ? variant : undefined}\n initial={{ opacity: 0, scale: 0.25 }}\n transition={SPRING}\n >\n {mark === undefined ? (\n <svg fill=\"none\" height=\"20\" viewBox=\"0 0 10 10\" width=\"20\">\n <path\n d={markPath}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.4\"\n />\n </svg>\n ) : (\n mark\n )}\n </m.span>\n <div data-slot=\"dyn-flow-status-hero-copy\">\n <span data-slot=\"dyn-flow-status-hero-heading\">{heading}</span>\n {description !== undefined && (\n <span data-slot=\"dyn-flow-status-hero-description\">\n {description}\n </span>\n )}\n </div>\n </div>\n );\n};\n","import { createContext } from 'react';\n\nimport type { FlowUiSettings } from '../../../flow.types';\n\n/**\n * The host's display settings for the flow screens inside it, which replace\n * the flow's own UI config values they set.\n *\n * @example\n * ```ts\n * const overrides = useContext(FlowUiSettingsContext);\n * ```\n * @returns The context holding the host's settings, `undefined` outside a provider.\n * @see useFlowUiSettings\n * @see FlowWidget\n */\nexport const FlowUiSettingsContext = createContext<FlowUiSettings | undefined>(\n undefined\n);\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport { useContext } from 'react';\n\nimport type { FlowUiSettings } from '../../flow.types';\nimport { FlowUiSettingsContext } from './FlowUiSettingsContext';\n\n/** Params for {@link useFlowUiSettings}. */\nexport type UseFlowUiSettingsParams = {\n /** The flow whose own UI config the host's settings fall back to. */\n flow: Flow | undefined;\n};\n\n/**\n * Returns the display settings for a flow's screens: each setting the host\n * gave, else the flow's own UI config value.\n *\n * @example\n * ```ts\n * const { merchantName } = useFlowUiSettings({ flow });\n * ```\n * @param params.flow - The flow whose own UI config the host's settings fall back to.\n * @returns The display settings to use.\n * @see FlowUiSettingsContext\n * @see FlowWidgetSettings\n * @notInstrumented\n */\nexport const useFlowUiSettings = ({\n flow,\n}: UseFlowUiSettingsParams): FlowUiSettings => {\n const overrides = useContext(FlowUiSettingsContext);\n const uiConfig = flow?.uiConfig;\n\n return {\n enabledPaymentMethods:\n overrides?.enabledPaymentMethods ?? uiConfig?.enabledPaymentMethods,\n externalPaymentId:\n overrides?.externalPaymentId ?? uiConfig?.externalPaymentId,\n merchantLogoUrl: overrides?.merchantLogoUrl ?? uiConfig?.merchantLogoUrl,\n merchantName: overrides?.merchantName ?? uiConfig?.merchantName,\n termsOfServicesUrl:\n overrides?.termsOfServicesUrl ?? uiConfig?.termsOfServicesUrl,\n };\n};\n","/**\n * Default text for {@link FlowAlreadyPaid}.\n */\nexport const FLOW_ALREADY_PAID_TEXT = {\n /** Live-region announcement read out when the screen arrives. */\n announcement: 'This payment was already completed.',\n /** The boldest line — the outcome, so nobody pays twice. */\n message: 'This has already been paid',\n /** The reference line's date half — `{paidOn}` is the payment date. */\n paidAt: 'Paid {paidOn}',\n /** The centered header title. */\n title: 'Already paid',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-already-paid': typeof FLOW_ALREADY_PAID_TEXT;\n }\n}\n","import { isValidImageSource } from '../../../utils/isValidImageSource';\nimport type { FlowUiSettings } from '../../flow.types';\n\n/** Params for {@link getFlowMerchantLogoUrl}. */\nexport type GetFlowMerchantLogoUrlParams = {\n /** The flow's display settings, which may carry a merchant logo. */\n uiSettings: FlowUiSettings;\n};\n\n/**\n * Returns the merchant logo URL only when it is safe to show as an\n * image, so every screen shows or hides the logo the same way. A missing,\n * empty or unsafe URL (not `https:` or an inline image) means no logo.\n *\n * @example\n * ```ts\n * const logoUrl = getFlowMerchantLogoUrl({ uiSettings });\n * ```\n * @param params.uiSettings - The flow's display settings, which may carry a merchant logo.\n * @returns The logo URL, or `undefined` when there is none to show.\n * @see isValidImageSource\n * @see useFlowUiSettings\n * @notInstrumented\n */\nexport const getFlowMerchantLogoUrl = ({\n uiSettings,\n}: GetFlowMerchantLogoUrlParams): string | undefined => {\n const { merchantLogoUrl } = uiSettings;\n\n // The URL comes from the host and is rendered as `<img src>`, so an unsafe\n // one is dropped rather than shown.\n return merchantLogoUrl !== undefined && isValidImageSource(merchantLogoUrl)\n ? merchantLogoUrl\n : undefined;\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\nimport { interpolateText } from '../../../../i18n/interpolateText';\nimport type { FlowUiSettings } from '../../../flow.types';\nimport { getFlowMerchantLogoUrl } from '../../../utils/getFlowMerchantLogoUrl';\n\n/**\n * Inputs for {@link getFlowAlreadyPaidDetails}.\n *\n * @example\n * ```ts\n * const params: GetFlowAlreadyPaidDetailsParams = {\n * flow,\n * paidAtText: 'Paid {paidOn}',\n * uiSettings,\n * };\n * ```\n * @see getFlowAlreadyPaidDetails\n * @see FlowAlreadyPaid\n */\nexport type GetFlowAlreadyPaidDetailsParams = {\n /** SDK flow carrying the completion timestamp. */\n flow: Flow;\n /** Localized `Paid {paidOn}` template — `{paidOn}` is the payment date. */\n paidAtText: string;\n /** The flow's display settings, carrying the reference and logo. */\n uiSettings: FlowUiSettings;\n};\n\n/** Reference line and hero mark inputs returned to the already-paid screen. */\nexport type FlowAlreadyPaidDetails = {\n /** `Paid {paidOn} · {externalPaymentId}`, or `undefined` without `completedAt`. */\n description: string | undefined;\n /** The safe merchant logo — the custom hero mark, or `undefined` for the tick. */\n merchantLogoUrl: string | undefined;\n};\n\n/**\n * Derives the already-paid view's reference line — `Paid {completedAt} ·\n * {externalPaymentId}`, hidden when the flow carries no `completedAt` — and\n * the merchant logo shown as the status hero's custom mark.\n *\n * @example\n * ```tsx\n * const { description, merchantLogoUrl } = getFlowAlreadyPaidDetails({\n * flow,\n * paidAtText: text('paidAt'),\n * uiSettings,\n * });\n * ```\n * @param params.flow - SDK flow carrying `completedAt`.\n * @param params.paidAtText - Localized `Paid {paidOn}` template.\n * @param params.uiSettings - The flow's display settings, carrying the reference and logo.\n * @returns The reference line and the merchant logo URL for the hero mark.\n * @see FlowAlreadyPaid\n * @see FlowStatusHero\n * @notInstrumented\n */\nexport const getFlowAlreadyPaidDetails = ({\n flow,\n paidAtText,\n uiSettings,\n}: GetFlowAlreadyPaidDetailsParams): FlowAlreadyPaidDetails => {\n const getDescription = (): string | undefined => {\n if (flow.completedAt === undefined) {\n return undefined;\n }\n // The instant's calendar date (UTC) keeps the paid-on date identical for\n // every viewer; the locale comes from the runtime so the month name and\n // ordering follow the payer's language.\n const paidOn = new Intl.DateTimeFormat(undefined, {\n dateStyle: 'medium',\n timeZone: 'UTC',\n }).format(flow.completedAt);\n const description = interpolateText({\n template: paidAtText,\n token: '{paidOn}',\n value: paidOn,\n });\n if (uiSettings.externalPaymentId === undefined) {\n return description;\n }\n return `${description} · ${uiSettings.externalPaymentId}`;\n };\n\n return {\n description: getDescription(),\n merchantLogoUrl: getFlowMerchantLogoUrl({ uiSettings }),\n };\n};\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport type { FC, ReactNode } from 'react';\n\nimport { useText } from '../../../i18n/useText';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { useFlowUiSettings } from '../../hooks/useFlowUiSettings';\nimport { FLOW_ALREADY_PAID_TEXT } from './FlowAlreadyPaid.text';\nimport { getFlowAlreadyPaidDetails } from './getFlowAlreadyPaidDetails';\n\n/**\n * Props for {@link FlowAlreadyPaid}.\n *\n * @example\n * ```tsx\n * const props: FlowAlreadyPaidProps = { flow };\n * ```\n * @see FlowAlreadyPaid\n * @see Flow\n */\nexport type FlowAlreadyPaidProps = {\n className?: string;\n /**\n * The flow whose `uiConfig` carries the `merchantLogoUrl` shown in the\n * hero mark and the `externalPaymentId` shown as the payment reference\n * when present.\n */\n flow: Flow;\n /** Fires when the Back button is pressed. Omit on a root screen to hide Back. */\n onBack?: () => void;\n};\n\n/**\n * The Flow \"already paid\" screen: a {@link FlowStatusHero} whose mark is the\n * merchant logo when `uiConfig.merchantLogoUrl` is present, and a\n * `Paid {completedAt} · {externalPaymentId}` reference line — hidden when\n * the flow carries no `completedAt`. Terminal — the payer never pays twice.\n *\n * @example\n * ```tsx\n * import { FlowAlreadyPaid } from '@/flow/views/FlowAlreadyPaid/FlowAlreadyPaid';\n *\n * const App = () => <FlowAlreadyPaid flow={flow} />;\n * ```\n * @param params.className - Extra class names for the panel element.\n * @param params.flow - The flow carrying `uiConfig` merchant fields and reference.\n * @param params.onBack - Fires when the Back button is pressed. Omit on a root screen to hide Back.\n * @returns The already-paid view.\n * @see FlowAlreadyPaidProps\n * @see Panel\n * @see FlowStatusHero\n * @copy announcement - The live-region line announced when the screen arrives.\n * @copy message - The confirmation message under the hero.\n * @copy paidAt - The reference line's date half — `{paidOn}` is the payment date.\n * @copy title - The centered header title.\n * @notInstrumented\n */\nexport const FlowAlreadyPaid: FC<FlowAlreadyPaidProps> = ({\n className,\n flow,\n onBack,\n}) => {\n const text = useText({\n defaults: FLOW_ALREADY_PAID_TEXT,\n slot: 'dyn-flow-already-paid',\n });\n const uiSettings = useFlowUiSettings({ flow });\n const { description, merchantLogoUrl } = getFlowAlreadyPaidDetails({\n flow,\n paidAtText: text('paidAt'),\n uiSettings,\n });\n\n let mark: ReactNode | undefined;\n if (merchantLogoUrl !== undefined) {\n mark = (\n <img\n alt=\"\"\n data-slot=\"dyn-flow-already-paid-mark\"\n src={merchantLogoUrl}\n />\n );\n }\n\n return (\n <Panel className={className} onBack={onBack} title={text('title')}>\n <div data-slot=\"dyn-flow-already-paid\">\n {/* Announced on arrival; the mark alone carries no meaning. */}\n <span\n aria-live=\"polite\"\n data-slot=\"dyn-flow-already-paid-announce\"\n role=\"status\"\n >\n {text('announcement')}\n </span>\n <FlowStatusHero\n description={description}\n heading={text('message')}\n mark={mark}\n />\n </div>\n </Panel>\n );\n};\n","/**\n * Default text for {@link FlowExpired}.\n */\nexport const FLOW_EXPIRED_TEXT = {\n /** Live-region announcement read out when the screen arrives. */\n announcement: 'This payment has expired.',\n /** The reason line; `{merchant}` is replaced by the merchant's display name. Hidden without a merchant name. */\n contactMerchant: 'Contact {merchant} for a new one.',\n /** The boldest line — the outcome, so nobody retries a dead payment. */\n message: 'This payment has expired',\n /** The centered header title. */\n title: 'Payment expired',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-expired': typeof FLOW_EXPIRED_TEXT;\n }\n}\n","import { interpolateText } from '../../../../i18n/interpolateText';\nimport type { FlowUiSettings } from '../../../flow.types';\nimport { getFlowMerchantLogoUrl } from '../../../utils/getFlowMerchantLogoUrl';\n\n/**\n * Inputs for {@link getFlowExpiredDetails}.\n *\n * @example\n * ```ts\n * const params: GetFlowExpiredDetailsParams = {\n * contactMerchantText: 'Contact {merchant} for a new one.',\n * uiSettings,\n * };\n * ```\n * @see getFlowExpiredDetails\n * @see FlowExpired\n */\nexport type GetFlowExpiredDetailsParams = {\n /** Localized `Contact {merchant}` template — `{merchant}` is the merchant name. */\n contactMerchantText: string;\n /** The flow's display settings, carrying the merchant fields. */\n uiSettings: FlowUiSettings;\n};\n\n/** Contact line and hero mark inputs returned to the expired screen. */\nexport type FlowExpiredDetails = {\n /** `Contact {merchant} for a new one.`, or `undefined` without `merchantName`. */\n description: string | undefined;\n /** The safe merchant logo — the custom hero mark, or `undefined` for the danger mark. */\n merchantLogoUrl: string | undefined;\n};\n\n/**\n * Derives the expired view's contact line — `Contact {merchantName} for a new\n * one.`, hidden without a merchant name — and the merchant logo\n * shown as the status hero's custom mark.\n *\n * @example\n * ```tsx\n * const { description, merchantLogoUrl } = getFlowExpiredDetails({\n * contactMerchantText: text('contactMerchant'),\n * uiSettings,\n * });\n * ```\n * @param params.contactMerchantText - Localized `Contact {merchant}` template.\n * @param params.uiSettings - The flow's display settings, carrying the merchant fields.\n * @returns The contact line and the merchant logo URL for the hero mark.\n * @see FlowExpired\n * @see FlowStatusHero\n * @notInstrumented\n */\nexport const getFlowExpiredDetails = ({\n contactMerchantText,\n uiSettings,\n}: GetFlowExpiredDetailsParams): FlowExpiredDetails => {\n const getDescription = (): string | undefined => {\n const merchantName = uiSettings.merchantName?.trim() || undefined;\n if (merchantName === undefined) {\n return undefined;\n }\n return interpolateText({\n template: contactMerchantText,\n token: '{merchant}',\n value: merchantName,\n });\n };\n\n return {\n description: getDescription(),\n merchantLogoUrl: getFlowMerchantLogoUrl({ uiSettings }),\n };\n};\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport type { FC, ReactNode } from 'react';\n\nimport { useText } from '../../../i18n/useText';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { useFlowUiSettings } from '../../hooks/useFlowUiSettings';\nimport { FLOW_EXPIRED_TEXT } from './FlowExpired.text';\nimport { getFlowExpiredDetails } from './getFlowExpiredDetails';\n\n/**\n * Props for {@link FlowExpired}.\n *\n * @example\n * ```tsx\n * const props: FlowExpiredProps = { flow };\n * ```\n * @see FlowExpired\n * @see Flow\n */\nexport type FlowExpiredProps = {\n className?: string;\n /**\n * The flow whose `uiConfig` carries the `merchantLogoUrl` shown in the\n * hero mark and the `merchantName` shown in the contact line.\n */\n flow: Flow;\n /** Fires when the Back button is pressed. Omit on a root screen to hide Back. */\n onBack?: () => void;\n};\n\n/**\n * The Flow \"payment expired\" screen: a {@link FlowStatusHero} whose mark\n * is the merchant logo when `uiConfig.merchantLogoUrl` is present (danger\n * glyph otherwise), and a `Contact {merchant}` line — hidden when the flow\n * carries no `merchantName`. Terminal.\n *\n * @example\n * ```tsx\n * import { FlowExpired } from '@/flow/views/FlowExpired/FlowExpired';\n *\n * const App = () => <FlowExpired flow={flow} />;\n * ```\n * @param params.className - Extra class names for the panel element.\n * @param params.flow - The flow carrying `uiConfig` merchant fields.\n * @param params.onBack - Fires when the Back button is pressed. Omit on a root screen to hide Back.\n * @returns The expired view.\n * @see FlowExpiredProps\n * @see Panel\n * @see FlowStatusHero\n * @copy announcement - The live-region line announced when the screen arrives.\n * @copy contactMerchant - The reason line; `{merchant}` is replaced by the merchant's display name. Hidden without a merchant name.\n * @copy message - The outcome line under the hero mark.\n * @copy title - The centered header title.\n * @notInstrumented\n */\nexport const FlowExpired: FC<FlowExpiredProps> = ({\n className,\n flow,\n onBack,\n}) => {\n const text = useText({\n defaults: FLOW_EXPIRED_TEXT,\n slot: 'dyn-flow-expired',\n });\n const uiSettings = useFlowUiSettings({ flow });\n const { description, merchantLogoUrl } = getFlowExpiredDetails({\n contactMerchantText: text('contactMerchant'),\n uiSettings,\n });\n\n let mark: ReactNode | undefined;\n if (merchantLogoUrl !== undefined) {\n mark = (\n <img alt=\"\" data-slot=\"dyn-flow-expired-mark\" src={merchantLogoUrl} />\n );\n }\n\n return (\n <Panel className={className} onBack={onBack} title={text('title')}>\n <div data-slot=\"dyn-flow-expired\">\n {/* Announced on arrival; the mark alone carries no meaning. */}\n <span\n aria-live=\"polite\"\n data-slot=\"dyn-flow-expired-announce\"\n role=\"status\"\n >\n {text('announcement')}\n </span>\n <FlowStatusHero\n description={description}\n heading={text('message')}\n mark={mark}\n variant=\"danger\"\n />\n </div>\n </Panel>\n );\n};\n","/** One entry per dot in the loader's 3x3 grid. */\nexport const FLOW_LOADER_DOT_INDEXES = [0, 1, 2, 3, 4, 5, 6, 7, 8];\n","import type { CSSProperties, FC } from 'react';\n\nimport { FLOW_LOADER_DOT_INDEXES } from './FlowLoader.constants';\n\n/**\n * Ink shade for {@link FlowLoader}'s dots.\n *\n * @example\n * ```tsx\n * const shade: FlowLoaderShade = 'green';\n * ```\n * @see FlowLoader\n * @see FlowLoaderProps\n */\nexport type FlowLoaderShade = 'green' | 'grey' | 'ink';\n\n/**\n * Props for {@link FlowLoader}.\n *\n * @example\n * ```tsx\n * const props: FlowLoaderProps = { size: 24 };\n * ```\n * @see FlowLoader\n * @see FlowStatusBar\n */\nexport type FlowLoaderProps = {\n className?: string;\n /** Ink shade for the dots. */\n shade?: FlowLoaderShade;\n /** Overall box edge in px; dot size and gap derive from it. */\n size?: number;\n};\n\n/**\n * A 3x3 grid of dots breathing scale and opacity in a diagonal wave — the\n * house waiting indicator. The wave's period, stagger, and geometry are CSS\n * tokens on `.dyn-flow-root`, so a surrounding composition retunes the tempo\n * by overriding `--dyn-flow-loader-period` instead of prop-drilling.\n *\n * @example\n * ```tsx\n * import { FlowLoader } from '@/flow/components/FlowLoader/FlowLoader';\n *\n * const App = () => <FlowLoader />;\n * ```\n * @param params.className - Extra class names for the loader element.\n * @param params.shade - Ink shade for the dots.\n * @param params.size - Overall box edge in px; dot size and gap derive from it.\n * @returns The loader.\n * @see FlowLoaderProps\n * @see FlowStatusBar\n * @notInstrumented\n */\nexport const FlowLoader: FC<FlowLoaderProps> = ({\n className,\n shade = 'ink',\n size,\n}) => {\n const style =\n size === undefined\n ? undefined\n : ({ '--dyn-flow-size-loader': `${size}px` } as CSSProperties);\n\n return (\n <span\n aria-hidden=\"true\"\n className={className}\n data-shade={shade}\n data-slot=\"dyn-flow-loader\"\n style={style}\n >\n {FLOW_LOADER_DOT_INDEXES.map((index) => (\n <span data-slot=\"dyn-flow-loader-dot\" key={index} />\n ))}\n </span>\n );\n};\n","import type { CSSProperties, FC, ReactNode } from 'react';\n\nimport { FlowLoader } from '../FlowLoader/FlowLoader';\n\n/**\n * Props for {@link FlowStatusBar}.\n *\n * @example\n * ```tsx\n * const props: FlowStatusBarProps = { children: 'Waiting for exactly 225.25 USDC' };\n * ```\n * @see FlowStatusBar\n * @see FlowLoader\n */\nexport type FlowStatusBarProps = {\n /** The message. While busy, a trailing ellipsis is added automatically. */\n children: ReactNode;\n className?: string;\n /** Whether something is in progress: shows the loader, shimmer and ellipsis. Defaults to true. */\n isBusy?: boolean;\n /** One full shimmer sweep in seconds; the house {@link FlowLoader} shares this clock. */\n period?: number;\n};\n\n/**\n * A status line: while busy, a loader plus a shimmering message sharing one\n * tempo; otherwise the message alone, such as a countdown. Meant to sit in a\n * widget's tray — it carries no fill or border of its own.\n *\n * @example\n * ```tsx\n * import { FlowStatusBar } from '@/flow/components/FlowStatusBar/FlowStatusBar';\n *\n * const App = () => <FlowStatusBar>Waiting for exactly 225.25 USDC</FlowStatusBar>;\n * ```\n * @param params.children - The message.\n * @param params.className - Extra class names for the bar element.\n * @param params.isBusy - Whether something is in progress. Defaults to true.\n * @param params.period - One full shimmer sweep in seconds.\n * @returns The status bar.\n * @see FlowStatusBarProps\n * @see FlowLoader\n * @notInstrumented\n */\nexport const FlowStatusBar: FC<FlowStatusBarProps> = ({\n children,\n className,\n isBusy = true,\n period,\n}) => {\n const style =\n period === undefined\n ? undefined\n : ({ '--dyn-flow-status-period': `${period}s` } as CSSProperties);\n\n return (\n <output\n // A message that isn't progress, like a ticking countdown, would be read out on every change.\n aria-live={isBusy ? undefined : 'off'}\n className={className}\n data-busy={isBusy}\n data-slot=\"dyn-flow-status-bar\"\n style={style}\n >\n {isBusy && <FlowLoader />}\n {/* Whole line shimmers, not just the dots: two competing rhythms read\n as noise. */}\n <span data-slot=\"dyn-flow-status-bar-text\">\n {children}\n {isBusy && <span aria-hidden=\"true\">…</span>}\n </span>\n </output>\n );\n};\n","/**\n * How long a progress status waits before the tray shows it, so a quick\n * operation finishes without the tray flashing in and out.\n */\nexport const FLOW_STATUS_TRAY_BUSY_DELAY_MS = 3000;\n","import { type ReactNode, useContext, useEffect, useState } from 'react';\n\nimport { PanelHostContext } from '../../../../components/PanelHost/PanelHostContext';\nimport { FLOW_STATUS_TRAY_BUSY_DELAY_MS } from '../FlowStatusTray.constants';\n\n/** Params for {@link useFlowStatusTray}. */\nexport type UseFlowStatusTrayParams = {\n /** Whether the status is progress rather than plain text. */\n isBusy: boolean;\n /** The status message; `undefined` when there is none. */\n status: ReactNode | undefined;\n};\n\n/** What {@link useFlowStatusTray} returns. */\nexport type UseFlowStatusTrayResult = {\n /** Whether the tray shows the status now. */\n isStatusShown: boolean;\n /**\n * Inside a PanelHost, the element below its card that the status bar goes\n * into (`null` until it mounts); `undefined` outside a host.\n */\n outlet: HTMLElement | null | undefined;\n};\n\n/**\n * Decides when the tray shows its status: a plain status shows at once, while\n * a progress status waits {@link FLOW_STATUS_TRAY_BUSY_DELAY_MS} first, so a\n * quick operation never flashes the tray. A status that is already showing\n * stays up when it turns into progress.\n *\n * @example\n * ```ts\n * const { isStatusShown } = useFlowStatusTray({ isBusy: true, status: 'Getting quote' });\n * ```\n * @param params.isBusy - Whether the status is progress rather than plain text.\n * @param params.status - The status message.\n * @returns Whether the tray shows the status now.\n * @see FlowStatusTray\n * @see FlowStatusBar\n * @notInstrumented\n */\nexport const useFlowStatusTray = ({\n isBusy,\n status,\n}: UseFlowStatusTrayParams): UseFlowStatusTrayResult => {\n const hasStatus = status !== undefined;\n const [isStatusShown, setIsStatusShown] = useState(hasStatus && !isBusy);\n\n // Adjusted during render rather than in an effect, so the tray hides or\n // shows a plain status on the same render the status changes.\n if (!hasStatus && isStatusShown) setIsStatusShown(false);\n if (hasStatus && !isBusy && !isStatusShown) setIsStatusShown(true);\n\n // Keyed on the status being present, not its text, so progress that\n // changes its message keeps counting towards the same delay.\n useEffect(() => {\n if (!hasStatus || isStatusShown) return undefined;\n const show = () => setIsStatusShown(true);\n const timer = setTimeout(show, FLOW_STATUS_TRAY_BUSY_DELAY_MS);\n return () => clearTimeout(timer);\n }, [hasStatus, isStatusShown]);\n\n const host = useContext(PanelHostContext);\n\n return { isStatusShown: hasStatus && isStatusShown, outlet: host?.outlet };\n};\n","'use client';\n\nimport type { FC, ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { FlowStatusBar } from '../FlowStatusBar/FlowStatusBar';\nimport { useFlowStatusTray } from './useFlowStatusTray';\n\n/**\n * Props for {@link FlowStatusTray}.\n *\n * @example\n * ```tsx\n * const props: FlowStatusTrayProps = { children: <Panel title=\"Pay\" />, status: 'Getting quote' };\n * ```\n * @see FlowStatusTray\n * @see FlowStatusBar\n */\nexport type FlowStatusTrayProps = {\n /** The panel the tray frames. */\n children: ReactNode;\n className?: string;\n /** Whether the status is progress (loader and shimmer) rather than plain text. Defaults to true. */\n isBusy?: boolean;\n /** The status message; while set, the tray frames the panel and shows it at the bottom — after a short delay when it is progress. */\n status?: ReactNode;\n};\n\n/**\n * Frames a panel with a tray that shows a {@link FlowStatusBar} below it while\n * something is in progress, or a plain status such as a countdown. Progress\n * only shows once it has run for a few seconds, so a quick operation never\n * flashes the tray. Without a `status` it renders the panel alone. Inside a\n * PanelHost the host's card is the panel, so the status goes below that card.\n *\n * @example\n * ```tsx\n * import { FlowStatusTray } from '@/flow/components/FlowStatusTray/FlowStatusTray';\n *\n * const App = () => (\n * <FlowStatusTray status={isQuoting ? 'Getting quote' : undefined}>\n * <Panel title=\"Choose a token\">…</Panel>\n * </FlowStatusTray>\n * );\n * ```\n * @param params.children - The panel the tray frames.\n * @param params.className - Extra class names for the tray element.\n * @param params.isBusy - Whether the status is progress rather than plain text. Defaults to true.\n * @param params.status - The status message shown below the panel while set.\n * @returns The status tray.\n * @see FlowStatusTrayProps\n * @see FlowStatusBar\n * @see useFlowStatusTray\n * @notInstrumented\n */\nexport const FlowStatusTray: FC<FlowStatusTrayProps> = ({\n children,\n className,\n isBusy = true,\n status,\n}) => {\n const { isStatusShown, outlet } = useFlowStatusTray({ isBusy, status });\n\n const bar = isStatusShown ? (\n <div data-slot=\"dyn-flow-status-tray-bar\">\n <FlowStatusBar isBusy={isBusy}>{status}</FlowStatusBar>\n </div>\n ) : null;\n\n // The host draws the one card, so the bar goes below that card. The root\n // stays, without tray chrome, so the caller's class still has an element.\n if (outlet !== undefined) {\n return (\n <div\n className={className}\n data-active={isStatusShown}\n data-hosted=\"true\"\n data-slot=\"dyn-flow-status-tray\"\n >\n {children}\n {outlet !== null && bar !== null && createPortal(bar, outlet)}\n </div>\n );\n }\n\n return (\n <div\n className={className}\n data-active={isStatusShown}\n data-slot=\"dyn-flow-status-tray\"\n >\n {children}\n {bar}\n </div>\n );\n};\n","/**\n * Default text for {@link FlowLoadError}.\n */\nexport const FLOW_LOAD_ERROR_TEXT = {\n /** Live-region announcement read out when the screen arrives. */\n announcement: 'This payment could not be loaded.',\n /** The reason line when the payment could not be loaded. */\n description: 'Check your connection and try again.',\n /** The outcome line when the payment could not be loaded. */\n heading: \"We couldn't load this payment\",\n /** The reason line when no payment matches the link. */\n notFoundDescription: 'Check the payment link, or ask for a new one.',\n /** The outcome line when no payment matches the link. */\n notFoundHeading: \"We couldn't find this payment\",\n /** The tray status while the payment is loading again. */\n retrying: 'Trying again',\n /** The centered header title. */\n title: 'Payment unavailable',\n /** The button that loads the payment again. */\n tryAgain: 'Try again',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-load-error': typeof FLOW_LOAD_ERROR_TEXT;\n }\n}\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { Button } from '../../../components/Button';\nimport { useText } from '../../../i18n/useText';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { FlowStatusTray } from '../../components/FlowStatusTray';\nimport { FLOW_LOAD_ERROR_TEXT } from './FlowLoadError.text';\n\n/**\n * Props for {@link FlowLoadError}.\n *\n * @example\n * ```tsx\n * const props: FlowLoadErrorProps = { onRetry: () => refetch() };\n * ```\n * @see FlowLoadError\n * @see FlowOutcomeBoundary\n */\nexport type FlowLoadErrorProps = {\n className?: string;\n /** Whether no payment matches the link, rather than a failed load. */\n isNotFound?: boolean;\n /** Whether the payment is loading again; locks the button. */\n isRetrying?: boolean;\n /** Loads the payment again. */\n onRetry: () => void;\n};\n\n/**\n * The Flow \"payment unavailable\" screen, shown when a payment can't be\n * loaded, with a button to try again.\n *\n * @example\n * ```tsx\n * import { FlowLoadError } from '@/flow/views/FlowLoadError/FlowLoadError';\n *\n * const App = () => <FlowLoadError isNotFound onRetry={() => refetch()} />;\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.isNotFound - Whether no payment matches the link.\n * @param params.isRetrying - Whether the payment is loading again.\n * @param params.onRetry - Loads the payment again.\n * @returns The load error view.\n * @see FlowLoadErrorProps\n * @see FlowStatusHero\n * @copy announcement - The live-region line announced when the screen arrives.\n * @copy description - The reason line when the payment could not be loaded.\n * @copy heading - The outcome line when the payment could not be loaded.\n * @copy notFoundDescription - The reason line when no payment matches the link.\n * @copy notFoundHeading - The outcome line when no payment matches the link.\n * @copy retrying - The tray status while the payment is loading again.\n * @copy title - The centered header title.\n * @copy tryAgain - The button that loads the payment again.\n * @notInstrumented\n */\nexport const FlowLoadError: FC<FlowLoadErrorProps> = ({\n className,\n isNotFound = false,\n isRetrying = false,\n onRetry,\n}) => {\n const text = useText({\n defaults: FLOW_LOAD_ERROR_TEXT,\n slot: 'dyn-flow-load-error',\n });\n\n return (\n <FlowStatusTray\n className={className}\n status={isRetrying ? text('retrying') : undefined}\n >\n <Panel title={text('title')}>\n <div aria-busy={isRetrying} data-slot=\"dyn-flow-load-error\">\n {/* Announced on arrival; the mark alone carries no meaning. */}\n <span\n aria-live=\"polite\"\n data-slot=\"dyn-flow-load-error-announce\"\n role=\"status\"\n >\n {text('announcement')}\n </span>\n <FlowStatusHero\n description={text(\n isNotFound ? 'notFoundDescription' : 'description'\n )}\n heading={text(isNotFound ? 'notFoundHeading' : 'heading')}\n variant=\"danger\"\n />\n <div data-slot=\"dyn-flow-load-error-actions\">\n <Button disabled={isRetrying} onClick={onRetry}>\n {text('tryAgain')}\n </Button>\n </div>\n </div>\n </Panel>\n </FlowStatusTray>\n );\n};\n","/**\n * Default text for {@link FlowLoadingView}.\n */\nexport const FLOW_LOADING_VIEW_TEXT = {\n /** The status line under the loader. */\n message: 'Loading payment',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-loading-view': typeof FLOW_LOADING_VIEW_TEXT;\n }\n}\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { useText } from '../../../i18n/useText';\nimport { FlowLoader } from '../../components/FlowLoader';\nimport { Panel } from '../../../components/Panel';\nimport { FLOW_LOADING_VIEW_TEXT } from './FlowLoadingView.text';\n\n/**\n * Props for {@link FlowLoadingView}.\n *\n * @example\n * ```tsx\n * const props: FlowLoadingViewProps = { className: 'checkout' };\n * ```\n * @see FlowLoadingView\n * @see FlowOutcomeBoundary\n */\nexport type FlowLoadingViewProps = {\n className?: string;\n};\n\n/**\n * The Flow loading screen: a panel holding the loader, centred above a\n * status line, while the payment loads.\n *\n * @example\n * ```tsx\n * import { FlowLoadingView } from '@/flow/views/FlowLoadingView/FlowLoadingView';\n *\n * const App = () => <FlowLoadingView />;\n * ```\n * @param params.className - Extra class names for the panel element.\n * @returns The loading view.\n * @see FlowLoadingViewProps\n * @see FlowLoader\n * @copy message - The status line under the loader.\n * @notInstrumented\n */\nexport const FlowLoadingView: FC<FlowLoadingViewProps> = ({ className }) => {\n const text = useText({\n defaults: FLOW_LOADING_VIEW_TEXT,\n slot: 'dyn-flow-loading-view',\n });\n\n return (\n <Panel className={className}>\n <div aria-busy=\"true\" data-slot=\"dyn-flow-loading-view\">\n <FlowLoader />\n <p data-slot=\"dyn-flow-loading-view-message\" role=\"status\">\n {text('message')}\n </p>\n </div>\n </Panel>\n );\n};\n","/**\n * Default text for {@link FlowPaymentCancelled}. Placeholder copy until the final wording is settled.\n */\nexport const FLOW_PAYMENT_CANCELLED_TEXT = {\n /** Live-region announcement read out when the screen arrives. */\n announcement: 'This payment was cancelled.',\n /** The reason line; `{merchant}` is replaced by the merchant's display name. Hidden without a merchant name. */\n contactMerchant: 'Contact {merchant} if you need to pay again.',\n /** The boldest line — the outcome. */\n heading: 'This payment was cancelled',\n /** The centered header title. */\n title: 'Payment cancelled',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-payment-cancelled': typeof FLOW_PAYMENT_CANCELLED_TEXT;\n }\n}\n","import { interpolateText } from '../../../../i18n/interpolateText';\nimport type { FlowUiSettings } from '../../../flow.types';\nimport { getFlowMerchantLogoUrl } from '../../../utils/getFlowMerchantLogoUrl';\n\n/** Params for {@link getFlowPaymentCancelledDetails}. */\nexport type GetFlowPaymentCancelledDetailsParams = {\n /** Localized `Contact {merchant}` template — `{merchant}` is the merchant name. */\n contactMerchantText: string;\n /** The flow's display settings, carrying the merchant fields. */\n uiSettings: FlowUiSettings;\n};\n\n/** What {@link getFlowPaymentCancelledDetails} returns to the cancelled screen. */\nexport type FlowPaymentCancelledDetails = {\n /** The contact line, or `undefined` without a merchant name. */\n description: string | undefined;\n /** The merchant logo when it is a safe image source — the hero mark. */\n merchantLogoUrl: string | undefined;\n};\n\n/**\n * Derives the cancelled screen's contact line and merchant logo from the flow's display settings.\n *\n * @example\n * ```ts\n * const { description, merchantLogoUrl } = getFlowPaymentCancelledDetails({\n * contactMerchantText: text('contactMerchant'),\n * uiSettings,\n * });\n * ```\n * @param params.contactMerchantText - Localized `Contact {merchant}` template.\n * @param params.uiSettings - The flow's display settings, carrying the merchant fields.\n * @returns The contact line and the merchant logo URL for the hero mark.\n * @see FlowPaymentCancelled\n * @see FlowPaymentCancelledDetails\n * @notInstrumented\n */\nexport const getFlowPaymentCancelledDetails = ({\n contactMerchantText,\n uiSettings,\n}: GetFlowPaymentCancelledDetailsParams): FlowPaymentCancelledDetails => {\n const merchantLogoUrl = getFlowMerchantLogoUrl({ uiSettings });\n const merchantName = uiSettings.merchantName?.trim() || undefined;\n if (merchantName === undefined) {\n return { description: undefined, merchantLogoUrl };\n }\n\n return {\n description: interpolateText({\n template: contactMerchantText,\n token: '{merchant}',\n value: merchantName,\n }),\n merchantLogoUrl,\n };\n};\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport type { FC, ReactNode } from 'react';\n\nimport { useText } from '../../../i18n/useText';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { useFlowUiSettings } from '../../hooks/useFlowUiSettings';\nimport { FLOW_PAYMENT_CANCELLED_TEXT } from './FlowPaymentCancelled.text';\nimport { getFlowPaymentCancelledDetails } from './getFlowPaymentCancelledDetails';\n\n/**\n * Props for {@link FlowPaymentCancelled}.\n *\n * @example\n * ```tsx\n * const props: FlowPaymentCancelledProps = { flow };\n * ```\n * @see FlowPaymentCancelled\n * @see Flow\n */\nexport type FlowPaymentCancelledProps = {\n className?: string;\n /** The cancelled flow; its `uiConfig` carries the merchant logo and name. */\n flow: Flow;\n};\n\n/**\n * The Flow \"payment cancelled\" screen: shown when the merchant cancelled the\n * payment before it was paid. It states the outcome and, when the flow names\n * the merchant, who to contact. Terminal, with no actions.\n *\n * @example\n * ```tsx\n * import { FlowPaymentCancelled } from '@/flow/views/FlowPaymentCancelled/FlowPaymentCancelled';\n *\n * const App = () => <FlowPaymentCancelled flow={flow} />;\n * ```\n * @param params.className - Extra class names for the panel element.\n * @param params.flow - The cancelled flow.\n * @returns The payment-cancelled view.\n * @see FlowPaymentCancelledProps\n * @see FlowStatusHero\n * @copy announcement - The live-region line announced when the screen arrives.\n * @copy contactMerchant - The reason line; `{merchant}` is replaced by the merchant's display name. Hidden without a merchant name.\n * @copy heading - The outcome line under the hero mark.\n * @copy title - The centered header title.\n * @notInstrumented\n */\nexport const FlowPaymentCancelled: FC<FlowPaymentCancelledProps> = ({\n className,\n flow,\n}) => {\n const text = useText({\n defaults: FLOW_PAYMENT_CANCELLED_TEXT,\n slot: 'dyn-flow-payment-cancelled',\n });\n const uiSettings = useFlowUiSettings({ flow });\n const { description, merchantLogoUrl } = getFlowPaymentCancelledDetails({\n contactMerchantText: text('contactMerchant'),\n uiSettings,\n });\n\n let mark: ReactNode | undefined;\n if (merchantLogoUrl !== undefined) {\n mark = (\n <img\n alt=\"\"\n data-slot=\"dyn-flow-payment-cancelled-mark\"\n src={merchantLogoUrl}\n />\n );\n }\n\n return (\n <Panel className={className} title={text('title')}>\n <div data-slot=\"dyn-flow-payment-cancelled\">\n {/* Announced on arrival; the mark alone carries no meaning. */}\n <span\n aria-live=\"polite\"\n data-slot=\"dyn-flow-payment-cancelled-announce\"\n role=\"status\"\n >\n {text('announcement')}\n </span>\n <FlowStatusHero\n description={description}\n heading={text('heading')}\n mark={mark}\n variant=\"danger\"\n />\n </div>\n </Panel>\n );\n};\n","/**\n * Default text for {@link CopyText}.\n */\nexport const COPY_TEXT_TEXT = {\n copiedLabel: '{label} copied',\n copyLabel: 'Copy: {label}',\n};\n\ndeclare module '../../i18n/text.types' {\n interface TextSlots {\n 'dyn-copy-text': typeof COPY_TEXT_TEXT;\n }\n}\n","'use client';\n\nimport type { FC, ReactNode } from 'react';\n\nimport { interpolateText } from '../../i18n/interpolateText';\nimport { useText } from '../../i18n/useText';\nimport { CopyMorphIcon } from '../CopyMorphIcon';\nimport { useCopyToClipboard } from '../../utils/hooks/useCopyToClipboard';\nimport { COPY_TEXT_TEXT } from './CopyText.text';\n\n/**\n * Props for {@link CopyText}.\n *\n * @example\n * ```tsx\n * const props: CopyTextProps = {\n * copyValue: 'A-4821',\n * display: 'A-4821',\n * label: 'Reference',\n * };\n * ```\n * @see CopyText\n * @see CopyField\n */\nexport type CopyTextProps = {\n className?: string;\n /** What actually lands on the clipboard (raw amount / raw reference). */\n copyValue: string;\n /** The value as rendered — usually a truncated form of `copyValue`. */\n display: ReactNode;\n /** What the value is (\"Reference\") — used in the button's accessible name. */\n label: string;\n};\n\n/**\n * Inline copyable text: the value followed by a bare copy icon. The icon is\n * {@link CopyMorphIcon}, which morphs into a tick as the copy lands.\n *\n * @example\n * ```tsx\n * import { CopyText } from '@/components/CopyText/CopyText';\n *\n * const App = () => (\n * <CopyText copyValue=\"A-4821\" display=\"A-4821\" label=\"Reference\" />\n * );\n * ```\n * @param params.className - Extra class names for the element.\n * @param params.copyValue - The text written to the clipboard when the icon is pressed.\n * @param params.display - The value as rendered, usually truncated.\n * @param params.label - What the value is, used in the button's accessible name.\n * @returns The copyable text.\n * @see CopyTextProps\n * @see CopyMorphIcon\n * @see CopyField\n * @copy copyLabel - Accessible name of the copy icon; `{label}` is replaced by `label`.\n * @copy copiedLabel - Accessible name while the copy confirmation shows; `{label}` is replaced by `label`.\n * @notInstrumented\n */\nexport const CopyText: FC<CopyTextProps> = ({\n className,\n copyValue,\n display,\n label,\n}) => {\n const text = useText({ defaults: COPY_TEXT_TEXT, slot: 'dyn-copy-text' });\n const { copied, copy } = useCopyToClipboard({ value: copyValue });\n\n const labelTemplate = copied ? 'copiedLabel' : 'copyLabel';\n const ariaLabel = interpolateText({\n template: text(labelTemplate),\n token: '{label}',\n value: label,\n });\n\n return (\n <span className={className} data-slot=\"dyn-copy-text\">\n <span data-slot=\"dyn-copy-text-value\">{display}</span>\n <button\n aria-label={ariaLabel}\n data-slot=\"dyn-copy-text-button\"\n onClick={copy}\n type=\"button\"\n >\n <CopyMorphIcon copied={copied} size={12} />\n </button>\n </span>\n );\n};\n","'use client';\n\nimport type { FC } from 'react';\n\n/**\n * One label/value line in {@link FlowPaymentLedger}.\n *\n * @example\n * ```tsx\n * const line: FlowPaymentLedgerLine = { label: 'Network fee · Base', value: '~$0.03' };\n * ```\n * @see FlowPaymentLedger\n * @see FlowPaymentLedgerProps\n */\nexport type FlowPaymentLedgerLine = {\n /** What the line is for, e.g. \"Network fee · Base\". */\n label: string;\n /** The line's figure, e.g. \"~$0.03\". */\n value: string;\n};\n\n/**\n * Props for {@link FlowPaymentLedger}.\n *\n * @example\n * ```tsx\n * const props: FlowPaymentLedgerProps = {\n * lines: [\n * { label: 'Order total', value: '$225.25' },\n * { label: 'Network fee · Base', value: '~$0.03' },\n * ],\n * total: { label: 'Total', value: '~$225.28' },\n * };\n * ```\n * @see FlowPaymentLedger\n * @see FlowPaymentLedgerLine\n */\nexport type FlowPaymentLedgerProps = {\n className?: string;\n /** Ledger identifier; the ledger's `data-testid` is `flow-payment-ledger-<id>`. */\n id?: string;\n /** The itemized lines, rendered top to bottom. */\n lines: FlowPaymentLedgerLine[];\n /** The summed figure. Rendered after a dashed divider with emphasis. */\n total?: FlowPaymentLedgerLine;\n};\n\n/**\n * A cost summary as ledger lines — one \"label … value\" row per line, a dashed\n * divider, then the emphasized total. Labels stay muted so the figures carry\n * the reading order; the total is the only emphasized value.\n *\n * @example\n * ```tsx\n * import { FlowPaymentLedger } from '@/flow/components/FlowPaymentLedger/FlowPaymentLedger';\n *\n * const App = () => (\n * <FlowPaymentLedger\n * lines={[\n * { label: 'Order total', value: '$225.25' },\n * { label: 'Network fee · Base', value: '~$0.03' },\n * ]}\n * total={{ label: 'Total', value: '~$225.28' }}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the ledger element.\n * @param params.id - Ledger identifier, exposed as `data-testid=\"flow-payment-ledger-<id>\"`.\n * @param params.lines - The itemized lines, rendered top to bottom.\n * @param params.total - The summed figure, rendered after a dashed divider with emphasis.\n * @returns The payment ledger.\n * @see FlowPaymentLedgerProps\n * @see FlowPaymentLedgerLine\n * @notInstrumented\n */\nexport const FlowPaymentLedger: FC<FlowPaymentLedgerProps> = ({\n className,\n id,\n lines,\n total,\n}) => (\n <div\n className={className}\n data-slot=\"dyn-flow-payment-ledger\"\n data-testid={id !== undefined ? `flow-payment-ledger-${id}` : undefined}\n >\n {lines.map((line, index) => (\n <div data-slot=\"dyn-flow-payment-ledger-row\" key={`${index}-${line.label}`}>\n <span data-slot=\"dyn-flow-payment-ledger-label\">{line.label}</span>\n <span data-slot=\"dyn-flow-payment-ledger-value\">{line.value}</span>\n </div>\n ))}\n {total !== undefined && (\n <>\n <div aria-hidden data-slot=\"dyn-flow-payment-ledger-divider\" />\n <div data-slot=\"dyn-flow-payment-ledger-total\">\n <span data-slot=\"dyn-flow-payment-ledger-label\">{total.label}</span>\n <span data-slot=\"dyn-flow-payment-ledger-value\">{total.value}</span>\n </div>\n </>\n )}\n </div>\n);\n","import type { CSSProperties, FC, PropsWithChildren } from 'react';\n\n/**\n * Props for {@link FlowPill}.\n *\n * @example\n * ```tsx\n * const props: FlowPillProps = { children: null };\n * ```\n * @see FlowPill\n * @see Panel\n */\nexport type FlowPillProps = PropsWithChildren<{\n className?: string;\n /** Shrink-to-fit floor in pixels, so short content doesn't collapse the pill. */\n minWidth?: number;\n}>;\n\n/**\n * A bordered pill sized to its content, such as a \"Send exactly\" hero\n * amount or a QR tile's frame.\n *\n * @example\n * ```tsx\n * import { FlowPill } from '@/flow/components/FlowPill/FlowPill';\n *\n * const App = () => <FlowPill>225.25 USDC</FlowPill>;\n * ```\n * @param params.children - The pill's content.\n * @param params.className - Extra class names for the pill element.\n * @param params.minWidth - Shrink-to-fit floor in pixels.\n * @returns The pill.\n * @see FlowPillProps\n * @see Panel\n * @notInstrumented\n */\nexport const FlowPill: FC<FlowPillProps> = ({\n children,\n className,\n minWidth,\n}) => (\n <div\n className={className}\n data-slot=\"dyn-flow-pill\"\n style={\n minWidth !== undefined\n ? ({ '--dyn-flow-pill-min-width': `${minWidth}px` } as CSSProperties)\n : undefined\n }\n >\n {children}\n </div>\n);\n","/**\n * Default text for {@link FlowPaymentComplete}.\n */\nexport const FLOW_PAYMENT_COMPLETE_TEXT = {\n /**\n * Live-region announcement read out when the screen arrives; `{received}`\n * is replaced by the filled `received` line.\n */\n announcement: 'Payment complete. {received}.',\n /** The exit action's label. */\n continue: 'Continue',\n /** The ledger's fees line — the quoted fee keeps its `~` estimate mark. */\n fees: 'Fees',\n /** The boldest line when the received amount is unknown. */\n receivedAmountUnknown: 'Payment received',\n /**\n * The boldest line — the outcome; `{merchant}` is replaced by the\n * merchant's display name, `{amount}` by what they received.\n */\n receivedWithMerchant: '{merchant} received {amount}',\n /** The `received` line's shape when no merchant name is known; `{amount}` is replaced. */\n receivedWithoutMerchant: 'Received {amount}',\n /** The copyable payment reference row's label. */\n reference: 'Reference',\n /** The centered header title. */\n title: 'Payment complete',\n /** The ledger line reporting what left the payer's wallet. */\n youSent: 'You sent',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-payment-complete': typeof FLOW_PAYMENT_COMPLETE_TEXT;\n }\n}\n","import type {\n FlowDepositAddressSupportedChains,\n FlowPaymentMethod,\n} from './flow.types';\n\n/** The chain families a deposit address payment can come from: those the payer can give a refund address for. */\nexport const FLOW_DEPOSIT_ADDRESS_SUPPORTED_CHAINS: readonly FlowDepositAddressSupportedChains[] =\n ['BTC', 'EVM', 'SOL', 'TRON'];\n\n/** Shown in place of a figure the flow does not carry. */\nexport const FLOW_UNAVAILABLE_PLACEHOLDER = '—';\n\n/** Default copy for the submission failures both the review and not-approved screens report. */\nexport const FLOW_SUBMIT_ERROR_DEFAULT_TEXT = {\n gasBalance: 'Not enough balance to cover network fees.',\n generic: 'Failed to submit payment. Please try again.',\n transferBalance: 'Not enough balance to cover this payment.',\n};\n\n/** Fees and fiat totals are always USD, whatever currency the flow is priced in. */\nexport const FLOW_USD_CURRENCY = 'USD';\n\n/** The currency of a flow priced in its settlement token rather than fiat. */\nexport const FLOW_SETTLEMENT_TOKEN_CURRENCY = 'SETTLEMENT_TOKEN';\n\n/** The failure code of a payment that failed and whose refund to the payer has started. */\nexport const FLOW_REFUND_INITIATED_CODE = 'REFUND_INITIATED';\n\n/** The placeholder exchange screens' copy uses for the exchange's name. */\nexport const FLOW_EXCHANGE_NAME_TOKEN = '{exchange}';\n\n/** Every payment method a payer can choose, in the order the method choice lists them. */\nexport const FLOW_PAYMENT_METHODS: readonly FlowPaymentMethod[] = [\n 'wallet',\n 'exchange',\n 'deposit_address',\n];\n","// jsdoc-completeness-disable @see\n\nimport { InvalidParamError } from '@dynamic-labs-sdk/client';\n\n/**\n * Params for {@link formatFiatAmount}.\n */\nexport type FormatFiatAmountParams = {\n /** The decimal amount. */\n amount: string;\n /** The ISO 4217 currency code. */\n currency: string;\n /** The BCP 47 locale. Defaults to `en-US`. */\n lang?: string;\n};\n\n/**\n * Renders a decimal amount as a localized currency figure. The amount is\n * kept as a string through rounding so large values keep full precision,\n * and `Intl.NumberFormat` picks each currency's ISO minor-unit precision,\n * so an unassigned but well-formed code like `XTS` still reads as a price.\n *\n * @example\n * ```ts\n * formatFiatAmount({ amount: '225.25', currency: 'USD' }); // '$225.25'\n * ```\n * @param params.amount - The decimal amount.\n * @param params.currency - The ISO 4217 currency code.\n * @param params.lang - The BCP 47 locale, defaults to `en-US`.\n * @returns The formatted currency figure.\n * @throws InvalidParamError when `amount` is not a decimal string or `currency` is not an ISO 4217 code.\n * @notInstrumented\n */\nexport const formatFiatAmount = ({\n amount,\n currency,\n lang = 'en-US',\n}: FormatFiatAmountParams): string => {\n const isPlainDecimal = /^-?\\d+(\\.\\d+)?$/.test(amount);\n if (!isPlainDecimal) {\n throw new InvalidParamError('amount must be a decimal string');\n }\n\n const isIsoCurrencyCode = /^[A-Za-z]{3}$/.test(currency);\n if (!isIsoCurrencyCode) {\n throw new InvalidParamError('currency must be an ISO 4217 code');\n }\n\n const negative = amount.startsWith('-');\n const digitsBody = negative ? amount.slice(1) : amount;\n const [integerPart, fractionPart = ''] = digitsBody.split('.');\n\n const formatter = new Intl.NumberFormat(lang, {\n currency,\n style: 'currency',\n });\n // `resolvedOptions` types the digit count as optional; ISO 4217's\n // default exponent is 2, which is what most fiat currencies use.\n const minorDigits = formatter.resolvedOptions().maximumFractionDigits ?? 2;\n\n let roundedInteger = BigInt(integerPart);\n let fraction = fractionPart.padEnd(minorDigits, '0').slice(0, minorDigits);\n const firstDroppedDigit = fractionPart[minorDigits];\n if (firstDroppedDigit !== undefined && firstDroppedDigit >= '5') {\n const roundedFraction = BigInt(fraction || '0') + BigInt(1);\n if (roundedFraction === BigInt(10) ** BigInt(minorDigits)) {\n roundedInteger += BigInt(1);\n fraction = '0'.repeat(minorDigits);\n } else {\n fraction = roundedFraction.toString().padStart(minorDigits, '0');\n }\n }\n\n const signedInteger = negative ? -roundedInteger : roundedInteger;\n const parts = formatter.formatToParts(signedInteger);\n\n return parts\n .map((part) => (part.type === 'fraction' ? fraction : part.value))\n .join('');\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\nimport { formatFiatAmount } from '../../../utils/formatFiatAmount';\nimport { FLOW_SETTLEMENT_TOKEN_CURRENCY } from '../../constants';\n\n/** Params for {@link formatFlowAmount}. */\nexport type FormatFlowAmountParams = {\n /** The flow whose order amount is formatted. */\n flow: Flow;\n};\n\n/**\n * Formats the flow's order amount in the currency it is priced in, without throwing on an unknown currency.\n *\n * @example\n * ```ts\n * formatFlowAmount({ flow }); // '$225.00' or '225.5 USDC'\n * ```\n * @param params.flow - The flow whose order amount is formatted.\n * @returns The formatted order amount.\n * @see getFlowAmountUsd\n * @see formatFlowPayment\n * @notInstrumented\n */\nexport const formatFlowAmount = ({ flow }: FormatFlowAmountParams): string => {\n const { amount, currency } = flow;\n\n // A token-priced amount is already in whole tokens.\n if (currency === FLOW_SETTLEMENT_TOKEN_CURRENCY) {\n const symbol = flow.currencyTokenInfo?.symbol;\n if (symbol === undefined) {\n return amount;\n }\n\n return `${amount} ${symbol}`;\n }\n\n // An unknown currency code must not crash the screen, so it shows as-is.\n try {\n return formatFiatAmount({ amount, currency });\n } catch {\n return `${amount} ${currency}`;\n }\n};\n","/** Params for {@link formatFlowEstimate}. */\nexport type FormatFlowEstimateParams = {\n /** The already-formatted figure, e.g. \"$2.40\". */\n value: string;\n};\n\n/**\n * Marks a formatted figure as an estimate from the quote with a leading `~`.\n *\n * @example\n * ```ts\n * formatFlowEstimate({ value: '$2.40' }); // '~$2.40'\n * ```\n * @param params.value - The already-formatted figure.\n * @returns The figure prefixed with the estimate mark.\n * @see formatFlowPayment\n * @see getFlowPaymentTotal\n * @notInstrumented\n */\nexport const formatFlowEstimate = ({\n value,\n}: FormatFlowEstimateParams): string => `~${value}`;\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\nimport { FLOW_USD_CURRENCY } from '../../constants';\n\n/** Params for {@link getFlowAmountUsd}. */\nexport type GetFlowAmountUsdParams = {\n /** The flow whose order amount is read. */\n flow: Flow;\n};\n\n/**\n * Returns the flow's order amount in USD, which a token-priced flow only carries once quoted.\n *\n * @example\n * ```ts\n * getFlowAmountUsd({ flow }); // '225.5'\n * ```\n * @param params.flow - The flow whose order amount is read.\n * @returns The decimal USD amount, or `undefined` while it isn't known.\n * @see formatFlowAmount\n * @see getFlowPaymentTotal\n * @notInstrumented\n */\nexport const getFlowAmountUsd = ({\n flow,\n}: GetFlowAmountUsdParams): string | undefined => {\n if (flow.amountUsd !== undefined) {\n return flow.amountUsd;\n }\n\n // A USD flow's own amount is already in USD when the API omits the USD value.\n if (flow.currency === FLOW_USD_CURRENCY) {\n return flow.amount;\n }\n\n return undefined;\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\nimport { formatFiatAmount } from '../../../utils/formatFiatAmount';\nimport { FLOW_USD_CURRENCY } from '../../constants';\nimport { formatFlowAmount } from '../formatFlowAmount';\nimport { getFlowAmountUsd } from '../getFlowAmountUsd';\n\n/** Params for {@link formatFlowOrderTotal}. */\nexport type FormatFlowOrderTotalParams = {\n /** The flow whose order total is formatted. */\n flow: Flow;\n};\n\n/**\n * Formats the flow's order total in USD, or in the flow's own currency while its USD value is unknown.\n *\n * @example\n * ```ts\n * formatFlowOrderTotal({ flow }); // '$225.48'\n * ```\n * @param params.flow - The flow whose order total is formatted.\n * @returns The formatted order total.\n * @see getFlowAmountUsd\n * @see formatFlowAmount\n * @notInstrumented\n */\nexport const formatFlowOrderTotal = ({\n flow,\n}: FormatFlowOrderTotalParams): string => {\n const amountUsd = getFlowAmountUsd({ flow });\n if (amountUsd === undefined) {\n return formatFlowAmount({ flow });\n }\n\n return formatFiatAmount({ amount: amountUsd, currency: FLOW_USD_CURRENCY });\n};\n","import { InvalidParamError } from '@dynamic-labs-sdk/client';\n\nconst NON_NEGATIVE_DECIMAL_STRING_PATTERN = /^\\d+(\\.\\d+)?$/;\n\n/** Params for {@link assertValidNonNegativeDecimalString}. */\nexport type AssertValidNonNegativeDecimalStringParams = {\n /** Field name included in validation errors. */\n name: string;\n /** Decimal string to validate. */\n value: string;\n};\n\n/**\n * Asserts that a value is a non-negative decimal string, including zero.\n * @example\n * ```ts\n * assertValidNonNegativeDecimalString({ name: 'feesUsd', value: '2.40' });\n * ```\n * @param params.name - Field name included in validation errors.\n * @param params.value - Decimal string to validate.\n * @returns Nothing when the value is valid.\n * @throws InvalidParamError when the value is negative or not a decimal string.\n * @see AssertValidNonNegativeDecimalStringParams\n * @see InvalidParamError\n * @notInstrumented\n */\nexport const assertValidNonNegativeDecimalString = ({\n name,\n value,\n}: AssertValidNonNegativeDecimalStringParams): void => {\n if (!NON_NEGATIVE_DECIMAL_STRING_PATTERN.test(value)) {\n throw new InvalidParamError(\n `${name} must be a non-negative decimal string`\n );\n }\n};\n","import { FLOW_USD_CURRENCY } from '../../constants';\nimport { assertValidNonNegativeDecimalString } from '../../../utils/assertValidNonNegativeDecimalString';\nimport { formatFiatAmount } from '../../../utils/formatFiatAmount';\n\n/** Params for {@link getFlowPaymentTotal}. */\nexport type GetFlowPaymentTotalParams = {\n /** Order amount in USD. */\n amount: string;\n /** Total fees in USD. Use zero when there are no fees. */\n feesUsd: string;\n};\n\n/**\n * Adds an order amount and its total fees in USD while preserving decimal\n * precision.\n * @example\n * ```ts\n * getFlowPaymentTotal({ amount: '225', feesUsd: '2.40' }); // '$227.40'\n * ```\n * @param params.amount - Order amount in USD.\n * @param params.feesUsd - Total fees in USD. Use zero when there are no fees.\n * @returns The formatted USD total.\n * @throws InvalidParamError when an amount is not a non-negative decimal string.\n * @see assertValidNonNegativeDecimalString\n * @see formatFiatAmount\n * @notInstrumented\n */\nexport const getFlowPaymentTotal = ({\n amount,\n feesUsd,\n}: GetFlowPaymentTotalParams): string => {\n assertValidNonNegativeDecimalString({ name: 'amount', value: amount });\n assertValidNonNegativeDecimalString({ name: 'feesUsd', value: feesUsd });\n const [amountWhole, amountFraction = ''] = amount.split('.');\n const [feesWhole, feesFraction = ''] = feesUsd.split('.');\n const decimals = Math.max(amountFraction.length, feesFraction.length);\n // Scale both values to integers before adding so decimal precision is exact.\n const rawTotal =\n BigInt(amountWhole + amountFraction.padEnd(decimals, '0')) +\n BigInt(feesWhole + feesFraction.padEnd(decimals, '0'));\n const totalDigits = rawTotal.toString().padStart(decimals + 1, '0');\n const total =\n decimals === 0\n ? totalDigits\n : `${totalDigits.slice(0, -decimals)}.${totalDigits.slice(-decimals)}`;\n return formatFiatAmount({\n amount: total,\n currency: FLOW_USD_CURRENCY,\n });\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport { InvalidParamError, formatTokenAmount } from '@dynamic-labs-sdk/client';\n\nimport { formatFiatAmount } from '../../../utils/formatFiatAmount';\nimport { FLOW_USD_CURRENCY } from '../../constants';\nimport { formatFlowEstimate } from '../formatFlowEstimate';\nimport { formatFlowOrderTotal } from '../formatFlowOrderTotal';\nimport { getFlowAmountUsd } from '../getFlowAmountUsd';\nimport { getFlowPaymentTotal } from '../getFlowPaymentTotal';\n\n/** Display fields for one token in a flow's quote. */\ntype FormattedPaymentToken = {\n amount: string | undefined;\n name: string | undefined;\n tokenIcon: string | undefined;\n};\n\n/** Payment values derived from the flow and its quoted fees. */\nexport type FormattedFlowPayment = {\n fee: string | undefined;\n from: FormattedPaymentToken;\n orderTotal: string;\n to: FormattedPaymentToken | undefined;\n total: string | undefined;\n};\n\n/** Params for {@link formatFlowPayment}. */\nexport type FormatFlowPaymentParams = {\n /** SDK flow containing the payment order and quote. */\n flow: Flow;\n};\n\n/**\n * Formats quote amounts using token decimals and identifies direct payments\n * by chain and token address. The order and fiat totals are in USD; the\n * total includes quoted fees and is omitted while the order's USD value is\n * unknown.\n * @example\n * ```ts\n * const payment = formatFlowPayment({ flow });\n * ```\n * @param params.flow - SDK flow containing the payment order and quote.\n * @returns Display-ready token amounts, order amount, and available fees and total.\n * @throws InvalidParamError when the flow has no quote.\n * @see Flow\n * @see formatTokenAmount\n * @see getFlowPaymentTotal\n * @see formatFlowOrderTotal\n * @see formatFlowEstimate\n * @notInstrumented\n */\nexport const formatFlowPayment = ({\n flow,\n}: FormatFlowPaymentParams): FormattedFlowPayment => {\n const quote = flow.quote;\n if (quote === undefined) {\n throw new InvalidParamError('flow.quote is required');\n }\n const fromToken = quote.fromTokenInfo;\n const toToken = quote.toTokenInfo;\n const fromChainId = quote.fromChainId ?? flow.fromChainId;\n const toChainId = quote.toChainId ?? flow.toChainId;\n const fromTokenId = quote.fromToken ?? flow.fromToken;\n const toTokenId = quote.toToken ?? flow.toToken;\n const fromChainName = quote.fromChainName ?? flow.fromChainName;\n const toChainName = quote.toChainName ?? flow.toChainName;\n const fromTokenAddress =\n fromChainName === 'EVM' ? fromTokenId?.toLowerCase() : fromTokenId;\n const toTokenAddress =\n toChainName === 'EVM' ? toTokenId?.toLowerCase() : toTokenId;\n const isSameTokenTransfer =\n fromChainName !== undefined &&\n fromChainName === toChainName &&\n fromChainId !== undefined &&\n fromChainId === toChainId &&\n fromTokenAddress !== undefined &&\n fromTokenAddress === toTokenAddress;\n const feesUsd = quote.fees?.totalFeeUsd;\n const amountUsd = getFlowAmountUsd({ flow });\n\n return {\n fee:\n feesUsd !== undefined\n ? formatFlowEstimate({\n value: formatFiatAmount({\n amount: feesUsd,\n currency: FLOW_USD_CURRENCY,\n }),\n })\n : undefined,\n from: {\n amount:\n fromToken === undefined\n ? undefined\n : `${formatTokenAmount({\n decimals: fromToken.decimals,\n rawAmount: quote.fromAmount,\n })} ${fromToken.symbol}`,\n name: fromToken?.name ?? fromToken?.symbol,\n tokenIcon: fromToken?.logoURI,\n },\n orderTotal: formatFlowOrderTotal({ flow }),\n to: isSameTokenTransfer\n ? undefined\n : {\n amount:\n toToken === undefined\n ? undefined\n : `${formatTokenAmount({\n decimals: toToken.decimals,\n rawAmount: quote.toAmount,\n })} ${toToken.symbol}`,\n name: toToken?.name ?? toToken?.symbol,\n tokenIcon: toToken?.logoURI,\n },\n // Fees are USD, so the total needs the order's USD value too.\n total:\n amountUsd === undefined\n ? undefined\n : formatFlowEstimate({\n value: getFlowPaymentTotal({\n amount: amountUsd,\n feesUsd: feesUsd ?? '0',\n }),\n }),\n };\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport {\n formatTokenAmount,\n getFlowDeliveredAmount,\n} from '@dynamic-labs-sdk/client';\n\nimport { interpolateText } from '../../../../i18n/interpolateText';\nimport type { FlowPaymentLedgerLine } from '../../../components/FlowPaymentLedger';\nimport { FLOW_SETTLEMENT_TOKEN_CURRENCY } from '../../../constants';\nimport type { FlowUiSettings } from '../../../flow.types';\nimport { formatFlowAmount } from '../../../utils/formatFlowAmount';\nimport { formatFlowPayment } from '../../../utils/formatFlowPayment';\n\n/**\n * Inputs for {@link getFlowPaymentCompleteDetails}.\n *\n * @example\n * ```ts\n * const params: GetFlowPaymentCompleteDetailsParams = {\n * announcementText: text('announcement'),\n * feesText: text('fees'),\n * flow,\n * receivedAmountUnknownText: text('receivedAmountUnknown'),\n * receivedWithMerchantText: text('receivedWithMerchant'),\n * receivedWithoutMerchantText: text('receivedWithoutMerchant'),\n * uiSettings,\n * youSentText: text('youSent'),\n * };\n * ```\n * @see getFlowPaymentCompleteDetails\n * @see FlowPaymentComplete\n */\nexport type GetFlowPaymentCompleteDetailsParams = {\n /** Localized `Payment complete. {received}.` announcement template. */\n announcementText: string;\n /** Localized `Fees` ledger label. */\n feesText: string;\n /** The settled flow carrying the quote. */\n flow: Flow;\n /** Localized `Payment received` hero line, for an unknown received amount. */\n receivedAmountUnknownText: string;\n /** Localized `{merchant} received {amount}` hero template. */\n receivedWithMerchantText: string;\n /** Localized `Received {amount}` hero template for a merchantless flow. */\n receivedWithoutMerchantText: string;\n /** The flow's display settings, carrying the merchant fields. */\n uiSettings: FlowUiSettings;\n /** Localized `You sent` ledger label. */\n youSentText: string;\n};\n\n/** Presentation values returned to the payment-complete screen. */\nexport type FlowPaymentCompleteDetails = {\n /** The filled live-region announcement — `Payment complete. {receivedMessage}.` */\n announcement: string;\n /** Whether the summary pill holds anything — a ledger line or the reference. */\n hasSummary: boolean;\n /** The receipt's ledger rows — You sent, Fees — empty without a quote or when delivery differs from it. */\n ledgerLines: FlowPaymentLedgerLine[];\n /** The hero's `received` line with merchant name and amount filled in. */\n receivedMessage: string;\n /** `externalPaymentId` — the copyable reference support asks for. */\n reference: string | undefined;\n};\n\n/**\n * Derives the payment-complete screen's figures from the settled flow: what\n * the merchant received (the delivered amount when reported, else the quote's),\n * the sent/fees ledger lines, and the live-region announcement.\n *\n * @example\n * ```tsx\n * const { hasSummary, ledgerLines, receivedMessage } = getFlowPaymentCompleteDetails({\n * announcementText: text('announcement'),\n * feesText: text('fees'),\n * flow,\n * receivedAmountUnknownText: text('receivedAmountUnknown'),\n * receivedWithMerchantText: text('receivedWithMerchant'),\n * receivedWithoutMerchantText: text('receivedWithoutMerchant'),\n * uiSettings,\n * youSentText: text('youSent'),\n * });\n * ```\n * @param params.announcementText - Localized announcement template.\n * @param params.feesText - Localized `Fees` label.\n * @param params.flow - The settled flow carrying the quote.\n * @param params.receivedAmountUnknownText - Localized `Payment received` line for an unknown amount.\n * @param params.receivedWithMerchantText - Localized `{merchant} received {amount}` template.\n * @param params.receivedWithoutMerchantText - Localized `Received {amount}` template.\n * @param params.uiSettings - The flow's display settings, carrying the merchant fields.\n * @param params.youSentText - Localized `You sent` label.\n * @returns The view's display strings, ledger lines, and reference.\n * @see FlowPaymentComplete\n * @see formatFlowAmount\n * @see formatFlowPayment\n * @see getFlowDeliveredAmount\n * @see interpolateText\n * @notInstrumented\n */\nexport const getFlowPaymentCompleteDetails = ({\n announcementText,\n feesText,\n flow,\n receivedAmountUnknownText,\n receivedWithMerchantText,\n receivedWithoutMerchantText,\n uiSettings,\n youSentText,\n}: GetFlowPaymentCompleteDetailsParams): FlowPaymentCompleteDetails => {\n const orderTotal = formatFlowAmount({ flow });\n\n const { externalPaymentId: reference, merchantName } = uiSettings;\n\n let ledgerLines: FlowPaymentLedgerLine[] = [];\n let receivedAmount: string | undefined = orderTotal;\n if (flow.quote !== undefined) {\n const payment = formatFlowPayment({ flow });\n // A same-token transfer quotes no `to` side — the merchant received the\n // sent token itself.\n // A token-priced order total is already in the settlement token, unlike a fiat one.\n const isOrderTotalInToken =\n flow.currency === FLOW_SETTLEMENT_TOKEN_CURRENCY &&\n flow.currencyTokenInfo?.symbol !== undefined;\n if (payment.to === undefined) {\n receivedAmount = payment.from.amount ?? orderTotal;\n } else if (payment.to.amount !== undefined) {\n receivedAmount = payment.to.amount;\n } else if (!isOrderTotalInToken) {\n // Without the received token's details the amount stays unknown rather than borrowing the sent one.\n receivedAmount = undefined;\n }\n if (payment.from.amount !== undefined) {\n ledgerLines.push({ label: youSentText, value: payment.from.amount });\n }\n // Settlement reports no actual fee — the quoted fee stays an estimate.\n if (payment.fee !== undefined) {\n ledgerLines.push({ label: feesText, value: payment.fee });\n }\n }\n\n const delivered = getFlowDeliveredAmount({ flow });\n if (delivered !== undefined) {\n const deliveredAmount = `${formatTokenAmount({\n decimals: delivered.tokenInfo.decimals,\n rawAmount: delivered.amount,\n })} ${delivered.tokenInfo.symbol}`;\n // The quoted sent and fee figures would contradict a different delivered figure.\n if (deliveredAmount !== receivedAmount) {\n ledgerLines = [];\n }\n receivedAmount = deliveredAmount;\n }\n\n let receivedTemplate = receivedWithMerchantText;\n if (receivedAmount === undefined) {\n receivedTemplate = receivedAmountUnknownText;\n } else if (merchantName === undefined) {\n receivedTemplate = receivedWithoutMerchantText;\n }\n const receivedMessage = interpolateText({\n template: interpolateText({\n template: receivedTemplate,\n token: '{merchant}',\n value: merchantName ?? '',\n }),\n token: '{amount}',\n value: receivedAmount ?? '',\n });\n\n return {\n announcement: interpolateText({\n template: announcementText,\n token: '{received}',\n value: receivedMessage,\n }),\n hasSummary: ledgerLines.length > 0 || reference !== undefined,\n ledgerLines,\n receivedMessage,\n reference,\n };\n};\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport type { FC } from 'react';\n\nimport { Button } from '../../../components/Button';\nimport { CopyText } from '../../../components/CopyText';\nimport { useText } from '../../../i18n/useText';\nimport { Panel } from '../../../components/Panel';\nimport { FlowPaymentLedger } from '../../components/FlowPaymentLedger';\nimport { FlowPill } from '../../components/FlowPill';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { useFlowUiSettings } from '../../hooks/useFlowUiSettings';\nimport { FLOW_PAYMENT_COMPLETE_TEXT } from './FlowPaymentComplete.text';\nimport { getFlowPaymentCompleteDetails } from './getFlowPaymentCompleteDetails';\n\n/**\n * Props for {@link FlowPaymentComplete}.\n *\n * @example\n * ```tsx\n * const props: FlowPaymentCompleteProps = {\n * flow,\n * onContinue: () => window.close(),\n * };\n * ```\n * @see FlowPaymentComplete\n * @see Flow\n */\nexport type FlowPaymentCompleteProps = {\n className?: string;\n /**\n * The settled flow whose `uiConfig` carries the `merchantName` the hero\n * names, and the `externalPaymentId` shown as the copyable payment\n * reference when present.\n */\n flow: Flow;\n /** Fires when the Back button is pressed. Omit on a root screen to hide Back. */\n onBack?: () => void;\n /** Fires on the Continue exit — a real build returns the payer to the merchant. Omit to hide it. */\n onContinue?: () => void;\n};\n\n/**\n * The Flow \"payment complete\" screen: the settled state reached when a\n * payment lands. A {@link FlowStatusHero} success tick announces\n * `{merchant} received {amount}` (\"Received {amount}\" when no merchant name\n * is known); a {@link FlowPill} holds a {@link FlowPaymentLedger}\n * reconciling what the payer sent against the quoted fees — the Flow model\n * records no settled figures, so the fee keeps its `~` estimate mark — and a\n * copyable payment reference (it's what support and accounting ask for). The\n * exit is Continue.\n *\n * @example\n * ```tsx\n * import { FlowPaymentComplete } from '@/flow/views/FlowPaymentComplete/FlowPaymentComplete';\n *\n * const App = () => <FlowPaymentComplete flow={flow} onContinue={leave} />;\n * ```\n * @param params.className - Extra class names for the panel element.\n * @param params.flow - The settled flow carrying the quote and `uiConfig` merchant fields.\n * @param params.onBack - Fires when the Back button is pressed. Omit on a root screen to hide Back.\n * @param params.onContinue - Fires on the Continue exit. Omit to hide it.\n * @returns The payment-complete view.\n * @see FlowPaymentCompleteProps\n * @see FlowPaymentLedger\n * @see FlowStatusHero\n * @copy announcement - The live-region line announced when the screen arrives; `{received}` is replaced by the filled `received` line.\n * @copy continue - The exit action's label.\n * @copy fees - The ledger's fees line.\n * @copy receivedAmountUnknown - The boldest line when the received amount is unknown.\n * @copy receivedWithMerchant - The boldest line — `{merchant}` and `{amount}` are replaced.\n * @copy receivedWithoutMerchant - The `received` line's shape when no merchant name is known; `{amount}` is replaced.\n * @copy reference - The copyable payment reference row's label.\n * @copy title - The centered header title.\n * @copy youSent - The ledger line reporting what left the payer's wallet.\n * @notInstrumented\n */\nexport const FlowPaymentComplete: FC<FlowPaymentCompleteProps> = ({\n className,\n flow,\n onBack,\n onContinue,\n}) => {\n const text = useText({\n defaults: FLOW_PAYMENT_COMPLETE_TEXT,\n slot: 'dyn-flow-payment-complete',\n });\n const uiSettings = useFlowUiSettings({ flow });\n const { announcement, hasSummary, ledgerLines, receivedMessage, reference } =\n getFlowPaymentCompleteDetails({\n announcementText: text('announcement'),\n feesText: text('fees'),\n flow,\n receivedAmountUnknownText: text('receivedAmountUnknown'),\n receivedWithMerchantText: text('receivedWithMerchant'),\n receivedWithoutMerchantText: text('receivedWithoutMerchant'),\n uiSettings,\n youSentText: text('youSent'),\n });\n\n return (\n <Panel className={className} onBack={onBack} title={text('title')}>\n <div data-slot=\"dyn-flow-payment-complete\">\n {/* Announced on arrival; the mark alone carries no meaning. */}\n <span\n aria-live=\"polite\"\n data-slot=\"dyn-flow-payment-complete-announce\"\n role=\"status\"\n >\n {announcement}\n </span>\n <FlowStatusHero heading={receivedMessage} />\n {hasSummary && (\n <FlowPill>\n <div data-slot=\"dyn-flow-payment-complete-summary\">\n {ledgerLines.length > 0 && (\n <FlowPaymentLedger lines={ledgerLines} />\n )}\n {reference !== undefined && (\n <div data-slot=\"dyn-flow-payment-complete-reference\">\n <span data-slot=\"dyn-flow-payment-complete-reference-label\">\n {text('reference')}\n </span>\n <CopyText\n copyValue={reference}\n display={reference}\n label={text('reference')}\n />\n </div>\n )}\n </div>\n </FlowPill>\n )}\n {onContinue !== undefined && (\n <div data-slot=\"dyn-flow-payment-complete-actions\">\n <Button onClick={onContinue}>{text('continue')}</Button>\n </div>\n )}\n </div>\n </Panel>\n );\n};\n","/**\n * Default text for {@link FlowPaymentFailed}. Placeholder copy until the final wording is settled.\n */\nexport const FLOW_PAYMENT_FAILED_TEXT = {\n /** Live-region announcement read out when the screen arrives. */\n announcement: 'Payment failed.',\n /** The reason line when the flow reports no failure message. */\n genericDescription: 'Something went wrong while processing this payment.',\n /** The boldest line — the outcome. */\n heading: 'Payment failed',\n /** The centered header title. */\n title: 'Payment failed',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-payment-failed': typeof FLOW_PAYMENT_FAILED_TEXT;\n }\n}\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\nimport type { FlowUiSettings } from '../../../flow.types';\nimport { getFlowMerchantLogoUrl } from '../../../utils/getFlowMerchantLogoUrl';\n\n/**\n * Inputs for {@link getFlowPaymentFailedDetails}.\n *\n * @example\n * ```ts\n * const params: GetFlowPaymentFailedDetailsParams = { flow, uiSettings };\n * ```\n * @see getFlowPaymentFailedDetails\n * @see FlowPaymentFailed\n */\nexport type GetFlowPaymentFailedDetailsParams = {\n /** The failed flow. */\n flow: Flow;\n /** The flow's display settings, carrying the merchant logo. */\n uiSettings: FlowUiSettings;\n};\n\n/** What {@link getFlowPaymentFailedDetails} returns to the failed screen. */\nexport type FlowPaymentFailedDetails = {\n /** The flow's own failure message, or `undefined` when it reports none. */\n failureMessage: string | undefined;\n /** The merchant logo when it is a safe image source — the hero mark. */\n merchantLogoUrl: string | undefined;\n};\n\n/**\n * Derives the payment-failed screen's content from the flow: its failure\n * message and the merchant logo for the hero mark.\n *\n * @example\n * ```ts\n * const { failureMessage, merchantLogoUrl } = getFlowPaymentFailedDetails({ flow, uiSettings });\n * ```\n * @param params.flow - The failed flow.\n * @param params.uiSettings - The flow's display settings, carrying the merchant logo.\n * @returns The failure message and hero mark.\n * @see FlowPaymentFailed\n * @see FlowPaymentFailedDetails\n * @notInstrumented\n */\nexport const getFlowPaymentFailedDetails = ({\n flow,\n uiSettings,\n}: GetFlowPaymentFailedDetailsParams): FlowPaymentFailedDetails => ({\n failureMessage: flow.failure?.message.trim() || undefined,\n merchantLogoUrl: getFlowMerchantLogoUrl({ uiSettings }),\n});\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport type { FC, ReactNode } from 'react';\n\nimport { useText } from '../../../i18n/useText';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { useFlowUiSettings } from '../../hooks/useFlowUiSettings';\nimport { FLOW_PAYMENT_FAILED_TEXT } from './FlowPaymentFailed.text';\nimport { getFlowPaymentFailedDetails } from './getFlowPaymentFailedDetails';\n\n/**\n * Props for {@link FlowPaymentFailed}.\n *\n * @example\n * ```tsx\n * const props: FlowPaymentFailedProps = { flow };\n * ```\n * @see FlowPaymentFailed\n * @see Flow\n */\nexport type FlowPaymentFailedProps = {\n className?: string;\n /** The failed flow; its failure message fills the reason line. */\n flow: Flow;\n};\n\n/**\n * The Flow \"payment failed\" screen: shown when a payment or its settlement\n * fails. It states the outcome and the flow's failure message. Terminal, with no retry, since a failed payment cannot be resumed.\n *\n * @example\n * ```tsx\n * import { FlowPaymentFailed } from '@/flow/views/FlowPaymentFailed/FlowPaymentFailed';\n *\n * const App = () => <FlowPaymentFailed flow={flow} />;\n * ```\n * @param params.className - Extra class names for the panel element.\n * @param params.flow - The failed flow.\n * @returns The payment-failed view.\n * @see FlowPaymentFailedProps\n * @see FlowStatusHero\n * @copy announcement - The live-region line announced when the screen arrives.\n * @copy genericDescription - The reason line when the flow reports no failure message.\n * @copy heading - The outcome line under the hero mark.\n * @copy title - The centered header title.\n * @notInstrumented\n */\nexport const FlowPaymentFailed: FC<FlowPaymentFailedProps> = ({\n className,\n flow,\n}) => {\n const text = useText({\n defaults: FLOW_PAYMENT_FAILED_TEXT,\n slot: 'dyn-flow-payment-failed',\n });\n const uiSettings = useFlowUiSettings({ flow });\n const { failureMessage, merchantLogoUrl } = getFlowPaymentFailedDetails({\n flow,\n uiSettings,\n });\n\n let mark: ReactNode | undefined;\n if (merchantLogoUrl !== undefined) {\n mark = (\n <img\n alt=\"\"\n data-slot=\"dyn-flow-payment-failed-mark\"\n src={merchantLogoUrl}\n />\n );\n }\n\n return (\n <Panel className={className} title={text('title')}>\n <div data-slot=\"dyn-flow-payment-failed\">\n {/* Announced on arrival; the mark alone carries no meaning. */}\n <span\n aria-live=\"polite\"\n data-slot=\"dyn-flow-payment-failed-announce\"\n role=\"status\"\n >\n {text('announcement')}\n </span>\n <FlowStatusHero\n description={\n failureMessage === undefined\n ? text('genericDescription')\n : failureMessage\n }\n heading={text('heading')}\n mark={mark}\n variant=\"danger\"\n />\n </div>\n </Panel>\n );\n};\n","/**\n * Default text for {@link FlowPaymentRefunded}. Placeholder copy until the final wording is settled.\n */\nexport const FLOW_PAYMENT_REFUNDED_TEXT = {\n /** Live-region announcement read out when the screen arrives. */\n announcement: 'Payment failed. Your payment will be refunded.',\n /** The reason line: why the payment failed and that it will be refunded. */\n description:\n \"The amount transferred didn't match the exact amount required. Your payment will be refunded.\",\n /** The boldest line — the outcome. */\n heading: 'Payment failed',\n /** The centered header title. */\n title: 'Incorrect amount transferred',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-payment-refunded': typeof FLOW_PAYMENT_REFUNDED_TEXT;\n }\n}\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport type { FC, ReactNode } from 'react';\n\nimport { useText } from '../../../i18n/useText';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { useFlowUiSettings } from '../../hooks/useFlowUiSettings';\nimport { getFlowMerchantLogoUrl } from '../../utils/getFlowMerchantLogoUrl';\nimport { FLOW_PAYMENT_REFUNDED_TEXT } from './FlowPaymentRefunded.text';\n\n/**\n * Props for {@link FlowPaymentRefunded}.\n *\n * @example\n * ```tsx\n * const props: FlowPaymentRefundedProps = { flow };\n * ```\n * @see FlowPaymentRefunded\n * @see Flow\n */\nexport type FlowPaymentRefundedProps = {\n className?: string;\n /** The refunded flow; its `uiConfig` carries the merchant logo. */\n flow: Flow;\n};\n\n/**\n * The Flow \"payment refunded\" screen: shown when a payment failed because the\n * transferred amount didn't match and its funds will be returned. Terminal,\n * with no actions.\n *\n * @example\n * ```tsx\n * import { FlowPaymentRefunded } from '@/flow/views/FlowPaymentRefunded/FlowPaymentRefunded';\n *\n * const App = () => <FlowPaymentRefunded flow={flow} />;\n * ```\n * @param params.className - Extra class names for the panel element.\n * @param params.flow - The refunded flow.\n * @returns The payment-refunded view.\n * @see FlowPaymentRefundedProps\n * @see FlowStatusHero\n * @copy announcement - The live-region line announced when the screen arrives.\n * @copy description - The reason line: why the payment failed and that it will be refunded.\n * @copy heading - The outcome line under the hero mark.\n * @copy title - The centered header title.\n * @notInstrumented\n */\nexport const FlowPaymentRefunded: FC<FlowPaymentRefundedProps> = ({\n className,\n flow,\n}) => {\n const text = useText({\n defaults: FLOW_PAYMENT_REFUNDED_TEXT,\n slot: 'dyn-flow-payment-refunded',\n });\n const uiSettings = useFlowUiSettings({ flow });\n const merchantLogoUrl = getFlowMerchantLogoUrl({ uiSettings });\n\n let mark: ReactNode | undefined;\n if (merchantLogoUrl !== undefined) {\n mark = (\n <img\n alt=\"\"\n data-slot=\"dyn-flow-payment-refunded-mark\"\n src={merchantLogoUrl}\n />\n );\n }\n\n return (\n <Panel className={className} title={text('title')}>\n <div data-slot=\"dyn-flow-payment-refunded\">\n {/* Announced on arrival; the mark alone carries no meaning. */}\n <span\n aria-live=\"polite\"\n data-slot=\"dyn-flow-payment-refunded-announce\"\n role=\"status\"\n >\n {text('announcement')}\n </span>\n <FlowStatusHero\n description={text('description')}\n heading={text('heading')}\n mark={mark}\n variant=\"danger\"\n />\n </div>\n </Panel>\n );\n};\n","/** The visual state one tracker step renders in. */\nexport type FlowPaymentStepState = 'active' | 'done' | 'pending';\n\n/**\n * Params for {@link getStepState}.\n *\n * @example\n * ```tsx\n * const params: GetStepStateParams = { activeStepIndex: 1, index: 0 };\n * ```\n * @see getStepState\n */\nexport type GetStepStateParams = {\n /** Index of the in-progress step. */\n activeStepIndex: number;\n /** The step's position in the list. */\n index: number;\n};\n\n/**\n * Maps a step's position to its tracker state: steps before the active index\n * are done, the step at it is active, steps after it are pending.\n *\n * @example\n * ```ts\n * getStepState({ activeStepIndex: 1, index: 0 }); // 'done'\n * getStepState({ activeStepIndex: 1, index: 1 }); // 'active'\n * getStepState({ activeStepIndex: 1, index: 2 }); // 'pending'\n * ```\n * @param params.activeStepIndex - Index of the in-progress step.\n * @param params.index - The step's position in the list.\n * @returns The step's state.\n * @see FlowPaymentStepTracker\n * @see FlowPaymentStepTrackerProps\n * @notInstrumented\n */\nexport const getStepState = ({\n activeStepIndex,\n index,\n}: GetStepStateParams): FlowPaymentStepState => {\n if (index < activeStepIndex) {\n return 'done';\n }\n if (index === activeStepIndex) {\n return 'active';\n }\n return 'pending';\n};\n","import type { FC } from 'react';\n\n/**\n * The in-progress step's marker: an outlined clock whose hands keep running —\n * the minute hand sweeps a turn per clock period, the hour hand trails 12×\n * slower, both driven by the component stylesheet.\n *\n * @example\n * ```tsx\n * import { StepClockIcon } from '@/flow/components/FlowPaymentStepTracker/stepIcons/StepClockIcon/StepClockIcon';\n *\n * const App = () => <StepClockIcon />;\n * ```\n * @returns The active-step clock.\n * @see FlowPaymentStepTracker\n * @see getStepState\n * @notInstrumented\n */\nexport const StepClockIcon: FC = () => (\n <svg\n data-slot=\"dyn-flow-payment-step-tracker-clock\"\n fill=\"none\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n >\n <circle cx=\"9\" cy=\"9\" r=\"7.75\" strokeWidth=\"1.5\" />\n <path\n data-slot=\"dyn-flow-payment-step-tracker-clock-minute\"\n d=\"M9 9V5.4\"\n strokeLinecap=\"round\"\n strokeWidth=\"1.5\"\n />\n <path\n data-slot=\"dyn-flow-payment-step-tracker-clock-hour\"\n d=\"M9 9l2.4 1.6\"\n strokeLinecap=\"round\"\n strokeWidth=\"1.5\"\n />\n </svg>\n);\n","import { m } from 'motion/react';\nimport type { FC } from 'react';\n\nimport { SPRING } from '../../../../../motion/motionTokens';\n\n/**\n * A completed step's marker: a green disc whose white tick pops in on the\n * house spring.\n *\n * @example\n * ```tsx\n * import { StepDoneIcon } from '@/flow/components/FlowPaymentStepTracker/stepIcons/StepDoneIcon/StepDoneIcon';\n *\n * const App = () => <StepDoneIcon />;\n * ```\n * @returns The done-step marker.\n * @see FlowPaymentStepTracker\n * @see getStepState\n * @notInstrumented\n */\nexport const StepDoneIcon: FC = () => (\n <m.span\n animate={{ opacity: 1, scale: 1 }}\n data-slot=\"dyn-flow-payment-step-tracker-done\"\n initial={{ opacity: 0, scale: 0.25 }}\n transition={SPRING}\n >\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 10 10\" width=\"10\">\n <path\n d=\"M1.5 5.5L4 8L8.5 2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.8\"\n />\n </svg>\n </m.span>\n);\n","import type { FC } from 'react';\n\n/**\n * A pending step's marker: a small grey dot.\n *\n * @example\n * ```tsx\n * import { StepDotIcon } from '@/flow/components/FlowPaymentStepTracker/stepIcons/StepDotIcon/StepDotIcon';\n *\n * const App = () => <StepDotIcon />;\n * ```\n * @returns The pending-step dot.\n * @see FlowPaymentStepTracker\n * @see getStepState\n * @notInstrumented\n */\nexport const StepDotIcon: FC = () => (\n <span data-slot=\"dyn-flow-payment-step-tracker-dot\" />\n);\n","/**\n * Default text for {@link FlowPaymentStepTracker}.\n */\nexport const FLOW_PAYMENT_STEP_TRACKER_TEXT = {\n announceComplete: 'All steps complete',\n announceInProgress: '{step} in progress',\n statusDone: 'completed',\n statusInProgress: 'in progress',\n statusPending: 'pending',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-payment-step-tracker': typeof FLOW_PAYMENT_STEP_TRACKER_TEXT;\n }\n}\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { interpolateText } from '../../../i18n/interpolateText';\nimport { useText } from '../../../i18n/useText';\nimport { getStepState } from './getStepState';\nimport { StepClockIcon } from './stepIcons/StepClockIcon';\nimport { StepDoneIcon } from './stepIcons/StepDoneIcon';\nimport { StepDotIcon } from './stepIcons/StepDotIcon';\nimport { FLOW_PAYMENT_STEP_TRACKER_TEXT } from './FlowPaymentStepTracker.text';\n\n/**\n * Props for {@link FlowPaymentStepTracker}.\n *\n * @example\n * ```tsx\n * const props: FlowPaymentStepTrackerProps = {\n * activeStepIndex: 1,\n * steps: ['Authorize payment', 'Converting to USDC', 'Complete purchase'],\n * };\n * ```\n * @see FlowPaymentStepTracker\n * @see getStepState\n */\nexport type FlowPaymentStepTrackerProps = {\n /** Index of the in-progress step; steps before it render done, steps after it render pending. `steps.length` renders every step done. */\n activeStepIndex: number;\n className?: string;\n /** Tracker identifier; the tracker's `data-testid` is `flow-payment-step-tracker-<id>`. */\n id?: string;\n /** Step labels, rendered top to bottom. */\n steps: string[];\n};\n\n/**\n * A payment's progress as a vertical step list inside a bordered plate —\n * done steps carry a green tick disc, the active step an outlined clock with\n * running hands, pending steps a grey dot, and the connectors between steps\n * turn green as the step above completes.\n *\n * @example\n * ```tsx\n * import { FlowPaymentStepTracker } from '@/flow/components/FlowPaymentStepTracker/FlowPaymentStepTracker';\n *\n * const App = () => (\n * <FlowPaymentStepTracker\n * activeStepIndex={1}\n * steps={['Authorize payment', 'Converting to USDC', 'Complete purchase']}\n * />\n * );\n * ```\n * @param params.activeStepIndex - Index of the in-progress step.\n * @param params.className - Extra class names for the tracker element.\n * @param params.id - Tracker identifier, exposed as `data-testid=\"flow-payment-step-tracker-<id>\"`.\n * @param params.steps - Step labels, rendered top to bottom.\n * @returns The payment step tracker.\n * @copy announceInProgress - Live-region announcement for the active step; `{step}` is the step label.\n * @copy announceComplete - Live-region announcement once every step is done.\n * @copy statusDone - Hidden status read after a completed step's label.\n * @copy statusInProgress - Hidden status read after the active step's label.\n * @copy statusPending - Hidden status read after a pending step's label.\n * @see FlowPaymentStepTrackerProps\n * @see FlowLoader\n * @notInstrumented\n */\nexport const FlowPaymentStepTracker: FC<FlowPaymentStepTrackerProps> = ({\n activeStepIndex,\n className,\n id,\n steps,\n}) => {\n const text = useText({\n defaults: FLOW_PAYMENT_STEP_TRACKER_TEXT,\n slot: 'dyn-flow-payment-step-tracker',\n });\n\n const statusText = {\n active: text('statusInProgress'),\n done: text('statusDone'),\n pending: text('statusPending'),\n };\n\n const activeLabel = steps[activeStepIndex];\n const announcement =\n activeLabel === undefined\n ? text('announceComplete')\n : interpolateText({\n template: text('announceInProgress'),\n token: '{step}',\n value: activeLabel,\n });\n\n return (\n <div\n className={className}\n data-slot=\"dyn-flow-payment-step-tracker\"\n data-testid={\n id !== undefined ? `flow-payment-step-tracker-${id}` : undefined\n }\n >\n {/* Visually hidden, read aloud by screen readers as progress moves:\n the markers' states are color/motion only. */}\n <span\n aria-live=\"polite\"\n data-slot=\"dyn-flow-payment-step-tracker-announce\"\n role=\"status\"\n >\n {announcement}\n </span>\n <ol data-slot=\"dyn-flow-payment-step-tracker-list\">\n {steps.map((label, index) => {\n const state = getStepState({ activeStepIndex, index });\n return (\n <li\n data-slot=\"dyn-flow-payment-step-tracker-step\"\n data-state={state}\n key={`${index}-${label}`}\n >\n {index > 0 && (\n /* A connector completes when the step below it starts. */\n <span\n aria-hidden\n data-slot=\"dyn-flow-payment-step-tracker-connector\"\n data-state={index <= activeStepIndex ? 'complete' : 'pending'}\n />\n )}\n <div data-slot=\"dyn-flow-payment-step-tracker-row\">\n <span\n aria-hidden\n data-slot=\"dyn-flow-payment-step-tracker-disc\"\n >\n {state === 'done' && <StepDoneIcon />}\n {state === 'active' && <StepClockIcon />}\n {state === 'pending' && <StepDotIcon />}\n </span>\n <span data-slot=\"dyn-flow-payment-step-tracker-label\">\n {label}\n </span>\n <span data-slot=\"dyn-flow-payment-step-tracker-sr\">\n {`, ${statusText[state]}`}\n </span>\n </div>\n </li>\n );\n })}\n </ol>\n </div>\n );\n};\n","import type { FC, ReactNode } from 'react';\n\n/**\n * One side of a {@link FlowSwapTile} — what leaves or what arrives.\n *\n * @example\n * ```tsx\n * const side: FlowSwapTileSideProps = {\n * amount: '~0.0042 SOL',\n * fiat: '~$1,052.20',\n * icon: <TokenMark tokenIcon={solIconUrl} networkIcon={solanaIconUrl} />,\n * name: 'Solana',\n * };\n * ```\n * @see FlowSwapTile\n */\nexport type FlowSwapTileSideProps = {\n /** Token amount with symbol, already formatted (e.g. `\"~0.0042 SOL\"`). */\n amount: string;\n /** Fiat equivalent, already formatted (e.g. `\"~$1,052.20\"`). */\n fiat?: string;\n /** The side's mark — usually a `TokenMark`. */\n icon: ReactNode;\n /** The side's display name (e.g. `\"Solana\"`). */\n name: string;\n};\n\n/**\n * The content inside one swap tile: the token's mark over its name, amount,\n * and optional fiat line. Presentational only — the tile wrapper and its\n * accessible label belong to `FlowSwapTile`.\n *\n * @example\n * ```tsx\n * <FlowSwapTileSide\n * amount=\"~0.0042 SOL\"\n * fiat=\"~$1,052.20\"\n * icon={<TokenMark tokenIcon={solIconUrl} />}\n * name=\"Solana\"\n * />\n * ```\n * @param params.amount - Formatted token amount with symbol.\n * @param params.fiat - Formatted fiat equivalent.\n * @param params.icon - The side's mark.\n * @param params.name - The side's display name.\n * @returns The tile's content.\n * @see FlowSwapTileSideProps\n * @see FlowSwapTile\n * @notInstrumented\n */\nexport const FlowSwapTileSide: FC<FlowSwapTileSideProps> = ({\n amount,\n fiat,\n icon,\n name,\n}) => (\n <>\n <span aria-hidden data-slot=\"dyn-flow-swap-tile-mark\">\n {icon}\n </span>\n <span data-slot=\"dyn-flow-swap-tile-texts\">\n <span data-slot=\"dyn-flow-swap-tile-name\">{name}</span>\n <span data-slot=\"dyn-flow-swap-tile-amount\">{amount}</span>\n {fiat !== undefined && (\n <span data-slot=\"dyn-flow-swap-tile-fiat\">{fiat}</span>\n )}\n </span>\n </>\n);\n","/**\n * Default text for {@link FlowSwapTile}.\n */\nexport const FLOW_SWAP_TILE_TEXT = {\n from: 'From',\n payingWith: 'Paying with',\n to: 'To',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-swap-tile': typeof FLOW_SWAP_TILE_TEXT;\n }\n}\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { useText } from '../../../i18n/useText';\nimport { FlowSwapTileSide } from './FlowSwapTileSide';\nimport type { FlowSwapTileSideProps } from './FlowSwapTileSide';\nimport { FLOW_SWAP_TILE_TEXT } from './FlowSwapTile.text';\n\n/**\n * Props for {@link FlowSwapTile}.\n *\n * @example\n * ```tsx\n * const props: FlowSwapTileProps = {\n * from: { amount: '~0.0042 SOL', fiat: '~$1,052.20', icon: <TokenMark />, name: 'Solana' },\n * to: { amount: '1,000.00 USDC', fiat: '$1,000.00', icon: <TokenMark />, name: 'USDC' },\n * };\n * ```\n * @see FlowSwapTile\n * @see FlowSwapTileSide\n */\nexport type FlowSwapTileProps = {\n className?: string;\n /** What leaves the payer. Rendered alone when `to` is omitted. */\n from: FlowSwapTileSideProps;\n /** What arrives. Omit when paying in the settlement token — no swap to state. */\n to?: FlowSwapTileSideProps;\n};\n\n/**\n * A swap stated as tiles — what leaves, an arrow, what arrives. The pair's\n * gradients saturate at the outer edges and fade toward the arrow so the two\n * tiles read as flow through the swap. When `to` is omitted there is no swap\n * to state: one full-width tile with the joined gradient and no arrow.\n *\n * Each tile carries an accessible label (`from`/`to`, or `payingWith` on the\n * single variant) so the swap's direction reads without the arrow.\n *\n * @example\n * ```tsx\n * import { FlowSwapTile } from '@/flow/components/FlowSwapTile/FlowSwapTile';\n *\n * const App = () => (\n * <FlowSwapTile\n * from={{ amount: '~0.0042 SOL', fiat: '~$1,052.20', icon: <TokenMark />, name: 'Solana' }}\n * to={{ amount: '1,000.00 USDC', fiat: '$1,000.00', icon: <TokenMark />, name: 'USDC' }}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the swap tile element.\n * @param params.from - What leaves the payer.\n * @param params.to - What arrives. Omit for the no-swap variant.\n * @returns The swap tile.\n * @see FlowSwapTileProps\n * @see FlowSwapTileSide\n * @copy from - Accessible label on the departure tile.\n * @copy payingWith - Accessible label on the single tile when there is no swap.\n * @copy to - Accessible label on the arrival tile.\n * @notInstrumented\n */\nexport const FlowSwapTile: FC<FlowSwapTileProps> = ({ className, from, to }) => {\n const text = useText({\n defaults: FLOW_SWAP_TILE_TEXT,\n slot: 'dyn-flow-swap-tile',\n });\n\n if (to === undefined) {\n return (\n <div\n aria-label={text('payingWith')}\n className={className}\n data-slot=\"dyn-flow-swap-tile\"\n data-variant=\"single\"\n >\n <FlowSwapTileSide {...from} />\n </div>\n );\n }\n\n return (\n <div className={className} data-slot=\"dyn-flow-swap-tile\">\n <div aria-label={text('from')} data-slot=\"dyn-flow-swap-tile-from\">\n <FlowSwapTileSide {...from} />\n </div>\n <span aria-hidden data-slot=\"dyn-flow-swap-tile-arrow\">\n <svg fill=\"none\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\">\n <path\n d=\"M2.5 8H13M13 8L9 4M13 8L9 12\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.5\"\n />\n </svg>\n </span>\n <div aria-label={text('to')} data-slot=\"dyn-flow-swap-tile-to\">\n <FlowSwapTileSide {...to} />\n </div>\n </div>\n );\n};\n","import { FLOW_UNAVAILABLE_PLACEHOLDER } from '../../constants';\n\n/**\n * Default text for {@link FlowPaymentSwapTile}.\n */\nexport const FLOW_PAYMENT_SWAP_TILE_TEXT = {\n unavailableAmount: FLOW_UNAVAILABLE_PLACEHOLDER,\n unknownToken: 'Token',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-payment-swap-tile': typeof FLOW_PAYMENT_SWAP_TILE_TEXT;\n }\n}\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport type { FC } from 'react';\n\nimport { TokenMark } from '../../../components/TokenMark';\nimport { useText } from '../../../i18n/useText';\nimport { formatFlowPayment } from '../../utils/formatFlowPayment';\nimport { FlowSwapTile } from '../FlowSwapTile';\nimport { FLOW_PAYMENT_SWAP_TILE_TEXT } from './FlowPaymentSwapTile.text';\n\n/**\n * Props for {@link FlowPaymentSwapTile}.\n *\n * @example\n * ```tsx\n * const props: FlowPaymentSwapTileProps = { flow };\n * ```\n * @see FlowPaymentSwapTile\n * @see Flow\n */\nexport type FlowPaymentSwapTileProps = {\n className?: string;\n /** SDK flow whose quote states the swap. */\n flow: Flow;\n};\n\n/**\n * The {@link FlowSwapTile} bound to a flow: formats the flow's quote via\n * {@link formatFlowPayment} and renders each side's `TokenMark` from the\n * quoted token metadata, collapsing to the single-tile variant when the\n * payment settles in the source token.\n *\n * @example\n * ```tsx\n * <FlowPaymentSwapTile flow={flow} />\n * ```\n * @param params.className - Extra class names for the swap tile element.\n * @param params.flow - SDK flow whose quote states the swap.\n * @returns The swap tile for the flow's quote.\n * @see FlowPaymentSwapTileProps\n * @see FlowSwapTile\n * @copy unavailableAmount - Placeholder when token decimals are absent.\n * @copy unknownToken - Token name when quote metadata is absent.\n * @notInstrumented\n */\nexport const FlowPaymentSwapTile: FC<FlowPaymentSwapTileProps> = ({\n className,\n flow,\n}) => {\n const text = useText({\n defaults: FLOW_PAYMENT_SWAP_TILE_TEXT,\n slot: 'dyn-flow-payment-swap-tile',\n });\n const paymentData = formatFlowPayment({ flow });\n\n return (\n <FlowSwapTile\n className={className}\n from={{\n amount: paymentData.from.amount ?? text('unavailableAmount'),\n icon: <TokenMark tokenIcon={paymentData.from.tokenIcon} />,\n name: paymentData.from.name ?? text('unknownToken'),\n }}\n to={\n paymentData.to === undefined\n ? undefined\n : {\n amount: paymentData.to.amount ?? text('unavailableAmount'),\n icon: <TokenMark tokenIcon={paymentData.to.tokenIcon} />,\n name: paymentData.to.name ?? text('unknownToken'),\n }\n }\n />\n );\n};\n","/** Default copy for {@link FlowProcessingPayment}. */\nexport const FLOW_PROCESSING_PAYMENT_TEXT = {\n stepApprove: 'Approve payment',\n stepCompleteTransfer: 'Complete transfer',\n stepPaymentReceived: 'Payment received',\n title: 'Processing payment',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-processing-payment': typeof FLOW_PROCESSING_PAYMENT_TEXT;\n }\n}\n","/** A wallet payment's processing steps, in the order the payer sees them. */\nexport const FLOW_WALLET_PROCESSING_STEPS = [\n 'approve',\n 'completeTransfer',\n 'paymentReceived',\n] as const;\n\n/** A deposit-address or exchange payment's processing steps: there is no wallet approval. */\nexport const FLOW_DEPOSIT_PROCESSING_STEPS = [\n 'completeTransfer',\n 'paymentReceived',\n] as const;\n\n/** A processing step key, used to look up its label. */\nexport type FlowProcessingStep =\n | (typeof FLOW_DEPOSIT_PROCESSING_STEPS)[number]\n | (typeof FLOW_WALLET_PROCESSING_STEPS)[number];\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\nimport {\n FLOW_DEPOSIT_PROCESSING_STEPS,\n FLOW_WALLET_PROCESSING_STEPS,\n} from '../FlowProcessingPayment.constants';\nimport type { FlowProcessingStep } from '../FlowProcessingPayment.constants';\n\n/** A source type's steps and the execution states that activate them (others stay on step 0). */\ntype ProcessingStepMap = {\n executionStateStep: Partial<Record<Flow['executionState'], number>>;\n steps: readonly FlowProcessingStep[];\n};\n\nconst WALLET_PROCESSING: ProcessingStepMap = {\n executionStateStep: { broadcasted: 1, source_confirmed: 2 },\n steps: FLOW_WALLET_PROCESSING_STEPS,\n};\n\n// Funds seen at the source already finish the transfer step.\nconst DEPOSIT_PROCESSING: ProcessingStepMap = {\n executionStateStep: { source_confirmed: 1, source_detected: 1 },\n steps: FLOW_DEPOSIT_PROCESSING_STEPS,\n};\n\n/** Params for {@link getFlowProcessingStep}. */\nexport type GetFlowProcessingStepParams = {\n /** SDK flow whose source type and state drive the steps. */\n flow: Flow;\n};\n\n/** Step keys and active index for {@link getFlowProcessingStep}. */\nexport type FlowProcessingStepState = {\n /** Index of the in-progress step, or the step count when all are done. */\n activeStepIndex: number;\n /** Step keys in the order the payer sees them. */\n steps: readonly FlowProcessingStep[];\n};\n\n/**\n * Picks the processing steps for the flow's source type and the active one from its state.\n *\n * @example\n * ```ts\n * getFlowProcessingStep({ flow }); // { activeStepIndex: 1, steps: ['approve', …] }\n * ```\n * @param params.flow - SDK flow being processed.\n * @returns The step keys and the active step index (the step count once settled).\n * @see FlowProcessingPayment\n * @see FlowPaymentStepTracker\n * @notInstrumented\n */\nexport const getFlowProcessingStep = ({\n flow,\n}: GetFlowProcessingStepParams): FlowProcessingStepState => {\n // Exchange and deposit payments arrive without a wallet approval.\n const isWithoutApproval =\n flow.sourceType === 'deposit_address' || flow.sourceType === 'exchange';\n const { executionStateStep, steps } = isWithoutApproval\n ? DEPOSIT_PROCESSING\n : WALLET_PROCESSING;\n\n if (flow.settlementState === 'completed') {\n return { activeStepIndex: steps.length, steps };\n }\n return {\n activeStepIndex: executionStateStep[flow.executionState] ?? 0,\n steps,\n };\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\nimport { getFlowProcessingStep } from '../getFlowProcessingStep';\n\n/**\n * Inputs for {@link getFlowProcessingPaymentDetails}.\n * @example\n * ```ts\n * const params: GetFlowProcessingPaymentDetailsParams = {\n * approveText: 'Approve payment',\n * completeTransferText: 'Complete transfer',\n * flow,\n * paymentReceivedText: 'Payment received',\n * };\n * ```\n * @see getFlowProcessingPaymentDetails\n * @see FlowProcessingPayment\n */\nexport type GetFlowProcessingPaymentDetailsParams = {\n /** Localized label for the wallet approval and broadcast step. */\n approveText: string;\n /** Localized label for the transfer or deposit on its way to settlement. */\n completeTransferText: string;\n /** SDK flow being processed. */\n flow: Flow;\n /** Localized label for the settled payment. */\n paymentReceivedText: string;\n};\n\n/** Step list and active index returned to the processing screen. */\nexport type FlowProcessingPaymentDetails = {\n activeStepIndex: number;\n steps: string[];\n};\n\n/**\n * Derives the processing view's step labels for the flow's source type and which step is active.\n * @example\n * ```tsx\n * const { activeStepIndex, steps } = getFlowProcessingPaymentDetails({\n * approveText: 'Approve payment',\n * completeTransferText: 'Complete transfer',\n * flow,\n * paymentReceivedText: 'Payment received',\n * });\n * ```\n * @param params.approveText - Localized label for the approval step.\n * @param params.completeTransferText - Localized label for the transfer step.\n * @param params.flow - SDK flow being processed.\n * @param params.paymentReceivedText - Localized label for the receipt step.\n * @returns The ordered step labels and the active step index.\n * @see FlowProcessingPayment\n * @see getFlowProcessingStep\n * @notInstrumented\n */\nexport const getFlowProcessingPaymentDetails = ({\n approveText,\n completeTransferText,\n flow,\n paymentReceivedText,\n}: GetFlowProcessingPaymentDetailsParams): FlowProcessingPaymentDetails => {\n const stepText = {\n approve: approveText,\n completeTransfer: completeTransferText,\n paymentReceived: paymentReceivedText,\n };\n\n const { activeStepIndex, steps } = getFlowProcessingStep({ flow });\n\n return {\n activeStepIndex,\n steps: steps.map((step) => stepText[step]),\n };\n};\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport type { FC } from 'react';\n\nimport { useText } from '../../../i18n/useText';\nimport { Panel } from '../../../components/Panel';\nimport { FlowPaymentStepTracker } from '../../components/FlowPaymentStepTracker';\nimport { FlowPaymentSwapTile } from '../../components/FlowPaymentSwapTile';\nimport { FLOW_PROCESSING_PAYMENT_TEXT } from './FlowProcessingPayment.text';\nimport { getFlowProcessingPaymentDetails } from './getFlowProcessingPaymentDetails';\n\n/**\n * Props for {@link FlowProcessingPayment}.\n * @example\n * ```tsx\n * const props: FlowProcessingPaymentProps = { flow };\n * ```\n * @see FlowProcessingPayment\n * @see Flow\n */\nexport type FlowProcessingPaymentProps = {\n /** Extra class names for the outer panel. */\n className?: string;\n /** SDK flow whose source type and state drive the steps. */\n flow: Flow;\n};\n\n/**\n * The Flow processing screen shown while a confirmed payment executes: the\n * quoted assets keep their swap tiles and a step tracker advances as the flow\n * progresses (deposit-address and exchange payments skip the wallet approval step).\n * There is intentionally no Back — a broadcast transaction cannot be\n * cancelled from the UI.\n * @example\n * ```tsx\n * <FlowProcessingPayment flow={flow} />\n * ```\n * @param params.className - Extra class names for the outer panel.\n * @param params.flow - SDK flow being processed.\n * @returns The payment processing panel.\n * @see FlowProcessingPaymentProps\n * @see FlowPaymentSwapTile\n * @see FlowPaymentStepTracker\n * @copy stepApprove - Tracker label for wallet approval and broadcast.\n * @copy stepCompleteTransfer - Tracker label for the transfer or deposit on its way to settlement.\n * @copy stepPaymentReceived - Tracker label for the settled payment.\n * @copy title - Panel heading.\n * @notInstrumented\n */\nexport const FlowProcessingPayment: FC<FlowProcessingPaymentProps> = ({\n className,\n flow,\n}) => {\n const text = useText({\n defaults: FLOW_PROCESSING_PAYMENT_TEXT,\n slot: 'dyn-flow-processing-payment',\n });\n const { activeStepIndex, steps } = getFlowProcessingPaymentDetails({\n approveText: text('stepApprove'),\n completeTransferText: text('stepCompleteTransfer'),\n flow,\n paymentReceivedText: text('stepPaymentReceived'),\n });\n\n return (\n <Panel className={className} title={text('title')}>\n <div data-slot=\"dyn-flow-processing-payment\">\n {/* A flow reopened mid-payment may carry no quote to show. */}\n {flow.quote !== undefined && <FlowPaymentSwapTile flow={flow} />}\n <FlowPaymentStepTracker\n activeStepIndex={activeStepIndex}\n steps={steps}\n />\n </div>\n </Panel>\n );\n};\n","import { createContext } from 'react';\n\n/**\n * The id of the flow whose outcome an enclosing boundary already owns, so a\n * nested boundary for the same flow steps aside.\n *\n * @example\n * ```ts\n * const ownerFlowId = useContext(FlowOutcomeOwnerContext);\n * ```\n * @returns The context holding the owning flow id, `undefined` outside a boundary.\n * @see FlowOutcomeBoundary\n * @see useFlowOutcomeBoundary\n */\nexport const FlowOutcomeOwnerContext = createContext<string | undefined>(\n undefined\n);\n","import type { Flow, FlowExecutionState } from '@dynamic-labs-sdk/client';\n\nimport { FLOW_REFUND_INITIATED_CODE } from '../../constants';\n\n/**\n * The stage of a payment that decides which screen shows it, so every widget\n * shows the same flow the same way.\n */\nexport type FlowPhase =\n | 'awaiting-payment'\n | 'cancelled'\n | 'completed'\n | 'expired'\n | 'failed'\n | 'processing'\n | 'refunded';\n\n/** Params for {@link resolveFlowPhase}. */\nexport type ResolveFlowPhaseParams = {\n /** The latest known flow. */\n flow: Flow;\n /** Whether a payment may already be on its way although the flow does not report it yet. */\n isPaymentInFlight?: boolean;\n};\n\n/** Execution states that still wait on the payer's own steps. */\nconst AWAITING_PAYMENT_EXECUTION_STATES: ReadonlySet<FlowExecutionState> =\n new Set(['initiated', 'source_attached', 'quoted', 'signing']);\n\n/**\n * Tells which phase a payment is in from its execution and settlement state.\n *\n * A completed settlement wins, then a failure (refunded once a refund to the\n * payer has started), then a cancelled or expired payment. A payment that may\n * be in flight is processing, and one the payer has not sent yet is awaiting\n * payment. Any other state, including one added in the\n * future, is processing, so the payer keeps watching instead of retrying.\n *\n * @example\n * ```ts\n * const phase = resolveFlowPhase({ flow });\n * ```\n * @param params.flow - The latest known flow.\n * @param [params.isPaymentInFlight] - Whether a payment may already be on its way although the flow does not report it yet.\n * @returns The phase the payment is in.\n * @see FlowPhase\n * @see shouldPollFlow\n * @notInstrumented\n */\nexport const resolveFlowPhase = ({\n flow,\n isPaymentInFlight = false,\n}: ResolveFlowPhaseParams): FlowPhase => {\n // Settled funds mean the merchant was paid, whatever the execution state says.\n if (flow.settlementState === 'completed') {\n return 'completed';\n }\n // Either axis can fail; a refund is still a failure, shown on its own screen.\n if (flow.executionState === 'failed' || flow.settlementState === 'failed') {\n return flow.failure?.code === FLOW_REFUND_INITIATED_CODE\n ? 'refunded'\n : 'failed';\n }\n if (flow.executionState === 'cancelled') {\n return 'cancelled';\n }\n if (flow.executionState === 'expired') {\n return 'expired';\n }\n // Only outcomes outrank a payment that may be on its way, so the payer is\n // not offered to pay again.\n if (isPaymentInFlight) {\n return 'processing';\n }\n if (AWAITING_PAYMENT_EXECUTION_STATES.has(flow.executionState)) {\n return 'awaiting-payment';\n }\n\n return 'processing';\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport { useEffect, useRef } from 'react';\n\nimport { resolveFlowPhase } from '../../../utils/resolveFlowPhase';\nimport type { FlowPhase } from '../../../utils/resolveFlowPhase';\nimport type { FlowOutcomeCallbacks } from '../FlowOutcomeBoundary.types';\n\n/** Params for {@link useFlowOutcome}. */\nexport type UseFlowOutcomeParams = FlowOutcomeCallbacks & {\n /** The flow whose outcome to report; `undefined` reports nothing. */\n flow: Flow | undefined;\n};\n\n/** Phases that end the payment without paying the merchant. */\nconst FAILED_PHASES: ReadonlySet<FlowPhase> = new Set([\n 'cancelled',\n 'expired',\n 'failed',\n 'refunded',\n]);\n\n/**\n * Reports a flow's outcome once per flow and mount: `onPaymentCompleted`\n * when it completes, `onPaymentFailed` when it expires, is cancelled or fails.\n *\n * @example\n * ```ts\n * useFlowOutcome({ flow, onPaymentCompleted, onPaymentFailed });\n * ```\n * @param params.flow - The flow whose outcome to report.\n * @param params.onPaymentCompleted - Fires once per mount with the settled flow.\n * @param params.onPaymentFailed - Fires once per mount with the expired, cancelled or failed flow.\n * @returns Nothing — the outcome is reported through the callbacks.\n * @see useFlowOutcomeBoundary\n * @see resolveFlowPhase\n * @notInstrumented\n */\nexport const useFlowOutcome = ({\n flow,\n onPaymentCompleted,\n onPaymentFailed,\n}: UseFlowOutcomeParams): void => {\n const phase = flow === undefined ? undefined : resolveFlowPhase({ flow });\n const isCompleted = phase === 'completed';\n const hasOutcome =\n isCompleted || (phase !== undefined && FAILED_PHASES.has(phase));\n const endedFlow = hasOutcome ? flow : undefined;\n const reportOutcome = isCompleted ? onPaymentCompleted : onPaymentFailed;\n\n // A ref survives StrictMode's replayed effects, so a replay can't report\n // twice. It holds the reported flow's id, so a new flow reports its own\n // outcome even when the boundary is not remounted. It does not survive a\n // page reload: a new mount reports again, which the callbacks document.\n const reportedIdRef = useRef<string | undefined>(undefined);\n\n useEffect(() => {\n if (endedFlow === undefined || reportedIdRef.current === endedFlow.id) {\n return;\n }\n reportedIdRef.current = endedFlow.id;\n reportOutcome?.(endedFlow);\n }, [endedFlow, reportOutcome]);\n};\n","/**\n * How long after its quote expires a payment found in progress on load still\n * shows as processing. A payment signed before the quote expired can still be\n * matched to the flow for this long; after that the flow takes a new payment.\n */\nexport const RESUMED_PAYMENT_GRACE_MS = 15 * 60 * 1000;\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport { useEffect, useState } from 'react';\n\nimport { RESUMED_PAYMENT_GRACE_MS } from './useResumedPaymentPending.constants';\n\n/** Params for {@link useResumedPaymentPending}. */\nexport type UseResumedPaymentPendingParams = {\n /** The loaded flow, or `undefined` while it loads. */\n flow: Flow | undefined;\n /** The flow being paid. */\n flowId: string;\n};\n\n/** The first snapshot of a flow seen since mount: whether it was already being signed. */\ntype FirstSnapshot = {\n flowId: string;\n wasSigning: boolean;\n};\n\n/**\n * Tells whether a flow was already being signed when it first loaded and may\n * still have a payment on its way: the payer reloaded while their wallet was\n * open or after it sent the payment. It stays true while the flow is being\n * signed, until shortly after its quote expires, when no payment can still\n * reach it. Signing started after the flow loaded does not count.\n *\n * @example\n * ```ts\n * const isResumedPaymentPending = useResumedPaymentPending({ flow, flowId });\n * ```\n * @param params.flow - The loaded flow, or `undefined` while it loads.\n * @param params.flowId - The flow being paid.\n * @returns Whether to show the payment as in progress.\n * @see useFlowOutcomeBoundary\n * @see FlowOutcomeBoundary\n * @notInstrumented\n */\nexport const useResumedPaymentPending = ({\n flow,\n flowId,\n}: UseResumedPaymentPendingParams): boolean => {\n // Stamped with the flowId, so a new flowId starts over even when the\n // boundary is not remounted.\n const [firstSnapshot, setFirstSnapshot] = useState<FirstSnapshot | undefined>(\n undefined\n );\n const [elapsedDeadline, setElapsedDeadline] = useState<number | undefined>(\n undefined\n );\n\n const isSigning = flow?.executionState === 'signing';\n const isFirstSnapshot =\n flow !== undefined && firstSnapshot?.flowId !== flowId;\n // Records the first snapshot while rendering: the update re-renders at once,\n // and it is idempotent, so StrictMode's double render can't skew it.\n if (isFirstSnapshot) {\n setFirstSnapshot({ flowId, wasSigning: isSigning });\n }\n const wasSigningOnLoad = isFirstSnapshot\n ? isSigning\n : firstSnapshot?.wasSigning === true;\n\n const quoteExpiresAt = flow?.quote?.expiresAt;\n const deadline =\n wasSigningOnLoad && isSigning && quoteExpiresAt\n ? quoteExpiresAt.getTime() + RESUMED_PAYMENT_GRACE_MS\n : undefined;\n\n // Re-renders when the deadline passes, so the flow is handed back for a new\n // payment without waiting for another update.\n useEffect(() => {\n if (deadline === undefined) return undefined;\n const delayMs = deadline - Date.now();\n const timeout = setTimeout(() => setElapsedDeadline(deadline), delayMs);\n return () => clearTimeout(timeout);\n }, [deadline]);\n\n return (\n deadline !== undefined &&\n elapsedDeadline !== deadline &&\n deadline > Date.now()\n );\n};\n","import { type Flow, FlowNotFoundError } from '@dynamic-labs-sdk/client';\nimport { useGetFlow } from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useContext, useState } from 'react';\n\nimport { resolveFlowPhase } from '../../../utils/resolveFlowPhase';\nimport type { FlowPhase } from '../../../utils/resolveFlowPhase';\nimport type { FlowOutcomeCallbacks } from '../FlowOutcomeBoundary.types';\nimport { FlowOutcomeOwnerContext } from '../FlowOutcomeOwnerContext';\nimport { useFlowOutcome } from '../useFlowOutcome';\nimport { useResumedPaymentPending } from './useResumedPaymentPending';\n\n/** Params for {@link useFlowOutcomeBoundary}. */\nexport type UseFlowOutcomeBoundaryParams = FlowOutcomeCallbacks & {\n /** The flow the boundary loads. */\n flowId: string;\n};\n\n/** What a {@link FlowOutcomeBoundary} renders for its flow. */\nexport type FlowOutcomeBoundaryState =\n | { status: 'passthrough' }\n | { status: 'loading' }\n | {\n isNotFound: boolean;\n isRetrying: boolean;\n retry: () => void;\n status: 'load-error';\n }\n | {\n /** The loaded flow. */\n flow: Flow;\n /** Where the payment stands. */\n phase: FlowPhase;\n /** Whether the flow was seen unpaid since the boundary mounted — tells a payment just made from one already paid. */\n sawUnsettledFlow: boolean;\n status: 'ready';\n };\n\n/** Phases in which the payment is still on its way. */\nconst UNSETTLED_PHASES: ReadonlySet<FlowPhase> = new Set([\n 'awaiting-payment',\n 'processing',\n]);\n\n/**\n * Tells a flow boundary what to show: its children when an enclosing boundary\n * already owns the flow, a loader or a load error with a retry until the flow\n * loads, then the flow and where its payment stands — a payment already being\n * signed when the flow loaded shows as processing until its quote has run\n * out, since it may be on its way. The owning boundary also\n * reports the payment's outcome once through the callbacks.\n *\n * @example\n * ```ts\n * const state = useFlowOutcomeBoundary({ flowId, onPaymentCompleted });\n * ```\n * @param params.flowId - The flow the boundary loads.\n * @param params.onPaymentCompleted - Fires once per mount with the settled flow.\n * @param params.onPaymentFailed - Fires once per mount with the expired, cancelled or failed flow.\n * @returns The boundary's state.\n * @see FlowOutcomeBoundary\n * @see FlowOutcomeOwnerContext\n * @notInstrumented\n */\nexport const useFlowOutcomeBoundary = ({\n flowId,\n onPaymentCompleted,\n onPaymentFailed,\n}: UseFlowOutcomeBoundaryParams): FlowOutcomeBoundaryState => {\n const ownerFlowId = useContext(FlowOutcomeOwnerContext);\n const { data, error, isFetching, refetch } = useGetFlow({ flowId });\n const isPassthrough = ownerFlowId === flowId;\n\n const retry = useCallback(() => {\n void refetch();\n }, [refetch]);\n\n // Only the owning boundary reports the outcome.\n useFlowOutcome({\n flow: isPassthrough ? undefined : data,\n onPaymentCompleted,\n onPaymentFailed,\n });\n\n const isResumedPaymentPending = useResumedPaymentPending({\n flow: data,\n flowId,\n });\n\n // The id of the flow seen unpaid, so a new flowId starts over even when the\n // boundary is not remounted.\n const [unsettledFlowId, setUnsettledFlowId] = useState<string | undefined>(\n undefined\n );\n\n if (isPassthrough) {\n return { status: 'passthrough' };\n }\n // A failed poll keeps the loaded flow on screen; only a flow that never\n // loaded shows the error.\n if (data !== undefined) {\n const phase = resolveFlowPhase({\n flow: data,\n isPaymentInFlight: isResumedPaymentPending,\n });\n const isUnsettled = UNSETTLED_PHASES.has(phase);\n const sawUnsettledFlow = isUnsettled || unsettledFlowId === flowId;\n // Remembers across renders that the payment was seen unpaid. Updating\n // state while rendering re-renders at once with the new value, and the\n // update is idempotent, so StrictMode's double render can't skew it.\n if (isUnsettled && unsettledFlowId !== flowId) {\n setUnsettledFlowId(flowId);\n }\n\n return { flow: data, phase, sawUnsettledFlow, status: 'ready' };\n }\n if (error !== null) {\n return {\n isNotFound: error instanceof FlowNotFoundError,\n isRetrying: isFetching,\n retry,\n status: 'load-error',\n };\n }\n\n return { status: 'loading' };\n};\n","'use client';\n\nimport type { FC, ReactNode } from 'react';\n\nimport { FlowAlreadyPaid } from '../../views/FlowAlreadyPaid';\nimport { FlowExpired } from '../../views/FlowExpired';\nimport { FlowLoadError } from '../../views/FlowLoadError';\nimport { FlowLoadingView } from '../../views/FlowLoadingView';\nimport { FlowPaymentCancelled } from '../../views/FlowPaymentCancelled';\nimport { FlowPaymentComplete } from '../../views/FlowPaymentComplete';\nimport { FlowPaymentFailed } from '../../views/FlowPaymentFailed';\nimport { FlowPaymentRefunded } from '../../views/FlowPaymentRefunded';\nimport { FlowProcessingPayment } from '../../views/FlowProcessingPayment';\nimport type { FlowOutcomeCallbacks } from './FlowOutcomeBoundary.types';\nimport { FlowOutcomeOwnerContext } from './FlowOutcomeOwnerContext';\nimport { useFlowOutcomeBoundary } from './useFlowOutcomeBoundary';\n\n/**\n * Props for {@link FlowOutcomeBoundary}.\n *\n * @example\n * ```tsx\n * const props: FlowOutcomeBoundaryProps = { children: null, flowId: 'flow_123' };\n * ```\n * @see FlowOutcomeBoundary\n * @see FlowOutcomeCallbacks\n */\nexport type FlowOutcomeBoundaryProps = FlowOutcomeCallbacks & {\n /** The payment steps, shown while the flow awaits payment. */\n children: ReactNode;\n /** The flow being paid. */\n flowId: string;\n};\n\n/**\n * Loads a flow and shows a loader, or an error with a retry when it can't\n * load. Once loaded it renders the payment steps while the flow awaits\n * payment, then the payment's progress and its outcome: payment complete,\n * already paid when the flow was settled before it was opened, failed,\n * refunded, cancelled or expired — firing `onPaymentCompleted` or `onPaymentFailed` once. Inside\n * another boundary for the same flow it renders its children only: the outer\n * boundary shows the progress and outcome screens and fires the callbacks, so\n * an inner boundary's callbacks never fire.\n *\n * @example\n * ```tsx\n * <FlowOutcomeBoundary flowId={flowId}>\n * <PaymentSteps />\n * </FlowOutcomeBoundary>\n * ```\n * @param params.children - The payment steps, shown while the flow awaits payment.\n * @param params.flowId - The flow being paid.\n * @param params.onPaymentCompleted - Fires once per mount with the settled flow when the payment completes.\n * @param params.onPaymentFailed - Fires once per mount with the flow when it expires, is cancelled or fails.\n * @returns The loader, the load error, the payment's progress or outcome, or the children.\n * @see FlowOutcomeBoundaryProps\n * @see FlowPayWithWalletWidget\n * @notInstrumented\n */\nexport const FlowOutcomeBoundary: FC<FlowOutcomeBoundaryProps> = ({\n children,\n flowId,\n onPaymentCompleted,\n onPaymentFailed,\n}) => {\n const state = useFlowOutcomeBoundary({\n flowId,\n onPaymentCompleted,\n onPaymentFailed,\n });\n\n if (state.status === 'passthrough') {\n return children;\n }\n if (state.status === 'loading') {\n return <FlowLoadingView />;\n }\n if (state.status === 'load-error') {\n return (\n <FlowLoadError\n isNotFound={state.isNotFound}\n isRetrying={state.isRetrying}\n onRetry={state.retry}\n />\n );\n }\n\n const { flow, phase, sawUnsettledFlow } = state;\n if (phase === 'processing') {\n return <FlowProcessingPayment flow={flow} />;\n }\n if (phase === 'completed') {\n return sawUnsettledFlow ? (\n <FlowPaymentComplete flow={flow} />\n ) : (\n <FlowAlreadyPaid flow={flow} />\n );\n }\n if (phase === 'expired') {\n return <FlowExpired flow={flow} />;\n }\n if (phase === 'failed') {\n return <FlowPaymentFailed flow={flow} />;\n }\n if (phase === 'refunded') {\n return <FlowPaymentRefunded flow={flow} />;\n }\n if (phase === 'cancelled') {\n return <FlowPaymentCancelled flow={flow} />;\n }\n\n return (\n <FlowOutcomeOwnerContext.Provider value={flowId}>\n {children}\n </FlowOutcomeOwnerContext.Provider>\n );\n};\n","'use client';\n\nimport type { FC } from 'react';\n\n/**\n * Props for {@link FlowErrorBanner}.\n *\n * @example\n * ```tsx\n * const props: FlowErrorBannerProps = {\n * actionLabel: 'Try another token',\n * message: 'Not enough balance to cover this payment.',\n * };\n * ```\n * @see FlowErrorBanner\n * @see Button\n */\nexport type FlowErrorBannerProps = {\n /** Label for the optional recovery action; rendered only when `onAction` is also set. */\n actionLabel?: string;\n className?: string;\n /** The failure reason shown inside the box. */\n message: string;\n /** Fires on the recovery action — pick another token, fetch a new quote, retry submission. */\n onAction?: () => void;\n};\n\n/**\n * The inline failure banner the Flow views render where the failure happened:\n * a light-red box with a red border carrying the failure reason and, when a\n * recovery makes sense, an action link the user can take without leaving the\n * screen.\n *\n * @example\n * ```tsx\n * import { FlowErrorBanner } from '@/flow/components/FlowErrorBanner';\n *\n * const App = () => (\n * <FlowErrorBanner\n * actionLabel=\"Get a new quote\"\n * message=\"The quote has expired.\"\n * onAction={() => requote()}\n * />\n * );\n * ```\n * @param params.actionLabel - Label for the optional recovery action.\n * @param params.className - Extra class names for the banner element.\n * @param params.message - The failure reason inside the box.\n * @param params.onAction - Fires on the recovery action.\n * @returns The inline error banner.\n * @see FlowErrorBannerProps\n * @see Button\n * @notInstrumented\n */\nexport const FlowErrorBanner: FC<FlowErrorBannerProps> = ({\n actionLabel,\n className,\n message,\n onAction,\n}) => (\n <div\n className={className}\n data-slot=\"dyn-flow-error-banner\"\n role=\"alert\"\n >\n <p data-slot=\"dyn-flow-error-banner-message\">{message}</p>\n {onAction !== undefined && actionLabel !== undefined && (\n <button\n data-slot=\"dyn-flow-error-banner-action\"\n onClick={onAction}\n type=\"button\"\n >\n {actionLabel}\n </button>\n )}\n </div>\n);\n","import type { FlowDepositAddressSupportedChains } from '../../flow.types';\n\n/**\n * The copy key that tells the payer what a valid address looks like, per chain\n * family.\n */\nexport const REFUND_ADDRESS_HINT_KEYS = {\n BTC: 'bitcoinHint',\n EVM: 'evmHint',\n SOL: 'solanaHint',\n TRON: 'tronHint',\n} as const satisfies Record<FlowDepositAddressSupportedChains, string>;\n","/**\n * Default text for {@link FlowRefundAddressSheet}.\n */\nexport const FLOW_REFUND_ADDRESS_SHEET_TEXT = {\n bitcoinHint: 'Bitcoin addresses start with bc1, 1 or 3.',\n description:\n \"If we can't complete the payment, your funds go back to this address. Use a wallet you control, never an exchange.\",\n done: 'Done',\n evmHint: '{network} addresses start with 0x and are 42 characters long.',\n inputLabel: 'Refund address on {network}',\n inputPlaceholder: 'Enter your {network} address',\n solanaHint:\n 'Solana addresses are 32–44 characters and never contain 0, O, I or l.',\n title: 'Refund address',\n tronHint: 'Tron addresses start with T and are 34 characters long.',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-refund-address-sheet': typeof FLOW_REFUND_ADDRESS_SHEET_TEXT;\n }\n}\n","import type { FlowDepositAddressSupportedChains } from '../../flow.types';\n\n/**\n * Loose shape checks per chain family, used to catch typos and wrong-chain\n * pastes. They are not checksum validation.\n */\nexport const REFUND_ADDRESS_SHAPES = {\n // Bech32 may be written in all upper case (QR codes), but never mixed case.\n BTC: /^(bc1[02-9ac-hj-np-z]{11,71}|BC1[02-9AC-HJ-NP-Z]{11,71}|[13][a-km-zA-HJ-NP-Z1-9]{25,34})$/,\n EVM: /^0x[a-fA-F0-9]{40}$/,\n // Every 32-byte key encodes to 32-44 characters; anything tighter would reject valid ones.\n SOL: /^[1-9A-HJ-NP-Za-km-z]{32,44}$/,\n TRON: /^T[1-9A-HJ-NP-Za-km-z]{33}$/,\n} as const satisfies Record<FlowDepositAddressSupportedChains, RegExp>;\n","import type { FlowDepositAddressSupportedChains } from '../../flow.types';\nimport { REFUND_ADDRESS_SHAPES } from './isRefundAddressValid.constants';\n\n/**\n * Params for {@link isRefundAddressValid}.\n *\n * @example\n * ```ts\n * const params: IsRefundAddressValidParams = { address: '0xabc', chain: 'EVM' };\n * ```\n * @see isRefundAddressValid\n * @see FlowDepositAddressSupportedChains\n */\nexport type IsRefundAddressValidParams = {\n /** The address as typed; surrounding spaces are ignored. */\n address: string;\n /** The chain family the refund goes out on. */\n chain: FlowDepositAddressSupportedChains;\n};\n\n/**\n * Checks that a refund address looks right for its chain family.\n *\n * @example\n * ```ts\n * const isValid = isRefundAddressValid({ address, chain: 'EVM' });\n * ```\n * @param params.address - The address as typed.\n * @param params.chain - The chain family the refund goes out on.\n * @returns Whether the address can be used.\n * @see IsRefundAddressValidParams\n * @see FlowDepositAddressSupportedChains\n * @notInstrumented\n */\nexport const isRefundAddressValid = ({\n address,\n chain,\n}: IsRefundAddressValidParams): boolean => {\n return REFUND_ADDRESS_SHAPES[chain].test(address.trim());\n};\n","import type { KeyboardEvent } from 'react';\nimport { useCallback, useRef, useState } from 'react';\n\nimport type { FlowDepositAddressSupportedChains } from '../../../flow.types';\nimport { isRefundAddressValid } from '../../../utils/isRefundAddressValid';\n\n/**\n * Params for {@link useFlowRefundAddressSheet}.\n *\n * @example\n * ```tsx\n * const params: UseFlowRefundAddressSheetParams = { chain: 'EVM', onSubmit };\n * ```\n * @see useFlowRefundAddressSheet\n */\nexport type UseFlowRefundAddressSheetParams = {\n /** The chain family the refund goes out on. */\n chain: FlowDepositAddressSupportedChains;\n /** Fires with the trimmed address once it is valid and confirmed. */\n onSubmit: (address: string) => void;\n};\n\n/**\n * What {@link useFlowRefundAddressSheet} hands the sheet to render.\n *\n * @example\n * ```tsx\n * const { value, showError } = useFlowRefundAddressSheet({ chain, onSubmit });\n * ```\n * @see useFlowRefundAddressSheet\n */\nexport type UseFlowRefundAddressSheetResult = {\n /** True when the address can be confirmed. */\n isValid: boolean;\n /** Marks the field as visited, which lets the hint appear. */\n onBlur: () => void;\n /** Fires with the typed text. */\n onChange: (value: string) => void;\n /** Confirms on Enter. */\n onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;\n /** Ref callback for the input; focuses it once on mount. */\n setInput: (node: HTMLInputElement | null) => void;\n /** True when the hint should show: the field was visited and holds a malformed address. */\n showError: boolean;\n /** Confirms the address, or refocuses the field when it is not valid. */\n submit: () => void;\n /** The address as typed. */\n value: string;\n};\n\n/**\n * Owns {@link FlowRefundAddressSheet}'s state: the typed address, when its\n * hint becomes visible, and confirmation.\n *\n * @example\n * ```tsx\n * const sheet = useFlowRefundAddressSheet({ chain: 'EVM', onSubmit });\n * ```\n * @param params.chain - The chain family the refund goes out on.\n * @param params.onSubmit - Fires with the trimmed address once confirmed.\n * @returns The field state and handlers for the sheet.\n * @see UseFlowRefundAddressSheetParams\n * @see UseFlowRefundAddressSheetResult\n * @notInstrumented\n */\nexport const useFlowRefundAddressSheet = ({\n chain,\n onSubmit,\n}: UseFlowRefundAddressSheetParams): UseFlowRefundAddressSheetResult => {\n const [value, setValue] = useState('');\n const [isTouched, setIsTouched] = useState(false);\n const input = useRef<HTMLInputElement | null>(null);\n const hasFocused = useRef(false);\n\n const trimmed = value.trim();\n const isValid = isRefundAddressValid({ address: trimmed, chain });\n // The hint waits for a deliberate act so nobody is scolded mid-address.\n const showError = isTouched && trimmed !== '' && !isValid;\n\n // Latest values behind stable handlers, so typing never changes their identity.\n const latest = useRef({ isValid, onSubmit, trimmed });\n latest.current = { isValid, onSubmit, trimmed };\n\n // Focus once: refocusing on every ref call would trap the field.\n const setInput = useCallback((node: HTMLInputElement | null) => {\n input.current = node;\n\n if (node && !hasFocused.current) {\n hasFocused.current = true;\n requestAnimationFrame(() => node.focus({ preventScroll: true }));\n }\n }, []);\n\n const onBlur = useCallback(() => setIsTouched(true), []);\n\n const submit = useCallback(() => {\n setIsTouched(true);\n\n if (latest.current.isValid) {\n latest.current.onSubmit(latest.current.trimmed);\n return;\n }\n\n input.current?.focus({ preventScroll: true });\n }, []);\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter') {\n return;\n }\n\n event.preventDefault();\n submit();\n },\n [submit]\n );\n\n return {\n isValid,\n onBlur,\n onChange: setValue,\n onKeyDown,\n setInput,\n showError,\n submit,\n value,\n };\n};\n","'use client';\n\nimport { m } from 'motion/react';\nimport type { FC } from 'react';\n\nimport { Button } from '../../../components/Button';\nimport { interpolateText } from '../../../i18n/interpolateText';\nimport { useText } from '../../../i18n/useText';\nimport { SPRING } from '../../../motion/motionTokens';\nimport type { FlowDepositAddressSupportedChains } from '../../flow.types';\nimport { REFUND_ADDRESS_HINT_KEYS } from './FlowRefundAddressSheet.constants';\nimport { FLOW_REFUND_ADDRESS_SHEET_TEXT } from './FlowRefundAddressSheet.text';\nimport { useFlowRefundAddressSheet } from './useFlowRefundAddressSheet';\n\n/**\n * How long the sheet takes to slide away. Shorter and softer than its entrance.\n */\nconst SHEET_EXIT_DURATION_S = 0.22;\n\n/**\n * Props for {@link FlowRefundAddressSheet}.\n *\n * @example\n * ```tsx\n * const props: FlowRefundAddressSheetProps = {\n * chain: 'EVM',\n * networkName: 'Base',\n * onSubmit: (address) => console.log(address),\n * };\n * ```\n * @see FlowRefundAddressSheet\n * @see FlowDepositAddressSupportedChains\n */\nexport type FlowRefundAddressSheetProps = {\n /** The chain family the refund goes out on; it decides what counts as a valid address. */\n chain: FlowDepositAddressSupportedChains;\n className?: string;\n /** The network's display name, used in the field's copy. */\n networkName: string;\n /** Fires with the trimmed address once the payer confirms a valid one. */\n onSubmit: (address: string) => void;\n};\n\n/**\n * A card that slides up over a screen to ask where a failed payment should be\n * refunded: a short explanation, one address field with an inline hint, and a\n * Done button that stays off until the address looks valid for the chain.\n *\n * @example\n * ```tsx\n * import { FlowRefundAddressSheet } from '@/flow/components/FlowRefundAddressSheet/FlowRefundAddressSheet';\n *\n * const App = () => (\n * <FlowRefundAddressSheet\n * chain=\"EVM\"\n * networkName=\"Base\"\n * onSubmit={(address) => console.log(address)}\n * />\n * );\n * ```\n * @param params.chain - The chain family the refund goes out on.\n * @param params.className - Extra class names for the sheet element.\n * @param params.networkName - The network's display name.\n * @param params.onSubmit - Fires with the trimmed address once confirmed.\n * @returns The refund address sheet.\n * @see FlowRefundAddressSheetProps\n * @see Button\n * @copy title - The sheet's heading.\n * @copy description - The line explaining where the refund goes.\n * @copy inputLabel - The field's accessible name; `{network}` is replaced by the network name.\n * @copy inputPlaceholder - The field's placeholder; `{network}` is replaced by the network name.\n * @copy done - The confirm button's label.\n * @copy evmHint - The hint for a malformed EVM address; `{network}` is replaced by the network name.\n * @copy solanaHint - The hint for a malformed Solana address.\n * @copy bitcoinHint - The hint for a malformed Bitcoin address.\n * @copy tronHint - The hint for a malformed Tron address.\n * @notInstrumented\n */\nexport const FlowRefundAddressSheet: FC<FlowRefundAddressSheetProps> = ({\n chain,\n className,\n networkName,\n onSubmit,\n}) => {\n const text = useText({\n defaults: FLOW_REFUND_ADDRESS_SHEET_TEXT,\n slot: 'dyn-flow-refund-address-sheet',\n });\n const {\n isValid,\n onBlur,\n onChange,\n onKeyDown,\n setInput,\n showError,\n submit,\n value,\n } = useFlowRefundAddressSheet({ chain, onSubmit });\n\n const fillNetwork = (template: string) =>\n interpolateText({ template, token: '{network}', value: networkName });\n\n return (\n <m.div\n animate={{ transition: SPRING, y: 0 }}\n className={className}\n data-slot=\"dyn-flow-refund-address-sheet\"\n /* 115%, not 100%: the sheet rests inset from the card's edge, so its own\n height would leave a sliver showing. */\n exit={{\n transition: { duration: SHEET_EXIT_DURATION_S, ease: 'easeOut' },\n y: '115%',\n }}\n initial={{ y: '115%' }}\n >\n <div data-slot=\"dyn-flow-refund-address-sheet-intro\">\n <span data-slot=\"dyn-flow-refund-address-sheet-title\">\n {text('title')}\n </span>\n <p data-slot=\"dyn-flow-refund-address-sheet-description\">\n {text('description')}\n </p>\n </div>\n <div data-slot=\"dyn-flow-refund-address-sheet-field\">\n <input\n aria-invalid={showError}\n aria-label={fillNetwork(text('inputLabel'))}\n autoComplete=\"off\"\n data-slot=\"dyn-flow-refund-address-sheet-input\"\n name=\"refund-address\"\n onBlur={onBlur}\n onChange={(event) => onChange(event.target.value)}\n onKeyDown={onKeyDown}\n placeholder={fillNetwork(text('inputPlaceholder'))}\n ref={setInput}\n spellCheck={false}\n type=\"text\"\n value={value}\n />\n {showError && (\n <span\n data-slot=\"dyn-flow-refund-address-sheet-hint\"\n role=\"alert\"\n >\n {fillNetwork(text(REFUND_ADDRESS_HINT_KEYS[chain]))}\n </span>\n )}\n </div>\n <Button disabled={!isValid} onClick={submit} variant=\"secondary\">\n {text('done')}\n </Button>\n </m.div>\n );\n};\n","import type { FlowDepositAddressSourceTokenOption } from '../../flow.types';\n\n/**\n * Params for {@link getFlowSourceNetworkKey}.\n *\n * @see getFlowSourceNetworkKey\n */\nexport type GetFlowSourceNetworkKeyParams = {\n /** The source network option to key. */\n option: FlowDepositAddressSourceTokenOption;\n};\n\n/**\n * The unique select key for a source network: chain family plus network id.\n * Raw network ids collide across chain families (`'1'` is both Bitcoin and\n * Ethereum), so the selects and the flow-source match key on this pair.\n *\n * @example\n * ```ts\n * const key = getFlowSourceNetworkKey({ option }); // 'EVM:8453'\n * ```\n * @param params.option - The source network option to key.\n * @returns `'chainName:networkId'`.\n * @see FlowDepositAddressSourceTokenOption\n * @see getFlowDepositAddressSourceTokenOptions\n * @notInstrumented\n */\nexport const getFlowSourceNetworkKey = ({\n option,\n}: GetFlowSourceNetworkKeyParams): string =>\n `${option.chain.name}:${option.network.id}`;\n","/**\n * Default text for {@link FlowDepositAddressView}.\n */\nexport const FLOW_DEPOSIT_ADDRESS_VIEW_TEXT = {\n amountLabel: 'amount',\n fees: 'Fees',\n orderTotal: 'Order total',\n qrLabel: 'QR code to pay the exact amount to the deposit address',\n qrPlaceholder: 'Select a chain and token',\n qrQuoting: 'Fetching quote…',\n quoteFailed:\n \"We couldn't get a quote for the selected token. Try selecting a different one.\",\n selectChainLabel: 'Select chain',\n selectChainPlaceholder: 'Select chain',\n selectTokenLabel: 'Select token',\n selectTokenPlaceholder: 'Select token',\n sendExactly: 'Send exactly',\n title: 'Send to address',\n toThisAddress: 'To this address',\n waitingForAmount: 'Waiting for exactly {amount}',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-deposit-address-view': typeof FLOW_DEPOSIT_ADDRESS_VIEW_TEXT;\n }\n}\n","import type { FlowSourceTokenOption } from '@dynamic-labs-sdk/client';\n\nimport { FLOW_DEPOSIT_ADDRESS_SUPPORTED_CHAINS } from '../../constants';\nimport type { FlowDepositAddressSourceTokenOption } from '../../flow.types';\n\n/**\n * Params for {@link getFlowDepositAddressSourceTokenOptions}.\n *\n * @example\n * ```ts\n * const params: GetFlowDepositAddressSourceTokenOptionsParams = {\n * sourceTokenOptions,\n * };\n * ```\n * @see getFlowDepositAddressSourceTokenOptions\n */\nexport type GetFlowDepositAddressSourceTokenOptionsParams = {\n /** The flow's source token options, as `useGetFlowSourceTokenOptions` returns them. */\n sourceTokenOptions: readonly FlowSourceTokenOption[];\n};\n\n/**\n * Keeps the source token options whose chain family the deposit address view\n * can take a refund address for, typed with that family.\n *\n * @example\n * ```ts\n * const networks = getFlowDepositAddressSourceTokenOptions({ sourceTokenOptions });\n * ```\n * @param params.sourceTokenOptions - The flow's source token options.\n * @returns The options the deposit address view can offer, in the same order.\n * @see FlowDepositAddressSourceTokenOption\n * @see FlowDepositAddressView\n * @notInstrumented\n */\nexport const getFlowDepositAddressSourceTokenOptions = ({\n sourceTokenOptions,\n}: GetFlowDepositAddressSourceTokenOptionsParams): FlowDepositAddressSourceTokenOption[] =>\n sourceTokenOptions.flatMap(({ chain, network, tokens }) => {\n const name = FLOW_DEPOSIT_ADDRESS_SUPPORTED_CHAINS.find(\n (supported) => supported === chain.name\n );\n\n // A family without a refund address check can't be offered.\n if (name === undefined) {\n return [];\n }\n\n return [{ chain: { ...chain, name }, network, tokens }];\n });\n","import type { FlowDepositAddressSourceTokenOption } from '../../../flow.types';\nimport { getFlowSourceNetworkKey } from '../../../utils/getFlowSourceNetworkKey';\n\n/**\n * Params for {@link getFlowDepositSourceKey}.\n *\n * @example\n * ```ts\n * const params: GetFlowDepositSourceKeyParams = { option, refundAddress, token };\n * ```\n * @see getFlowDepositSourceKey\n * @see getFlowSourceNetworkKey\n */\nexport type GetFlowDepositSourceKeyParams = {\n /** The picked network. */\n option: FlowDepositAddressSourceTokenOption;\n /** The refund address the source is reported with. */\n refundAddress: string;\n /** The picked token on that network. */\n token: FlowDepositAddressSourceTokenOption['tokens'][number];\n};\n\n/**\n * Identifies a deposit source by its network, token and refund address, so\n * the same source is not reported twice.\n *\n * @example\n * ```ts\n * const key = getFlowDepositSourceKey({ option, refundAddress, token });\n * ```\n * @param params.option - The picked network.\n * @param params.refundAddress - The refund address the source is reported with.\n * @param params.token - The picked token on that network.\n * @returns The source's key.\n * @see GetFlowDepositSourceKeyParams\n * @see getFlowSourceNetworkKey\n * @notInstrumented\n */\nexport const getFlowDepositSourceKey = ({\n option,\n refundAddress,\n token,\n}: GetFlowDepositSourceKeyParams): string =>\n `${getFlowSourceNetworkKey({ option })}|${token.address}|${refundAddress}`;\n","/** The Bitcoin payment link scheme defined by BIP-21. */\nexport const BITCOIN_PAYMENT_URI_SCHEME = 'bitcoin';\n\n/** The EVM payment link scheme defined by EIP-681. */\n// eslint-disable-next-line custom-rules/ban-ethereum-eth-terms -- EIP-681 fixes the scheme name.\nexport const EVM_PAYMENT_URI_SCHEME = 'ethereum';\n\n/** The Solana payment link scheme defined by Solana Pay. */\nexport const SOLANA_PAYMENT_URI_SCHEME = 'solana';\n\n/** The token address that stands for an EVM network's own coin. */\nexport const EVM_NATIVE_TOKEN_ADDRESS =\n '0x0000000000000000000000000000000000000000';\n\n/** The token address that stands for native SOL: the System Program's. */\nexport const SOLANA_NATIVE_TOKEN_ADDRESS = '11111111111111111111111111111111';\n\n/** The wrapped SOL mint, which wallets also read as native SOL. */\nexport const SOLANA_WRAPPED_NATIVE_TOKEN_ADDRESS =\n 'So11111111111111111111111111111111111111112';\n","import {\n BITCOIN_PAYMENT_URI_SCHEME,\n EVM_NATIVE_TOKEN_ADDRESS,\n EVM_PAYMENT_URI_SCHEME,\n SOLANA_NATIVE_TOKEN_ADDRESS,\n SOLANA_PAYMENT_URI_SCHEME,\n SOLANA_WRAPPED_NATIVE_TOKEN_ADDRESS,\n} from './buildFlowDepositUri.constants';\n\n/**\n * Params for {@link buildFlowDepositUri}.\n *\n * @example\n * ```ts\n * const params: BuildFlowDepositUriParams = {\n * chainId: '8453',\n * chainName: 'EVM',\n * decimalAmount: '225.25',\n * depositAddress: '0x…',\n * rawAmount: '225250000',\n * tokenAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n * };\n * ```\n * @see buildFlowDepositUri\n */\nexport type BuildFlowDepositUriParams = {\n /** The network id the funds must be sent on. */\n chainId: string;\n /** The chain family the funds are sent from (`'BTC'`, `'EVM'`, `'SOL'`, …). */\n chainName?: string;\n /** The exact amount in whole tokens (\"225.25\"). */\n decimalAmount: string;\n /** The address the funds go to. */\n depositAddress: string;\n /** The exact amount in the token's smallest unit (\"225250000\"). */\n rawAmount: string;\n /** The token sent; a native-token stand-in or omitted for the network's own coin. */\n tokenAddress?: string;\n};\n\n/**\n * Builds the payment link a deposit QR code encodes, so wallets that support it\n * pre-fill the address, amount, token and network; chains without a widely\n * supported link fall back to the bare address.\n *\n * @example\n * ```ts\n * const uri = buildFlowDepositUri({\n * chainId: '8453',\n * chainName: 'EVM',\n * decimalAmount: '225.25',\n * depositAddress,\n * rawAmount: '225250000',\n * tokenAddress: BASE_USDC_ADDRESS,\n * });\n * // An EIP-681 token transfer link on network 8453.\n * ```\n * @param params.chainId - The network id the funds must be sent on.\n * @param params.chainName - The chain family the funds are sent from.\n * @param params.decimalAmount - The exact amount in whole tokens.\n * @param params.depositAddress - The address the funds go to.\n * @param params.rawAmount - The exact amount in the token's smallest unit.\n * @param params.tokenAddress - The token sent; a native-token stand-in or omitted for the network's own coin.\n * @returns The payment link, or the bare address when the chain has none.\n * @see resolveFlowDepositAddressDetails\n * @see FlowDepositAddressView\n * @notInstrumented\n */\nexport const buildFlowDepositUri = ({\n chainId,\n chainName,\n decimalAmount,\n depositAddress,\n rawAmount,\n tokenAddress,\n}: BuildFlowDepositUriParams): string => {\n if (chainName === 'BTC') {\n return `${BITCOIN_PAYMENT_URI_SCHEME}:${depositAddress}?amount=${decimalAmount}`;\n }\n\n if (chainName === 'SOL') {\n const solanaUri = `${SOLANA_PAYMENT_URI_SCHEME}:${depositAddress}?amount=${decimalAmount}`;\n // Without `spl-token` a wallet reads the amount as native SOL.\n if (\n tokenAddress === undefined ||\n tokenAddress === SOLANA_NATIVE_TOKEN_ADDRESS ||\n tokenAddress === SOLANA_WRAPPED_NATIVE_TOKEN_ADDRESS\n ) {\n return solanaUri;\n }\n return `${solanaUri}&spl-token=${tokenAddress}`;\n }\n\n if (chainName !== 'EVM') {\n return depositAddress;\n }\n\n // The `@chainId` keeps the wallet from sending on whichever network it has open.\n if (\n tokenAddress === undefined ||\n tokenAddress.toLowerCase() === EVM_NATIVE_TOKEN_ADDRESS\n ) {\n return `${EVM_PAYMENT_URI_SCHEME}:${depositAddress}@${chainId}?value=${rawAmount}`;\n }\n return `${EVM_PAYMENT_URI_SCHEME}:${tokenAddress}@${chainId}/transfer?address=${depositAddress}&uint256=${rawAmount}`;\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport { formatTokenAmount } from '@dynamic-labs-sdk/client';\n\nimport type { FlowDepositAddressSourceTokenOption } from '../../../flow.types';\nimport { formatFiatAmount } from '../../../../utils/formatFiatAmount';\nimport {\n FLOW_UNAVAILABLE_PLACEHOLDER,\n FLOW_USD_CURRENCY,\n} from '../../../constants';\nimport { formatFlowEstimate } from '../../../utils/formatFlowEstimate';\nimport { formatFlowOrderTotal } from '../../../utils/formatFlowOrderTotal';\nimport { getFlowAmountUsd } from '../../../utils/getFlowAmountUsd';\nimport { getFlowPaymentTotal } from '../../../utils/getFlowPaymentTotal';\nimport { buildFlowDepositUri } from '../buildFlowDepositUri';\n\n/**\n * Params for {@link resolveFlowDepositAddressDetails}.\n *\n * @example\n * ```ts\n * const params: ResolveFlowDepositAddressDetailsParams = {\n * flow,\n * networkId,\n * token,\n * };\n * ```\n * @see resolveFlowDepositAddressDetails\n */\nexport type ResolveFlowDepositAddressDetailsParams = {\n /** The flow whose quote and deposit address feed the details. */\n flow?: Flow;\n /** The payer's picked network key (`chain:id`), the chain select's value. */\n networkId?: string;\n /** The payer's picked token. */\n token?: FlowDepositAddressSourceTokenOption['tokens'][number];\n};\n\n/**\n * The display-ready deposit details for {@link FlowDepositAddressView} — the\n * deposit address plus the formatted \"Send exactly\", order total, fee, and\n * total figures. `undefined` until the flow's quote matches the payer's\n * selection.\n *\n * @see resolveFlowDepositAddressDetails\n * @see useFlowDepositAddressView\n */\nexport type FlowDepositAddressQuoteDetails = {\n /** The flow's deposit address. */\n depositAddress: string;\n /** The payment link the QR code encodes; the bare address on chains without one. */\n depositUri: string;\n /** The \"Send exactly\" figure (\"225.25 USDC\"). */\n displayTokenAmount: string;\n /** The quote's fee in USD — a dash when the quote carries no fee. */\n fees: string;\n /** The flow's order amount in USD, or in its own currency while the USD value is unknown. */\n orderTotal: string;\n /** The exact token amount without its symbol (\"225.25\"), for copying into an amount field. */\n tokenAmount: string;\n /** The USD amount plus `totalFeeUsd`, prefixed with `~`; `undefined` while the USD amount is unknown. */\n total: string | undefined;\n};\n\n/**\n * Gathers the deposit details the view renders once a quote is live, or\n * `undefined` when they should stay hidden: a flow only reveals its details\n * when it is a deposit-address source whose attached chain/token matches the\n * payer's selection — switching the chain or token hides the previous quote\n * instead of showing instructions for a source that is no longer picked.\n *\n * @example\n * ```ts\n * const quoteDetails = resolveFlowDepositAddressDetails({\n * flow,\n * networkId,\n * token,\n * });\n * ```\n * @param params.flow - The flow whose quote and deposit address feed the details.\n * @param params.networkId - The payer's picked network key.\n * @param params.token - The payer's picked token.\n * @returns The formatted deposit details, or `undefined` while nothing should show.\n * @see useFlowDepositAddressView\n * @see resolveFlowDepositAddressSelection\n * @notInstrumented\n */\nexport const resolveFlowDepositAddressDetails = ({\n flow,\n networkId,\n token,\n}: ResolveFlowDepositAddressDetailsParams):\n | FlowDepositAddressQuoteDetails\n | undefined => {\n const quote = flow?.quote;\n const depositAddress = flow?.depositAddress;\n\n // The flow's own network key follows the same `chain:id` shape the select\n // keys use, so a quoted source only reveals under its own pair.\n const flowNetworkId =\n flow === undefined\n ? undefined\n : `${flow.fromChainName ?? ''}:${flow.fromChainId ?? ''}`;\n if (\n flow?.sourceType !== 'deposit_address' ||\n networkId !== flowNetworkId ||\n flow.fromChainId === undefined ||\n token === undefined ||\n flow.fromToken === undefined ||\n flow.fromToken.toLowerCase() !== token.address.toLowerCase() ||\n quote === undefined ||\n depositAddress === undefined\n ) {\n return undefined;\n }\n\n const tokenAmount = formatTokenAmount({\n decimals: quote.fromTokenInfo?.decimals ?? token.decimals,\n rawAmount: quote.fromAmount,\n });\n const symbol = quote.fromTokenInfo?.symbol ?? token.symbol;\n const displayTokenAmount = `${tokenAmount} ${symbol}`;\n const depositUri = buildFlowDepositUri({\n chainId: flow.fromChainId,\n chainName: flow.fromChainName,\n decimalAmount: tokenAmount,\n depositAddress,\n rawAmount: quote.fromAmount,\n tokenAddress: flow.fromToken,\n });\n const orderTotal = formatFlowOrderTotal({ flow });\n\n const feeUsd = quote.fees?.totalFeeUsd;\n // The estimate mark flags the fee as a quote, matching the \"~$x\" convention.\n const fees =\n feeUsd === undefined\n ? FLOW_UNAVAILABLE_PLACEHOLDER\n : formatFlowEstimate({\n value: formatFiatAmount({\n amount: feeUsd,\n currency: FLOW_USD_CURRENCY,\n }),\n });\n const amountUsd = getFlowAmountUsd({ flow });\n // Fees are USD, so the total needs the order's USD value too.\n const total =\n amountUsd === undefined\n ? undefined\n : formatFlowEstimate({\n value: getFlowPaymentTotal({\n amount: amountUsd,\n feesUsd: feeUsd ?? '0',\n }),\n });\n\n return {\n depositAddress,\n depositUri,\n displayTokenAmount,\n fees,\n orderTotal,\n tokenAmount,\n total,\n };\n};\n","import type {\n FlowDepositAddressSupportedChains,\n FlowRefundAddresses,\n} from '../../../flow.types';\nimport { isRefundAddressValid } from '../../../utils/isRefundAddressValid';\n\n/**\n * Params for {@link resolveFlowDepositAddressRefund}.\n *\n * @example\n * ```ts\n * const params: ResolveFlowDepositAddressRefundParams = { chain: 'EVM', hostAddresses: {} };\n * ```\n * @see resolveFlowDepositAddressRefund\n */\nexport type ResolveFlowDepositAddressRefundParams = {\n /** The chain family of the picked source. */\n chain: FlowDepositAddressSupportedChains;\n /** The addresses the payer typed in the sheet, per chain family. */\n entered?: FlowRefundAddresses;\n /** The addresses the host already holds for the payer, per chain family. */\n hostAddresses?: FlowRefundAddresses;\n};\n\n/**\n * Finds the refund address to use for a picked source, or `undefined` when\n * the payer still has to be asked.\n *\n * The host's address for the chain family wins when it is valid; one that is\n * missing or not valid counts as missing, so the payer is asked instead of the\n * payment failing later. Otherwise the address the payer typed for that family\n * is used.\n *\n * @example\n * ```ts\n * const address = resolveFlowDepositAddressRefund({ chain: 'EVM', hostAddresses });\n * ```\n * @param params.chain - The chain family of the picked source.\n * @param params.entered - The addresses typed in the sheet, per chain family.\n * @param params.hostAddresses - The addresses the host already holds, per chain family.\n * @returns The address to use, or `undefined` when none is known.\n * @see ResolveFlowDepositAddressRefundParams\n * @see FlowRefundAddresses\n * @notInstrumented\n */\nexport const resolveFlowDepositAddressRefund = ({\n chain,\n entered,\n hostAddresses,\n}: ResolveFlowDepositAddressRefundParams): string | undefined => {\n const hostAddress = hostAddresses?.[chain]?.trim();\n\n if (\n hostAddress !== undefined &&\n isRefundAddressValid({ address: hostAddress, chain })\n ) {\n return hostAddress;\n }\n\n return entered?.[chain];\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\nimport type { FlowDepositAddressSourceTokenOption } from '../../../flow.types';\nimport { getFlowSourceNetworkKey } from '../../../utils/getFlowSourceNetworkKey';\n\n/**\n * Params for {@link resolveFlowDepositAddressSelection}.\n *\n * @example\n * ```ts\n * const params: ResolveFlowDepositAddressSelectionParams = { flow, networks };\n * ```\n * @see resolveFlowDepositAddressSelection\n */\nexport type ResolveFlowDepositAddressSelectionParams = {\n /** The flow whose attached source should drive the selects. */\n flow?: Flow;\n /** The source networks offered to the chain select. */\n networks: readonly FlowDepositAddressSourceTokenOption[];\n};\n\n/**\n * The select pair derived from the flow's attached source.\n *\n * @see resolveFlowDepositAddressSelection\n */\nexport type FlowDepositAddressSelection = {\n /** The resolved network's select id, for the chain select. */\n networkId: string;\n /** The resolved token's select id, for the token select. */\n tokenId?: string;\n};\n\n/**\n * Maps a deposit-address flow's attached source (`fromChainId`/`fromToken`)\n * onto the select ids the deposit view renders: a flow carrying a source the\n * payer is being asked to fund pre-fills the selects to that pair. `fromToken`\n * is the token's contract address. `undefined` when the flow's source is not a\n * deposit address, is not quoted yet, or names a network the catalogue does\n * not offer.\n *\n * @example\n * ```ts\n * const selection = resolveFlowDepositAddressSelection({ flow, networks });\n * ```\n * @param params.flow - The flow whose attached source should drive the selects.\n * @param params.networks - The source networks offered to the chain select.\n * @returns The resolved select ids, or `undefined` when the flow has no deposit-address source.\n * @see useFlowDepositAddressView\n * @see FlowDepositAddressView\n * @notInstrumented\n */\nexport const resolveFlowDepositAddressSelection = ({\n flow,\n networks,\n}: ResolveFlowDepositAddressSelectionParams):\n | FlowDepositAddressSelection\n | undefined => {\n if (flow?.sourceType !== 'deposit_address') {\n return undefined;\n }\n\n // Setting a source keeps the previous quote's token until the new quote, so\n // only a quoted source names the payer's pick.\n if (flow.executionState === 'source_attached') {\n return undefined;\n }\n\n const fromChainId = flow.fromChainId;\n if (fromChainId === undefined) {\n return undefined;\n }\n // Network ids collide across chain families ('1' is both Bitcoin and\n // Ethereum), so the match needs the chain family too.\n const option = networks.find(\n (entry) =>\n entry.network.id === fromChainId &&\n entry.chain.name === flow.fromChainName,\n );\n if (option === undefined) {\n return undefined;\n }\n\n const selection: FlowDepositAddressSelection = {\n networkId: getFlowSourceNetworkKey({ option }),\n };\n\n const fromToken = flow.fromToken?.toLowerCase();\n const token = option.tokens.find(\n (entry) => entry.address.toLowerCase() === fromToken,\n );\n if (token !== undefined) {\n selection.tokenId = token.address;\n }\n\n return selection;\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport { useGetFlowSourceTokenOptions } from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type {\n FlowDepositAddressSourceTokenOption,\n FlowDepositAddressSupportedChains,\n FlowRefundAddresses,\n} from '../../../flow.types';\nimport { getFlowDepositAddressSourceTokenOptions } from '../../../utils/getFlowDepositAddressSourceTokenOptions';\nimport { getFlowSourceNetworkKey } from '../../../utils/getFlowSourceNetworkKey';\nimport { getFlowDepositSourceKey } from '../getFlowDepositSourceKey';\nimport type { FlowDepositAddressQuoteDetails } from '../resolveFlowDepositAddressDetails';\nimport { resolveFlowDepositAddressDetails } from '../resolveFlowDepositAddressDetails';\nimport { resolveFlowDepositAddressRefund } from '../resolveFlowDepositAddressRefund';\nimport { resolveFlowDepositAddressSelection } from '../resolveFlowDepositAddressSelection';\n\n/**\n * The deposit source the payer picks in {@link FlowDepositAddressView}: the\n * chain family, the network the funds land on, the token sent on it, and where\n * funds go back to if the payment fails.\n *\n * @example\n * ```ts\n * const source: FlowDepositAddressSource = { chain, network, refundAddress, token };\n * ```\n * @see FlowDepositAddressView\n * @see getFlowDepositAddressSourceTokenOptions\n */\nexport type FlowDepositAddressSource = {\n /** The chain family the payer sends from. */\n chain: FlowDepositAddressSourceTokenOption['chain'];\n /** The network within that family. */\n network: FlowDepositAddressSourceTokenOption['network'];\n /** Where funds are returned if the payment fails. */\n refundAddress: string;\n /** The token sent on that network. */\n token: FlowDepositAddressSourceTokenOption['tokens'][number];\n};\n\n/**\n * Params for {@link useFlowDepositAddressView}, mirroring the props the view\n * exposes.\n *\n * @example\n * ```tsx\n * const params: UseFlowDepositAddressViewParams = { flow, onSourceChange };\n * ```\n * @see useFlowDepositAddressView\n */\nexport type UseFlowDepositAddressViewParams = {\n /** The flow carrying the resolved quote and deposit address. */\n flow?: Flow;\n /** Set while a fresh quote is in flight — hides the deposit details so a stale quote never shows. */\n isQuoting?: boolean;\n /** Fires when a network, a token and a refund address are all known. */\n onSourceChange?: (source: FlowDepositAddressSource) => void;\n /** Refund addresses the host already holds, per chain family; the payer is asked only when the picked family's is missing or not valid. */\n refundAddresses?: FlowRefundAddresses;\n};\n\n/**\n * What {@link useFlowDepositAddressView} hands the view to render: the select\n * state, the deposit payload, and the display-ready figures derived from the\n * flow's quote.\n */\nexport type UseFlowDepositAddressViewResult = {\n /** Whether the networks and tokens are still loading. */\n isLoadingSourceTokenOptions: boolean;\n /** Whether the networks and tokens are loading again after they failed to load. */\n isRetryingSourceTokenOptions: boolean;\n /** The picked network's id (`Select` value). */\n networkId?: string;\n /** Every source network offered to the chain select. */\n networks: readonly FlowDepositAddressSourceTokenOption[];\n /** Fires when the chain select changes; resets the token when it does not exist on the new network. */\n onNetworkChange: (id: string) => void;\n /** Fires with the address the payer confirmed in the refund sheet; reports the source. */\n onRefundAddressSubmit: (address: string) => void;\n /** Fires when the token select changes; resolves the source. */\n onTokenChange: (id: string) => void;\n /** The picked network's icon URL, for the QR's center logo. */\n qrLogoUrl?: string;\n /** The deposit details to render — set only while the flow's quote matches the payer's selection. */\n quoteDetails?: FlowDepositAddressQuoteDetails;\n /** Set while the payer still has to give a refund address: the chain and network to ask about. */\n refundPrompt?: {\n chain: FlowDepositAddressSupportedChains;\n networkName: string;\n };\n /** Loads the networks and tokens again; set only while they failed to load. */\n retryLoadSourceTokenOptions: (() => void) | undefined;\n /** The picked token's id (`Select` value). */\n tokenId?: string;\n /** The tokens listed in the token select — the picked network's, or none. */\n tokens: FlowDepositAddressSourceTokenOption['tokens'];\n};\n\n/**\n * Owns {@link FlowDepositAddressView}'s state: the chain/token select pair\n * (networks come from {@link useGetFlowSourceTokenOptions}; a token choice\n * resolves the source and fires `onSourceChange` once a refund address is\n * known) and the display figures derived from the flow's quote. The returned\n * handlers keep their identity across renders. When `flow` gains a source\n * (`fromChainId`/`fromToken`), the selects sync to it — a host that attaches\n * the source server-side still lands on the same picture.\n *\n * @example\n * ```tsx\n * const view = useFlowDepositAddressView({ flow, onSourceChange });\n * ```\n * @param params.flow - The flow carrying the resolved quote and deposit address.\n * @param params.isQuoting - Hides the deposit details while a fresh quote is in flight.\n * @param params.onSourceChange - Fires when a network, a token and a refund address are all known.\n * @param params.refundAddresses - Refund addresses the host already holds, per chain family; the payer is asked only when the picked family's is missing or not valid.\n * @returns The select state and the display figures for the view.\n * @see UseFlowDepositAddressViewParams\n * @see UseFlowDepositAddressViewResult\n * @see FlowDepositAddressView\n * @see getFlowDepositAddressSourceTokenOptions\n * @notInstrumented\n */\nexport const useFlowDepositAddressView = ({\n flow,\n isQuoting,\n onSourceChange,\n refundAddresses,\n}: UseFlowDepositAddressViewParams): UseFlowDepositAddressViewResult => {\n const {\n data: sourceTokenOptions,\n error: sourceTokenOptionsError,\n isFetching: isFetchingSourceTokenOptions,\n refetch: refetchSourceTokenOptions,\n } = useGetFlowSourceTokenOptions({\n flowId: flow?.id,\n sourceType: 'deposit_address',\n });\n const hasSourceTokenOptionsError =\n sourceTokenOptions === undefined && sourceTokenOptionsError !== null;\n const isLoadingSourceTokenOptions =\n sourceTokenOptions === undefined && !hasSourceTokenOptionsError;\n const retryLoadSourceTokenOptions = useCallback(() => {\n void refetchSourceTokenOptions();\n }, [refetchSourceTokenOptions]);\n\n const networks =\n sourceTokenOptions === undefined\n ? []\n : getFlowDepositAddressSourceTokenOptions({ sourceTokenOptions });\n\n const [networkId, setNetworkId] = useState<string | undefined>(undefined);\n const [tokenId, setTokenId] = useState<string | undefined>(undefined);\n // Addresses the payer typed in the sheet, kept per chain family so switching\n // back to a family never asks again.\n const [enteredRefunds, setEnteredRefunds] = useState<FlowRefundAddresses>({});\n\n // A flow with a source attached (fromChainId) pre-fills the selects: the\n // quoted network/token is the thing the payer is being asked to fund.\n // Keyed on the resolved ids rather than the flow, so a poll that returns a\n // new flow object for the same source never snaps a newer payer selection\n // back before the host replies.\n const flowSelection = resolveFlowDepositAddressSelection({ flow, networks });\n const flowNetworkId = flowSelection?.networkId;\n const flowTokenId = flowSelection?.tokenId;\n useEffect(() => {\n if (flowNetworkId !== undefined) {\n setNetworkId(flowNetworkId);\n setTokenId(flowTokenId);\n }\n }, [flowNetworkId, flowTokenId]);\n\n const selectedNetwork = networks.find(\n (option) => getFlowSourceNetworkKey({ option }) === networkId\n );\n const selectedToken = selectedNetwork?.tokens.find(\n (token) => token.address === tokenId\n );\n\n // Latest values behind stable handlers, so a re-render never changes their identity.\n const latest = useRef({\n enteredRefunds,\n networks,\n onSourceChange,\n refundAddresses,\n selectedNetwork,\n selectedToken,\n });\n latest.current = {\n enteredRefunds,\n networks,\n onSourceChange,\n refundAddresses,\n selectedNetwork,\n selectedToken,\n };\n\n // The key of the last source reported, so one that becomes ready without a\n // pick is reported only once.\n const reportedSourceKeyRef = useRef<string | undefined>(undefined);\n\n // Nothing is reported until a refund address is known for the source's\n // chain family; otherwise the sheet asks and reports once confirmed.\n const reportSource = useCallback(\n ({\n entered,\n option,\n token,\n }: {\n entered: FlowRefundAddresses;\n option: FlowDepositAddressSourceTokenOption;\n token: FlowDepositAddressSourceTokenOption['tokens'][number];\n }): void => {\n const refundAddress = resolveFlowDepositAddressRefund({\n chain: option.chain.name,\n entered,\n hostAddresses: latest.current.refundAddresses,\n });\n\n if (refundAddress === undefined) {\n return;\n }\n\n reportedSourceKeyRef.current = getFlowDepositSourceKey({\n option,\n refundAddress,\n token,\n });\n latest.current.onSourceChange?.({\n chain: option.chain,\n network: option.network,\n refundAddress,\n token,\n });\n },\n []\n );\n\n const onNetworkChange = useCallback(\n (id: string): void => {\n setNetworkId(id);\n const option = latest.current.networks.find(\n (entry) => getFlowSourceNetworkKey({ option: entry }) === id\n );\n\n // A single-token network resolves the source on its own.\n if (option?.tokens.length === 1) {\n const token = option.tokens[0];\n setTokenId(token.address);\n reportSource({ entered: latest.current.enteredRefunds, option, token });\n return;\n }\n\n setTokenId(undefined);\n },\n [reportSource]\n );\n\n const onTokenChange = useCallback(\n (id: string): void => {\n setTokenId(id);\n const option = latest.current.selectedNetwork;\n const token = option?.tokens.find((entry) => entry.address === id);\n\n if (option === undefined || token === undefined) {\n return;\n }\n\n reportSource({ entered: latest.current.enteredRefunds, option, token });\n },\n [reportSource]\n );\n\n const onRefundAddressSubmit = useCallback(\n (address: string): void => {\n const { selectedNetwork: option, selectedToken: token } = latest.current;\n\n if (option === undefined || token === undefined) {\n return;\n }\n\n const entered = {\n ...latest.current.enteredRefunds,\n [option.chain.name]: address,\n };\n setEnteredRefunds(entered);\n reportSource({ entered, option, token });\n },\n [reportSource]\n );\n\n // Reports the selected source when it is ready and was not reported yet.\n const reportReadySource = useCallback(\n ({ sourceKey }: { sourceKey: string | undefined }): void => {\n const {\n enteredRefunds: entered,\n selectedNetwork: option,\n selectedToken: token,\n } = latest.current;\n\n if (\n sourceKey !== undefined &&\n sourceKey !== reportedSourceKeyRef.current &&\n option !== undefined &&\n token !== undefined\n ) {\n reportSource({ entered, option, token });\n }\n },\n [reportSource]\n );\n\n // While a fresh quote is in flight the view keeps the placeholder state:\n // the previous quote no longer reflects the pending source.\n const quoteDetails =\n isQuoting === true\n ? undefined\n : resolveFlowDepositAddressDetails({\n flow,\n networkId,\n token: selectedToken,\n });\n\n // Both pickers are set and nothing matches the selection yet. A quote that\n // already matches it (a resumed flow) needs no refund address.\n const isAwaitingQuote =\n selectedNetwork !== undefined &&\n selectedToken !== undefined &&\n quoteDetails === undefined &&\n isQuoting !== true;\n\n let refundPrompt: UseFlowDepositAddressViewResult['refundPrompt'];\n let readySourceKey: string | undefined;\n if (isAwaitingQuote) {\n const refundAddress = resolveFlowDepositAddressRefund({\n chain: selectedNetwork.chain.name,\n entered: enteredRefunds,\n hostAddresses: refundAddresses,\n });\n\n // No address known for the picked chain family: the sheet asks for one.\n if (refundAddress === undefined) {\n refundPrompt = {\n chain: selectedNetwork.chain.name,\n networkName: selectedNetwork.network.name,\n };\n } else {\n readySourceKey = getFlowDepositSourceKey({\n option: selectedNetwork,\n refundAddress,\n token: selectedToken,\n });\n }\n }\n\n // A refund address can become known without a pick (host addresses that\n // load late, or a reloaded flow whose source was set but never quoted), so\n // a ready source that was not reported yet is reported then.\n useEffect(() => {\n reportReadySource({ sourceKey: readySourceKey });\n }, [readySourceKey, reportReadySource]);\n\n return {\n isLoadingSourceTokenOptions,\n isRetryingSourceTokenOptions:\n hasSourceTokenOptionsError && isFetchingSourceTokenOptions,\n networkId,\n networks,\n onNetworkChange,\n onRefundAddressSubmit,\n onTokenChange,\n qrLogoUrl: selectedNetwork?.network.iconUrl,\n quoteDetails,\n refundPrompt,\n retryLoadSourceTokenOptions: hasSourceTokenOptionsError\n ? retryLoadSourceTokenOptions\n : undefined,\n tokenId,\n tokens: selectedNetwork?.tokens ?? [],\n };\n};\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport { AnimatePresence } from 'motion/react';\nimport type { FC } from 'react';\n\nimport { CopyField } from '../../../components/CopyField';\nimport { CopyText } from '../../../components/CopyText';\nimport { QRCode } from '../../../components/QRCode';\nimport type { SelectOption } from '../../../components/Select';\nimport { Select } from '../../../components/Select';\nimport { TokenMark } from '../../../components/TokenMark';\nimport { interpolateText } from '../../../i18n/interpolateText';\nimport { useText } from '../../../i18n/useText';\nimport { FlowErrorBanner } from '../../components/FlowErrorBanner';\nimport { Panel } from '../../../components/Panel';\nimport type { FlowPaymentLedgerLine } from '../../components/FlowPaymentLedger';\nimport { FlowPaymentLedger } from '../../components/FlowPaymentLedger';\nimport { FlowPill } from '../../components/FlowPill';\nimport { FlowRefundAddressSheet } from '../../components/FlowRefundAddressSheet';\nimport { FlowStatusTray } from '../../components/FlowStatusTray';\nimport type { FlowRefundAddresses } from '../../flow.types';\nimport { getFlowSourceNetworkKey } from '../../utils/getFlowSourceNetworkKey';\nimport { FlowLoadError } from '../FlowLoadError';\nimport { FlowLoadingView } from '../FlowLoadingView';\nimport { FLOW_DEPOSIT_ADDRESS_VIEW_TEXT } from './FlowDepositAddressView.text';\nimport type { FlowDepositAddressSource } from './useFlowDepositAddressView';\nimport { useFlowDepositAddressView } from './useFlowDepositAddressView';\n\n/**\n * Props for {@link FlowDepositAddressView}.\n *\n * @example\n * ```tsx\n * const props: FlowDepositAddressViewProps = {\n * flow,\n * onSourceChange: ({ chain, network, refundAddress, token }) =>\n * console.log(chain.name, network.id, token.address, refundAddress),\n * };\n * ```\n * @see FlowDepositAddressView\n * @see useFlowDepositAddressView\n * @see FlowRefundAddressSheet\n */\nexport type FlowDepositAddressViewProps = {\n className?: string;\n /**\n * The flow being funded. With no `flow` — or with a flow that does not yet\n * carry `depositAddress` + `quote` — the view renders the source selects and\n * the QR placeholder alone; once both are set it reveals the QR, the exact\n * amount, the fee ledger, the copyable address, and the waiting strip. The\n * payer's picks and typed refund address belong to one payment: render with\n * `key={flow.id}` so a different flow starts from a clean view.\n */\n flow?: Flow;\n /**\n * Set while the host is attaching a source or fetching a fresh quote: the\n * selects lock and the deposit details stay on their placeholder state so a\n * stale quote never shows mid-flight.\n */\n isQuoting?: boolean;\n /** Fires when the Back button is pressed. Omit on a root screen to hide Back. */\n onBack?: () => void;\n /**\n * Fires when the payer has picked a chain and a token and a refund address\n * is known — the moment the host should attach the source and fetch a\n * quote, then pass the updated `flow` back in.\n */\n onSourceChange?: (source: FlowDepositAddressSource) => void;\n /** Shows a failure banner under the selects when the last source could not be quoted; picking a token again retries. */\n quoteFailed?: boolean;\n /**\n * Refund addresses you already hold for the payer, one per chain family\n * (e.g. `{ EVM: '0x…', SOL: '…' }`). When the picked family's address is\n * valid the payer is never asked; otherwise a sheet asks once both pickers\n * are set.\n */\n refundAddresses?: FlowRefundAddresses;\n};\n\n/**\n * The Flow \"Send to address\" screen: a {@link Panel} framing the deposit\n * source picker — chain select first, then the token select scoped to the\n * picked network, both fed by {@link useGetFlowSourceTokenOptions} — above a\n * {@link QRCode} of the deposit payment link. Until the flow carries a quote the QR\n * shows its pulsing placeholder; once it does, the view adds the \"Send\n * exactly\" amount card with a {@link CopyText} for the bare amount, a\n * {@link FlowPaymentLedger} of order total and network fee, a\n * {@link CopyField} for the address, and a {@link FlowStatusTray} that\n * announces the awaited amount. Without a valid address for the picked chain\n * family in `refundAddresses`, a\n * {@link FlowRefundAddressSheet} slides up over the screen to ask for one before\n * anything is quoted.\n *\n * @example\n * ```tsx\n * import { FlowDepositAddressView } from '@/flow/views/FlowDepositAddressView/FlowDepositAddressView';\n *\n * const App = () => (\n * <FlowDepositAddressView\n * flow={flow}\n * onSourceChange={({ chain, network, refundAddress, token }) =>\n * console.log(chain.name, network.id, token.address, refundAddress)\n * }\n * />\n * );\n * ```\n * @param params.className - Extra class names for the panel element.\n * @param params.flow - The flow carrying the resolved quote and deposit address.\n * @param params.isQuoting - Locks the selects and keeps the deposit details hidden while a new quote is fetched.\n * @param params.onBack - Fires when the Back button is pressed. Omit on a root screen to hide Back.\n * @param params.onSourceChange - Fires when a network, a token and a refund address are all known.\n * @param params.quoteFailed - Shows a failure banner when the last source could not be quoted.\n * @param params.refundAddresses - Refund addresses you already hold, per chain family; the payer is asked only when the picked family's is missing or not valid.\n * @returns The deposit-address view.\n * @see FlowDepositAddressViewProps\n * @see getFlowDepositAddressSourceTokenOptions\n * @see FlowRefundAddressSheet\n * @copy title - The centered header title.\n * @copy selectChainLabel - The chain select's label.\n * @copy selectChainPlaceholder - The chain select's placeholder.\n * @copy selectTokenLabel - The token select's label.\n * @copy selectTokenPlaceholder - The token select's placeholder.\n * @copy qrPlaceholder - The QR placeholder's loading message while no quote is live.\n * @copy qrQuoting - The QR placeholder's loading message while a quote is in flight.\n * @copy quoteFailed - The failure banner's message when the last source could not be quoted.\n * @copy qrLabel - The QR code's accessible label once the payment link is set.\n * @copy sendExactly - The amount card's small-caps title.\n * @copy amountLabel - What the amount's copy button copies, used in its accessible name.\n * @copy orderTotal - The order total line's label.\n * @copy fees - The fee line's label.\n * @copy toThisAddress - The address field's label.\n * @copy waitingForAmount - The status strip's message; `{amount}` is replaced by the exact token amount.\n * @notInstrumented\n */\nexport const FlowDepositAddressView: FC<FlowDepositAddressViewProps> = ({\n className,\n flow,\n isQuoting,\n onBack,\n onSourceChange,\n quoteFailed,\n refundAddresses,\n}) => {\n const text = useText({\n defaults: FLOW_DEPOSIT_ADDRESS_VIEW_TEXT,\n slot: 'dyn-flow-deposit-address-view',\n });\n const {\n isLoadingSourceTokenOptions,\n isRetryingSourceTokenOptions,\n networkId,\n networks,\n onNetworkChange,\n onRefundAddressSubmit,\n onTokenChange,\n qrLogoUrl,\n quoteDetails,\n refundPrompt,\n retryLoadSourceTokenOptions,\n tokenId,\n tokens,\n } = useFlowDepositAddressView({\n flow,\n isQuoting,\n onSourceChange,\n refundAddresses,\n });\n\n if (retryLoadSourceTokenOptions !== undefined) {\n return (\n <FlowLoadError\n className={className}\n isRetrying={isRetryingSourceTokenOptions}\n onRetry={retryLoadSourceTokenOptions}\n />\n );\n }\n\n if (isLoadingSourceTokenOptions) {\n return <FlowLoadingView className={className} />;\n }\n\n const networkOptions: SelectOption[] = networks.map((option) => ({\n icon: <TokenMark tokenIcon={option.network.iconUrl} />,\n id: getFlowSourceNetworkKey({ option }),\n name: option.network.name,\n }));\n const tokenOptions: SelectOption[] = tokens.map((token) => ({\n icon: <TokenMark tokenIcon={token.iconUrl} />,\n id: token.address,\n name: token.symbol,\n }));\n\n const ledgerLines: FlowPaymentLedgerLine[] = [];\n if (quoteDetails !== undefined) {\n ledgerLines.push({\n label: text('orderTotal'),\n value: quoteDetails.orderTotal,\n });\n ledgerLines.push({ label: text('fees'), value: quoteDetails.fees });\n }\n\n return (\n <FlowStatusTray\n className={className}\n status={\n quoteDetails === undefined\n ? undefined\n : interpolateText({\n template: text('waitingForAmount'),\n token: '{amount}',\n value: quoteDetails.displayTokenAmount,\n })\n }\n >\n <Panel onBack={onBack} title={text('title')}>\n <div data-slot=\"dyn-flow-deposit-address-view\">\n <div data-slot=\"dyn-flow-deposit-address-view-selects\">\n <Select\n disabled={isQuoting}\n label={text('selectChainLabel')}\n onChange={onNetworkChange}\n options={networkOptions}\n placeholder={text('selectChainPlaceholder')}\n searchable\n value={networkId}\n />\n <Select\n disabled={isQuoting}\n label={text('selectTokenLabel')}\n onChange={onTokenChange}\n options={tokenOptions}\n placeholder={text('selectTokenPlaceholder')}\n searchable\n value={tokenId}\n />\n </div>\n {quoteFailed === true && (\n <FlowErrorBanner message={text('quoteFailed')} />\n )}\n <QRCode\n label={quoteDetails !== undefined ? text('qrLabel') : undefined}\n loadingMessage={\n isQuoting === true ? text('qrQuoting') : text('qrPlaceholder')\n }\n logoSrc={qrLogoUrl}\n value={quoteDetails?.depositUri}\n />\n {quoteDetails !== undefined && (\n <div data-slot=\"dyn-flow-deposit-address-view-details\">\n <FlowPill>\n <div data-slot=\"dyn-flow-deposit-address-view-amount\">\n <span data-slot=\"dyn-flow-deposit-address-view-amount-label\">\n {text('sendExactly')}\n </span>\n <span data-slot=\"dyn-flow-deposit-address-view-amount-value\">\n <CopyText\n copyValue={quoteDetails.tokenAmount}\n display={quoteDetails.displayTokenAmount}\n label={text('amountLabel')}\n />\n </span>\n {quoteDetails.total !== undefined && (\n <span data-slot=\"dyn-flow-deposit-address-view-amount-fiat\">\n {quoteDetails.total}\n </span>\n )}\n </div>\n </FlowPill>\n {ledgerLines.length > 0 && (\n <FlowPaymentLedger lines={ledgerLines} />\n )}\n <CopyField\n copyValue={quoteDetails.depositAddress}\n display={quoteDetails.depositAddress}\n label={text('toThisAddress')}\n />\n </div>\n )}\n <AnimatePresence initial={false}>\n {/* Keyed by chain family: switching family asks a new question,\n so the sheet starts over with an empty field. */}\n {refundPrompt !== undefined && (\n <FlowRefundAddressSheet\n chain={refundPrompt.chain}\n key={refundPrompt.chain}\n networkName={refundPrompt.networkName}\n onSubmit={onRefundAddressSubmit}\n />\n )}\n </AnimatePresence>\n </div>\n </Panel>\n </FlowStatusTray>\n );\n};\n","import { FlowDepositAddressView } from '../../../../views/FlowDepositAddressView';\nimport type { FlowDepositAddressRouteModule } from '../flowDepositAddressRoutes.types';\n\n/** The deposit address route entry; it carries no params. */\nexport type DepositAddressRoute = {\n name: 'deposit-address';\n};\n\n/**\n * The first route of {@link FlowDepositAddressWidget}: the payer picks the\n * network, token and refund address, then sees the address to send to.\n * Retained in history, so keeping the address after Back returns here.\n *\n * @see FlowDepositAddressRouteModule\n * @see flowDepositAddressRoutes\n * @see FlowDepositAddressView\n */\nexport const depositAddressRoute: FlowDepositAddressRouteModule<DepositAddressRoute> =\n {\n render: ({ widget }) => (\n <FlowDepositAddressView\n flow={widget.flow}\n isQuoting={widget.isQuoting}\n onBack={widget.goBack}\n onSourceChange={widget.onSourceChange}\n quoteFailed={widget.quoteFailed}\n refundAddresses={widget.refundAddresses}\n />\n ),\n retainInHistory: true,\n };\n","// jsdoc-completeness-disable @see\nimport type { FC } from 'react';\n\nimport type { IconProps } from '../icon.types';\n\n/**\n * QR-code glyph for payment-method rows.\n *\n * The source artwork is 18.4889×18.4889 (the method list's designed box); it\n * renders at that size by default and inherits its color from `currentColor`\n * so the row can tone it to its ink.\n *\n * @example\n * ```tsx\n * import { QrCodeIcon } from '@/icons/QrCodeIcon/QrCodeIcon';\n *\n * const App = () => <QrCodeIcon />;\n * ```\n * @param params.className - Extra class names for the svg element.\n * @param params.size - Rendered edge length in pixels.\n * @returns The QR-code glyph.\n * @see IconProps\n * @notInstrumented\n */\nexport const QrCodeIcon: FC<IconProps> = ({ className, size = 18.4889 }) => (\n <svg\n aria-hidden=\"true\"\n className={className}\n fill=\"none\"\n focusable=\"false\"\n height={size}\n viewBox=\"0 0 18.4889 18.4889\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2.31112 4.62224C2.31112 3.53277 2.31112 2.98803 2.64957 2.64957C2.98803 2.31112 3.53277 2.31112 4.62224 2.31112C5.71171 2.31112 6.25644 2.31112 6.5949 2.64957C6.93336 2.98803 6.93336 3.53277 6.93336 4.62224C6.93336 5.71171 6.93336 6.25644 6.5949 6.5949C6.25644 6.93336 5.71171 6.93336 4.62224 6.93336C3.53277 6.93336 2.98803 6.93336 2.64957 6.5949C2.31112 6.25644 2.31112 5.71171 2.31112 4.62224Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M2.31112 13.8667C2.31112 12.7773 2.31112 12.2325 2.64957 11.894C2.98803 11.5556 3.53277 11.5556 4.62224 11.5556C5.71171 11.5556 6.25644 11.5556 6.5949 11.894C6.93336 12.2325 6.93336 12.7773 6.93336 13.8667C6.93336 14.9562 6.93336 15.5009 6.5949 15.8394C6.25644 16.1778 5.71171 16.1778 4.62224 16.1778C3.53277 16.1778 2.98803 16.1778 2.64957 15.8394C2.31112 15.5009 2.31112 14.9562 2.31112 13.8667Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M2.31112 9.24447H6.93336\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M9.24447 2.31112V6.16298\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M11.5556 4.62224C11.5556 3.53277 11.5556 2.98803 11.894 2.64957C12.2325 2.31112 12.7773 2.31112 13.8667 2.31112C14.9562 2.31112 15.5009 2.31112 15.8394 2.64957C16.1778 2.98803 16.1778 3.53277 16.1778 4.62224C16.1778 5.71171 16.1778 6.25644 15.8394 6.5949C15.5009 6.93336 14.9562 6.93336 13.8667 6.93336C12.7773 6.93336 12.2325 6.93336 11.894 6.5949C11.5556 6.25644 11.5556 5.71171 11.5556 4.62224Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M16.1778 9.24447H11.5556C10.4661 9.24447 9.9214 9.24447 9.5829 9.5829C9.24447 9.9214 9.24447 10.4661 9.24447 11.5556M9.24447 13.6889V15.8223M11.5556 11.5556V12.7112C11.5556 13.8254 12.1593 13.8667 13.0963 13.8667C13.5218 13.8667 13.8667 14.2116 13.8667 14.6371M12.326 16.1778H11.5556M13.8667 11.5556C14.9562 11.5556 15.5009 11.5556 15.8394 11.8946C16.1778 12.2334 16.1778 12.779 16.1778 13.87C16.1778 14.9611 16.1778 15.5066 15.8394 15.8456C15.5923 16.0929 15.2354 16.1598 14.6371 16.1778\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeWidth=\"1.15556\"\n />\n </svg>\n);\n","/**\n * Default text for {@link FlowLeaveDepositAddressView}.\n */\nexport const FLOW_LEAVE_DEPOSIT_ADDRESS_VIEW_TEXT = {\n /** The warning under the heading: funds sent to the address only count while the payer stays. */\n description:\n \"This screen updates when your payment arrives. If you pay another way, funds sent here won't count towards this payment.\",\n /** The boldest line — the question the payer answers before leaving. */\n heading: 'Already sent funds to this address?',\n /** Primary action returning to the deposit address. */\n keepAddress: 'Keep this address',\n /** Secondary action leaving the deposit address for another payment method. */\n payAnotherWay: 'Pay another way',\n /** The centered header title. */\n title: 'Send to address',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-leave-deposit-address-view': typeof FLOW_LEAVE_DEPOSIT_ADDRESS_VIEW_TEXT;\n }\n}\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { Button } from '../../../components/Button';\nimport { useText } from '../../../i18n/useText';\nimport { QrCodeIcon } from '../../../icons/QrCodeIcon';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { FLOW_LEAVE_DEPOSIT_ADDRESS_VIEW_TEXT } from './FlowLeaveDepositAddressView.text';\n\n/**\n * Props for {@link FlowLeaveDepositAddressView}.\n *\n * @example\n * ```tsx\n * const props: FlowLeaveDepositAddressViewProps = {\n * onKeepAddress: () => showAddress(),\n * onPayAnotherWay: () => goToMethods(),\n * };\n * ```\n * @see FlowLeaveDepositAddressView\n * @see Panel\n */\nexport type FlowLeaveDepositAddressViewProps = {\n className?: string;\n /** Fires on the primary action — return to the deposit address. */\n onKeepAddress: () => void;\n /** Fires on the secondary action — leave the deposit address for another payment method. */\n onPayAnotherWay: () => void;\n};\n\n/**\n * The Flow screen shown before a payer leaves a deposit address for another\n * payment method. It asks whether they already sent funds there and warns\n * that those funds won't count once they pay another way. Two exits, and no\n * Back since it would repeat the first: Keep this address and Pay another way.\n *\n * @example\n * ```tsx\n * import { FlowLeaveDepositAddressView } from '@/flow/views/FlowLeaveDepositAddressView/FlowLeaveDepositAddressView';\n *\n * const App = () => (\n * <FlowLeaveDepositAddressView\n * onKeepAddress={() => showAddress()}\n * onPayAnotherWay={() => goToMethods()}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.onKeepAddress - Fires on the primary action.\n * @param params.onPayAnotherWay - Fires on the secondary action.\n * @returns The leave-deposit-address view.\n * @see FlowLeaveDepositAddressViewProps\n * @see FlowDepositAddressView\n * @see Button\n * @copy description - The warning under the heading.\n * @copy heading - The boldest line, the question the payer answers before leaving.\n * @copy keepAddress - The primary action returning to the deposit address.\n * @copy payAnotherWay - The secondary action leaving for another payment method.\n * @copy title - The centered header title.\n * @notInstrumented\n */\nexport const FlowLeaveDepositAddressView: FC<\n FlowLeaveDepositAddressViewProps\n> = ({ className, onKeepAddress, onPayAnotherWay }) => {\n const text = useText({\n defaults: FLOW_LEAVE_DEPOSIT_ADDRESS_VIEW_TEXT,\n slot: 'dyn-flow-leave-deposit-address-view',\n });\n\n return (\n <Panel className={className} title={text('title')}>\n <div data-slot=\"dyn-flow-leave-deposit-address-view\">\n <FlowStatusHero\n description={text('description')}\n heading={text('heading')}\n mark={\n <span data-slot=\"dyn-flow-leave-deposit-address-view-mark\">\n <QrCodeIcon />\n </span>\n }\n />\n <div data-slot=\"dyn-flow-leave-deposit-address-view-actions\">\n <Button onClick={onKeepAddress}>{text('keepAddress')}</Button>\n <Button onClick={onPayAnotherWay} variant=\"secondary\">\n {text('payAnotherWay')}\n </Button>\n </div>\n </div>\n </Panel>\n );\n};\n","import { FlowLeaveDepositAddressView } from '../../../../views/FlowLeaveDepositAddressView';\nimport type { FlowDepositAddressRouteModule } from '../flowDepositAddressRoutes.types';\n\n/** The leave confirmation route entry; it carries no params. */\nexport type LeaveDepositAddressRoute = {\n name: 'leave-deposit-address';\n};\n\n/**\n * The confirmation route of {@link FlowDepositAddressWidget}, opened by Back\n * while the flow has a deposit address: keeping the address returns to it,\n * paying another way leaves the widget.\n *\n * @see FlowDepositAddressRouteModule\n * @see flowDepositAddressRoutes\n * @see FlowLeaveDepositAddressView\n */\nexport const leaveDepositAddressRoute: FlowDepositAddressRouteModule<LeaveDepositAddressRoute> =\n {\n render: ({ widget }) => (\n <FlowLeaveDepositAddressView\n onKeepAddress={widget.returnToDepositAddress}\n onPayAnotherWay={widget.payAnotherWay}\n />\n ),\n };\n","import { depositAddressRoute } from './depositAddressRoute';\nimport type {\n FlowDepositAddressRouteByName,\n FlowDepositAddressRouteModule,\n FlowDepositAddressRouteName,\n} from './flowDepositAddressRoutes.types';\nimport { leaveDepositAddressRoute } from './leaveDepositAddressRoute';\n\n/**\n * The route table behind {@link FlowDepositAddressWidget}: the deposit address\n * screen and the confirmation before leaving it. A route missing here, or a\n * module filed under another route's name, fails type checking.\n *\n * @see FlowDepositAddressRouteModule\n * @see renderFlowDepositAddressRoute\n */\nexport const flowDepositAddressRoutes: {\n [Name in FlowDepositAddressRouteName]: FlowDepositAddressRouteModule<\n FlowDepositAddressRouteByName[Name]\n >;\n} = {\n 'deposit-address': depositAddressRoute,\n 'leave-deposit-address': leaveDepositAddressRoute,\n};\n","import type { ReactNode } from 'react';\n\nimport { flowDepositAddressRoutes } from '../routes/flowDepositAddressRoutes';\nimport type {\n FlowDepositAddressRouteByName,\n FlowDepositAddressRouteName,\n FlowDepositAddressRouteRenderParams,\n} from '../routes/flowDepositAddressRoutes.types';\n\n/**\n * Params for {@link renderFlowDepositAddressRoute}.\n *\n * @see renderFlowDepositAddressRoute\n * @see FlowDepositAddressRouteRenderParams\n */\nexport type RenderFlowDepositAddressRouteParams<\n Name extends FlowDepositAddressRouteName,\n> = FlowDepositAddressRouteRenderParams<\n FlowDepositAddressRouteByName[Name] & { name: Name }\n>;\n\n/**\n * Renders the deposit-address widget screen for a route through its route\n * module. The generic route name ties the route to its own module, so the\n * lookup needs no cast.\n *\n * @example\n * ```tsx\n * renderFlowDepositAddressRoute({ route: widget.currentRoute, widget });\n * ```\n * @param params.route - The route entry to render.\n * @param params.widget - The widget's state and actions.\n * @returns The route's screen.\n * @see flowDepositAddressRoutes\n * @see FlowDepositAddressRouteModule\n * @notInstrumented\n */\nexport const renderFlowDepositAddressRoute = <\n Name extends FlowDepositAddressRouteName,\n>({\n route,\n widget,\n}: RenderFlowDepositAddressRouteParams<Name>): ReactNode =>\n flowDepositAddressRoutes[route.name].render({ route, widget });\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\n/**\n * What Back does on the deposit address screen: nothing to show (`hidden`),\n * leave right away (`leave`), or ask first (`confirm`).\n */\nexport type FlowDepositAddressBack = 'confirm' | 'hidden' | 'leave';\n\n/**\n * Params for {@link resolveFlowDepositAddressBack}.\n *\n * @example\n * ```ts\n * const params: ResolveFlowDepositAddressBackParams = { flow, hasOnBack: true };\n * ```\n * @see resolveFlowDepositAddressBack\n */\nexport type ResolveFlowDepositAddressBackParams = {\n /** The flow being paid. */\n flow: Flow | undefined;\n /** Whether the host gave the screen a Back. */\n hasOnBack: boolean;\n};\n\n/**\n * Decides what Back does on the deposit address screen. Without a host Back\n * there is none. Once the flow has a deposit address the payer is asked\n * first, since funds they already sent there won't count once they pay\n * another way. Before that, Back leaves right away. Funds seen at the\n * address move the flow to processing, which replaces this screen.\n *\n * @example\n * ```ts\n * const back = resolveFlowDepositAddressBack({ flow, hasOnBack: true });\n * ```\n * @param params.flow - The flow being paid.\n * @param params.hasOnBack - Whether the host gave the screen a Back.\n * @returns What Back does.\n * @see ResolveFlowDepositAddressBackParams\n * @see FlowDepositAddressBack\n * @notInstrumented\n */\nexport const resolveFlowDepositAddressBack = ({\n flow,\n hasOnBack,\n}: ResolveFlowDepositAddressBackParams): FlowDepositAddressBack => {\n if (!hasOnBack) {\n return 'hidden';\n }\n\n if (flow?.depositAddress !== undefined) {\n return 'confirm';\n }\n\n return 'leave';\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport {\n useAttachFlowSource,\n useGetFlow,\n useGetFlowQuote,\n} from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { useViewRouter } from '../../../../utils/hooks/useViewRouter';\nimport type { FlowRefundAddresses } from '../../../flow.types';\nimport type { FlowDepositAddressSource } from '../../../views/FlowDepositAddressView';\nimport { flowDepositAddressRoutes } from '../routes/flowDepositAddressRoutes';\nimport type { FlowDepositAddressRoute } from '../routes/flowDepositAddressRoutes.types';\nimport { resolveFlowDepositAddressBack } from './resolveFlowDepositAddressBack';\n\n/**\n * Params for {@link useFlowDepositAddressWidget}.\n *\n * @example\n * ```ts\n * const params: UseFlowDepositAddressWidgetParams = { flowId: 'flow_123' };\n * ```\n * @see useFlowDepositAddressWidget\n * @see UseFlowDepositAddressWidgetResult\n */\nexport type UseFlowDepositAddressWidgetParams = {\n /** The flow the customer is paying for. */\n flowId: string;\n /** Leaves the deposit address screen. Without it, the screen has no Back. */\n onBack?: () => void;\n /** Refund addresses the host already holds for the payer, one per chain family. */\n refundAddresses?: FlowRefundAddresses;\n};\n\n/** What {@link useFlowDepositAddressWidget} returns. */\nexport type UseFlowDepositAddressWidgetResult = {\n /** The route on top of the stack — the screen to render. */\n currentRoute: FlowDepositAddressRoute;\n /** The flow, kept current by polling and by every source and quote request. */\n flow: Flow | undefined;\n /**\n * The deposit address screen's Back: leaves right away before the flow has\n * an address, asks first once it has one, and is unset without a host Back\n * or once funds are seen at the address.\n */\n goBack: (() => void) | undefined;\n /** Whether the latest source is being set or quoted. */\n isQuoting: boolean;\n /** Sets the picked source on the flow and quotes it, which creates the deposit address. */\n onSourceChange: (source: FlowDepositAddressSource) => void;\n /** Leaves the deposit address for another payment method, through the host's Back. */\n payAnotherWay: () => void;\n /** Whether the latest source could not be set or quoted; cleared by the next pick. */\n quoteFailed: boolean;\n /**\n * Refund addresses for the payer, one per chain family: the host's, with\n * every address already used for a pick on top, so returning to the deposit\n * address never asks the payer again.\n */\n refundAddresses: FlowRefundAddresses;\n /** Returns from the leave confirmation to the deposit address. */\n returnToDepositAddress: () => void;\n};\n\n/**\n * Drives a deposit-address payment: each source the payer picks is set on the\n * flow and then quoted, which creates the address to send funds to. The\n * newest pick wins, and picking again after a failure retries. Back from a\n * flow that has a deposit address opens a confirmation first, since funds\n * already sent there won't count once the payer pays another way.\n *\n * @example\n * ```ts\n * const { flow, isQuoting, onSourceChange } = useFlowDepositAddressWidget({\n * flowId: 'flow_123',\n * });\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onBack - Leaves the deposit address screen.\n * @param params.refundAddresses - Refund addresses the host already holds for the payer.\n * @returns The current route, the flow, the source handler, the quoting state and the Back actions.\n * @see FlowDepositAddressWidget\n * @see FlowDepositAddressView\n * @see resolveFlowDepositAddressBack\n * @notInstrumented\n */\nexport const useFlowDepositAddressWidget = ({\n flowId,\n onBack,\n refundAddresses,\n}: UseFlowDepositAddressWidgetParams): UseFlowDepositAddressWidgetResult => {\n const { data: flow } = useGetFlow({ flowId });\n const router = useViewRouter<FlowDepositAddressRoute>({\n initial: { name: 'deposit-address' },\n routes: flowDepositAddressRoutes,\n });\n const { isPending: isAttaching, mutate: attachFlowSource } =\n useAttachFlowSource();\n const { isPending: isFetchingQuote, mutate: getFlowQuote } =\n useGetFlowQuote();\n const [quoteFailed, setQuoteFailed] = useState(false);\n // The refund address each picked source was sent with, per chain family.\n // Kept here because the deposit view remounts after the leave confirmation.\n const [usedRefundAddresses, setUsedRefundAddresses] =\n useState<FlowRefundAddresses>({});\n\n // An older pick's replies are ignored, so a slow reply never quotes a source the payer moved away from.\n const latestSourceRef = useRef<FlowDepositAddressSource | undefined>(\n undefined\n );\n\n const failSource = useCallback((source: FlowDepositAddressSource) => {\n if (latestSourceRef.current === source) {\n setQuoteFailed(true);\n }\n }, []);\n\n // The quote, not the attach, creates the deposit address.\n const quoteSource = useCallback(\n (source: FlowDepositAddressSource) => {\n if (latestSourceRef.current !== source) {\n return;\n }\n\n getFlowQuote(\n {\n flowId,\n fromChainId: source.network.id,\n fromTokenAddress: source.token.address,\n },\n { onError: () => failSource(source) }\n );\n },\n [failSource, flowId, getFlowQuote]\n );\n\n const onSourceChange = useCallback(\n (source: FlowDepositAddressSource) => {\n latestSourceRef.current = source;\n setQuoteFailed(false);\n // The same address again keeps the object, so nothing downstream re-renders.\n setUsedRefundAddresses((used) => {\n if (used[source.chain.name] === source.refundAddress) {\n return used;\n }\n return { ...used, [source.chain.name]: source.refundAddress };\n });\n\n attachFlowSource(\n {\n flowId,\n fromChainId: source.network.id,\n fromChainName: source.chain.name,\n refundAddress: source.refundAddress,\n sourceType: 'deposit_address',\n },\n {\n onError: () => failSource(source),\n onSuccess: () => quoteSource(source),\n }\n );\n },\n [attachFlowSource, failSource, flowId, quoteSource]\n );\n\n const { navigate, pop } = router;\n // Back to the address first, so a host that keeps the widget mounted\n // doesn't leave the payer on the confirmation.\n const payAnotherWay = useCallback(() => {\n pop();\n onBack?.();\n }, [onBack, pop]);\n\n // Memoized on the decision rather than the flow, so a poll that returns a\n // new flow object with the same address keeps Back's identity.\n const back = resolveFlowDepositAddressBack({\n flow,\n hasOnBack: onBack !== undefined,\n });\n const goBack = useMemo(() => {\n if (back === 'hidden') {\n return undefined;\n }\n if (back === 'leave') {\n return onBack;\n }\n return () => navigate({ name: 'leave-deposit-address' });\n }, [back, navigate, onBack]);\n\n // A used address is the one the view resolved (the host's when valid, else\n // the payer's), so it wins over the host's.\n const knownRefundAddresses = useMemo(\n () => ({ ...refundAddresses, ...usedRefundAddresses }),\n [refundAddresses, usedRefundAddresses]\n );\n\n return {\n currentRoute: router.current,\n flow,\n goBack,\n isQuoting: isAttaching || isFetchingQuote,\n onSourceChange,\n payAnotherWay,\n quoteFailed,\n refundAddresses: knownRefundAddresses,\n returnToDepositAddress: pop,\n };\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport type { FlowRefundAddresses } from '../../../flow.types';\nimport { renderFlowDepositAddressRoute } from '../renderFlowDepositAddressRoute';\nimport { useFlowDepositAddressWidget } from '../useFlowDepositAddressWidget';\n\n/**\n * Props for {@link FlowDepositAddressWidgetContent}.\n *\n * @example\n * ```tsx\n * const props: FlowDepositAddressWidgetContentProps = { flowId: 'flow_123' };\n * ```\n * @see FlowDepositAddressWidgetContent\n * @see FlowDepositAddressWidgetProps\n */\nexport type FlowDepositAddressWidgetContentProps = {\n /** The flow the customer is paying for. */\n flowId: string;\n /** Fires when the Back button is pressed; without it the screen has no Back. */\n onBack?: () => void;\n /** Refund addresses you already hold for the payer, one per chain family. */\n refundAddresses?: FlowRefundAddresses;\n};\n\n/**\n * Renders the deposit-address widget's current screen for one flow — the\n * deposit address, or the confirmation before leaving it; the widget remounts\n * it when the flow changes.\n *\n * @example\n * ```tsx\n * <FlowDepositAddressWidgetContent key={flowId} flowId={flowId} />\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onBack - Fires when the Back button is pressed.\n * @param params.refundAddresses - Refund addresses you already hold for the payer.\n * @returns The current route's screen.\n * @see FlowDepositAddressWidget\n * @see useFlowDepositAddressWidget\n * @notInstrumented\n */\nexport const FlowDepositAddressWidgetContent: FC<\n FlowDepositAddressWidgetContentProps\n> = ({ flowId, onBack, refundAddresses }) => {\n const widget = useFlowDepositAddressWidget({\n flowId,\n onBack,\n refundAddresses,\n });\n\n return renderFlowDepositAddressRoute({ route: widget.currentRoute, widget });\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport type { FlowRefundAddresses } from '../../flow.types';\nimport { PanelHost } from '../../../components/PanelHost';\nimport { FlowOutcomeBoundary } from '../FlowOutcomeBoundary';\nimport type { FlowOutcomeCallbacks } from '../FlowOutcomeBoundary/FlowOutcomeBoundary.types';\nimport { FlowDepositAddressWidgetContent } from './FlowDepositAddressWidgetContent';\n\n/**\n * Props for {@link FlowDepositAddressWidget}.\n *\n * @example\n * ```tsx\n * const props: FlowDepositAddressWidgetProps = {\n * flowId: 'flow_123',\n * onPaymentCompleted: (flow) => console.log(flow.id),\n * };\n * ```\n * @see FlowDepositAddressWidget\n * @see FlowDepositAddressView\n */\nexport type FlowDepositAddressWidgetProps = FlowOutcomeCallbacks & {\n className?: string;\n /** The flow the customer is paying for — fetched and polled by id. */\n flowId: string;\n /**\n * Leaves the deposit-address screen as its Back — e.g. to return to a\n * payment method choice. Without it, the screen has no Back.\n */\n onBack?: () => void;\n /**\n * Refund addresses you already hold for the payer, one per chain family\n * (e.g. `{ EVM: '0x…', SOL: '…' }`). The payer is asked for one only when\n * the picked family's is missing or not valid.\n */\n refundAddresses?: FlowRefundAddresses;\n};\n\n/**\n * The pay-by-deposit-address widget: shows a loader while the payment loads,\n * or an error with a retry when it can't load, then lets the payer pick the\n * network and token to send and a refund address, and shows the address and\n * exact amount to send. Back from a payment that already has an address asks\n * the payer to confirm first, since funds sent there won't count once they\n * pay another way. It waits for the deposit and lands on\n * payment-complete, payment-failed, payment-refunded, payment-cancelled or\n * expired as the flow's own state decides — also when the link is reopened\n * or reloaded while waiting. Fires `onPaymentCompleted` or `onPaymentFailed`\n * once per mount.\n *\n * Stands alone — it needs only a `flowId`.\n *\n * @example\n * ```tsx\n * import { FlowDepositAddressWidget } from '@/flow/widgets/FlowDepositAddressWidget/FlowDepositAddressWidget';\n *\n * const App = () => (\n * <FlowDepositAddressWidget\n * flowId=\"flow_123\"\n * onPaymentCompleted={(flow) => console.log(flow.id)}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onBack - Leaves the deposit-address screen.\n * @param params.onPaymentCompleted - Fires once per mount with the settled flow when the payment completes, including one already paid when opened.\n * @param params.onPaymentFailed - Fires once per mount with the flow when it expires, is cancelled or fails.\n * @param params.refundAddresses - Refund addresses you already hold for the payer, one per chain family.\n * @returns The pay-by-deposit-address orchestration.\n * @see FlowDepositAddressWidgetProps\n * @see useFlowDepositAddressWidget\n * @see FlowPayWithWalletWidget\n * @see PanelHost\n * @notInstrumented\n */\nexport const FlowDepositAddressWidget: FC<FlowDepositAddressWidgetProps> = ({\n className,\n flowId,\n onBack,\n onPaymentCompleted,\n onPaymentFailed,\n refundAddresses,\n}) => (\n // The root sits outside the boundary so the host's class also applies while\n // the flow loads or fails to load.\n <div className={className} data-slot=\"dyn-flow-deposit-address-widget\">\n {/* One card for every screen, including loading and the outcome. */}\n <PanelHost>\n {/* Keyed by flow so a new flowId starts a fresh payment: picks, the typed\n refund address and any failure all reset. */}\n <FlowOutcomeBoundary\n flowId={flowId}\n key={flowId}\n onPaymentCompleted={onPaymentCompleted}\n onPaymentFailed={onPaymentFailed}\n >\n <FlowDepositAddressWidgetContent\n flowId={flowId}\n onBack={onBack}\n refundAddresses={refundAddresses}\n />\n </FlowOutcomeBoundary>\n </PanelHost>\n </div>\n);\n","import type { FlowExchangeAttachErrorKind } from '../../flow.types';\nimport type { FLOW_CHOOSE_EXCHANGE_VIEW_TEXT } from './FlowChooseExchangeView.text';\n\n/** Placeholder rows shown while the exchanges load. */\nexport const SKELETON_ROW_COUNT = 3;\n\n/** The message copy key each attach failure kind reports with. */\nexport const ATTACH_ERROR_TEXT_KEY = {\n incompatible: 'incompatibleError',\n temporary: 'temporaryError',\n unavailable: 'unavailableError',\n unknown: 'unknownError',\n} as const satisfies Record<\n FlowExchangeAttachErrorKind,\n keyof typeof FLOW_CHOOSE_EXCHANGE_VIEW_TEXT\n>;\n","/** Default text for {@link FlowChooseExchangeView}. */\nexport const FLOW_CHOOSE_EXCHANGE_VIEW_TEXT = {\n attachingStatus: 'Connecting to {exchange}',\n empty:\n 'No exchanges are available for this payment. Choose another payment method.',\n incompatibleError:\n \"{exchange} can't be used for this payment. Choose another payment method.\",\n loadError: \"We couldn't load the exchanges for this payment.\",\n retry: 'Try again',\n temporaryError:\n \"{exchange} isn't responding right now. Try again or choose another payment method.\",\n title: 'Pay with an exchange',\n unavailableError:\n \"{exchange} isn't available for this payment. Choose another payment method.\",\n unknownError:\n 'Something went wrong with {exchange}. Try again or choose another payment method.',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-choose-exchange-view': typeof FLOW_CHOOSE_EXCHANGE_VIEW_TEXT;\n }\n}\n","'use client';\n\nimport type { FlowExchange } from '@dynamic-labs-sdk/client';\nimport type { FC } from 'react';\n\nimport { ProviderIcon } from '../../../components/ProviderIcon';\nimport { ProviderOption } from '../../../components/ProviderOption';\nimport { interpolateText } from '../../../i18n/interpolateText';\nimport { useText } from '../../../i18n/useText';\nimport { FlowErrorBanner } from '../../components/FlowErrorBanner';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusTray } from '../../components/FlowStatusTray';\nimport type { FlowExchangeAttachError } from '../../flow.types';\nimport { FLOW_EXCHANGE_NAME_TOKEN } from '../../constants';\nimport {\n ATTACH_ERROR_TEXT_KEY,\n SKELETON_ROW_COUNT,\n} from './FlowChooseExchangeView.constants';\nimport { FLOW_CHOOSE_EXCHANGE_VIEW_TEXT } from './FlowChooseExchangeView.text';\n\n/**\n * Props for {@link FlowChooseExchangeView}.\n *\n * @example\n * ```tsx\n * const props: FlowChooseExchangeViewProps = {\n * exchanges: [{ iconUrl, id, key: 'coinbase', label: 'Coinbase' }],\n * onSelect: (exchange) => console.log(exchange.key),\n * };\n * ```\n * @see FlowChooseExchangeView\n * @see FlowExchange\n */\nexport type FlowChooseExchangeViewProps = {\n /** The last failure to set up an exchange; shows the matching inline error. */\n attachError?: FlowExchangeAttachError;\n /** The exchange being set up for the payment; shows progress and locks the screen. */\n attachingExchange?: FlowExchange;\n className?: string;\n /** The exchanges to offer, in display order. */\n exchanges: readonly FlowExchange[];\n /** The exchanges are still loading; shows placeholder rows instead. */\n isLoading?: boolean;\n /** Fires when Back is pressed. Omit on a root screen to hide Back. */\n onBack?: () => void;\n /** Set when the exchanges failed to load; shows the error with a retry that fires it. */\n onRetryLoad?: () => void;\n /** Fires with the chosen exchange; the parent sets it up. */\n onSelect: (exchange: FlowExchange) => void;\n};\n\n/**\n * The Flow \"Pay with an exchange\" screen: pick the exchange to pay from.\n *\n * @example\n * ```tsx\n * import { FlowChooseExchangeView } from '@/flow/views/FlowChooseExchangeView/FlowChooseExchangeView';\n *\n * const App = () => (\n * <FlowChooseExchangeView\n * exchanges={exchanges}\n * onBack={() => history.back()}\n * onSelect={(exchange) => console.log(exchange.key)}\n * />\n * );\n * ```\n * @param params.attachError - The last failure to set up an exchange.\n * @param params.attachingExchange - The exchange being set up for the payment.\n * @param params.className - Extra class names for the panel element.\n * @param params.exchanges - The exchanges to offer, in display order.\n * @param params.isLoading - The exchanges are still loading.\n * @param params.onBack - Fires when Back is pressed. Omit to hide Back.\n * @param params.onRetryLoad - Set when the exchanges failed to load; retries loading them.\n * @param params.onSelect - Fires with the chosen exchange.\n * @returns The exchange picker.\n * @see FlowChooseExchangeViewProps\n * @see ProviderOption\n * @see FlowStatusTray\n * @copy title - The centered header title.\n * @copy attachingStatus - The progress line while {exchange} is set up.\n * @copy empty - Shown when no exchange is offered.\n * @copy incompatibleError - Shown when {exchange} can't be used for this payment.\n * @copy loadError - Shown when the exchanges couldn't load.\n * @copy retry - The action that loads the exchanges again.\n * @copy temporaryError - Shown when {exchange} isn't responding.\n * @copy unavailableError - Shown when {exchange} isn't offered for this payment.\n * @copy unknownError - Shown when setting up {exchange} failed unexpectedly.\n * @notInstrumented\n */\nexport const FlowChooseExchangeView: FC<FlowChooseExchangeViewProps> = ({\n attachError,\n attachingExchange,\n className,\n exchanges,\n isLoading = false,\n onBack,\n onRetryLoad,\n onSelect,\n}) => {\n const text = useText({\n defaults: FLOW_CHOOSE_EXCHANGE_VIEW_TEXT,\n slot: 'dyn-flow-choose-exchange-view',\n });\n\n const isAttaching = attachingExchange !== undefined;\n const hasLoadError = onRetryLoad !== undefined && !isLoading;\n const attachingStatus = isAttaching\n ? interpolateText({\n template: text('attachingStatus'),\n token: FLOW_EXCHANGE_NAME_TOKEN,\n value: attachingExchange.label,\n })\n : undefined;\n\n return (\n <FlowStatusTray className={className} status={attachingStatus}>\n <Panel onBack={isAttaching ? undefined : onBack} title={text('title')}>\n <div\n aria-busy={isAttaching || isLoading}\n data-slot=\"dyn-flow-choose-exchange-view\"\n >\n {/* A new attempt replaces the last failure, so its banner hides meanwhile. */}\n {attachError !== undefined && !isAttaching && (\n <FlowErrorBanner\n message={interpolateText({\n template: text(ATTACH_ERROR_TEXT_KEY[attachError.kind]),\n token: FLOW_EXCHANGE_NAME_TOKEN,\n value: attachError.exchange.label,\n })}\n />\n )}\n {hasLoadError && (\n <FlowErrorBanner\n actionLabel={text('retry')}\n message={text('loadError')}\n onAction={onRetryLoad}\n />\n )}\n {!isLoading && !hasLoadError && exchanges.length === 0 && (\n <p data-slot=\"dyn-flow-choose-exchange-view-empty\">\n {text('empty')}\n </p>\n )}\n {/* A disabled fieldset disables every exchange row at once. */}\n <fieldset\n data-slot=\"dyn-flow-choose-exchange-view-exchanges\"\n disabled={isAttaching}\n >\n {isLoading\n ? Array.from({ length: SKELETON_ROW_COUNT }, (_, index) => (\n <div\n aria-hidden=\"true\"\n data-slot=\"dyn-flow-choose-exchange-view-skeleton-row\"\n key={index}\n />\n ))\n : exchanges.map((exchange) => (\n <ProviderOption\n icon={\n <ProviderIcon\n name={exchange.label}\n url={exchange.iconUrl}\n />\n }\n id={exchange.key}\n key={exchange.key}\n name={exchange.label}\n onClick={() => onSelect(exchange)}\n />\n ))}\n </fieldset>\n </div>\n </Panel>\n </FlowStatusTray>\n );\n};\n","import { FlowChooseExchangeView } from '../../../../views/FlowChooseExchangeView';\nimport type { FlowPayWithExchangeRouteModule } from '../flowPayWithExchangeRoutes.types';\n\n/** The exchange list route entry; it carries no params. */\nexport type ChooseExchangeRoute = {\n name: 'choose-exchange';\n};\n\n/**\n * The first route of {@link FlowPayWithExchangeWidget}: the payer picks the\n * exchange to pay on. Retained in history, so Back from the exchange returns here.\n *\n * @see FlowPayWithExchangeRouteModule\n * @see flowPayWithExchangeRoutes\n * @see FlowChooseExchangeView\n */\nexport const chooseExchangeRoute: FlowPayWithExchangeRouteModule<ChooseExchangeRoute> =\n {\n render: ({ widget }) => (\n <FlowChooseExchangeView\n attachError={widget.attachError}\n attachingExchange={widget.attachingExchange}\n exchanges={widget.exchanges}\n isLoading={widget.isLoadingExchanges}\n onBack={widget.goBack}\n onRetryLoad={widget.retryLoadExchanges}\n onSelect={widget.selectExchange}\n />\n ),\n retainInHistory: true,\n };\n","/** The placeholder the heading uses for the amount to buy. */\nexport const AMOUNT_TOKEN = '{amount}';\n","import type { FLOW_EXCHANGE_VIEW_TEXT } from '../FlowExchangeView.text';\n\n/**\n * Params for {@link getFlowExchangeViewStatusKey}.\n *\n * @example\n * ```ts\n * const params: GetFlowExchangeViewStatusKeyParams = { hasOpened: true, isRenewing: false };\n * ```\n * @see getFlowExchangeViewStatusKey\n */\nexport type GetFlowExchangeViewStatusKeyParams = {\n /** The payer already opened the exchange. */\n hasOpened: boolean;\n /** A new link to the exchange is being fetched. */\n isRenewing: boolean;\n};\n\n/**\n * Picks the exchange screen's progress line: fetching a new link wins over\n * waiting for the purchase, and there is none before the payer opens the exchange.\n *\n * @example\n * ```ts\n * const statusKey = getFlowExchangeViewStatusKey({ hasOpened, isRenewing });\n * ```\n * @param params.hasOpened - The payer already opened the exchange.\n * @param params.isRenewing - A new link to the exchange is being fetched.\n * @returns The copy key of the progress line, or `undefined` for none.\n * @see FlowExchangeView\n * @see FlowStatusTray\n * @notInstrumented\n */\nexport const getFlowExchangeViewStatusKey = ({\n hasOpened,\n isRenewing,\n}: GetFlowExchangeViewStatusKeyParams):\n | keyof typeof FLOW_EXCHANGE_VIEW_TEXT\n | undefined => {\n if (isRenewing) {\n return 'renewingStatus';\n }\n if (hasOpened) {\n return 'waitingStatus';\n }\n return undefined;\n};\n","import { FLOW_CHOOSE_EXCHANGE_VIEW_TEXT } from '../FlowChooseExchangeView/FlowChooseExchangeView.text';\n\n/** Default text for {@link FlowExchangeView}. */\nexport const FLOW_EXCHANGE_VIEW_TEXT = {\n continue: 'Continue to {exchange}',\n heading: 'Buy {amount} on {exchange}',\n incompatibleError: FLOW_CHOOSE_EXCHANGE_VIEW_TEXT.incompatibleError,\n openHint: 'Opens {exchange} in a new tab.',\n renewingStatus: 'Getting a new {exchange} link',\n reopen: 'Reopen {exchange}',\n temporaryError: FLOW_CHOOSE_EXCHANGE_VIEW_TEXT.temporaryError,\n title: 'Pay with {exchange}',\n unavailableError: FLOW_CHOOSE_EXCHANGE_VIEW_TEXT.unavailableError,\n unknownError: FLOW_CHOOSE_EXCHANGE_VIEW_TEXT.unknownError,\n waitingDescription: 'Finish on {exchange}. This page updates by itself.',\n waitingStatus: 'Waiting for your {exchange} purchase',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-exchange-view': typeof FLOW_EXCHANGE_VIEW_TEXT;\n }\n}\n","'use client';\n\nimport type { Flow, FlowExchange } from '@dynamic-labs-sdk/client';\nimport type { FC } from 'react';\n\nimport { Button } from '../../../components/Button';\nimport { ProviderIcon } from '../../../components/ProviderIcon';\nimport { interpolateText } from '../../../i18n/interpolateText';\nimport { useText } from '../../../i18n/useText';\nimport { FlowErrorBanner } from '../../components/FlowErrorBanner';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { FlowStatusTray } from '../../components/FlowStatusTray';\nimport { FLOW_EXCHANGE_NAME_TOKEN } from '../../constants';\nimport type { FlowExchangeAttachErrorKind } from '../../flow.types';\nimport { formatFlowAmount } from '../../utils/formatFlowAmount';\nimport { ATTACH_ERROR_TEXT_KEY } from '../FlowChooseExchangeView/FlowChooseExchangeView.constants';\nimport { AMOUNT_TOKEN } from './FlowExchangeView.constants';\nimport { getFlowExchangeViewStatusKey } from './getFlowExchangeViewStatusKey';\nimport { FLOW_EXCHANGE_VIEW_TEXT } from './FlowExchangeView.text';\n\n/**\n * Props for {@link FlowExchangeView}.\n *\n * @example\n * ```tsx\n * const props: FlowExchangeViewProps = {\n * exchange: { iconUrl, id, key: 'coinbase', label: 'Coinbase' },\n * flow,\n * hasOpened: false,\n * onOpen: () => window.open(url, '_blank', 'noopener,noreferrer'),\n * };\n * ```\n * @see FlowExchangeView\n * @see FlowExchange\n */\nexport type FlowExchangeViewProps = {\n className?: string;\n /** The exchange the payer buys on. */\n exchange: FlowExchange;\n /** The flow being paid; its amount is what the payer buys. */\n flow: Flow;\n /** The payer already opened the exchange; shows the waiting state. */\n hasOpened: boolean;\n /** A new link to the exchange is being fetched; shows progress and locks the action. */\n isRenewing?: boolean;\n /** Fires when Back is pressed. Omit to hide Back. */\n onBack?: () => void;\n /** Fires on Continue and Reopen; the parent opens the exchange in a new tab. */\n onOpen: () => void;\n /** Why the last new link failed; shows the matching inline error. */\n renewError?: FlowExchangeAttachErrorKind;\n};\n\n/**\n * The Flow screen where the payer buys the payment amount on an exchange,\n * then waits on it until the exchange confirms the purchase; it shows\n * progress and failures while a new link is fetched.\n *\n * @example\n * ```tsx\n * import { FlowExchangeView } from '@/flow/views/FlowExchangeView/FlowExchangeView';\n *\n * const App = () => (\n * <FlowExchangeView\n * exchange={exchange}\n * flow={flow}\n * hasOpened={hasOpened}\n * onOpen={openExchange}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.exchange - The exchange the payer buys on.\n * @param params.flow - The flow being paid.\n * @param params.hasOpened - The payer already opened the exchange.\n * @param params.isRenewing - A new link to the exchange is being fetched.\n * @param params.onBack - Fires when Back is pressed. Omit to hide Back.\n * @param params.onOpen - Fires on Continue and Reopen.\n * @param params.renewError - Why the last new link failed.\n * @returns The pay-on-exchange view.\n * @see FlowExchangeViewProps\n * @see FlowChooseExchangeView\n * @see FlowStatusTray\n * @copy continue - The primary action opening {exchange}.\n * @copy heading - What the payer buys: {amount} on {exchange}.\n * @copy incompatibleError - Shown when {exchange} can't be used for this payment.\n * @copy openHint - Says {exchange} opens in a new tab.\n * @copy renewingStatus - The progress line while a new {exchange} link is fetched.\n * @copy reopen - The secondary action opening {exchange} again.\n * @copy temporaryError - Shown when {exchange} isn't responding.\n * @copy title - The centered header title naming {exchange}.\n * @copy unavailableError - Shown when {exchange} isn't offered for this payment.\n * @copy unknownError - Shown when a new {exchange} link failed unexpectedly.\n * @copy waitingDescription - Asks the payer to finish on {exchange}.\n * @copy waitingStatus - The progress line while the {exchange} purchase is pending.\n * @notInstrumented\n */\nexport const FlowExchangeView: FC<FlowExchangeViewProps> = ({\n className,\n exchange,\n flow,\n hasOpened,\n isRenewing = false,\n onBack,\n onOpen,\n renewError,\n}) => {\n const text = useText({\n defaults: FLOW_EXCHANGE_VIEW_TEXT,\n slot: 'dyn-flow-exchange-view',\n });\n const withExchange = (key: keyof typeof FLOW_EXCHANGE_VIEW_TEXT) =>\n interpolateText({\n template: text(key),\n token: FLOW_EXCHANGE_NAME_TOKEN,\n value: exchange.label,\n });\n\n const statusKey = getFlowExchangeViewStatusKey({ hasOpened, isRenewing });\n\n return (\n <FlowStatusTray\n className={className}\n status={statusKey && withExchange(statusKey)}\n >\n <Panel onBack={onBack} title={withExchange('title')}>\n <div\n aria-busy={hasOpened || isRenewing}\n data-slot=\"dyn-flow-exchange-view\"\n >\n {/* A new attempt replaces the last failure, so its banner hides meanwhile. */}\n {renewError !== undefined && !isRenewing && (\n <FlowErrorBanner\n message={withExchange(ATTACH_ERROR_TEXT_KEY[renewError])}\n />\n )}\n <FlowStatusHero\n description={withExchange(\n hasOpened ? 'waitingDescription' : 'openHint'\n )}\n heading={interpolateText({\n template: withExchange('heading'),\n token: AMOUNT_TOKEN,\n value: formatFlowAmount({ flow }),\n })}\n mark={\n <span data-slot=\"dyn-flow-exchange-view-mark\">\n <ProviderIcon name={exchange.label} url={exchange.iconUrl} />\n </span>\n }\n />\n <div data-slot=\"dyn-flow-exchange-view-actions\">\n {hasOpened ? (\n <Button\n disabled={isRenewing}\n onClick={onOpen}\n variant=\"secondary\"\n >\n {withExchange('reopen')}\n </Button>\n ) : (\n <Button disabled={isRenewing} onClick={onOpen}>\n {withExchange('continue')}\n </Button>\n )}\n </div>\n </div>\n </Panel>\n </FlowStatusTray>\n );\n};\n","import type { FlowExchange } from '@dynamic-labs-sdk/client';\n\nimport { FlowExchangeView } from '../../../../views/FlowExchangeView';\nimport { FlowLoadingView } from '../../../../views/FlowLoadingView';\nimport type { FlowPayWithExchangeRouteModule } from '../flowPayWithExchangeRoutes.types';\n\n/** The exchange route entry, carrying the exchange the payer buys on. */\nexport type ExchangeRoute = {\n name: 'exchange';\n params: {\n /** The exchange the payer buys on. */\n exchange: FlowExchange;\n };\n};\n\n/**\n * The route of {@link FlowPayWithExchangeWidget} where the payer opens the\n * exchange and waits for the purchase. Retained in history, so keeping on\n * waiting after Back returns here.\n *\n * @see FlowPayWithExchangeRouteModule\n * @see flowPayWithExchangeRoutes\n * @see FlowExchangeView\n */\nexport const exchangeRoute: FlowPayWithExchangeRouteModule<ExchangeRoute> = {\n render: ({ route, widget }) => {\n if (widget.flow === undefined) {\n return <FlowLoadingView />;\n }\n\n return (\n <FlowExchangeView\n exchange={route.params.exchange}\n flow={widget.flow}\n hasOpened={widget.hasOpened}\n isRenewing={widget.isRenewing}\n onBack={widget.goBack}\n onOpen={widget.openExchange}\n renewError={widget.renewError}\n />\n );\n },\n retainInHistory: true,\n};\n","/** Default text for {@link FlowLeaveExchangeView}. */\nexport const FLOW_LEAVE_EXCHANGE_VIEW_TEXT = {\n description:\n 'Purchases can take a few minutes to confirm. If you pay another way too, you may be charged twice and need a refund.',\n heading: 'Already paid on {exchange}?',\n keepWaiting: 'Keep waiting',\n payAnotherWay: 'Pay another way',\n title: 'Pay with {exchange}',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-leave-exchange-view': typeof FLOW_LEAVE_EXCHANGE_VIEW_TEXT;\n }\n}\n","'use client';\n\nimport type { FlowExchange } from '@dynamic-labs-sdk/client';\nimport type { FC } from 'react';\n\nimport { Button } from '../../../components/Button';\nimport { ProviderIcon } from '../../../components/ProviderIcon';\nimport { interpolateText } from '../../../i18n/interpolateText';\nimport { useText } from '../../../i18n/useText';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { FLOW_EXCHANGE_NAME_TOKEN } from '../../constants';\nimport { FLOW_LEAVE_EXCHANGE_VIEW_TEXT } from './FlowLeaveExchangeView.text';\n\n/**\n * Props for {@link FlowLeaveExchangeView}.\n *\n * @example\n * ```tsx\n * const props: FlowLeaveExchangeViewProps = {\n * exchange: { iconUrl, id, key: 'coinbase', label: 'Coinbase' },\n * onKeepWaiting: () => showExchange(),\n * onPayAnotherWay: () => goToMethods(),\n * };\n * ```\n * @see FlowLeaveExchangeView\n * @see FlowExchange\n */\nexport type FlowLeaveExchangeViewProps = {\n className?: string;\n /** The exchange the payer may already have paid on. */\n exchange: FlowExchange;\n /** Fires on the primary action — return to waiting on the exchange. */\n onKeepWaiting: () => void;\n /** Fires on the secondary action — leave the exchange for another payment method. */\n onPayAnotherWay: () => void;\n};\n\n/**\n * The Flow screen shown before a payer leaves an opened exchange payment for\n * another payment method, warning they may be charged twice. No Back, since\n * it would repeat Keep waiting.\n *\n * @example\n * ```tsx\n * import { FlowLeaveExchangeView } from '@/flow/views/FlowLeaveExchangeView/FlowLeaveExchangeView';\n *\n * const App = () => (\n * <FlowLeaveExchangeView\n * exchange={exchange}\n * onKeepWaiting={() => showExchange()}\n * onPayAnotherWay={() => goToMethods()}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.exchange - The exchange the payer may already have paid on.\n * @param params.onKeepWaiting - Fires on the primary action.\n * @param params.onPayAnotherWay - Fires on the secondary action.\n * @returns The leave-exchange view.\n * @see FlowLeaveExchangeViewProps\n * @see FlowExchangeView\n * @see FlowLeaveDepositAddressView\n * @copy description - The double-charge warning under the heading.\n * @copy heading - Asks whether the payer already paid on {exchange}.\n * @copy keepWaiting - The primary action returning to the {exchange} payment.\n * @copy payAnotherWay - The secondary action leaving {exchange} for another payment method.\n * @copy title - The centered header title naming {exchange}.\n * @notInstrumented\n */\nexport const FlowLeaveExchangeView: FC<FlowLeaveExchangeViewProps> = ({\n className,\n exchange,\n onKeepWaiting,\n onPayAnotherWay,\n}) => {\n const text = useText({\n defaults: FLOW_LEAVE_EXCHANGE_VIEW_TEXT,\n slot: 'dyn-flow-leave-exchange-view',\n });\n const withExchange = (key: keyof typeof FLOW_LEAVE_EXCHANGE_VIEW_TEXT) =>\n interpolateText({\n template: text(key),\n token: FLOW_EXCHANGE_NAME_TOKEN,\n value: exchange.label,\n });\n\n return (\n <Panel className={className} title={withExchange('title')}>\n <div data-slot=\"dyn-flow-leave-exchange-view\">\n <FlowStatusHero\n description={text('description')}\n heading={withExchange('heading')}\n mark={\n <span data-slot=\"dyn-flow-leave-exchange-view-mark\">\n <ProviderIcon name={exchange.label} url={exchange.iconUrl} />\n </span>\n }\n />\n <div data-slot=\"dyn-flow-leave-exchange-view-actions\">\n <Button onClick={onKeepWaiting}>{text('keepWaiting')}</Button>\n <Button onClick={onPayAnotherWay} variant=\"secondary\">\n {text('payAnotherWay')}\n </Button>\n </div>\n </div>\n </Panel>\n );\n};\n","import type { FlowExchange } from '@dynamic-labs-sdk/client';\n\nimport { FlowLeaveExchangeView } from '../../../../views/FlowLeaveExchangeView';\nimport type { FlowPayWithExchangeRouteModule } from '../flowPayWithExchangeRoutes.types';\n\n/** The leave confirmation route entry, carrying the exchange being left. */\nexport type LeaveExchangeRoute = {\n name: 'leave-exchange';\n params: {\n /** The exchange the payer may already have paid on. */\n exchange: FlowExchange;\n };\n};\n\n/**\n * The confirmation route of {@link FlowPayWithExchangeWidget}, opened by\n * Back once the payer opened the exchange: keeping on waiting returns to it,\n * paying another way leaves the widget.\n *\n * @see FlowPayWithExchangeRouteModule\n * @see flowPayWithExchangeRoutes\n * @see FlowLeaveExchangeView\n */\nexport const leaveExchangeRoute: FlowPayWithExchangeRouteModule<LeaveExchangeRoute> =\n {\n render: ({ route, widget }) => (\n <FlowLeaveExchangeView\n exchange={route.params.exchange}\n onKeepWaiting={widget.keepWaiting}\n onPayAnotherWay={widget.payAnotherWay}\n />\n ),\n };\n","import { chooseExchangeRoute } from './chooseExchangeRoute';\nimport { exchangeRoute } from './exchangeRoute';\nimport type {\n FlowPayWithExchangeRouteByName,\n FlowPayWithExchangeRouteModule,\n FlowPayWithExchangeRouteName,\n} from './flowPayWithExchangeRoutes.types';\nimport { leaveExchangeRoute } from './leaveExchangeRoute';\n\n/**\n * The route table behind {@link FlowPayWithExchangeWidget}: the exchange\n * list, the exchange screen and the confirmation before leaving it. A route\n * missing here, or a module filed under another route's name, fails type\n * checking.\n *\n * @see FlowPayWithExchangeRouteModule\n * @see renderFlowPayWithExchangeRoute\n */\nexport const flowPayWithExchangeRoutes: {\n [Name in FlowPayWithExchangeRouteName]: FlowPayWithExchangeRouteModule<\n FlowPayWithExchangeRouteByName[Name]\n >;\n} = {\n 'choose-exchange': chooseExchangeRoute,\n exchange: exchangeRoute,\n 'leave-exchange': leaveExchangeRoute,\n};\n","import type { ReactNode } from 'react';\n\nimport { flowPayWithExchangeRoutes } from '../routes/flowPayWithExchangeRoutes';\nimport type {\n FlowPayWithExchangeRouteByName,\n FlowPayWithExchangeRouteName,\n FlowPayWithExchangeRouteRenderParams,\n} from '../routes/flowPayWithExchangeRoutes.types';\n\n/**\n * Params for {@link renderFlowPayWithExchangeRoute}.\n *\n * @see renderFlowPayWithExchangeRoute\n * @see FlowPayWithExchangeRouteRenderParams\n */\nexport type RenderFlowPayWithExchangeRouteParams<\n Name extends FlowPayWithExchangeRouteName\n> = FlowPayWithExchangeRouteRenderParams<\n FlowPayWithExchangeRouteByName[Name] & { name: Name }\n>;\n\n/**\n * Renders the pay-with-exchange widget screen for a route through its route\n * module. The generic route name ties the route to its own module, so the\n * lookup needs no cast.\n *\n * @example\n * ```tsx\n * renderFlowPayWithExchangeRoute({ route: widget.currentRoute, widget });\n * ```\n * @param params.route - The route entry to render.\n * @param params.widget - The widget's state and actions.\n * @returns The route's screen.\n * @see flowPayWithExchangeRoutes\n * @see FlowPayWithExchangeRouteModule\n * @notInstrumented\n */\nexport const renderFlowPayWithExchangeRoute = <\n Name extends FlowPayWithExchangeRouteName\n>({\n route,\n widget,\n}: RenderFlowPayWithExchangeRouteParams<Name>): ReactNode =>\n flowPayWithExchangeRoutes[route.name].render({ route, widget });\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport { assertSafeNavigationUrl } from '@dynamic-labs-sdk/client/core';\n\n/**\n * Params for {@link getFlowExchangeUrl}.\n *\n * @example\n * ```ts\n * const params: GetFlowExchangeUrlParams = { flow };\n * ```\n * @see getFlowExchangeUrl\n */\nexport type GetFlowExchangeUrlParams = {\n /** The flow being paid on an exchange. */\n flow: Flow | undefined;\n};\n\n/**\n * Reads the link to the exchange the payer buys on from the flow, keeping\n * only one that is safe to open.\n *\n * @example\n * ```ts\n * const url = getFlowExchangeUrl({ flow });\n * ```\n * @param params.flow - The flow being paid on an exchange.\n * @returns The exchange link, or `undefined` when the flow has none or it isn't safe to open.\n * @see openFlowExchangeUrl\n * @see assertSafeNavigationUrl\n * @see FlowExchangeView\n * @notInstrumented\n */\nexport const getFlowExchangeUrl = ({\n flow,\n}: GetFlowExchangeUrlParams): string | undefined => {\n const metadata = flow?.exchangeSource?.metadata;\n\n if (metadata === undefined || !('url' in metadata)) {\n return undefined;\n }\n\n if (typeof metadata.url !== 'string') {\n return undefined;\n }\n\n // The link comes from the server, so a script or other non-web link is never opened.\n try {\n assertSafeNavigationUrl(metadata.url);\n } catch {\n return undefined;\n }\n\n return metadata.url;\n};\n","/* eslint-disable no-restricted-globals -- this is the one place the exchange\n link meets the browser, so specs can replace it. */\n\n/**\n * Params for {@link openFlowExchangeUrl}.\n *\n * @example\n * ```ts\n * const params: OpenFlowExchangeUrlParams = { url };\n * ```\n * @see openFlowExchangeUrl\n */\nexport type OpenFlowExchangeUrlParams = {\n /** The exchange link to open. */\n url: string;\n};\n\n/**\n * Opens the exchange link in a new tab, cut off from this page. Call it\n * inside the click that asked for it, or the browser may block the tab.\n *\n * @example\n * ```ts\n * openFlowExchangeUrl({ url });\n * ```\n * @param params.url - The exchange link to open.\n * @returns Nothing; the tab opens on its own.\n * @see getFlowExchangeUrl\n * @see FlowExchangeView\n * @notInstrumented\n */\nexport const openFlowExchangeUrl = ({\n url,\n}: OpenFlowExchangeUrlParams): void => {\n window.open(url, '_blank', 'noopener,noreferrer');\n};\n","import type { FlowExchange } from '@dynamic-labs-sdk/client';\nimport { useGetFlowSupportedExchanges } from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback } from 'react';\n\n/**\n * Params for {@link useFlowExchangeList}.\n *\n * @example\n * ```ts\n * const params: UseFlowExchangeListParams = { flowId: 'flow_123' };\n * ```\n * @see useFlowExchangeList\n * @see UseFlowExchangeListResult\n */\nexport type UseFlowExchangeListParams = {\n /** The flow the customer is paying for. */\n flowId: string;\n};\n\n/** What {@link useFlowExchangeList} returns. */\nexport type UseFlowExchangeListResult = {\n /** The exchanges the flow can be paid with; `undefined` until they load. */\n exchanges: FlowExchange[] | undefined;\n /** Whether the exchanges failed to load, so none are known. */\n hasLoadError: boolean;\n /** Whether the exchanges are loading and none are known yet. */\n isLoading: boolean;\n /** Loads the exchanges again. */\n retryLoad: () => void;\n};\n\n/**\n * The exchanges a flow can be paid with, and whether they are loading or\n * failed to load.\n *\n * @example\n * ```ts\n * const { exchanges, hasLoadError, retryLoad } = useFlowExchangeList({ flowId });\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @returns The exchanges, their loading and failed states, and a retry.\n * @see useFlowPayWithExchangeWidget\n * @see FlowChooseExchangeView\n * @notInstrumented\n */\nexport const useFlowExchangeList = ({\n flowId,\n}: UseFlowExchangeListParams): UseFlowExchangeListResult => {\n const {\n data: exchanges,\n error,\n isFetching,\n refetch,\n } = useGetFlowSupportedExchanges({ flowId });\n\n const retryLoad = useCallback(() => {\n void refetch();\n }, [refetch]);\n\n return {\n exchanges,\n hasLoadError: exchanges === undefined && error !== null,\n isLoading: exchanges === undefined && isFetching,\n retryLoad,\n };\n};\n","import type { FlowExchange } from '@dynamic-labs-sdk/client';\n\nimport type { UseViewRouterParams } from '../../../../../utils/hooks/useViewRouter';\nimport { flowPayWithExchangeRoutes } from '../../routes/flowPayWithExchangeRoutes';\nimport type { FlowPayWithExchangeRoute } from '../../routes/flowPayWithExchangeRoutes.types';\n\n/** Params for {@link getRouterParams}. */\nexport type GetRouterParamsParams = {\n /** The exchange a waiting payment resumes on, or `undefined` to let the payer choose. */\n resumedExchange: FlowExchange | undefined;\n};\n\n/**\n * The pay-with-exchange widget's router setup: its route table and the\n * screens it starts with — the exchange list, with the resumed exchange on\n * top of it when a waiting payment is reopened, so Back still returns to the list.\n *\n * @example\n * ```ts\n * const router = useViewRouter(getRouterParams({ resumedExchange }));\n * ```\n * @param params.resumedExchange - The exchange a waiting payment resumes on.\n * @returns The params for the widget's router.\n * @see useFlowPayWithExchangeWidget\n * @see useResumedFlowExchange\n * @notInstrumented\n */\nexport const getRouterParams = ({\n resumedExchange,\n}: GetRouterParamsParams): UseViewRouterParams<FlowPayWithExchangeRoute> => {\n if (resumedExchange) {\n return {\n initialStack: [\n { name: 'choose-exchange' },\n { name: 'exchange', params: { exchange: resumedExchange } },\n ],\n routes: flowPayWithExchangeRoutes,\n };\n }\n\n return {\n initialStack: [{ name: 'choose-exchange' }],\n routes: flowPayWithExchangeRoutes,\n };\n};\n","import type { FlowPayWithExchangeRoute } from '../../routes/flowPayWithExchangeRoutes.types';\n\n/**\n * What Back does on a pay-with-exchange screen: nothing, leave through the\n * host's Back, return to the list, or ask first.\n *\n * @example\n * ```ts\n * const back: FlowExchangeBack = 'confirm';\n * ```\n * @see resolveFlowExchangeBack\n * @see useFlowPayWithExchangeWidget\n */\nexport type FlowExchangeBack = 'confirm' | 'hidden' | 'leave' | 'pop';\n\n/**\n * Params for {@link resolveFlowExchangeBack}.\n *\n * @example\n * ```ts\n * const params: ResolveFlowExchangeBackParams = {\n * hasOnBack: true,\n * hasOpenedAnyLink: false,\n * routeName: 'exchange',\n * };\n * ```\n * @see resolveFlowExchangeBack\n */\nexport type ResolveFlowExchangeBackParams = {\n /** Whether the host gave the widget a Back. */\n hasOnBack: boolean;\n /** Whether the payer opened a link to the exchange. */\n hasOpenedAnyLink: boolean;\n /** The screen Back is shown on. */\n routeName: FlowPayWithExchangeRoute['name'];\n};\n\n/**\n * Decides what Back does on a pay-with-exchange screen. The list leaves\n * through the host's Back, if any. The exchange asks first once the payer\n * opened it, since a purchase there may still land; before that it returns\n * to the list. The confirmation has its own buttons instead.\n *\n * @example\n * ```ts\n * const back = resolveFlowExchangeBack({ hasOnBack, hasOpenedAnyLink, routeName: 'exchange' });\n * ```\n * @param params.hasOnBack - Whether the host gave the widget a Back.\n * @param params.hasOpenedAnyLink - Whether the payer opened a link to the exchange.\n * @param params.routeName - The screen Back is shown on.\n * @returns What Back does.\n * @see ResolveFlowExchangeBackParams\n * @see FlowExchangeBack\n * @notInstrumented\n */\nexport const resolveFlowExchangeBack = ({\n hasOnBack,\n hasOpenedAnyLink,\n routeName,\n}: ResolveFlowExchangeBackParams): FlowExchangeBack => {\n if (routeName === 'exchange' && hasOpenedAnyLink) {\n return 'confirm';\n }\n\n if (routeName === 'exchange') {\n return 'pop';\n }\n\n if (routeName === 'choose-exchange' && hasOnBack) {\n return 'leave';\n }\n\n return 'hidden';\n};\n","import type { FlowExchangeAttachErrorKind } from '../../flow.types';\n\n/** The failure kind each exchange attach error code reports as; any other code is `unknown`. */\nexport const EXCHANGE_ATTACH_ERROR_KIND_BY_CODE: Readonly<\n Partial<Record<string, FlowExchangeAttachErrorKind>>\n> = {\n exchange_currency_unsupported: 'incompatible',\n exchange_not_configured: 'unavailable',\n exchange_not_supported: 'unavailable',\n exchange_settlement_unsupported: 'incompatible',\n exchange_unavailable: 'temporary',\n};\n","import { BaseError } from '@dynamic-labs-sdk/client';\n\nimport type { FlowExchangeAttachErrorKind } from '../../flow.types';\nimport { EXCHANGE_ATTACH_ERROR_KIND_BY_CODE } from './getExchangeAttachErrorKind.constants';\n\n/**\n * Params for {@link getExchangeAttachErrorKind}.\n *\n * @example\n * ```ts\n * const params: GetExchangeAttachErrorKindParams = { error };\n * ```\n * @see getExchangeAttachErrorKind\n */\nexport type GetExchangeAttachErrorKindParams = {\n /** The error setting up the exchange failed with. */\n error: Error;\n};\n\n/**\n * Maps a failure to set up an exchange to the kind the exchange screens report.\n *\n * @example\n * ```ts\n * const kind = getExchangeAttachErrorKind({ error });\n * ```\n * @param params.error - The error setting up the exchange failed with.\n * @returns The failure kind, `unknown` for an unrecognised error.\n * @see FlowExchangeAttachErrorKind\n * @see FlowChooseExchangeView\n * @notInstrumented\n */\nexport const getExchangeAttachErrorKind = ({\n error,\n}: GetExchangeAttachErrorKindParams): FlowExchangeAttachErrorKind => {\n if (!(error instanceof BaseError)) {\n return 'unknown';\n }\n\n return EXCHANGE_ATTACH_ERROR_KIND_BY_CODE[error.code] ?? 'unknown';\n};\n","import type { FlowExchange } from '@dynamic-labs-sdk/client';\nimport { useAttachFlowSource } from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useRef, useState } from 'react';\n\nimport type { FlowExchangeAttachErrorKind } from '../../../../flow.types';\nimport { getExchangeAttachErrorKind } from '../../../../utils/getExchangeAttachErrorKind';\nimport { getFlowExchangeUrl } from '../../../../utils/getFlowExchangeUrl';\n\n/**\n * Params for {@link useAttachFlowExchange}.\n *\n * @example\n * ```ts\n * const params: UseAttachFlowExchangeParams = { flowId: 'flow_123' };\n * ```\n * @see useAttachFlowExchange\n * @see UseAttachFlowExchangeResult\n */\nexport type UseAttachFlowExchangeParams = {\n /** The flow the customer is paying for. */\n flowId: string;\n};\n\n/**\n * One request to set up an exchange: a pick from the list, or a new link for\n * the exchange already shown.\n *\n * @example\n * ```ts\n * const attempt: AttachFlowExchangeAttempt = { exchange, onFailed, reason: 'renew' };\n * ```\n * @see useAttachFlowExchange\n * @see UseAttachFlowExchangeResult\n */\nexport type AttachFlowExchangeAttempt = {\n /** The exchange to set up. */\n exchange: FlowExchange;\n /** Fires once the exchange is set up with a link. */\n onAttached?: () => void;\n /** Fires with why the set up failed. */\n onFailed: (kind: FlowExchangeAttachErrorKind) => void;\n /** Why the exchange is set up: a pick from the list, or a new link. */\n reason: 'pick' | 'renew';\n};\n\n/** What {@link useAttachFlowExchange} returns. */\nexport type UseAttachFlowExchangeResult = {\n /** Sets up an exchange on the flow; a newer attempt replaces an older one. */\n attachExchange: (attempt: AttachFlowExchangeAttempt) => void;\n /** The picked exchange while it is being set up. */\n attachingExchange: FlowExchange | undefined;\n /** Whether a new link to the shown exchange is being fetched. */\n isRenewing: boolean;\n};\n\n/**\n * Sets up an exchange as the flow's payment source, which issues a new link\n * to the exchange each time. Only the newest attempt's reply counts, and a\n * set up without a link counts as failed.\n *\n * @example\n * ```ts\n * const { attachExchange, attachingExchange } = useAttachFlowExchange({ flowId });\n * attachExchange({ exchange, onAttached, onFailed, reason: 'pick' });\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @returns The set up action and what is being set up.\n * @see useFlowPayWithExchangeWidget\n * @see getExchangeAttachErrorKind\n * @notInstrumented\n */\nexport const useAttachFlowExchange = ({\n flowId,\n}: UseAttachFlowExchangeParams): UseAttachFlowExchangeResult => {\n const { mutate: attachFlowSource } = useAttachFlowSource();\n const [pendingAttempt, setPendingAttempt] = useState<\n AttachFlowExchangeAttempt | undefined\n >(undefined);\n\n // An older attempt's replies are ignored, so the newest pick or link wins.\n const latestAttemptRef = useRef<AttachFlowExchangeAttempt | undefined>(\n undefined\n );\n\n const attachExchange = useCallback(\n (attempt: AttachFlowExchangeAttempt) => {\n latestAttemptRef.current = attempt;\n setPendingAttempt(attempt);\n\n const finishAttempt = () => {\n if (latestAttemptRef.current !== attempt) {\n return false;\n }\n latestAttemptRef.current = undefined;\n setPendingAttempt(undefined);\n return true;\n };\n\n attachFlowSource(\n {\n exchangeProvider: attempt.exchange.key,\n flowId,\n sourceType: 'exchange',\n },\n {\n onError: (error) => {\n if (finishAttempt()) {\n attempt.onFailed(getExchangeAttachErrorKind({ error }));\n }\n },\n onSuccess: (response) => {\n if (!finishAttempt()) {\n return;\n }\n // Without a link there is nothing to open.\n if (getFlowExchangeUrl({ flow: response.flow }) === undefined) {\n attempt.onFailed('unknown');\n return;\n }\n attempt.onAttached?.();\n },\n }\n );\n },\n [attachFlowSource, flowId]\n );\n\n return {\n attachExchange,\n attachingExchange:\n pendingAttempt?.reason === 'pick' ? pendingAttempt.exchange : undefined,\n isRenewing: pendingAttempt?.reason === 'renew',\n };\n};\n","import type { FlowExchange } from '@dynamic-labs-sdk/client';\nimport { useGetFlow } from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useMemo, useState } from 'react';\n\nimport { useViewRouter } from '../../../../utils/hooks/useViewRouter';\nimport type {\n FlowExchangeAttachError,\n FlowExchangeAttachErrorKind,\n} from '../../../flow.types';\nimport { getFlowExchangeUrl } from '../../../utils/getFlowExchangeUrl';\nimport { openFlowExchangeUrl } from '../../../utils/openFlowExchangeUrl';\nimport { useFlowExchangeList } from '../useFlowExchangeList';\nimport { getRouterParams } from './getRouterParams';\nimport { resolveFlowExchangeBack } from './resolveFlowExchangeBack';\nimport { useAttachFlowExchange } from './useAttachFlowExchange';\nimport type { UseFlowPayWithExchangeWidgetResult } from './useFlowPayWithExchangeWidget.types';\n\n/**\n * Params for {@link useFlowPayWithExchangeWidget}.\n *\n * @example\n * ```ts\n * const params: UseFlowPayWithExchangeWidgetParams = { flowId: 'flow_123' };\n * ```\n * @see useFlowPayWithExchangeWidget\n * @see UseFlowPayWithExchangeWidgetResult\n */\nexport type UseFlowPayWithExchangeWidgetParams = {\n /** The flow the customer is paying for. */\n flowId: string;\n /** Leaves the exchange list. Without it, the list has no Back. */\n onBack?: () => void;\n /** The exchange a reopened payment waits on; the widget starts on it. */\n resumedExchange?: FlowExchange;\n};\n\n/**\n * Drives an exchange payment: the picked exchange is set up on the flow,\n * then the payer opens its link in a new tab and the screen waits until the\n * exchange confirms the purchase. Each link is opened once; opening again\n * fetches a new link first. Back after opening asks first, since a purchase\n * may still land.\n *\n * @example\n * ```ts\n * const widget = useFlowPayWithExchangeWidget({ flowId: 'flow_123' });\n * renderFlowPayWithExchangeRoute({ route: widget.currentRoute, widget });\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onBack - Leaves the exchange list.\n * @param params.resumedExchange - The exchange a reopened payment waits on.\n * @returns The current route, the flow, the exchanges and the payer's actions.\n * @see FlowPayWithExchangeWidget\n * @see getRouterParams\n * @see resolveFlowExchangeBack\n * @see FlowExchangeView\n * @notInstrumented\n */\nexport const useFlowPayWithExchangeWidget = ({\n flowId,\n onBack,\n resumedExchange,\n}: UseFlowPayWithExchangeWidgetParams): UseFlowPayWithExchangeWidgetResult => {\n const { data: flow } = useGetFlow({ flowId });\n const {\n exchanges,\n hasLoadError: hasExchangesError,\n isLoading: isLoadingExchanges,\n retryLoad: retryLoadExchanges,\n } = useFlowExchangeList({ flowId });\n // The router captures its starting stack on mount only.\n const router = useViewRouter(getRouterParams({ resumedExchange }));\n const { attachExchange, attachingExchange, isRenewing } =\n useAttachFlowExchange({ flowId });\n\n const [attachError, setAttachError] = useState<\n FlowExchangeAttachError | undefined\n >(undefined);\n const [renewError, setRenewError] = useState<\n FlowExchangeAttachErrorKind | undefined\n >(undefined);\n const [openedUrl, setOpenedUrl] = useState<string | undefined>(undefined);\n // A resumed link may be spent, even one that loads after mount, so the first open renews it.\n const [isResumedLinkSpent, setIsResumedLinkSpent] = useState(\n resumedExchange !== undefined\n );\n // A resumed payment counts as opened, so Back asks first.\n const [hasOpenedAnyLink, setHasOpenedAnyLink] = useState(\n resumedExchange !== undefined\n );\n\n const { current, navigate, pop } = router;\n\n const selectExchange = useCallback(\n (exchange: FlowExchange) => {\n setAttachError(undefined);\n setRenewError(undefined);\n attachExchange({\n exchange,\n onAttached: () => navigate({ name: 'exchange', params: { exchange } }),\n onFailed: (kind) => setAttachError({ exchange, kind }),\n reason: 'pick',\n });\n },\n [attachExchange, navigate]\n );\n\n const currentUrl = getFlowExchangeUrl({ flow });\n\n // The open must run inside the click, or the browser blocks the new tab.\n const openExchange = useCallback(() => {\n if (current.name !== 'exchange') {\n return;\n }\n if (\n !isResumedLinkSpent &&\n currentUrl !== undefined &&\n currentUrl !== openedUrl\n ) {\n openFlowExchangeUrl({ url: currentUrl });\n setOpenedUrl(currentUrl);\n setHasOpenedAnyLink(true);\n return;\n }\n\n // An opened link may be spent, so a new one is fetched for the next click.\n setRenewError(undefined);\n attachExchange({\n exchange: current.params.exchange,\n onAttached: () => setIsResumedLinkSpent(false),\n onFailed: setRenewError,\n reason: 'renew',\n });\n }, [attachExchange, current, currentUrl, isResumedLinkSpent, openedUrl]);\n\n // Back to the list first, so a host that keeps the widget mounted doesn't\n // leave the payer on the confirmation. The next exchange starts unopened.\n const payAnotherWay = useCallback(() => {\n setOpenedUrl(undefined);\n setIsResumedLinkSpent(false);\n setHasOpenedAnyLink(false);\n pop();\n pop();\n onBack?.();\n }, [onBack, pop]);\n\n // Memoized on the decision and the screen, so a poll keeps Back's identity.\n const back = resolveFlowExchangeBack({\n hasOnBack: onBack !== undefined,\n hasOpenedAnyLink,\n routeName: current.name,\n });\n const goBack = useMemo(() => {\n if (back === 'leave') {\n return onBack;\n }\n if (back === 'pop') {\n return pop;\n }\n if (back === 'confirm' && current.name === 'exchange') {\n const { exchange } = current.params;\n return () => navigate({ name: 'leave-exchange', params: { exchange } });\n }\n return undefined;\n }, [back, current, navigate, onBack, pop]);\n\n return {\n attachError,\n attachingExchange,\n currentRoute: current,\n exchanges: exchanges ?? [],\n flow,\n goBack,\n hasOpened:\n isResumedLinkSpent ||\n (currentUrl !== undefined && currentUrl === openedUrl),\n isLoadingExchanges,\n isRenewing,\n keepWaiting: pop,\n openExchange,\n payAnotherWay,\n renewError,\n // Hidden while a retry runs.\n retryLoadExchanges:\n hasExchangesError && !isLoadingExchanges ? retryLoadExchanges : undefined,\n selectExchange,\n };\n};\n","'use client';\n\nimport type { FlowExchange } from '@dynamic-labs-sdk/client';\nimport type { FC } from 'react';\n\nimport { renderFlowPayWithExchangeRoute } from '../renderFlowPayWithExchangeRoute';\nimport { useFlowPayWithExchangeWidget } from '../useFlowPayWithExchangeWidget';\n\n/**\n * Props for {@link FlowPayWithExchangeWidgetScreen}.\n *\n * @example\n * ```tsx\n * const props: FlowPayWithExchangeWidgetScreenProps = { flowId: 'flow_123' };\n * ```\n * @see FlowPayWithExchangeWidgetScreen\n * @see FlowPayWithExchangeWidgetContentProps\n */\nexport type FlowPayWithExchangeWidgetScreenProps = {\n /** The flow the customer is paying for. */\n flowId: string;\n /** Fires when Back is pressed on the exchange list; without it the list has no Back. */\n onBack?: () => void;\n /** The exchange a reopened payment waits on; the widget starts on it. */\n resumedExchange?: FlowExchange;\n};\n\n/**\n * Renders the pay-with-exchange widget's current screen — the exchange list,\n * the exchange, or the confirmation before leaving it.\n *\n * @example\n * ```tsx\n * <FlowPayWithExchangeWidgetScreen flowId={flowId} />\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onBack - Fires when Back is pressed on the exchange list.\n * @param params.resumedExchange - The exchange a reopened payment waits on.\n * @returns The current route's screen.\n * @see FlowPayWithExchangeWidgetContent\n * @see useFlowPayWithExchangeWidget\n * @notInstrumented\n */\nexport const FlowPayWithExchangeWidgetScreen: FC<\n FlowPayWithExchangeWidgetScreenProps\n> = ({ flowId, onBack, resumedExchange }) => {\n const widget = useFlowPayWithExchangeWidget({\n flowId,\n onBack,\n resumedExchange,\n });\n\n return renderFlowPayWithExchangeRoute({ route: widget.currentRoute, widget });\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\n/**\n * Params for {@link getWaitingFlowExchangeId}.\n *\n * @example\n * ```ts\n * const params: GetWaitingFlowExchangeIdParams = { flow };\n * ```\n * @see getWaitingFlowExchangeId\n */\nexport type GetWaitingFlowExchangeIdParams = {\n /** The flow being paid. */\n flow: Flow | undefined;\n};\n\n/**\n * Finds the exchange a flow is waiting to be paid on: set up as an exchange\n * payment and not paid yet.\n *\n * @example\n * ```ts\n * const exchangeId = getWaitingFlowExchangeId({ flow });\n * ```\n * @param params.flow - The flow being paid.\n * @returns The exchange's id, or `undefined` when the flow isn't waiting on one.\n * @see useResumedFlowExchange\n * @see getRouterParams\n * @notInstrumented\n */\nexport const getWaitingFlowExchangeId = ({\n flow,\n}: GetWaitingFlowExchangeIdParams): string | undefined => {\n if (\n flow?.executionState !== 'source_attached' ||\n flow.sourceType !== 'exchange'\n ) {\n return undefined;\n }\n\n return flow.exchangeSource?.exchangeId;\n};\n","import type { FlowExchange } from '@dynamic-labs-sdk/client';\nimport { useGetFlow } from '@dynamic-labs-sdk/react-hooks';\n\nimport { useFlowExchangeList } from '../useFlowExchangeList';\nimport { getWaitingFlowExchangeId } from './getWaitingFlowExchangeId';\n\n/**\n * Params for {@link useResumedFlowExchange}.\n *\n * @example\n * ```ts\n * const params: UseResumedFlowExchangeParams = { flowId: 'flow_123' };\n * ```\n * @see useResumedFlowExchange\n */\nexport type UseResumedFlowExchangeParams = {\n /** The flow the customer is paying for. */\n flowId: string;\n};\n\n/** What {@link useResumedFlowExchange} returns. */\nexport type UseResumedFlowExchangeResult = {\n /** Whether the exchanges are still loading for a flow that waits on one. */\n isResolving: boolean;\n /** Whether the exchanges are loading again after failing. */\n isRetrying: boolean;\n /** The listed exchange the flow waits on, or `undefined` to start on the list. */\n resumedExchange: FlowExchange | undefined;\n /** Loads the exchanges again; set only when they failed for a flow that waits on one. */\n retryLoadExchanges: (() => void) | undefined;\n};\n\n/**\n * Finds the exchange a reopened payment waits on, among the flow's listed\n * exchanges, so the widget can return the payer to it.\n *\n * @example\n * ```ts\n * const { isResolving, resumedExchange } = useResumedFlowExchange({ flowId });\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @returns Whether the lookup is still loading, the exchange to resume on, and a retry when it failed.\n * @see FlowPayWithExchangeWidgetContent\n * @see getWaitingFlowExchangeId\n * @notInstrumented\n */\nexport const useResumedFlowExchange = ({\n flowId,\n}: UseResumedFlowExchangeParams): UseResumedFlowExchangeResult => {\n const { data: flow } = useGetFlow({ flowId });\n const { exchanges, hasLoadError, isLoading, retryLoad } = useFlowExchangeList(\n { flowId }\n );\n\n const exchangeId = getWaitingFlowExchangeId({ flow });\n\n if (exchangeId === undefined) {\n return {\n isResolving: false,\n isRetrying: false,\n resumedExchange: undefined,\n retryLoadExchanges: undefined,\n };\n }\n\n return {\n isResolving: exchanges === undefined && !hasLoadError,\n isRetrying: hasLoadError && isLoading,\n resumedExchange: exchanges?.find((exchange) => exchange.id === exchangeId),\n // A failed list must not start on the picker, which allows a second purchase.\n retryLoadExchanges: hasLoadError ? retryLoad : undefined,\n };\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { FlowLoadError } from '../../../views/FlowLoadError';\nimport { FlowLoadingView } from '../../../views/FlowLoadingView';\nimport { FlowPayWithExchangeWidgetScreen } from '../FlowPayWithExchangeWidgetScreen';\nimport { useResumedFlowExchange } from '../useResumedFlowExchange';\n\n/**\n * Props for {@link FlowPayWithExchangeWidgetContent}.\n *\n * @example\n * ```tsx\n * const props: FlowPayWithExchangeWidgetContentProps = {\n * flowId: 'flow_123',\n * resumesWaitingExchange: true,\n * };\n * ```\n * @see FlowPayWithExchangeWidgetContent\n * @see FlowPayWithExchangeWidgetProps\n */\nexport type FlowPayWithExchangeWidgetContentProps = {\n /** The flow the customer is paying for. */\n flowId: string;\n /** Fires when Back is pressed on the exchange list; without it the list has no Back. */\n onBack?: () => void;\n /** Whether a payment waiting on an exchange reopens on it; otherwise the list shows. */\n resumesWaitingExchange: boolean;\n};\n\n/**\n * Renders the pay-with-exchange widget for one flow, first finding the\n * exchange a reopened payment waits on so the payer returns to it, unless\n * told to start on the exchange list.\n *\n * @example\n * ```tsx\n * <FlowPayWithExchangeWidgetContent\n * key={flowId}\n * flowId={flowId}\n * resumesWaitingExchange\n * />\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onBack - Fires when Back is pressed on the exchange list.\n * @param params.resumesWaitingExchange - Whether a waiting payment reopens on its exchange.\n * @returns A loader while the exchange is found, a retry if that fails, then the widget's screens.\n * @see FlowPayWithExchangeWidget\n * @see useResumedFlowExchange\n * @notInstrumented\n */\nexport const FlowPayWithExchangeWidgetContent: FC<\n FlowPayWithExchangeWidgetContentProps\n> = ({ flowId, onBack, resumesWaitingExchange }) => {\n const { isResolving, isRetrying, resumedExchange, retryLoadExchanges } =\n useResumedFlowExchange({ flowId });\n\n // A payer who left an exchange and chose this method again picks anew.\n if (!resumesWaitingExchange) {\n return (\n <FlowPayWithExchangeWidgetScreen\n flowId={flowId}\n onBack={onBack}\n resumedExchange={undefined}\n />\n );\n }\n\n if (retryLoadExchanges) {\n return (\n <FlowLoadError isRetrying={isRetrying} onRetry={retryLoadExchanges} />\n );\n }\n\n // The screens start from the resumed exchange once, so they wait for it.\n if (isResolving) {\n return <FlowLoadingView />;\n }\n\n return (\n <FlowPayWithExchangeWidgetScreen\n flowId={flowId}\n onBack={onBack}\n resumedExchange={resumedExchange}\n />\n );\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { PanelHost } from '../../../components/PanelHost';\nimport { FlowOutcomeBoundary } from '../FlowOutcomeBoundary';\nimport type { FlowOutcomeCallbacks } from '../FlowOutcomeBoundary/FlowOutcomeBoundary.types';\nimport { FlowPayWithExchangeWidgetContent } from './FlowPayWithExchangeWidgetContent';\n\n/**\n * Props for {@link FlowPayWithExchangeWidget}.\n *\n * @example\n * ```tsx\n * const props: FlowPayWithExchangeWidgetProps = {\n * flowId: 'flow_123',\n * onPaymentCompleted: (flow) => console.log(flow.id),\n * };\n * ```\n * @see FlowPayWithExchangeWidget\n * @see FlowExchangeView\n */\nexport type FlowPayWithExchangeWidgetProps = FlowOutcomeCallbacks & {\n className?: string;\n /** The flow the customer is paying for — fetched and polled by id. */\n flowId: string;\n /**\n * Leaves the exchange list as its Back — e.g. to return to a payment\n * method choice. Without it, the list has no Back.\n */\n onBack?: () => void;\n};\n\n/**\n * The pay-with-exchange widget: shows a loader while the payment loads, or an\n * error with a retry when it can't load, then lets the payer pick an exchange,\n * open it in a new tab to buy the payment amount, and waits until the exchange\n * confirms the purchase. Back after opening the exchange asks the payer to\n * confirm first, since a purchase there may still land. It lands on\n * payment-complete, payment-failed, payment-refunded, payment-cancelled or\n * expired as the flow's own state decides — also when the link is reopened or\n * reloaded while waiting. Fires `onPaymentCompleted` or `onPaymentFailed` once\n * per mount.\n *\n * Stands alone — it needs only a `flowId`.\n *\n * @example\n * ```tsx\n * import { FlowPayWithExchangeWidget } from '@/flow/widgets/FlowPayWithExchangeWidget/FlowPayWithExchangeWidget';\n *\n * const App = () => (\n * <FlowPayWithExchangeWidget\n * flowId=\"flow_123\"\n * onPaymentCompleted={(flow) => console.log(flow.id)}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onBack - Leaves the exchange list.\n * @param params.onPaymentCompleted - Fires once per mount with the settled flow when the payment completes, including one already paid when opened.\n * @param params.onPaymentFailed - Fires once per mount with the flow when it expires, is cancelled or fails.\n * @returns The pay-with-exchange orchestration.\n * @see FlowPayWithExchangeWidgetProps\n * @see useFlowPayWithExchangeWidget\n * @see FlowDepositAddressWidget\n * @see PanelHost\n * @notInstrumented\n */\nexport const FlowPayWithExchangeWidget: FC<FlowPayWithExchangeWidgetProps> = ({\n className,\n flowId,\n onBack,\n onPaymentCompleted,\n onPaymentFailed,\n}) => (\n // The root sits outside the boundary so the host's class also applies while\n // the flow loads or fails to load.\n <div className={className} data-slot=\"dyn-flow-pay-with-exchange-widget\">\n {/* One card for every screen, including loading and the outcome. */}\n <PanelHost>\n {/* Keyed by flow so a new flowId starts a fresh payment. */}\n <FlowOutcomeBoundary\n flowId={flowId}\n key={flowId}\n onPaymentCompleted={onPaymentCompleted}\n onPaymentFailed={onPaymentFailed}\n >\n <FlowPayWithExchangeWidgetContent\n flowId={flowId}\n onBack={onBack}\n resumesWaitingExchange\n />\n </FlowOutcomeBoundary>\n </PanelHost>\n </div>\n);\n","// jsdoc-completeness-disable @see\n\n/** Number of leading characters kept by {@link truncateWalletAddress}. */\nconst ADDRESS_HEAD = 6;\n/** Number of trailing characters kept by {@link truncateWalletAddress}. */\nconst ADDRESS_TAIL = 4;\n\n/**\n * Params for {@link truncateWalletAddress}.\n */\nexport type TruncateWalletAddressParams = {\n /** The full address. */\n address: string;\n};\n\n/**\n * Shortens a wallet address for display: the leading characters (the `0x`\n * prefix or the address-family prefix other chains use) and the final four,\n * ellipsis between. Addresses at or under head + tail are returned whole —\n * truncating them would hide real characters.\n *\n * @example\n * ```ts\n * truncateWalletAddress({ address: '0x1eA89D7ef1eeF27CAE83c96fef207dbEfC0e2d15' }); // '0x1eA8…2d15'\n * ```\n * @param params.address - The full address.\n * @returns The truncated address.\n * @notInstrumented\n */\nexport const truncateWalletAddress = ({\n address,\n}: TruncateWalletAddressParams): string => {\n if (address.length <= ADDRESS_HEAD + ADDRESS_TAIL) return address;\n\n return `${address.slice(0, ADDRESS_HEAD)}…${address.slice(-ADDRESS_TAIL)}`;\n};\n","/**\n * Default text for {@link FlowChooseTokenView}.\n */\nexport const FLOW_CHOOSE_TOKEN_VIEW_TEXT = {\n changeWallet: 'Change',\n /** Status shown below the panel while the picked token is quoted; an ellipsis is added. */\n processingTokenSelection: 'Getting quote',\n /** Inline error shown when the last token pick failed upstream. */\n selectionError: 'Payment cannot be completed with the selected token. Try another one.',\n title: 'Choose a token',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-choose-token-view': typeof FLOW_CHOOSE_TOKEN_VIEW_TEXT;\n }\n}\n","import type { WalletAccount } from '@dynamic-labs-sdk/client';\nimport {\n useGetNetworksData,\n useGetWalletProviderDataByKey,\n} from '@dynamic-labs-sdk/react-hooks';\nimport { useMemo } from 'react';\n\n/**\n * Params for {@link useFlowChooseTokenView}, mirroring the props the view\n * exposes.\n *\n * @example\n * ```tsx\n * const params: UseFlowChooseTokenViewParams = { walletAccount };\n * ```\n * @see useFlowChooseTokenView\n * @see useGetNetworksData\n */\nexport type UseFlowChooseTokenViewParams = {\n /** The wallet account whose chain scopes the enabled networks. */\n walletAccount: WalletAccount;\n};\n\n/**\n * What {@link useFlowChooseTokenView} hands the view to render: the networks\n * {@link WalletAccountBalances} should query, and their badge icons.\n */\nexport type UseFlowChooseTokenViewResult = {\n /** Icon URLs keyed by network id, for each row's mark badge. */\n networkIcons: Record<string, string>;\n /** Enabled network ids on the account's chain. */\n networkIds: number[];\n /** Icon URL of the account's wallet provider, once the registry resolves it. */\n walletIconUrl: string | undefined;\n};\n\ntype ResolvedNetworks = Pick<\n UseFlowChooseTokenViewResult,\n 'networkIcons' | 'networkIds'\n>;\n\n/**\n * Resolves the environment's enabled networks on the wallet account's chain\n * into the `networkIds` and `networkIcons` props of\n * {@link WalletAccountBalances}, reading {@link useGetNetworksData}, which\n * re-renders when project settings change. Networks whose id is not numeric\n * are skipped, since the balances API only accepts numeric ids.\n *\n * @example\n * ```tsx\n * const { networkIcons, networkIds } = useFlowChooseTokenView({ walletAccount });\n * ```\n * @param params.walletAccount - The wallet account whose chain scopes the enabled networks.\n * @returns The enabled network ids and their badge icons.\n * @see UseFlowChooseTokenViewParams\n * @see useGetNetworksData\n * @see useGetWalletProviderDataByKey\n * @notInstrumented\n */\nexport const useFlowChooseTokenView = ({\n walletAccount,\n}: UseFlowChooseTokenViewParams): UseFlowChooseTokenViewResult => {\n const { data: networks } = useGetNetworksData();\n\n const resolved = useMemo<ResolvedNetworks>(() => {\n const networkIcons: Record<string, string> = {};\n const networkIds: number[] = [];\n for (const network of networks ?? []) {\n if (network.chain !== walletAccount.chain) {\n continue;\n }\n const networkId = Number(network.networkId);\n if (!Number.isFinite(networkId)) {\n continue;\n }\n networkIds.push(networkId);\n networkIcons[network.networkId] = network.iconUrl;\n }\n return { networkIcons, networkIds };\n }, [networks, walletAccount.chain]);\n\n const walletProviderResult = useGetWalletProviderDataByKey({\n walletProviderKey: walletAccount.walletProviderKey,\n });\n\n return {\n ...resolved,\n walletIconUrl: walletProviderResult?.data?.metadata.icon,\n };\n};\n","'use client';\n\nimport type { TokenBalance, WalletAccount } from '@dynamic-labs-sdk/client';\nimport type { FC } from 'react';\n\nimport { ProviderIcon } from '../../../components/ProviderIcon';\nimport { useText } from '../../../i18n/useText';\nimport { truncateWalletAddress } from '../../../utils/truncateWalletAddress';\nimport { WalletAccountBalances } from '../../../views/WalletAccountBalances';\nimport { FlowErrorBanner } from '../../components/FlowErrorBanner';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusTray } from '../../components/FlowStatusTray';\nimport { FLOW_CHOOSE_TOKEN_VIEW_TEXT } from './FlowChooseTokenView.text';\nimport { useFlowChooseTokenView } from './useFlowChooseTokenView';\n\n/**\n * Props for {@link FlowChooseTokenView}.\n *\n * @example\n * ```tsx\n * const props: FlowChooseTokenViewProps = {\n * onTokenSelect: (token) => console.log(token.symbol),\n * walletAccount,\n * };\n * ```\n * @see FlowChooseTokenView\n * @see useGetTokenBalances\n */\nexport type FlowChooseTokenViewProps = {\n className?: string;\n /** The picked token is being quoted — shows progress and locks the list, Back and Change. */\n isProcessingTokenSelection?: boolean;\n /** Fires when the Back button is pressed. Omit on a root screen to hide Back. */\n onBack?: () => void;\n /** Fires when the account line's Change action is pressed. Omit to hide it. */\n onChangeWallet?: () => void;\n /** Fires with the chosen token balance when a row is tapped. */\n onTokenSelect?: (token: TokenBalance) => void;\n /** The last token pick failed upstream — shows an inline error above the list. */\n selectionFailed?: boolean;\n /** The wallet account whose balances are offered for payment. */\n walletAccount: WalletAccount;\n};\n\n/**\n * The Flow \"Choose a token\" screen: a {@link Panel} framing the connected\n * account's identity line — provider icon, truncated address, and an optional\n * Change action — above a {@link WalletAccountBalances} list of the tokens\n * the account holds on the environment's enabled networks, resolved from\n * `useGetNetworksData` for the account's chain. Tapping a row fires\n * `onTokenSelect` with the chosen balance.\n *\n * @example\n * ```tsx\n * import { FlowChooseTokenView } from '@/flow/views/FlowChooseTokenView/FlowChooseTokenView';\n *\n * const App = () => (\n * <FlowChooseTokenView\n * onBack={() => history.back()}\n * onTokenSelect={(token) => console.log(token.symbol)}\n * walletAccount={walletAccount}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.isProcessingTokenSelection - Shows progress and locks the list, Back and Change while the picked token is quoted.\n * @param params.onBack - Fires when the Back button is pressed. Omit on a root screen to hide Back.\n * @param params.onChangeWallet - Fires when the account line's Change action is pressed. Omit to hide it.\n * @param params.onTokenSelect - Fires with the chosen token balance when a row is tapped.\n * @param params.selectionFailed - Shows an inline error above the list when the last pick failed.\n * @param params.walletAccount - The wallet account whose balances are offered for payment.\n * @returns The choose-token view.\n * @see FlowChooseTokenViewProps\n * @see useGetTokenBalances\n * @copy title - The centered header title.\n * @copy changeWallet - The account line's switch-wallet action.\n * @copy selectionError - Inline error shown when the last token pick failed.\n * @copy processingTokenSelection - Progress shown while the picked token is quoted.\n * @notInstrumented\n */\nexport const FlowChooseTokenView: FC<FlowChooseTokenViewProps> = ({\n className,\n isProcessingTokenSelection = false,\n onBack,\n onChangeWallet,\n onTokenSelect,\n selectionFailed = false,\n walletAccount,\n}) => {\n const text = useText({\n defaults: FLOW_CHOOSE_TOKEN_VIEW_TEXT,\n slot: 'dyn-flow-choose-token-view',\n });\n const resolvedTitle = text('title');\n\n const { networkIcons, networkIds, walletIconUrl } = useFlowChooseTokenView({\n walletAccount,\n });\n\n const { address } = walletAccount;\n\n return (\n <FlowStatusTray\n className={className}\n status={\n isProcessingTokenSelection\n ? text('processingTokenSelection')\n : undefined\n }\n >\n <Panel\n onBack={isProcessingTokenSelection ? undefined : onBack}\n title={resolvedTitle}\n >\n <div\n aria-busy={isProcessingTokenSelection}\n data-slot=\"dyn-flow-choose-token-view\"\n >\n {selectionFailed && (\n <FlowErrorBanner message={text('selectionError')} />\n )}\n <div data-slot=\"dyn-flow-choose-token-view-account\">\n <ProviderIcon\n name={walletAccount.walletProviderKey}\n url={walletIconUrl}\n />\n <span\n data-slot=\"dyn-flow-choose-token-view-address\"\n title={address}\n >\n {truncateWalletAddress({ address })}\n </span>\n {onChangeWallet !== undefined && !isProcessingTokenSelection && (\n <button\n data-slot=\"dyn-flow-choose-token-view-change\"\n onClick={onChangeWallet}\n type=\"button\"\n >\n {text('changeWallet')}\n </button>\n )}\n </div>\n {/* A disabled fieldset disables every token row button at once. */}\n <fieldset\n data-slot=\"dyn-flow-choose-token-view-balances\"\n disabled={isProcessingTokenSelection}\n >\n <WalletAccountBalances\n networkIcons={networkIcons}\n networkIds={networkIds}\n onTokenSelect={onTokenSelect}\n walletAccount={walletAccount}\n />\n </fieldset>\n </div>\n </Panel>\n </FlowStatusTray>\n );\n};\n","'use client';\n\nimport type { FC } from 'react';\nimport type { TokenBalance, WalletAccount } from '@dynamic-labs-sdk/client';\n\nimport { FlowChooseTokenView } from '../../../../views/FlowChooseTokenView';\n\n/**\n * Props for {@link ChooseTokenRouteView}.\n *\n * @example\n * ```tsx\n * const props: ChooseTokenRouteViewProps = {\n * goBack,\n * isProcessingTokenSelection: false,\n * onSelectToken,\n * tokenSelectionFailed: false,\n * walletAccount,\n * };\n * ```\n * @see ChooseTokenRouteView\n */\nexport type ChooseTokenRouteViewProps = {\n /** Returns to the wallet connection; `undefined` when there is no way back. */\n goBack: (() => void) | undefined;\n /** Whether the picked token is still being quoted — locks the list and shows progress. */\n isProcessingTokenSelection: boolean;\n /** Picks the token to pay with; attaches the source and fetches the quote. */\n onSelectToken: (token: TokenBalance) => void;\n /** Whether the last token pick failed — shows the inline error banner. */\n tokenSelectionFailed: boolean;\n /** The connected wallet account whose balances are offered. */\n walletAccount: WalletAccount;\n};\n\n/**\n * The choose-token route's screen: {@link FlowChooseTokenView} fed by the\n * connected wallet account the route entry carries — Back and the account\n * line's Change action both return to the wallet connection.\n *\n * @param params.goBack - Returns to the wallet connection.\n * @param params.isProcessingTokenSelection - Locks the list and shows progress while the picked token is quoted.\n * @param params.onSelectToken - Picks the token to pay with; attaches the source and fetches the quote.\n * @param params.tokenSelectionFailed - Shows the inline error banner when the last pick failed.\n * @param params.walletAccount - The connected wallet account whose balances are offered.\n * @returns The choose-token screen.\n * @example\n * ```tsx\n * <ChooseTokenRouteView\n * goBack={goBack}\n * isProcessingTokenSelection={false}\n * onSelectToken={onSelectToken}\n * tokenSelectionFailed={false}\n * walletAccount={walletAccount}\n * />\n * ```\n * @see FlowChooseTokenView\n * @see ChooseTokenRoute\n * @notInstrumented\n */\nexport const ChooseTokenRouteView: FC<ChooseTokenRouteViewProps> = ({\n goBack,\n isProcessingTokenSelection,\n onSelectToken,\n tokenSelectionFailed,\n walletAccount,\n}) => (\n <FlowChooseTokenView\n isProcessingTokenSelection={isProcessingTokenSelection}\n onBack={goBack}\n onChangeWallet={goBack}\n onTokenSelect={onSelectToken}\n selectionFailed={tokenSelectionFailed}\n walletAccount={walletAccount}\n />\n);\n","import type { WalletAccount } from '@dynamic-labs-sdk/client';\n\nimport type { FlowPayWithWalletRouteModule } from '../flowPayWithWalletRoutes.types';\nimport { ChooseTokenRouteView } from './ChooseTokenRouteView';\n\n/**\n * The choose-token route entry: carries the wallet account whose balances are\n * offered for payment.\n */\nexport type ChooseTokenRoute = {\n name: 'choose-token';\n params: { walletAccount: WalletAccount };\n};\n\n/**\n * The choose-token route of {@link FlowPayWithWalletWidget}: the token pick\n * between connecting and reviewing. Retained in history so Back from the\n * review lands back on it.\n *\n * @see FlowPayWithWalletRouteModule\n * @see flowPayWithWalletRoutes\n * @see ChooseTokenRouteView\n */\nexport const chooseTokenRoute: FlowPayWithWalletRouteModule<ChooseTokenRoute> =\n {\n render: ({ route, widget }) => (\n <ChooseTokenRouteView\n goBack={widget.goBack}\n isProcessingTokenSelection={widget.isProcessingTokenSelection}\n onSelectToken={widget.handleSelectedToken}\n tokenSelectionFailed={widget.tokenSelectionFailed}\n walletAccount={route.params.walletAccount}\n />\n ),\n retainInHistory: true,\n };\n","/**\n * Default text for {@link FlowWalletAttachErrorBanner}.\n */\nexport const FLOW_WALLET_ATTACH_ERROR_BANNER_TEXT = {\n /** Inline error when the connected wallet could not be attached for another reason; the wallet list is shown again below it. */\n attachError:\n \"This wallet couldn't be connected to the payment. Try connecting it again.\",\n /** Inline error when the connected wallet failed the sanctions check and can't be used for this payment. */\n walletBlockedError:\n \"This wallet didn't pass the sanctions check, so it can't be used for this payment. Connect a different wallet.\",\n};\n\ndeclare module '../../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-wallet-attach-error-banner': typeof FLOW_WALLET_ATTACH_ERROR_BANNER_TEXT;\n }\n}\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { useText } from '../../../../i18n/useText';\nimport { FlowErrorBanner } from '../../../components/FlowErrorBanner';\nimport type { WalletAttachErrorType } from '../../../utils/getWalletAttachErrorType';\nimport { FLOW_WALLET_ATTACH_ERROR_BANNER_TEXT } from './FlowWalletAttachErrorBanner.text';\n\n/**\n * Props for {@link FlowWalletAttachErrorBanner}.\n *\n * @example\n * ```tsx\n * const props: FlowWalletAttachErrorBannerProps = { attachError: 'wallet-blocked' };\n * ```\n * @see FlowWalletAttachErrorBanner\n */\nexport type FlowWalletAttachErrorBannerProps = {\n /** The kind of the last failure to attach the connected wallet. */\n attachError: WalletAttachErrorType | undefined;\n className?: string;\n};\n\n/**\n * The inline error {@link FlowWalletConnectionView} shows when the connected\n * wallet could not be attached: a wallet that failed the sanctions check asks\n * for a different one, any other failure asks the payer to connect again.\n * Either way the wallet list is back below it. Renders nothing without a\n * failure.\n *\n * @example\n * ```tsx\n * <FlowWalletAttachErrorBanner attachError=\"generic\" />\n * ```\n * @param params.attachError - The kind of the last attach failure.\n * @param params.className - Extra class names for the banner.\n * @returns The inline error, or nothing.\n * @see FlowWalletConnectionView\n * @see FlowErrorBanner\n * @copy attachError - Inline error when the connected wallet could not be attached for another reason.\n * @copy walletBlockedError - Inline error when the connected wallet failed the sanctions check and can't be used for this payment.\n * @notInstrumented\n */\nexport const FlowWalletAttachErrorBanner: FC<\n FlowWalletAttachErrorBannerProps\n> = ({ attachError, className }) => {\n const text = useText({\n defaults: FLOW_WALLET_ATTACH_ERROR_BANNER_TEXT,\n slot: 'dyn-flow-wallet-attach-error-banner',\n });\n\n if (attachError === undefined) {\n return null;\n }\n if (attachError === 'wallet-blocked') {\n return (\n <FlowErrorBanner\n className={className}\n message={text('walletBlockedError')}\n />\n );\n }\n return (\n <FlowErrorBanner className={className} message={text('attachError')} />\n );\n};\n","import type { CONNECT_WALLET_WIDGET_TEXT } from '../../../widgets/ConnectWalletOptionWidget/ConnectWalletOptionWidget.text';\n\n/**\n * Default text for {@link FlowWalletConnectionView}'s own status line, shown\n * while the connected wallet is attached to the payment.\n */\nexport const FLOW_WALLET_CONNECTION_VIEW_TEXT = {\n /** Status shown below the panel while the connected wallet is checked; an ellipsis is added. */\n attachingStatus: 'Checking wallet',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-wallet-connection-view': typeof FLOW_WALLET_CONNECTION_VIEW_TEXT;\n }\n}\n\n/**\n * The `dyn-connect-wallet-option-widget` copy {@link FlowWalletConnectionView}\n * applies through `TextProvider`: Flow screens keep the status lines short so\n * they sit inside the panel's narrow body — and the Flow flavor of the\n * connecting line drops the trailing \"to continue\". Not a `_TEXT` dictionary:\n * it fills the connect widget's slot, whose copy docs live on that widget.\n */\nexport const FLOW_WALLET_CONNECTION_VIEW_WIDGET_COPY: Partial<\n typeof CONNECT_WALLET_WIDGET_TEXT\n> = {\n /** Confirmation line once the wallet account connects. */\n connectedStatusMessage: 'Connected',\n /**\n * Waiting line while the wallet holds the approval; `{wallet}` is\n * replaced by the wallet's display name.\n */\n connectingStatusMessage: 'Approve the connection in {wallet}',\n};\n","'use client';\n\nimport { type FC, useContext } from 'react';\n\nimport { TextContext } from '../../../i18n/TextProvider/TextProvider';\nimport { TextProvider } from '../../../i18n/TextProvider';\nimport { useText } from '../../../i18n/useText';\nimport { ConnectWalletOptionWidget } from '../../../widgets/ConnectWalletOptionWidget';\nimport type { ConnectWalletOptionConnectedParams } from '../../../widgets/ConnectWalletOptionWidget/useConnectWalletOptionWidget';\nimport { FlowStatusTray } from '../../components/FlowStatusTray';\nimport type { WalletAttachErrorType } from '../../utils/getWalletAttachErrorType';\nimport { FlowWalletAttachErrorBanner } from './FlowWalletAttachErrorBanner';\nimport {\n FLOW_WALLET_CONNECTION_VIEW_TEXT,\n FLOW_WALLET_CONNECTION_VIEW_WIDGET_COPY,\n} from './FlowWalletConnectionView.text';\n\n/**\n * Props for {@link FlowWalletConnectionView}.\n *\n * @example\n * ```tsx\n * const props: FlowWalletConnectionViewProps = {\n * onConnected: ({ walletAccount }) => console.log(walletAccount.address),\n * };\n * ```\n * @see FlowWalletConnectionView\n * @see ConnectWalletOptionWidget\n */\nexport type FlowWalletConnectionViewProps = {\n /** The kind of the last failure to attach the connected wallet; shows the matching inline error. */\n attachError?: WalletAttachErrorType;\n className?: string;\n /** Whether the connected wallet is being attached to the payment; shows progress below the panel. */\n isAttaching?: boolean;\n /** Leaves the screen from the wallet list; shows Back there when set. Later connection steps keep their own Back. */\n onBack?: () => void;\n /** Fires with the connected, unverified wallet account on success, and a way to start over. */\n onConnected?: (params: ConnectWalletOptionConnectedParams) => void;\n /** Fires when the customer picks a wallet from the list; the host clears a shown attach error here. */\n onSelectWalletOption?: () => void;\n};\n\n/**\n * The wallet connection screen as a Flow step: {@link ConnectWalletOptionWidget}'s\n * route-driven orchestration, which renders inside its own panel. While the\n * connected wallet is attached to the payment, progress shows below the\n * panel; a failed attach shows {@link FlowWalletAttachErrorBanner} above the\n * screen. The view also shortens the connect widget's `connectedStatusMessage`\n * (\"Connected\") and `connectingStatusMessage` (\"Approve the connection in\n * {wallet}\"); override those in the `dyn-connect-wallet-option-widget` slot.\n *\n * @example\n * ```tsx\n * import { FlowWalletConnectionView } from '@/flow/views/FlowWalletConnectionView/FlowWalletConnectionView';\n *\n * const App = () => (\n * <FlowWalletConnectionView\n * onConnected={({ walletAccount }) => console.log(walletAccount.address)}\n * />\n * );\n * ```\n * @param params.attachError - The kind of the last failure to attach the connected wallet.\n * @param params.className - Extra class names for the root element.\n * @param params.isAttaching - Whether the connected wallet is being attached.\n * @param params.onBack - Leaves the screen from the wallet list.\n * @param params.onConnected - Fires with the connected account on success, and a way to start over.\n * @param params.onSelectWalletOption - Fires when the customer picks a wallet from the list.\n * @returns The wallet connection Flow screen.\n * @see FlowWalletConnectionViewProps\n * @see ConnectWalletOptionWidget\n * @copy attachingStatus - Status shown below the panel while the connected wallet is checked.\n * @notInstrumented\n */\nexport const FlowWalletConnectionView: FC<FlowWalletConnectionViewProps> = ({\n attachError,\n className,\n isAttaching = false,\n onBack,\n onConnected,\n onSelectWalletOption,\n}) => {\n const inheritedText = useContext(TextContext);\n const text = useText({\n defaults: FLOW_WALLET_CONNECTION_VIEW_TEXT,\n slot: 'dyn-flow-wallet-connection-view',\n });\n\n return (\n <FlowStatusTray\n className={className}\n status={isAttaching ? text('attachingStatus') : undefined}\n >\n <div aria-busy={isAttaching} data-slot=\"dyn-flow-wallet-connection-view\">\n <TextProvider\n text={{\n 'dyn-connect-wallet-option-widget': {\n ...FLOW_WALLET_CONNECTION_VIEW_WIDGET_COPY,\n ...inheritedText['dyn-connect-wallet-option-widget'],\n },\n }}\n >\n <ConnectWalletOptionWidget\n onBack={onBack}\n onConnected={onConnected}\n onSelectWalletOption={onSelectWalletOption}\n >\n <FlowWalletAttachErrorBanner attachError={attachError} />\n </ConnectWalletOptionWidget>\n </TextProvider>\n </div>\n </FlowStatusTray>\n );\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport type { WalletAttachErrorType } from '../../../../utils/getWalletAttachErrorType';\nimport { FlowWalletConnectionView } from '../../../../views/FlowWalletConnectionView';\nimport type { ConnectWalletOptionConnectedParams } from '../../../../../widgets/ConnectWalletOptionWidget/useConnectWalletOptionWidget';\n\n/**\n * Props for {@link ConnectWalletRouteView}.\n *\n * @example\n * ```tsx\n * const props: ConnectWalletRouteViewProps = {\n * attachError: undefined,\n * isAttaching: false,\n * onBack: undefined,\n * onConnectWalletAccount,\n * onSelectWalletOption,\n * };\n * ```\n * @see ConnectWalletRouteView\n */\nexport type ConnectWalletRouteViewProps = {\n /** The kind of the last failure to attach the connected wallet. */\n attachError: WalletAttachErrorType | undefined;\n /** Whether the connected wallet is being attached. */\n isAttaching: boolean;\n /** Leaves the rail from the wallet list; `undefined` shows no Back there. */\n onBack: (() => void) | undefined;\n /** Attaches the connected account, then advances past wallet connection; a failure starts the connection over. */\n onConnectWalletAccount: (params: ConnectWalletOptionConnectedParams) => void;\n /** Clears the last attach failure once another wallet is picked. */\n onSelectWalletOption: () => void;\n};\n\n/**\n * The connect-wallet route's screen: {@link FlowWalletConnectionView}, whose\n * `onConnected` attaches the wallet before advancing to the token pick. A\n * failed attach starts the connection over, so the wallet list is back and\n * another wallet can be connected.\n *\n * @param params.attachError - The kind of the last attach failure.\n * @param params.isAttaching - Whether the connected wallet is being attached.\n * @param params.onBack - Leaves the rail from the wallet list.\n * @param params.onConnectWalletAccount - Attaches the connected account, then advances.\n * @param params.onSelectWalletOption - Clears the last attach failure once another wallet is picked.\n * @returns The wallet connection screen.\n * @example\n * ```tsx\n * <ConnectWalletRouteView\n * attachError={undefined}\n * isAttaching={false}\n * onBack={undefined}\n * onConnectWalletAccount={onConnectWalletAccount}\n * onSelectWalletOption={onSelectWalletOption}\n * />\n * ```\n * @see FlowWalletConnectionView\n * @see ConnectWalletRoute\n * @notInstrumented\n */\nexport const ConnectWalletRouteView: FC<ConnectWalletRouteViewProps> = ({\n attachError,\n isAttaching,\n onBack,\n onConnectWalletAccount,\n onSelectWalletOption,\n}) => (\n <FlowWalletConnectionView\n attachError={attachError}\n isAttaching={isAttaching}\n onBack={onBack}\n onConnected={onConnectWalletAccount}\n onSelectWalletOption={onSelectWalletOption}\n />\n);\n","import type { FlowPayWithWalletRouteModule } from '../flowPayWithWalletRoutes.types';\nimport { ConnectWalletRouteView } from './ConnectWalletRouteView';\n\n/**\n * The connect-wallet route entry: no wallet is in play yet, so the entry declares no params.\n */\nexport type ConnectWalletRoute = {\n name: 'connect-wallet';\n};\n\n/**\n * The connect-wallet route of {@link FlowPayWithWalletWidget}: the screen the\n * payment opens on and the back target later steps return to — its\n * `retainInHistory` flag is what lets routes leaving it push onto the stack.\n *\n * @see FlowPayWithWalletRouteModule\n * @see flowPayWithWalletRoutes\n * @see ConnectWalletRouteView\n */\nexport const connectWalletRoute: FlowPayWithWalletRouteModule<ConnectWalletRoute> =\n {\n render: ({ widget }) => (\n <ConnectWalletRouteView\n attachError={widget.attachError}\n isAttaching={widget.isAttachingWallet}\n onBack={widget.goBack}\n onConnectWalletAccount={widget.handleConnectedWallet}\n onSelectWalletOption={widget.clearAttachError}\n />\n ),\n retainInHistory: true,\n };\n","import { FLOW_SUBMIT_ERROR_DEFAULT_TEXT } from '../../constants';\n\n/**\n * Default text for {@link FlowPaymentNotApproved}.\n */\nexport const FLOW_PAYMENT_NOT_APPROVED_TEXT = {\n /** Live-region announcement read out when the screen arrives. */\n announcement: 'Payment not approved. Nothing was sent.',\n /**\n * Reason line under the heading; `{wallet}` is replaced by the wallet's\n * display name, or `fallbackWallet` when none is known.\n */\n declinedMessage: 'The request was declined in {wallet}.',\n /** The `{wallet}` replacement when no wallet name is passed. */\n fallbackWallet: 'your wallet',\n /** The boldest line — the decline can never read as money lost. */\n nothingWasSent: 'Nothing was sent',\n /** Secondary action leaving the wallet rail for another method. */\n payAnotherWay: 'Pay another way',\n /** Inline error when a retry failed on an expired quote. */\n retryErrorExpiredQuote: 'The quote has expired. Try again to get a new one.',\n /** Inline error when a retry failed because the wallet can't cover network fees. */\n retryErrorGasBalance: FLOW_SUBMIT_ERROR_DEFAULT_TEXT.gasBalance,\n /** Inline error when a retry failed for any other reason. */\n retryErrorGeneric: FLOW_SUBMIT_ERROR_DEFAULT_TEXT.generic,\n /** Inline error when a retry failed because the wallet can't cover the payment amount. */\n retryErrorTransferBalance: FLOW_SUBMIT_ERROR_DEFAULT_TEXT.transferBalance,\n /** Status shown below the panel while a retry runs; an ellipsis is added. */\n retrying: 'Trying again',\n /** The centered header title. */\n title: 'Payment not approved',\n /** Primary action re-running the authorize step. */\n tryAgain: 'Try again',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-payment-not-approved': typeof FLOW_PAYMENT_NOT_APPROVED_TEXT;\n }\n}\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { Button } from '../../../components/Button';\nimport { interpolateText } from '../../../i18n/interpolateText';\nimport { useText } from '../../../i18n/useText';\nimport { FlowErrorBanner } from '../../components/FlowErrorBanner';\nimport { Panel } from '../../../components/Panel';\nimport { FlowStatusHero } from '../../components/FlowStatusHero';\nimport { FlowStatusTray } from '../../components/FlowStatusTray';\nimport type { SubmitTransactionErrorType } from '../../utils/getSubmitTransactionErrorType';\nimport { FLOW_PAYMENT_NOT_APPROVED_TEXT } from './FlowPaymentNotApproved.text';\n\n/**\n * Props for {@link FlowPaymentNotApproved}.\n *\n * @example\n * ```tsx\n * const props: FlowPaymentNotApprovedProps = {\n * onRetry: () => authorize(),\n * onPayAnotherWay: () => goToMethods(),\n * walletName: 'MetaMask',\n * };\n * ```\n * @see FlowPaymentNotApproved\n * @see Panel\n */\nexport type FlowPaymentNotApprovedProps = {\n className?: string;\n /** A retry is running — shows progress and locks both actions. */\n isRetrying?: boolean;\n /** Fires when the Back button is pressed. Omit on a root screen to hide Back. */\n onBack?: () => void;\n /** Fires on the secondary action — leave the wallet rail for another payment method. */\n onPayAnotherWay?: () => void;\n /** Fires on the primary action — re-run the authorize step. */\n onRetry?: () => void;\n /** The type of the last retry's failure — shows the matching inline error. */\n retryErrorType?: SubmitTransactionErrorType;\n /**\n * Display name of the wallet that declined; when set the reason line names\n * it (\"The request was declined in MetaMask.\"), otherwise it falls back to\n * \"your wallet\".\n */\n walletName?: string;\n};\n\n/** The message copy key each retry failure kind reports with. */\nconst RETRY_ERROR_TEXT_KEY = {\n generic: 'retryErrorGeneric',\n 'insufficient-gas-balance': 'retryErrorGasBalance',\n 'insufficient-transfer-balance': 'retryErrorTransferBalance',\n 'quote-expired': 'retryErrorExpiredQuote',\n} as const satisfies Record<\n SubmitTransactionErrorType,\n keyof typeof FLOW_PAYMENT_NOT_APPROVED_TEXT\n>;\n\n/**\n * The Flow \"Payment not approved\" screen: the wallet-side decline state. The\n * one fact that matters is stated boldest — nothing was sent, because a\n * decline in the wallet must never read as money lost. Two exits, in spec\n * order: Try again (re-runs the authorize step) and Pay another way.\n *\n * @example\n * ```tsx\n * import { FlowPaymentNotApproved } from '@/flow/views/FlowPaymentNotApproved/FlowPaymentNotApproved';\n *\n * const App = () => (\n * <FlowPaymentNotApproved\n * onPayAnotherWay={() => goToMethods()}\n * onRetry={() => authorize()}\n * walletName=\"MetaMask\"\n * />\n * );\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.isRetrying - Shows progress and locks both actions while a retry runs.\n * @param params.onBack - Fires when the Back button is pressed. Omit on a root screen to hide Back.\n * @param params.onPayAnotherWay - Fires on the secondary action.\n * @param params.onRetry - Fires on the primary action.\n * @param params.retryErrorType - Shows the inline error for the last retry's failure.\n * @param params.walletName - Display name of the wallet that declined the request.\n * @returns The payment-not-approved view.\n * @see FlowPaymentNotApprovedProps\n * @see Button\n * @copy announcement - The live-region line announced when the screen arrives.\n * @copy declinedMessage - The reason line; `{wallet}` is replaced by the wallet's display name or the fallback.\n * @copy fallbackWallet - The `{wallet}` replacement when no wallet name is passed.\n * @copy nothingWasSent - The boldest line — a decline never reads as money lost.\n * @copy payAnotherWay - The secondary action's label.\n * @copy retryErrorExpiredQuote - Inline error when a retry failed on an expired quote.\n * @copy retryErrorGasBalance - Inline error when a retry failed on network fees.\n * @copy retryErrorGeneric - Inline error when a retry failed for any other reason.\n * @copy retryErrorTransferBalance - Inline error when a retry failed on the payment amount.\n * @copy retrying - The status shown below the panel while a retry runs.\n * @copy title - The centered header title.\n * @copy tryAgain - The primary action's label.\n * @notInstrumented\n */\nexport const FlowPaymentNotApproved: FC<FlowPaymentNotApprovedProps> = ({\n className,\n isRetrying = false,\n onBack,\n onPayAnotherWay,\n onRetry,\n retryErrorType,\n walletName,\n}) => {\n const text = useText({\n defaults: FLOW_PAYMENT_NOT_APPROVED_TEXT,\n slot: 'dyn-flow-payment-not-approved',\n });\n\n const declinedMessage = interpolateText({\n template: text('declinedMessage'),\n token: '{wallet}',\n value: walletName ?? text('fallbackWallet'),\n });\n\n return (\n <FlowStatusTray\n className={className}\n status={isRetrying ? text('retrying') : undefined}\n >\n <Panel onBack={isRetrying ? undefined : onBack} title={text('title')}>\n <div aria-busy={isRetrying} data-slot=\"dyn-flow-payment-not-approved\">\n {/* Announced on arrival; the mark alone carries no meaning. */}\n <span\n aria-live=\"polite\"\n data-slot=\"dyn-flow-payment-not-approved-announce\"\n role=\"status\"\n >\n {text('announcement')}\n </span>\n <FlowStatusHero\n description={declinedMessage}\n heading={text('nothingWasSent')}\n variant=\"danger\"\n />\n {retryErrorType !== undefined && (\n <FlowErrorBanner\n message={text(RETRY_ERROR_TEXT_KEY[retryErrorType])}\n />\n )}\n <div data-slot=\"dyn-flow-payment-not-approved-actions\">\n {onRetry !== undefined && (\n <Button disabled={isRetrying} onClick={onRetry}>\n {text('tryAgain')}\n </Button>\n )}\n {onPayAnotherWay !== undefined && (\n <Button\n disabled={isRetrying}\n onClick={onPayAnotherWay}\n variant=\"secondary\"\n >\n {text('payAnotherWay')}\n </Button>\n )}\n </div>\n </div>\n </Panel>\n </FlowStatusTray>\n );\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport type { SubmitTransactionErrorType } from '../../../../utils/getSubmitTransactionErrorType';\nimport { FlowPaymentNotApproved } from '../../../../views/FlowPaymentNotApproved';\n\n/**\n * Props for {@link PaymentNotApprovedRouteView}.\n *\n * @example\n * ```tsx\n * const props: PaymentNotApprovedRouteViewProps = {\n * isRetrying: false,\n * onPayAnotherWay: undefined,\n * onRetry,\n * retryErrorType: undefined,\n * walletName: 'MetaMask',\n * };\n * ```\n * @see PaymentNotApprovedRouteView\n */\nexport type PaymentNotApprovedRouteViewProps = {\n /** Whether Try again is re-quoting and resubmitting — locks the actions and shows progress. */\n isRetrying: boolean;\n /** Leaves the wallet rail for another payment method; `undefined` hides the option. */\n onPayAnotherWay: (() => void) | undefined;\n /** Gets a fresh quote and submits the payment again. */\n onRetry: () => void;\n /** The type of the last retry's failure, if any — shows the matching inline error. */\n retryErrorType: SubmitTransactionErrorType | undefined;\n /** Display name of the wallet that declined, when known. */\n walletName: string | undefined;\n};\n\n/**\n * The payment-not-approved route's screen: {@link FlowPaymentNotApproved}\n * after the wallet declines or submission fails — Try again gets a fresh\n * quote and submits again, and Pay another way only appears when the widget was given a\n * way out of the wallet rail.\n *\n * @param params.isRetrying - Locks the actions and shows progress while Try again runs.\n * @param params.onPayAnotherWay - Leaves the wallet rail for another payment method; `undefined` hides the option.\n * @param params.onRetry - Gets a fresh quote and submits the payment again.\n * @param params.retryErrorType - Shows the inline error for the last retry's failure.\n * @param params.walletName - Display name of the wallet that declined, when known.\n * @returns The payment-not-approved screen.\n * @example\n * ```tsx\n * <PaymentNotApprovedRouteView\n * isRetrying={false}\n * onPayAnotherWay={onPayAnotherWay}\n * onRetry={onRetry}\n * retryErrorType={undefined}\n * walletName=\"MetaMask\"\n * />\n * ```\n * @see FlowPaymentNotApproved\n * @see PaymentNotApprovedRoute\n * @notInstrumented\n */\nexport const PaymentNotApprovedRouteView: FC<\n PaymentNotApprovedRouteViewProps\n> = ({ isRetrying, onPayAnotherWay, onRetry, retryErrorType, walletName }) => (\n <FlowPaymentNotApproved\n isRetrying={isRetrying}\n onPayAnotherWay={onPayAnotherWay}\n onRetry={onRetry}\n retryErrorType={retryErrorType}\n walletName={walletName}\n />\n);\n","import type { FlowPayWithWalletRouteModule } from '../flowPayWithWalletRoutes.types';\nimport { PaymentNotApprovedRouteView } from './PaymentNotApprovedRouteView';\n\n/**\n * The payment-not-approved route entry: the screen reads the widget's wallet\n * name and callbacks, so the entry carries no params of its own.\n */\nexport type PaymentNotApprovedRoute = {\n name: 'payment-not-approved';\n};\n\n/**\n * The payment-not-approved route of {@link FlowPayWithWalletWidget}: shown\n * only when the payer declines in their wallet. `terminal` hides Back —\n * the exits are the route's own Try again and Pay another way actions.\n *\n * @see FlowPayWithWalletRouteModule\n * @see flowPayWithWalletRoutes\n * @see PaymentNotApprovedRouteView\n */\nexport const paymentNotApprovedRoute: FlowPayWithWalletRouteModule<PaymentNotApprovedRoute> =\n {\n render: ({ widget }) => (\n <PaymentNotApprovedRouteView\n isRetrying={widget.isRetryingPayment}\n onPayAnotherWay={widget.onPayAnotherWay}\n onRetry={widget.retryDeclinedPayment}\n retryErrorType={widget.submitTransactionErrorType}\n walletName={widget.walletName}\n />\n ),\n terminal: true,\n };\n","'use client';\n\nimport type { FC } from 'react';\nimport type { Flow } from '@dynamic-labs-sdk/client';\n\nimport { FlowLoadingView } from '../../../../views/FlowLoadingView';\nimport { FlowProcessingPayment } from '../../../../views/FlowProcessingPayment';\n\n/**\n * Props for {@link PaymentSentRouteView}.\n *\n * @example\n * ```tsx\n * const props: PaymentSentRouteViewProps = { flow };\n * ```\n * @see PaymentSentRouteView\n */\nexport type PaymentSentRouteViewProps = {\n /** The flow whose payment was sent; `undefined` until it loads. */\n flow: Flow | undefined;\n};\n\n/**\n * The payment-sent route's screen: {@link FlowProcessingPayment} fed by the\n * widget's latest flow until the flow itself reports the payment.\n *\n * @param params.flow - The flow whose payment was sent.\n * @returns The payment processing screen.\n * @example\n * ```tsx\n * <PaymentSentRouteView flow={flow} />\n * ```\n * @see FlowProcessingPayment\n * @see PaymentSentRoute\n * @notInstrumented\n */\nexport const PaymentSentRouteView: FC<PaymentSentRouteViewProps> = ({ flow }) =>\n flow === undefined ? (\n <FlowLoadingView />\n ) : (\n <FlowProcessingPayment flow={flow} />\n );\n","import type { FlowPayWithWalletRouteModule } from '../flowPayWithWalletRoutes.types';\nimport { PaymentSentRouteView } from './PaymentSentRouteView';\n\n/**\n * The payment-sent route entry: the screen reads the widget's latest flow, so\n * the entry carries no params of its own.\n */\nexport type PaymentSentRoute = {\n name: 'payment-sent';\n};\n\n/**\n * The payment-sent route of {@link FlowPayWithWalletWidget}: shown once the\n * payer's wallet sent the payment while the flow has not caught up yet, so\n * the payment's progress shows instead of a review the payer could confirm\n * twice. `terminal` locks the way back.\n *\n * @see FlowPayWithWalletRouteModule\n * @see flowPayWithWalletRoutes\n * @see PaymentSentRouteView\n */\nexport const paymentSentRoute: FlowPayWithWalletRouteModule<PaymentSentRoute> =\n {\n render: ({ widget }) => <PaymentSentRouteView flow={widget.flow} />,\n terminal: true,\n };\n","import type { SubmitTransactionErrorType } from '../../utils/getSubmitTransactionErrorType';\nimport type { FLOW_REVIEW_PAYMENT_VIEW_TEXT } from './FlowReviewPaymentView.text';\n\n/** The message copy key each submission failure kind reports with. */\nexport const SUBMIT_ERROR_TEXT_KEY = {\n generic: 'submitErrorGeneric',\n 'insufficient-gas-balance': 'submitErrorGasBalance',\n 'insufficient-transfer-balance': 'submitErrorTransferBalance',\n 'quote-expired': 'submitErrorExpiredQuote',\n} as const satisfies Record<\n SubmitTransactionErrorType,\n keyof typeof FLOW_REVIEW_PAYMENT_VIEW_TEXT\n>;\n\n/** The action label copy key each submission failure kind recovers with. */\nexport const SUBMIT_ERROR_ACTION_TEXT_KEY = {\n generic: 'tryAgain',\n 'insufficient-gas-balance': 'tryAnotherToken',\n 'insufficient-transfer-balance': 'tryAnotherToken',\n 'quote-expired': 'getNewQuote',\n} as const satisfies Record<\n SubmitTransactionErrorType,\n keyof typeof FLOW_REVIEW_PAYMENT_VIEW_TEXT\n>;\n","import { FLOW_SUBMIT_ERROR_DEFAULT_TEXT } from '../../constants';\n\n/** Default copy for {@link FlowReviewPaymentView}. */\nexport const FLOW_REVIEW_PAYMENT_VIEW_TEXT = {\n back: 'Back',\n confirm: 'Confirm payment',\n consent: 'I agree to the {terms}',\n fees: 'Fees',\n /** The inline error's re-quote action for an expired quote. */\n getNewQuote: 'Get a new quote',\n orderTotal: 'Order total',\n /** Countdown at the bottom of the panel; `{time}` is replaced by the time left. */\n quoteExpiresIn: 'Quote expires in {time}',\n /** Shown at the bottom of the panel while a new quote is fetched. */\n requoting: 'Getting a new quote',\n /** Inline error shown when the quote expired. */\n submitErrorExpiredQuote: 'The quote has expired. Get a new one to continue.',\n /** Inline error shown when the wallet can't cover network fees. */\n submitErrorGasBalance: FLOW_SUBMIT_ERROR_DEFAULT_TEXT.gasBalance,\n /** Inline error shown when submission failed for any other reason. */\n submitErrorGeneric: FLOW_SUBMIT_ERROR_DEFAULT_TEXT.generic,\n /** Inline error shown when the wallet can't cover the payment amount. */\n submitErrorTransferBalance: FLOW_SUBMIT_ERROR_DEFAULT_TEXT.transferBalance,\n terms: 'Terms of Service',\n title: 'Review your payment',\n total: 'Total',\n /** The inline error's retry action. */\n tryAgain: 'Try again',\n /** The inline error's action returning to the token pick. */\n tryAnotherToken: 'Try another token',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-review-payment-view': typeof FLOW_REVIEW_PAYMENT_VIEW_TEXT;\n }\n}\n","const SECONDS_PER_MINUTE = 60;\n\n/** Params for {@link formatQuoteTimeLeft}. */\nexport type FormatQuoteTimeLeftParams = {\n /** Whole seconds left. */\n seconds: number;\n};\n\n/**\n * Formats the time a quote is still valid for as minutes and seconds.\n *\n * @example\n * ```ts\n * formatQuoteTimeLeft({ seconds: 65 }); // '1:05'\n * ```\n * @param params.seconds - Whole seconds left.\n * @returns The time left as `m:ss`.\n * @see useQuoteCountdown\n * @see FlowReviewPaymentView\n * @notInstrumented\n */\nexport const formatQuoteTimeLeft = ({\n seconds,\n}: FormatQuoteTimeLeftParams): string => {\n const minutes = Math.floor(seconds / SECONDS_PER_MINUTE);\n const paddedSeconds = String(seconds % SECONDS_PER_MINUTE).padStart(2, '0');\n\n return `${minutes}:${paddedSeconds}`;\n};\n","/** Milliseconds in a second, for converting the time left to whole seconds. */\nexport const MS_PER_SECOND = 1000;\n\n/**\n * How long before its expiry a quote is treated as expired, so a payment\n * confirmed in the last seconds isn't rejected by a clock that runs ahead.\n */\nexport const QUOTE_EXPIRY_SAFETY_MARGIN_MS = 5 * MS_PER_SECOND;\n\n/** How often the quote countdown updates — once per counted second. */\nexport const QUOTE_COUNTDOWN_TICK_MS = MS_PER_SECOND;\n","import { useEffect, useState } from 'react';\n\nimport {\n MS_PER_SECOND,\n QUOTE_COUNTDOWN_TICK_MS,\n QUOTE_EXPIRY_SAFETY_MARGIN_MS,\n} from './useQuoteCountdown.constants';\n\n/** Params for {@link useQuoteCountdown}. */\nexport type UseQuoteCountdownParams = {\n /** When the quote expires; `undefined` when there is no quote. */\n expiresAt: Date | undefined;\n};\n\n/** What {@link useQuoteCountdown} returns. */\nexport type UseQuoteCountdownResult = {\n /** Whether the quote has run out. */\n isQuoteExpired: boolean;\n /** Whole seconds the quote is still valid for; `undefined` once expired or without a quote. */\n remainingSeconds: number | undefined;\n};\n\n/**\n * Counts down the seconds a quote is still valid for, a few seconds short of\n * its expiry, and tells when it has run out.\n *\n * @example\n * ```ts\n * const { isQuoteExpired, remainingSeconds } = useQuoteCountdown({\n * expiresAt: flow.quote?.expiresAt,\n * });\n * ```\n * @param params.expiresAt - When the quote expires.\n * @returns Whether the quote has expired and the seconds left until it does.\n * @see useFlowReviewPaymentView\n * @see FlowReviewPaymentView\n * @notInstrumented\n */\nexport const useQuoteCountdown = ({\n expiresAt,\n}: UseQuoteCountdownParams): UseQuoteCountdownResult => {\n // Each tick only re-renders; the time left is always read from the clock.\n const [, setTick] = useState(0);\n\n const deadline =\n expiresAt === undefined\n ? undefined\n : expiresAt.getTime() - QUOTE_EXPIRY_SAFETY_MARGIN_MS;\n const remainingMs =\n deadline === undefined ? 0 : Math.max(0, deadline - Date.now());\n const isCountingDown = remainingMs > 0;\n\n useEffect(() => {\n if (!isCountingDown) return undefined;\n const tick = () => setTick((count) => count + 1);\n const interval = setInterval(tick, QUOTE_COUNTDOWN_TICK_MS);\n return () => clearInterval(interval);\n }, [isCountingDown]);\n\n return {\n isQuoteExpired: deadline !== undefined && !isCountingDown,\n remainingSeconds: isCountingDown\n ? Math.ceil(remainingMs / MS_PER_SECOND)\n : undefined,\n };\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\nimport { assertSafeNavigationUrl } from '@dynamic-labs-sdk/client/core';\nimport { useCallback, useState } from 'react';\n\nimport { useFlowUiSettings } from '../../../hooks/useFlowUiSettings';\nimport type { FormattedFlowPayment } from '../../../utils/formatFlowPayment';\nimport { formatFlowPayment } from '../../../utils/formatFlowPayment';\nimport type { SubmitTransactionErrorType } from '../../../utils/getSubmitTransactionErrorType';\nimport { formatQuoteTimeLeft } from '../formatQuoteTimeLeft';\nimport { useQuoteCountdown } from './useQuoteCountdown';\n\n/**\n * Inputs for {@link useFlowReviewPaymentView}.\n * @example\n * ```ts\n * const params: UseFlowReviewPaymentViewParams = {\n * consentText: 'I agree to the {terms}', flow,\n * isConfirmingPayment: false, isRequoting: false,\n * };\n * ```\n * @see useFlowReviewPaymentView\n * @see FlowReviewPaymentView\n */\nexport type UseFlowReviewPaymentViewParams = {\n /** Localized consent sentence, with a {terms} placeholder for the link. */\n consentText: string;\n /** SDK flow being reviewed. */\n flow: Flow;\n /** Whether the parent has started confirming payment. */\n isConfirmingPayment: boolean;\n /** Whether a new quote is being fetched. */\n isRequoting: boolean;\n /** Fetches a new quote once the current one expires. */\n onRequote?: () => void;\n /** The recovery action for the last submission's failure. */\n onSubmitErrorAction?: () => void;\n /** The kind of the last submission's failure. */\n submitTransactionErrorType?: SubmitTransactionErrorType;\n};\n\n/** Consent state and presentation values returned to the review screen. */\nexport type UseFlowReviewPaymentViewResult = {\n afterTermsText: string | undefined;\n beforeTermsText: string | undefined;\n canConfirmPayment: boolean;\n /** The inline error's recovery action; hidden while confirming or fetching a new quote. */\n errorAction: (() => void) | undefined;\n /** The inline error to show — a submission failure, else an expired quote. */\n errorType: SubmitTransactionErrorType | undefined;\n hasAcceptedTerms: boolean;\n onCheckedChange: (checked: boolean) => void;\n paymentData: FormattedFlowPayment;\n /** How long the quote is still valid for, as `m:ss`; `undefined` once expired or while confirming. */\n quoteTimeLeft: string | undefined;\n termsUrl: string | undefined;\n};\n\n/**\n * Tracks terms acceptance and the quote's expiry, and derives whether the\n * payment can be confirmed and which inline error to show.\n * @example\n * ```tsx\n * const { canConfirmPayment, hasAcceptedTerms, onCheckedChange } = useFlowReviewPaymentView({\n * consentText: 'I agree to the {terms}', flow,\n * isConfirmingPayment: false, isRequoting: false,\n * });\n * ```\n * @param params.consentText - Localized sentence containing {terms}.\n * @param params.flow - SDK flow being reviewed.\n * @param params.isConfirmingPayment - Whether confirmation has started.\n * @param params.isRequoting - Whether a new quote is being fetched.\n * @param params.onRequote - Fetches a new quote once the current one expires.\n * @param params.onSubmitErrorAction - The recovery action for the last submission's failure.\n * @param params.submitTransactionErrorType - The kind of the last submission's failure.\n * @returns Consent controls, safe terms URL, the quote's time left, the inline error and confirmation availability.\n * @see FlowReviewPaymentView\n * @see assertSafeNavigationUrl\n * @see useQuoteCountdown\n * @notInstrumented\n */\nexport const useFlowReviewPaymentView = ({\n consentText,\n flow,\n isConfirmingPayment,\n isRequoting,\n onRequote,\n onSubmitErrorAction,\n submitTransactionErrorType,\n}: UseFlowReviewPaymentViewParams): UseFlowReviewPaymentViewResult => {\n const [hasAcceptedTerms, setHasAcceptedTerms] = useState(false);\n\n const { isQuoteExpired, remainingSeconds } = useQuoteCountdown({\n expiresAt: flow.quote?.expiresAt,\n });\n // A submission failure keeps its own message and action: the payment may already be\n // sent, so a new quote is only offered when nothing failed. A confirmation in progress\n // settles the quote itself, so its expiry isn't shown meanwhile.\n const isExpiryShown = isQuoteExpired && !isConfirmingPayment;\n const errorType =\n submitTransactionErrorType ?? (isExpiryShown ? 'quote-expired' : undefined);\n const recoveryAction =\n submitTransactionErrorType === undefined ? onRequote : onSubmitErrorAction;\n\n const { termsOfServicesUrl } = useFlowUiSettings({ flow });\n\n let termsUrl: string | undefined;\n try {\n if (termsOfServicesUrl !== undefined) {\n const parsedTermsUrl = new URL(termsOfServicesUrl);\n assertSafeNavigationUrl(parsedTermsUrl);\n termsUrl = parsedTermsUrl.href;\n }\n } catch {\n termsUrl = undefined;\n }\n\n const [beforeTermsText, afterTermsText] = consentText.split('{terms}');\n\n const onCheckedChange = useCallback((checked: boolean) => {\n setHasAcceptedTerms(checked);\n }, []);\n\n return {\n afterTermsText,\n beforeTermsText,\n canConfirmPayment:\n !isConfirmingPayment &&\n !isRequoting &&\n errorType === undefined &&\n (termsUrl === undefined || hasAcceptedTerms),\n errorAction:\n isConfirmingPayment || isRequoting ? undefined : recoveryAction,\n errorType,\n hasAcceptedTerms,\n onCheckedChange,\n paymentData: formatFlowPayment({ flow }),\n quoteTimeLeft:\n remainingSeconds === undefined || isConfirmingPayment\n ? undefined\n : formatQuoteTimeLeft({ seconds: remainingSeconds }),\n termsUrl,\n };\n};\n","'use client';\n\nimport type { Flow } from '@dynamic-labs-sdk/client';\nimport type { FC } from 'react';\n\nimport { Button } from '../../../components/Button';\nimport { CheckboxField } from '../../../components/CheckboxField';\nimport { interpolateText } from '../../../i18n/interpolateText';\nimport { useText } from '../../../i18n/useText';\nimport { FlowErrorBanner } from '../../components/FlowErrorBanner';\nimport { Panel } from '../../../components/Panel';\nimport { FlowPaymentLedger } from '../../components/FlowPaymentLedger';\nimport { FlowPaymentSwapTile } from '../../components/FlowPaymentSwapTile';\nimport { FlowStatusTray } from '../../components/FlowStatusTray';\nimport type { SubmitTransactionErrorType } from '../../utils/getSubmitTransactionErrorType';\nimport {\n SUBMIT_ERROR_ACTION_TEXT_KEY,\n SUBMIT_ERROR_TEXT_KEY,\n} from './FlowReviewPaymentView.constants';\nimport { FLOW_REVIEW_PAYMENT_VIEW_TEXT } from './FlowReviewPaymentView.text';\nimport { useFlowReviewPaymentView } from './useFlowReviewPaymentView';\n\n/**\n * Props for {@link FlowReviewPaymentView}.\n * @example\n * ```tsx\n * const props: FlowReviewPaymentViewProps = {\n * flow, onConfirmPayment: handleConfirm,\n * };\n * ```\n * @see FlowReviewPaymentView\n * @see Flow\n */\nexport type FlowReviewPaymentViewProps = {\n /** Extra class names for the root element. */\n className?: string;\n /** SDK flow containing the order, route, and quote. */\n flow: Flow;\n /** Locks interactions once confirmation starts. Defaults to false. */\n isConfirmingPayment?: boolean;\n /** Locks interactions while a new quote is fetched. Defaults to false. */\n isRequoting?: boolean;\n /** Returns to the previous step. Omit to hide both Back actions. */\n onBack?: () => void;\n /** Called when the user confirms after any required consent. The parent executes payment. */\n onConfirmPayment: () => void;\n /** Fetches a new quote once the current one expires; omit to hide the action. */\n onRequote?: () => void;\n /** Fires on the inline error's recovery action — re-quote, pick another token, or retry. */\n onSubmitErrorAction?: () => void;\n /** The kind of the last submission's failure — picks the inline error shown above the actions. */\n submitTransactionErrorType?: SubmitTransactionErrorType;\n};\n\n/**\n * The Flow review screen: quoted payment assets, fee estimates, and\n * optional terms consent before confirming payment through the parent. It\n * counts down the quote and, once it expires, offers a new one instead.\n * @example\n * ```tsx\n * <FlowReviewPaymentView\n * onBack={handleBack}\n * onConfirmPayment={handleConfirm}\n * flow={flow}\n * />\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.onBack - Returns to the previous step. Omit to hide Back.\n * @param params.onConfirmPayment - Called when the user confirms after any required consent.\n * @param params.flow - SDK flow containing the order, route, and quote.\n * @param params.isConfirmingPayment - Locks interactions while the parent confirms payment.\n * @param params.isRequoting - Locks interactions while a new quote is fetched.\n * @param params.onRequote - Fetches a new quote once the current one expires.\n * @param params.onSubmitErrorAction - Fires on the inline error's recovery action.\n * @param params.submitTransactionErrorType - The kind of the last submission's failure.\n * @returns The payment review panel.\n * @see FlowReviewPaymentViewProps\n * @see FlowPaymentSwapTile\n * @see FlowPaymentLedger\n * @copy back - Footer action returning to the previous step.\n * @copy confirm - Action confirming the reviewed payment.\n * @copy consent - Consent sentence with a {terms} placeholder for the link.\n * @copy fees - Label for quoted fees.\n * @copy orderTotal - Ledger label for the order amount before fees.\n * @copy quoteExpiresIn - Countdown at the bottom of the panel; `{time}` is replaced by the time left.\n * @copy requoting - Shown at the bottom of the panel while a new quote is fetched.\n * @copy getNewQuote - The inline error's re-quote action for an expired quote.\n * @copy submitErrorExpiredQuote - Inline error shown when the quote expired.\n * @copy submitErrorGasBalance - Inline error shown when the wallet can't cover network fees.\n * @copy submitErrorGeneric - Inline error shown when submission failed for any other reason.\n * @copy submitErrorTransferBalance - Inline error shown when the wallet can't cover the payment amount.\n * @copy terms - Accessible text of the terms link.\n * @copy tryAgain - The inline error's retry action.\n * @copy tryAnotherToken - The inline error's action returning to the token pick.\n * @copy title - Panel heading.\n * @copy total - Ledger label for order amount plus quoted fees.\n * @notInstrumented\n */\nexport const FlowReviewPaymentView: FC<FlowReviewPaymentViewProps> = ({\n className,\n onBack,\n onConfirmPayment,\n onSubmitErrorAction,\n flow,\n isConfirmingPayment = false,\n isRequoting = false,\n onRequote,\n submitTransactionErrorType,\n}) => {\n const text = useText({\n defaults: FLOW_REVIEW_PAYMENT_VIEW_TEXT,\n slot: 'dyn-flow-review-payment-view',\n });\n const {\n afterTermsText,\n beforeTermsText,\n canConfirmPayment,\n errorAction,\n errorType,\n hasAcceptedTerms,\n onCheckedChange,\n paymentData,\n quoteTimeLeft,\n termsUrl,\n } = useFlowReviewPaymentView({\n consentText: text('consent'),\n flow,\n isConfirmingPayment,\n isRequoting,\n onRequote,\n onSubmitErrorAction,\n submitTransactionErrorType,\n });\n const isLocked = isConfirmingPayment || isRequoting;\n const quoteExpiresInStatus =\n quoteTimeLeft === undefined\n ? undefined\n : interpolateText({\n template: text('quoteExpiresIn'),\n token: '{time}',\n value: quoteTimeLeft,\n });\n\n return (\n <FlowStatusTray\n className={className}\n // Only the re-quote is progress; the countdown is plain text.\n isBusy={isRequoting}\n status={isRequoting ? text('requoting') : quoteExpiresInStatus}\n >\n <Panel onBack={isLocked ? undefined : onBack} title={text('title')}>\n <div aria-busy={isLocked} data-slot=\"dyn-flow-review-payment-view\">\n <FlowPaymentSwapTile flow={flow} />\n <div data-slot=\"dyn-flow-review-payment-view-ledger\">\n <FlowPaymentLedger\n lines={[\n { label: text('orderTotal'), value: paymentData.orderTotal },\n ...(paymentData.fee === undefined\n ? []\n : [\n {\n label: text('fees'),\n value: paymentData.fee,\n },\n ]),\n ]}\n total={\n paymentData.total === undefined\n ? undefined\n : { label: text('total'), value: paymentData.total }\n }\n />\n </div>\n {termsUrl !== undefined && (\n <CheckboxField\n checked={hasAcceptedTerms}\n disabled={isLocked}\n onCheckedChange={(checked) => onCheckedChange(checked === true)}\n >\n {beforeTermsText}\n <a\n data-slot=\"dyn-flow-review-payment-view-terms\"\n href={termsUrl}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n {text('terms')}\n </a>\n {afterTermsText}\n </CheckboxField>\n )}\n {errorType !== undefined && (\n <FlowErrorBanner\n actionLabel={text(SUBMIT_ERROR_ACTION_TEXT_KEY[errorType])}\n message={text(SUBMIT_ERROR_TEXT_KEY[errorType])}\n onAction={errorAction}\n />\n )}\n <div data-slot=\"dyn-flow-review-payment-view-actions\">\n {onBack !== undefined && (\n <Button disabled={isLocked} onClick={onBack} variant=\"secondary\">\n {text('back')}\n </Button>\n )}\n <Button\n disabled={!canConfirmPayment}\n onClick={() => onConfirmPayment()}\n >\n {text('confirm')}\n </Button>\n </div>\n </div>\n </Panel>\n </FlowStatusTray>\n );\n};\n","'use client';\n\nimport type { FC } from 'react';\nimport type { Flow } from '@dynamic-labs-sdk/client';\n\nimport type { SubmitTransactionErrorType } from '../../../../utils/getSubmitTransactionErrorType';\nimport { FlowLoadingView } from '../../../../views/FlowLoadingView';\nimport { FlowReviewPaymentView } from '../../../../views/FlowReviewPaymentView';\n\n/**\n * Props for {@link ReviewPaymentRouteView}.\n *\n * @example\n * ```tsx\n * const props: ReviewPaymentRouteViewProps = {\n * confirmPayment,\n * flow,\n * goBack,\n * isRequoting: false,\n * isSubmittingPayment: false,\n * requoteExpiredQuote,\n * submitErrorAction: undefined,\n * submitTransactionErrorType: undefined,\n * };\n * ```\n * @see ReviewPaymentRouteView\n */\nexport type ReviewPaymentRouteViewProps = {\n /** Confirms the reviewed payment; runs submission and moves to processing. */\n confirmPayment: () => void;\n /** The quoted flow being reviewed; `undefined` until it loads. */\n flow: Flow | undefined;\n /** Returns to the token pick; `undefined` when there is no way back. */\n goBack: (() => void) | undefined;\n /** Locks the review actions while a new quote is fetched. */\n isRequoting: boolean;\n /** Locks the review actions while payment submission runs. */\n isSubmittingPayment: boolean;\n /** Replaces the expired quote with a new one. */\n requoteExpiredQuote: () => void;\n /** The recovery action the current submission failure offers — re-quote, pick another token, or retry. */\n submitErrorAction: (() => void) | undefined;\n /** The kind of the last submission's failure — picks the inline error. */\n submitTransactionErrorType: SubmitTransactionErrorType | undefined;\n};\n\n/**\n * The review-payment route's screen: {@link FlowReviewPaymentView} fed by the\n * widget's latest flow — the one the quote fetch returned. Until a quoted\n * flow exists the route holds a loader, since review has nothing to show\n * without it.\n *\n * @param params.confirmPayment - Confirms the reviewed payment; runs submission.\n * @param params.flow - The quoted flow being reviewed.\n * @param params.goBack - Returns to the token pick.\n * @param params.isRequoting - Locks the review actions while a new quote is fetched.\n * @param params.isSubmittingPayment - Locks the review actions while submission runs.\n * @param params.requoteExpiredQuote - Replaces the expired quote with a new one.\n * @param params.submitTransactionErrorType - The kind of the last submission's failure — picks the inline error.\n * @param params.submitErrorAction - The recovery action the current submission failure offers.\n * @returns The payment review screen.\n * @example\n * ```tsx\n * <ReviewPaymentRouteView confirmPayment={confirmPayment} flow={flow} />\n * ```\n * @see FlowReviewPaymentView\n * @see ReviewPaymentRoute\n * @notInstrumented\n */\nexport const ReviewPaymentRouteView: FC<ReviewPaymentRouteViewProps> = ({\n confirmPayment,\n flow,\n goBack,\n isRequoting,\n isSubmittingPayment,\n requoteExpiredQuote,\n submitTransactionErrorType,\n submitErrorAction,\n}) =>\n flow === undefined ? (\n <FlowLoadingView />\n ) : (\n <FlowReviewPaymentView\n flow={flow}\n isConfirmingPayment={isSubmittingPayment}\n isRequoting={isRequoting}\n onBack={goBack}\n onConfirmPayment={confirmPayment}\n onRequote={requoteExpiredQuote}\n onSubmitErrorAction={submitErrorAction}\n submitTransactionErrorType={submitTransactionErrorType}\n />\n );\n","import type { FlowPayWithWalletRouteModule } from '../flowPayWithWalletRoutes.types';\nimport { ReviewPaymentRouteView } from './ReviewPaymentRouteView';\n\n/**\n * The review-payment route entry: the screen reads the widget's latest flow,\n * so the entry carries no params of its own.\n */\nexport type ReviewPaymentRoute = {\n name: 'review-payment';\n};\n\n/**\n * The review-payment route of {@link FlowPayWithWalletWidget}: the quote\n * review between the token pick and submission. Retained in history so it\n * survives as a back target.\n *\n * @see FlowPayWithWalletRouteModule\n * @see flowPayWithWalletRoutes\n * @see ReviewPaymentRouteView\n */\nexport const reviewPaymentRoute: FlowPayWithWalletRouteModule<ReviewPaymentRoute> =\n {\n render: ({ widget }) => (\n <ReviewPaymentRouteView\n confirmPayment={widget.confirmPayment}\n flow={widget.flow}\n goBack={widget.goBack}\n // On review, a pending quote request is always a re-quote.\n isRequoting={widget.isProcessingTokenSelection}\n isSubmittingPayment={widget.isSubmittingPayment}\n requoteExpiredQuote={widget.requoteExpiredQuote}\n submitErrorAction={widget.submitErrorAction}\n submitTransactionErrorType={widget.submitTransactionErrorType}\n />\n ),\n retainInHistory: true,\n };\n","import { chooseTokenRoute } from './chooseTokenRoute';\nimport { connectWalletRoute } from './connectWalletRoute';\nimport type {\n FlowPayWithWalletRouteByName,\n FlowPayWithWalletRouteModule,\n FlowPayWithWalletRouteName,\n} from './flowPayWithWalletRoutes.types';\nimport { paymentNotApprovedRoute } from './paymentNotApprovedRoute';\nimport { paymentSentRoute } from './paymentSentRoute';\nimport { reviewPaymentRoute } from './reviewPaymentRoute';\n\n/**\n * The route table behind {@link FlowPayWithWalletWidget}: every step the\n * payer takes in the wallet payment as a route module that owns its rendering\n * and history behavior. A route missing here, or a module filed under another route's\n * name, fails type checking — adding or dropping a screen is a single module.\n *\n * @see FlowPayWithWalletRouteModule\n * @see renderFlowPayWithWalletRoute\n */\nexport const flowPayWithWalletRoutes: {\n [Name in FlowPayWithWalletRouteName]: FlowPayWithWalletRouteModule<\n FlowPayWithWalletRouteByName[Name]\n >;\n} = {\n 'choose-token': chooseTokenRoute,\n 'connect-wallet': connectWalletRoute,\n 'payment-not-approved': paymentNotApprovedRoute,\n 'payment-sent': paymentSentRoute,\n 'review-payment': reviewPaymentRoute,\n};\n","import type { ReactNode } from 'react';\n\nimport { flowPayWithWalletRoutes } from '../routes/flowPayWithWalletRoutes';\nimport type {\n FlowPayWithWalletRouteByName,\n FlowPayWithWalletRouteName,\n FlowPayWithWalletRouteRenderParams,\n} from '../routes/flowPayWithWalletRoutes.types';\n\n/**\n * Params for {@link renderFlowPayWithWalletRoute}.\n *\n * @see renderFlowPayWithWalletRoute\n * @see FlowPayWithWalletRouteRenderParams\n */\nexport type RenderFlowPayWithWalletRouteParams<\n Name extends FlowPayWithWalletRouteName,\n> = FlowPayWithWalletRouteRenderParams<\n FlowPayWithWalletRouteByName[Name] & { name: Name }\n>;\n\n/**\n * Renders the pay-with-wallet screen for a route through its route module.\n * The generic route name ties the route to its own module, so the lookup\n * needs no cast.\n *\n * @example\n * ```tsx\n * renderFlowPayWithWalletRoute({ route: widget.currentRoute, widget });\n * ```\n * @param params.route - The route entry to render.\n * @param params.widget - The widget's latest flow, state and actions.\n * @returns The route's screen.\n * @see flowPayWithWalletRoutes\n * @see FlowPayWithWalletRouteModule\n * @notInstrumented\n */\nexport const renderFlowPayWithWalletRoute = <\n Name extends FlowPayWithWalletRouteName,\n>({\n route,\n widget,\n}: RenderFlowPayWithWalletRouteParams<Name>): ReactNode =>\n flowPayWithWalletRoutes[route.name].render({ route, widget });\n","import {\n type Flow,\n type WalletAccount,\n isSameAddress,\n} from '@dynamic-labs-sdk/client';\n\n/** Params for {@link findResumableWalletAccount}. */\nexport type FindResumableWalletAccountParams = {\n /** The flow being paid, as loaded. */\n flow: Flow | undefined;\n /** The wallet accounts connected in this browser. */\n walletAccounts: readonly WalletAccount[];\n};\n\n/**\n * Finds the connected wallet a quoted payment can resume with: the wallet the\n * flow was quoted for, on the same chain. Only a wallet payment holding a\n * quote that still awaits payment can resume on its review; a payment to a\n * deposit address never resumes here, even when a connected wallet matches.\n *\n * @example\n * ```ts\n * const walletAccount = findResumableWalletAccount({\n * flow,\n * walletAccounts: getWalletAccounts(client),\n * });\n * ```\n * @param params.flow - The flow being paid, as loaded.\n * @param params.walletAccounts - The wallet accounts connected in this browser.\n * @returns The wallet account to resume with, or `undefined` to start over.\n * @see useFlowPayWithWalletWidget\n * @see getWalletAccounts\n * @see isSameAddress\n * @notInstrumented\n */\nexport const findResumableWalletAccount = ({\n flow,\n walletAccounts,\n}: FindResumableWalletAccountParams): WalletAccount | undefined => {\n if (\n flow?.sourceType !== 'wallet' ||\n flow.quote === undefined ||\n flow.fromAddress === undefined ||\n (flow.executionState !== 'quoted' && flow.executionState !== 'signing')\n ) {\n return undefined;\n }\n const { fromAddress, fromChainName } = flow;\n\n return walletAccounts.find(\n (walletAccount) =>\n walletAccount.chain === fromChainName &&\n isSameAddress({\n chain: walletAccount.chain,\n left: walletAccount.address,\n right: fromAddress,\n })\n );\n};\n","import type { WalletAccount } from '@dynamic-labs-sdk/client';\n\nimport type { UseViewRouterParams } from '../../../../../utils/hooks/useViewRouter';\nimport { flowPayWithWalletRoutes } from '../../routes/flowPayWithWalletRoutes';\nimport type { FlowPayWithWalletRoute } from '../../routes/flowPayWithWalletRoutes.types';\n\n/** Params for {@link getRouterParams}. */\nexport type GetRouterParamsParams = {\n /** The connected wallet a quoted payment resumes with, or `undefined` to start over. */\n resumedWalletAccount: WalletAccount | undefined;\n};\n\n/**\n * The wallet rail's router setup: its route table and the screens it starts\n * with — wallet connection for a new payment, or the review of a resumed one\n * with the steps that lead to it beneath, so Back works as if the payer had\n * taken them.\n *\n * @example\n * ```ts\n * const router = useViewRouter(getRouterParams({ resumedWalletAccount }));\n * ```\n * @param params.resumedWalletAccount - The connected wallet a quoted payment resumes with.\n * @returns The params for the rail's router.\n * @see useFlowPayWithWalletWidget\n * @see findResumableWalletAccount\n * @notInstrumented\n */\nexport const getRouterParams = ({\n resumedWalletAccount,\n}: GetRouterParamsParams): UseViewRouterParams<FlowPayWithWalletRoute> => {\n if (resumedWalletAccount) {\n return {\n initialStack: [\n { name: 'connect-wallet' },\n {\n name: 'choose-token',\n params: { walletAccount: resumedWalletAccount },\n },\n { name: 'review-payment' },\n ],\n routes: flowPayWithWalletRoutes,\n };\n }\n\n return {\n initialStack: [{ name: 'connect-wallet' }],\n routes: flowPayWithWalletRoutes,\n };\n};\n","import type { SubmitTransactionErrorType } from '../../../../utils/getSubmitTransactionErrorType';\n\n/** The recovery actions a submission failure can offer, one picked per error kind. */\nexport type SubmitErrorRecoveryActions = {\n /** Returns to token selection — offered on an insufficient balance. */\n onPickAnotherToken: () => void;\n /** Re-quotes the last token pick — offered when the quote expired. */\n onRequote: () => void;\n /** Retries the submission — the fallback for any other failure. */\n onRetry: () => void;\n};\n\n/**\n * Params for {@link getSubmitErrorAction}.\n *\n * @example\n * ```ts\n * const params: GetSubmitErrorActionParams = { actions, kind: 'quote-expired' };\n * ```\n * @see getSubmitErrorAction\n */\nexport type GetSubmitErrorActionParams = {\n /** The recovery actions to pick from. */\n actions: SubmitErrorRecoveryActions;\n /** The kind of the active submission failure, if any. */\n kind: SubmitTransactionErrorType | undefined;\n};\n\n/**\n * Picks the recovery action a submission failure offers.\n *\n * @example\n * ```ts\n * getSubmitErrorAction({ actions, kind: 'quote-expired' }); // actions.onRequote\n * ```\n * @param params.actions - The recovery actions to pick from.\n * @param params.kind - The kind of the active submission failure, if any.\n * @returns The recovery action, or `undefined` when there is no failure.\n * @see getSubmitTransactionErrorType\n * @see useFlowPayWithWalletWidget\n * @notInstrumented\n */\nexport const getSubmitErrorAction = ({\n actions,\n kind,\n}: GetSubmitErrorActionParams): (() => void) | undefined => {\n if (kind === undefined) {\n return undefined;\n }\n if (kind === 'quote-expired') {\n return actions.onRequote;\n }\n if (\n kind === 'insufficient-gas-balance' ||\n kind === 'insufficient-transfer-balance'\n ) {\n return actions.onPickAnotherToken;\n }\n return actions.onRetry;\n};\n","import { FlowSourceBlockedError } from '@dynamic-labs-sdk/client';\n\n/**\n * The wallet attach failures the connect screen can speak to: a wallet that\n * can't be used for this payment, and everything else.\n */\nexport type WalletAttachErrorType = 'generic' | 'wallet-blocked';\n\n/**\n * Maps a failure to attach the connected wallet to its kind.\n *\n * @example\n * ```ts\n * const kind = getWalletAttachErrorType(error);\n * // kind is 'wallet-blocked' | 'generic'\n * ```\n * @param error - The error attaching the wallet failed with.\n * @returns The kind of attach failure the connect screen should report.\n * @see WalletAttachErrorType\n * @see useAttachWalletSource\n * @notInstrumented\n */\nexport const getWalletAttachErrorType = (\n error: Error\n): WalletAttachErrorType => {\n if (error instanceof FlowSourceBlockedError) {\n return 'wallet-blocked';\n }\n return 'generic';\n};\n","import {\n type WalletAccount,\n getActiveNetworkId,\n} from '@dynamic-labs-sdk/client';\nimport {\n useAttachFlowSource,\n useDynamicClient,\n} from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useState } from 'react';\n\nimport {\n type WalletAttachErrorType,\n getWalletAttachErrorType,\n} from '../../../../utils/getWalletAttachErrorType';\nimport type { ConnectWalletOptionConnectedParams } from '../../../../../widgets/ConnectWalletOptionWidget/useConnectWalletOptionWidget';\n\n/**\n * Params for {@link useAttachWalletSource}.\n *\n * @example\n * ```ts\n * const params: UseAttachWalletSourceParams = { flowId, onAttached };\n * ```\n * @see useAttachWalletSource\n * @see UseAttachWalletSourceResult\n */\nexport type UseAttachWalletSourceParams = {\n /** The flow being paid. */\n flowId: string;\n /** Fires with the wallet once it is attached as the flow's source. */\n onAttached: (walletAccount: WalletAccount) => void;\n};\n\n/** What {@link useAttachWalletSource} returns. */\nexport type UseAttachWalletSourceResult = {\n /** The kind of the last attach failure, cleared when the next attach starts or by `clearAttachError`. */\n attachError: WalletAttachErrorType | undefined;\n /** Attaches the connected wallet as the flow's source; a failure starts the connection over, back on the wallet list. */\n attachWalletSource: (params: ConnectWalletOptionConnectedParams) => void;\n /** Clears the last attach failure, such as when the payer picks another wallet. */\n clearAttachError: () => void;\n /** Whether the attach request is in flight (the network lookup before it is not shown as progress). */\n isAttachingWallet: boolean;\n};\n\n/**\n * Attaches a connected wallet as the flow's payment source, which also checks\n * the wallet can be used for this payment, and tracks the attach's pending and\n * failed states. A failed attach starts the connection over, so the payer is\n * back on the wallet list and can connect again.\n *\n * @example\n * ```ts\n * const { attachWalletSource, attachError } = useAttachWalletSource({\n * flowId,\n * onAttached: (walletAccount) => navigate({ name: 'choose-token', params: { walletAccount } }),\n * });\n * ```\n * @param params.flowId - The flow being paid.\n * @param params.onAttached - Fires with the wallet once it is attached.\n * @returns The attach verbs, whether an attach is running and the last failure's kind.\n * @see useFlowPayWithWalletWidget\n * @see useTokenPick\n * @notInstrumented\n */\nexport const useAttachWalletSource = ({\n flowId,\n onAttached,\n}: UseAttachWalletSourceParams): UseAttachWalletSourceResult => {\n const client = useDynamicClient();\n const { isPending: isAttachingWallet, mutate: attachFlowSource } =\n useAttachFlowSource();\n const [attachError, setAttachError] = useState<WalletAttachErrorType>();\n\n // Runs once per connection: the wallet picker reports a wallet once, stays on\n // its connected screen while this runs, and a failure starts it over.\n const attachWalletSource = useCallback(\n ({ startOver, walletAccount }: ConnectWalletOptionConnectedParams) => {\n setAttachError(undefined);\n const handleAttachError = (error: Error) => {\n setAttachError(getWalletAttachErrorType(error));\n startOver();\n };\n\n // The wallet's current network seeds the source; the quote can still\n // switch to another network of the same chain.\n const attachOnActiveNetwork = async () => {\n const { networkId } = await getActiveNetworkId(\n { walletAccount },\n client\n );\n attachFlowSource(\n {\n flowId,\n fromAddress: walletAccount.address,\n fromChainId: networkId,\n fromChainName: walletAccount.chain,\n sourceType: 'wallet',\n },\n {\n onError: handleAttachError,\n onSuccess: () => onAttached(walletAccount),\n }\n );\n };\n // Async so a lookup that throws, e.g. no provider for the wallet, is\n // reported like a failed attach.\n void attachOnActiveNetwork().catch(handleAttachError);\n },\n [attachFlowSource, client, flowId, onAttached]\n );\n\n const clearAttachError = useCallback(() => setAttachError(undefined), []);\n\n return {\n attachError,\n attachWalletSource,\n clearAttachError,\n isAttachingWallet,\n };\n};\n","import { FlowPrepareSigningError } from '@dynamic-labs-sdk/client';\n\n/**\n * The submit failures the review screen can speak to specifically: an\n * expired quote (auto re-quoted), a balance shortfall on gas or on the\n * transfer itself, and everything else.\n */\nexport type SubmitTransactionErrorType =\n | 'generic'\n | 'insufficient-gas-balance'\n | 'insufficient-transfer-balance'\n | 'quote-expired';\n\n/**\n * Maps a submission failure to its kind. The prepare-signing endpoint\n * propagates an error `code` that the client maps to\n * `FlowPrepareSigningError`. Gas and transfer shortfalls share\n * `insufficient_balance`, so the backend's message splits them.\n *\n * @example\n * ```ts\n * const kind = getSubmitTransactionErrorType(error);\n * // kind is 'quote-expired' | 'insufficient-gas-balance' |\n * // 'insufficient-transfer-balance' | 'generic'\n * ```\n * @param error - The error `submitFlowTransaction` rejected with.\n * @returns The kind of submit failure the review screen should report.\n * @see SubmitTransactionErrorType\n * @see useFlowPayWithWalletWidget\n * @notInstrumented\n */\nexport const getSubmitTransactionErrorType = (error: Error): SubmitTransactionErrorType => {\n if (error instanceof FlowPrepareSigningError) {\n if (error.code === 'quote_expired') {\n return 'quote-expired';\n }\n if (error.code === 'insufficient_balance') {\n return error.message.includes('gas')\n ? 'insufficient-gas-balance'\n : 'insufficient-transfer-balance';\n }\n }\n return 'generic';\n};\n","import { useCallback, useState } from 'react';\n\nimport { getSubmitTransactionErrorType } from '../../../../../utils/getSubmitTransactionErrorType';\nimport type { SubmitTransactionErrorType } from '../../../../../utils/getSubmitTransactionErrorType';\n\n/** Args for the {@link UseSubmitErrorStateResult.reportSubmitFailure} verb. */\nexport type ReportSubmitFailureParams = {\n /** The error the submission (or a recovery re-quote) rejected with. */\n error: Error;\n};\n\n/** What {@link useSubmitErrorState} returns. */\nexport type UseSubmitErrorStateResult = {\n /** Clears the active failure, such as when a fresh quote or submit starts. */\n clearSubmitError: () => void;\n /** Records a non-decline failure and its kind. */\n reportSubmitFailure: (params: ReportSubmitFailureParams) => void;\n /** The kind of the active submission failure — picks the banner's copy and recovery action. */\n submitTransactionErrorType: SubmitTransactionErrorType | undefined;\n};\n\n/**\n * Holds the review screen's submission-failure state: the active failure's\n * kind. A wallet decline is not a submission failure: the widget\n * routes it away and never reports it here.\n *\n * @returns The active failure's state and the verbs that record or clear it.\n * @example\n * ```ts\n * const { submitTransactionErrorType, reportSubmitFailure, clearSubmitError } =\n * useSubmitErrorState();\n * reportSubmitFailure({ error });\n * ```\n * @see UseSubmitErrorStateResult\n * @see useFlowPayWithWalletWidget\n * @notInstrumented\n */\nexport const useSubmitErrorState = (): UseSubmitErrorStateResult => {\n // Non-decline submission failures report inline on the review screen.\n const [submitTransactionErrorType, setSubmitTransactionErrorType] = useState<\n SubmitTransactionErrorType | undefined\n >(undefined);\n\n const clearSubmitError = useCallback(() => {\n setSubmitTransactionErrorType(undefined);\n }, []);\n\n const reportSubmitFailure = useCallback(\n ({ error }: ReportSubmitFailureParams) => {\n const kind = getSubmitTransactionErrorType(error);\n setSubmitTransactionErrorType(kind);\n },\n []\n );\n\n return {\n clearSubmitError,\n reportSubmitFailure,\n submitTransactionErrorType,\n };\n};\n","import {\n UserRejectedError,\n type WalletAccount,\n} from '@dynamic-labs-sdk/client';\nimport { useSubmitFlowTransaction } from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useRef } from 'react';\n\nimport type { SubmitTransactionErrorType } from '../../../../utils/getSubmitTransactionErrorType';\nimport { useSubmitErrorState } from './useSubmitErrorState';\n\n/**\n * Params for {@link useSubmitPayment}.\n *\n * @example\n * ```ts\n * const params: UseSubmitPaymentParams = { flowId, onDeclined, onSubmitted, walletAccount };\n * ```\n * @see useSubmitPayment\n * @see UseSubmitPaymentResult\n */\nexport type UseSubmitPaymentParams = {\n /** The flow being paid. */\n flowId: string;\n /** Fires when the payer declines in their wallet. */\n onDeclined: () => void;\n /** Fires once the wallet sent the payment. */\n onSubmitted: () => void;\n /** The connected wallet paying; submission is ignored until it is set. */\n walletAccount: WalletAccount | undefined;\n};\n\n/** Optional per-call options for {@link UseSubmitPaymentResult.submitPayment}. */\nexport type SubmitPaymentParams = {\n /** Fires once this submission settles, whether it was sent, declined or failed. */\n onSettled?: () => void;\n};\n\n/** What {@link useSubmitPayment} returns. */\nexport type UseSubmitPaymentResult = {\n /** Dismisses the active failure's inline error. */\n clearSubmitError: () => void;\n /** Routes a decline to `onDeclined` and records any other failure with its kind. */\n handleSubmitError: (error: Error) => void;\n /** Whether a submission is in flight. */\n isSubmittingPayment: boolean;\n /** Dismisses the active failure and submits again. */\n retrySubmit: () => void;\n /** Signs and sends the quoted payment from the connected wallet; ignored while one is in flight. */\n submitPayment: (params?: SubmitPaymentParams) => void;\n /** The kind of the active submission failure, if any. */\n submitTransactionErrorType: SubmitTransactionErrorType | undefined;\n};\n\n/**\n * Submits a quoted wallet payment and tracks why the last attempt failed.\n * A wallet decline is not a failure: it fires `onDeclined` instead.\n *\n * @example\n * ```ts\n * const { submitPayment, isSubmittingPayment } = useSubmitPayment({\n * flowId,\n * onDeclined: () => navigate({ name: 'payment-not-approved' }),\n * onSubmitted: () => navigate({ name: 'payment-sent' }),\n * walletAccount,\n * });\n * ```\n * @param params.flowId - The flow being paid.\n * @param params.onDeclined - Fires when the payer declines in their wallet.\n * @param params.onSubmitted - Fires once the wallet sent the payment.\n * @param params.walletAccount - The connected wallet paying.\n * @returns The submission verbs, its pending state and the active failure's kind.\n * @see useFlowPayWithWalletWidget\n * @see useTokenPick\n * @notInstrumented\n */\nexport const useSubmitPayment = ({\n flowId,\n onDeclined,\n onSubmitted,\n walletAccount,\n}: UseSubmitPaymentParams): UseSubmitPaymentResult => {\n // Set synchronously: Confirm only locks once the pending state reaches a render.\n const isSubmitInFlightRef = useRef(false);\n // Mutation-level, so it still fires when a newer `mutate` drops the per-call callbacks.\n const { isPending: isSubmittingPayment, mutate: submitFlowTransaction } =\n useSubmitFlowTransaction({\n mutateParams: {\n onSettled: () => {\n isSubmitInFlightRef.current = false;\n },\n },\n });\n const { clearSubmitError, reportSubmitFailure, submitTransactionErrorType } =\n useSubmitErrorState();\n\n const handleSubmitError = useCallback(\n (error: Error) => {\n if (error instanceof UserRejectedError) {\n onDeclined();\n return;\n }\n reportSubmitFailure({ error });\n },\n [onDeclined, reportSubmitFailure]\n );\n\n const submitPayment = useCallback(\n ({ onSettled }: SubmitPaymentParams = {}) => {\n if (walletAccount === undefined || isSubmitInFlightRef.current) {\n return;\n }\n isSubmitInFlightRef.current = true;\n\n clearSubmitError();\n submitFlowTransaction(\n { flowId, walletAccount },\n { onError: handleSubmitError, onSettled, onSuccess: onSubmitted }\n );\n },\n [\n clearSubmitError,\n flowId,\n handleSubmitError,\n onSubmitted,\n submitFlowTransaction,\n walletAccount,\n ]\n );\n\n // Takes no options, so a click event never reaches `submitPayment` as its params.\n const retrySubmit = useCallback(() => submitPayment(), [submitPayment]);\n\n return {\n clearSubmitError,\n handleSubmitError,\n isSubmittingPayment,\n retrySubmit,\n submitPayment,\n submitTransactionErrorType,\n };\n};\n","import type {\n Flow,\n GetFlowQuoteParams,\n TokenBalance,\n} from '@dynamic-labs-sdk/client';\nimport { useGetFlowQuote } from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useRef, useState } from 'react';\n\n/**\n * Params for {@link useTokenPick}.\n *\n * @example\n * ```ts\n * const params: UseTokenPickParams = { flowId, onQuoted };\n * ```\n * @see useTokenPick\n * @see UseTokenPickResult\n */\nexport type UseTokenPickParams = {\n /** The flow being paid. */\n flowId: string;\n /** Fires once the latest pick's quote lands. */\n onQuoted: () => void;\n};\n\n/** Params for {@link UseTokenPickResult.requote}. */\nexport type RequoteParams = {\n /** Fires when the re-quote fails. */\n onError: (error: Error) => void;\n /** Fires when the re-quote lands. */\n onSuccess: () => void;\n /** The flow's current quote; its token and network are quoted again. */\n quote: Flow['quote'];\n};\n\n/** What {@link useTokenPick} returns. */\nexport type UseTokenPickResult = {\n /** Whether the latest pick is still being quoted; further picks are ignored meanwhile. */\n isProcessingTokenSelection: boolean;\n /** Quotes the flow's current token and network again; does nothing without a quote. */\n requote: (params: RequoteParams) => void;\n /** Picks the token to pay with and quotes it. */\n selectToken: (token: TokenBalance) => void;\n /** Whether the latest pick failed to quote. */\n tokenSelectionFailed: boolean;\n};\n\n/**\n * Picks the token a wallet payment uses and quotes it, and re-quotes the\n * flow's current quote. The wallet is already attached as the flow's source.\n *\n * @example\n * ```ts\n * const { selectToken, tokenSelectionFailed } = useTokenPick({\n * flowId,\n * onQuoted: () => navigate({ name: 'review-payment' }),\n * });\n * ```\n * @param params.flowId - The flow being paid.\n * @param params.onQuoted - Fires once the latest pick's quote lands.\n * @returns The pick verbs, whether a pick is pending and whether the latest pick failed.\n * @see useFlowPayWithWalletWidget\n * @see useSubmitPayment\n * @notInstrumented\n */\nexport const useTokenPick = ({\n flowId,\n onQuoted,\n}: UseTokenPickParams): UseTokenPickResult => {\n const { isPending: isProcessingTokenSelection, mutate: getFlowQuote } =\n useGetFlowQuote();\n\n // Set synchronously, so a second tap in the same tick is ignored too —\n // `isPending` only flips on the next render.\n const isPickPendingRef = useRef(false);\n const [tokenSelectionFailed, setTokenSelectionFailed] = useState(false);\n\n const selectToken = useCallback(\n (token: TokenBalance) => {\n // A tap while a pick is pending would race it: every quote still reaches the server.\n if (isPickPendingRef.current) {\n return;\n }\n isPickPendingRef.current = true;\n\n // The balance's Dynamic network id; the API calls it `fromChainId`.\n const fromNetworkId =\n token.networkId === undefined ? undefined : String(token.networkId);\n\n setTokenSelectionFailed(false);\n const handlePickError = () => {\n isPickPendingRef.current = false;\n setTokenSelectionFailed(true);\n };\n\n const flowQuoteParams = {\n flowId,\n fromChainId: fromNetworkId,\n fromTokenAddress: token.address,\n } satisfies GetFlowQuoteParams;\n\n getFlowQuote(flowQuoteParams, {\n onError: handlePickError,\n onSuccess: () => {\n isPickPendingRef.current = false;\n onQuoted();\n },\n });\n },\n [flowId, getFlowQuote, onQuoted]\n );\n\n // Reads the flow's quote rather than the last pick, so it also works for a\n // quote fetched before a reload.\n const requote = useCallback(\n ({ onError, onSuccess, quote }: RequoteParams) => {\n if (quote === undefined) {\n return;\n }\n // A newer quote drops a pending pick's quote callbacks, so they'd never release the pick.\n isPickPendingRef.current = false;\n\n getFlowQuote(\n {\n flowId,\n fromChainId: quote.fromChainId,\n fromTokenAddress: quote.fromToken,\n },\n { onError, onSuccess }\n );\n },\n [flowId, getFlowQuote]\n );\n\n return {\n isProcessingTokenSelection,\n requote,\n selectToken,\n tokenSelectionFailed,\n };\n};\n","import type {\n Flow,\n TokenBalance,\n WalletAccount,\n} from '@dynamic-labs-sdk/client';\nimport {\n useGetFlow,\n useGetWalletAccounts,\n} from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { useGetWalletName } from '../../../../utils/hooks/useGetWalletName';\nimport type { ConnectWalletOptionConnectedParams } from '../../../../widgets/ConnectWalletOptionWidget/useConnectWalletOptionWidget';\nimport { useViewRouter } from '../../../../utils/hooks/useViewRouter';\nimport type { SubmitTransactionErrorType } from '../../../utils/getSubmitTransactionErrorType';\nimport type { WalletAttachErrorType } from '../../../utils/getWalletAttachErrorType';\nimport { flowPayWithWalletRoutes } from '../routes/flowPayWithWalletRoutes';\nimport type { FlowPayWithWalletRoute } from '../routes/flowPayWithWalletRoutes.types';\nimport { findResumableWalletAccount } from './findResumableWalletAccount';\nimport { getRouterParams } from './getRouterParams';\nimport { getSubmitErrorAction } from './getSubmitErrorAction';\nimport { useAttachWalletSource } from './useAttachWalletSource';\nimport { useSubmitPayment } from './useSubmitPayment';\nimport { useTokenPick } from './useTokenPick';\n\n/**\n * Params for {@link useFlowPayWithWalletWidget}.\n *\n * @example\n * ```ts\n * const params: UseFlowPayWithWalletWidgetParams = { flowId: 'flow_123' };\n * ```\n * @see useFlowPayWithWalletWidget\n * @see FlowPayWithWalletRoute\n */\nexport type UseFlowPayWithWalletWidgetParams = {\n /** The flow the customer is paying for — the widget fetches and polls it by id. */\n flowId: string;\n /** Leaves the wallet rail from its first screen; omit to show no Back there. */\n onBack?: () => void;\n /** Leaves the wallet rail for another payment method after a decline; omit to hide the option. */\n onPayAnotherWay?: () => void;\n};\n\n/**\n * What {@link useFlowPayWithWalletWidget} hands the widget to render.\n */\nexport type UseFlowPayWithWalletWidgetResult = {\n /** The kind of the last failure to attach the connected wallet — the connect screen shows the matching inline error. */\n attachError: WalletAttachErrorType | undefined;\n /** Clears the last attach failure, such as when the payer picks another wallet. */\n clearAttachError: () => void;\n /** Confirms the reviewed payment and submits it; a sent payment shows its progress. */\n confirmPayment: () => void;\n /** The route on top of the stack — the screen to render. */\n currentRoute: FlowPayWithWalletRoute;\n /** The flow the widget renders — fetched and polled by `flowId`, kept current by mutations through the `useGetFlow` cache. */\n flow: Flow | undefined;\n /** Returns to the previous route retained in history, or calls `onBack` on the first screen. `undefined` when the current route offers no way back. */\n goBack: (() => void) | undefined;\n /** Attaches the connected account as the payment source, then advances to the token pick. */\n handleConnectedWallet: (params: ConnectWalletOptionConnectedParams) => void;\n /** Picks the token to pay with and fetches its quote. */\n handleSelectedToken: (token: TokenBalance) => void;\n /** Locks the connect screen while the connected wallet is attached. */\n isAttachingWallet: boolean;\n /** Locks the token list while the picked token is quoted. */\n isProcessingTokenSelection: boolean;\n /** Locks the decline screen's actions while a retry re-quotes and resubmits. */\n isRetryingPayment: boolean;\n /** Locks the review screen's actions while payment submission runs. */\n isSubmittingPayment: boolean;\n /** Leaves the wallet rail for another payment method — `undefined` when not offered. */\n onPayAnotherWay: (() => void) | undefined;\n /** Replaces an expired quote with a new one for the same token and network. */\n requoteExpiredQuote: () => void;\n /** Retries a declined payment: gets a fresh quote for the same token, then submits again. */\n retryDeclinedPayment: () => void;\n /** The recovery action the current submission failure offers — re-quote, pick another token, or retry. */\n submitErrorAction: (() => void) | undefined;\n /** The kind of the last submission's failure — the review screen shows the matching inline error. */\n submitTransactionErrorType: SubmitTransactionErrorType | undefined;\n /** Whether the last token pick failed — shows the inline error banner on the choose-token screen. */\n tokenSelectionFailed: boolean;\n /** Display name of the wallet that declined, when known. */\n walletName: string | undefined;\n};\n\n/**\n * The state machine behind {@link FlowPayWithWalletWidget}: a stack of typed\n * route entries driven by the SDK flow functions across wallet connection,\n * token pick and quote review, plus the screens for a payment declined in the\n * wallet and for one sent before the flow reports it.\n *\n * `handleConnectedWallet` attaches the wallet as the flow's source, which\n * also checks the wallet can be used for this payment; `handleSelectedToken`\n * fetches the quote, and `confirmPayment` submits the transaction. Once sent, the flow's own state\n * takes over: processing and the payment's outcome are shown outside these\n * routes.\n *\n * A quoted payment reopened with the same wallet connected resumes on its\n * review.\n *\n * @example\n * ```tsx\n * const { currentRoute, handleSelectedToken, confirmPayment } = useFlowPayWithWalletWidget({\n * flowId,\n * });\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onBack - Leaves the wallet rail from its first screen.\n * @param params.onPayAnotherWay - Leaves the wallet rail for another payment method after a decline.\n * @returns The current route and the actions that advance it.\n * @see UseFlowPayWithWalletWidgetParams\n * @see UseFlowPayWithWalletWidgetResult\n * @notInstrumented\n */\nexport const useFlowPayWithWalletWidget = ({\n flowId,\n onBack,\n onPayAnotherWay,\n}: UseFlowPayWithWalletWidgetParams): UseFlowPayWithWalletWidgetResult => {\n // The flow the widget renders — a single source, polled by `useGetFlow`\n // while the flow can still change. The flow mutations keep it current by\n // writing their result into this query's cache.\n const { data: flow } = useGetFlow({ flowId });\n\n // The rail only mounts once the flow has loaded, so the client is ready and\n // the connected wallets are already known on this first render.\n const { data: walletAccounts } = useGetWalletAccounts();\n\n // Decided once, at mount: later wallet changes come from the payer's own steps.\n const [resumedWalletAccount] = useState(() =>\n findResumableWalletAccount({ flow, walletAccounts: walletAccounts ?? [] })\n );\n\n const router = useViewRouter(getRouterParams({ resumedWalletAccount }));\n\n const isTerminalRoute =\n flowPayWithWalletRoutes[router.current.name].terminal === true;\n const goBack = useMemo(() => {\n if (isTerminalRoute) {\n return undefined;\n }\n // The first screen has no route below it, so Back leaves to the host.\n if (!router.canPop) {\n return onBack;\n }\n return router.pop;\n }, [isTerminalRoute, onBack, router.canPop, router.pop]);\n\n const [walletAccount, setWalletAccount] = useState<WalletAccount | undefined>(\n resumedWalletAccount\n );\n const walletName = useGetWalletName({ walletAccount });\n\n // A wallet only becomes the paying one once attached, so a rejected wallet\n // never reaches the later steps.\n const handleAttached = useCallback(\n (attachedAccount: WalletAccount) => {\n setWalletAccount(attachedAccount);\n router.navigate({\n name: 'choose-token',\n params: { walletAccount: attachedAccount },\n });\n },\n [router.navigate]\n );\n\n const {\n attachError,\n attachWalletSource,\n clearAttachError,\n isAttachingWallet,\n } = useAttachWalletSource({ flowId, onAttached: handleAttached });\n\n const handleDeclined = useCallback(() => {\n router.navigate({ name: 'payment-not-approved' });\n }, [router.navigate]);\n\n // A sent payment usually lands as a broadcasted flow and the outcome\n // boundary takes over. When the wallet's confirmation times out the flow is\n // still awaiting payment, so the rail shows the progress itself: staying on\n // review would let the payer confirm, and pay, a second time.\n const handleSubmitted = useCallback(() => {\n router.navigate({ name: 'payment-sent' });\n }, [router.navigate]);\n\n const {\n clearSubmitError,\n handleSubmitError,\n isSubmittingPayment,\n retrySubmit,\n submitPayment,\n submitTransactionErrorType,\n } = useSubmitPayment({\n flowId,\n onDeclined: handleDeclined,\n onSubmitted: handleSubmitted,\n walletAccount,\n });\n\n const handleQuoted = useCallback(() => {\n // A fresh quote retires the previous token's submission failure.\n clearSubmitError();\n router.navigate({ name: 'review-payment' });\n }, [clearSubmitError, router.navigate]);\n\n const {\n isProcessingTokenSelection,\n requote,\n selectToken,\n tokenSelectionFailed,\n } = useTokenPick({ flowId, onQuoted: handleQuoted });\n\n // The expired-quote error stays until the replacement quote lands or a new\n // failure replaces it — clearing it first would re-enable Confirm on the\n // expired quote while the re-quote is still in flight.\n const quote = flow?.quote;\n const requoteExpiredQuote = useCallback(() => {\n requote({\n onError: handleSubmitError,\n onSuccess: clearSubmitError,\n quote,\n });\n }, [clearSubmitError, handleSubmitError, quote, requote]);\n\n // A decline leaves the flow mid-signing, where submitting again is rejected;\n // a fresh quote reopens it, so the retry submits only once that quote lands.\n // Set synchronously: the button only locks once the pending state reaches a render,\n // and a second re-quote would drop the first one's callbacks.\n const isRetryInFlightRef = useRef(false);\n const retryDeclinedPayment = useCallback(() => {\n if (isRetryInFlightRef.current) {\n return;\n }\n isRetryInFlightRef.current = true;\n const releaseRetry = () => {\n isRetryInFlightRef.current = false;\n };\n\n clearSubmitError();\n requote({\n onError: (error) => {\n releaseRetry();\n handleSubmitError(error);\n },\n onSuccess: () => submitPayment({ onSettled: releaseRetry }),\n quote,\n });\n }, [clearSubmitError, handleSubmitError, quote, requote, submitPayment]);\n\n // The re-quote shares the token pick's quote request, so its pending state covers it.\n const isRetryingPayment = isProcessingTokenSelection || isSubmittingPayment;\n\n const pickAnotherToken = useCallback(() => {\n clearSubmitError();\n // Back to the retained choose-token entry below the rejected review —\n // pushing another one would reopen the failed quote on Back.\n router.pop();\n }, [clearSubmitError, router.pop]);\n\n // Derived at render so the action is always the current verb, never a stale closure.\n const submitErrorAction = getSubmitErrorAction({\n actions: {\n onPickAnotherToken: pickAnotherToken,\n onRequote: requoteExpiredQuote,\n onRetry: retrySubmit,\n },\n kind: submitTransactionErrorType,\n });\n\n return {\n attachError,\n clearAttachError,\n confirmPayment: submitPayment,\n currentRoute: router.current,\n flow,\n goBack,\n handleConnectedWallet: attachWalletSource,\n handleSelectedToken: selectToken,\n isAttachingWallet,\n isProcessingTokenSelection,\n isRetryingPayment,\n isSubmittingPayment,\n onPayAnotherWay,\n requoteExpiredQuote,\n retryDeclinedPayment,\n submitErrorAction,\n submitTransactionErrorType,\n tokenSelectionFailed,\n walletName,\n };\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { renderFlowPayWithWalletRoute } from '../renderFlowPayWithWalletRoute';\nimport { useFlowPayWithWalletWidget } from '../useFlowPayWithWalletWidget';\nimport type { UseFlowPayWithWalletWidgetParams } from '../useFlowPayWithWalletWidget';\n\n/**\n * Props for {@link FlowPayWithWalletWidgetContent}.\n *\n * @example\n * ```tsx\n * const props: FlowPayWithWalletWidgetContentProps = { flowId: 'flow_123' };\n * ```\n * @see FlowPayWithWalletWidgetContent\n * @see FlowPayWithWalletWidgetProps\n */\nexport type FlowPayWithWalletWidgetContentProps =\n UseFlowPayWithWalletWidgetParams;\n\n/**\n * Renders the pay-with-wallet step for one flow; the widget remounts it when the flow changes.\n *\n * @example\n * ```tsx\n * <FlowPayWithWalletWidgetContent key={flowId} flowId={flowId} />\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onBack - Leaves the wallet rail from its first screen.\n * @param params.onPayAnotherWay - Leaves the wallet rail for another payment method after a decline.\n * @returns The current route's screen.\n * @see FlowPayWithWalletWidget\n * @see useFlowPayWithWalletWidget\n * @notInstrumented\n */\nexport const FlowPayWithWalletWidgetContent: FC<\n FlowPayWithWalletWidgetContentProps\n> = ({ flowId, onBack, onPayAnotherWay }) => {\n const widget = useFlowPayWithWalletWidget({\n flowId,\n onBack,\n onPayAnotherWay,\n });\n\n return renderFlowPayWithWalletRoute({ route: widget.currentRoute, widget });\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { PanelHost } from '../../../components/PanelHost';\nimport { FlowOutcomeBoundary } from '../FlowOutcomeBoundary';\nimport type { FlowOutcomeCallbacks } from '../FlowOutcomeBoundary/FlowOutcomeBoundary.types';\nimport { FlowPayWithWalletWidgetContent } from './FlowPayWithWalletWidgetContent';\n\n/**\n * Props for {@link FlowPayWithWalletWidget}.\n *\n * @example\n * ```tsx\n * const props: FlowPayWithWalletWidgetProps = {\n * flowId: 'flow_123',\n * onPaymentCompleted: (flow) => console.log(flow.id),\n * };\n * ```\n * @see FlowPayWithWalletWidget\n * @see FlowWalletConnectionView\n * @see FlowChooseTokenView\n * @see FlowReviewPaymentView\n * @see FlowProcessingPayment\n */\nexport type FlowPayWithWalletWidgetProps = FlowOutcomeCallbacks & {\n className?: string;\n /** The flow the customer is paying for — fetched and polled by id. */\n flowId: string;\n /**\n * Leaves the wallet rail from its first screen, the wallet list, as its\n * Back — e.g. to return to a payment method choice. Later screens keep\n * going back within the rail. Without it, the first screen has no Back.\n */\n onBack?: () => void;\n /**\n * Leaves the wallet rail for another payment method after the payer\n * declined in their wallet. Offered on the payment-not-approved screen only\n * when set — a standalone widget without other payment options passes\n * nothing and the option stays hidden.\n */\n onPayAnotherWay?: () => void;\n};\n\n/**\n * The pay-with-wallet orchestrator: shows a loader while the payment loads,\n * or an error with a retry when it can't load, then walks the customer\n * through connecting a wallet, picking the token to pay with and reviewing\n * the quote, with payment-not-approved when the payer declines in their\n * wallet. Once the payment is sent it shows its progress and lands on\n * payment-complete, payment-failed, payment-refunded, payment-cancelled or\n * expired as the flow's own state\n * decides — also when the link is reopened or reloaded mid-payment, or opened\n * already paid. Drives the SDK flow itself: token pick attaches the source\n * and fetches the quote, review confirm runs the submission, and the flow is\n * polled to its outcome, firing `onPaymentCompleted` or `onPaymentFailed`\n * once per mount.\n *\n * Stands alone — it needs only a `flowId`. A host offering other payment\n * methods hands it two exits back to them: `onBack`, Back on the first\n * screen, and `onPayAnotherWay`, offered after a decline in the wallet.\n *\n * @example\n * ```tsx\n * import { FlowPayWithWalletWidget } from '@/flow/widgets/FlowPayWithWalletWidget/FlowPayWithWalletWidget';\n *\n * const App = () => (\n * <FlowPayWithWalletWidget\n * flowId=\"flow_123\"\n * onPaymentCompleted={(flow) => console.log(flow.id)}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onPaymentCompleted - Fires once per mount with the settled flow when the payment completes, including one already paid when opened.\n * @param params.onPaymentFailed - Fires once per mount with the flow when it expires, is cancelled or fails.\n * @param params.onBack - Leaves the wallet rail from its first screen.\n * @param params.onPayAnotherWay - Leaves the wallet rail for another payment method after a decline.\n * @returns The pay-with-wallet orchestration.\n * @see FlowPayWithWalletWidgetProps\n * @see useFlowPayWithWalletWidget\n * @see ConnectWalletOptionWidget\n * @see PanelHost\n * @notInstrumented\n */\nexport const FlowPayWithWalletWidget: FC<FlowPayWithWalletWidgetProps> = ({\n className,\n flowId,\n onBack,\n onPayAnotherWay,\n onPaymentCompleted,\n onPaymentFailed,\n}) => (\n // The root sits outside the boundary so the host's class also applies while\n // the flow loads or fails to load.\n <div className={className} data-slot=\"dyn-flow-pay-with-wallet-widget\">\n {/* One card for every screen, including loading and the outcome. */}\n <PanelHost>\n {/* Keyed by flow so a new flowId starts a fresh payment: the boundary,\n route, wallet, errors and in-flight submission all reset. */}\n <FlowOutcomeBoundary\n flowId={flowId}\n key={flowId}\n onPaymentCompleted={onPaymentCompleted}\n onPaymentFailed={onPaymentFailed}\n >\n <FlowPayWithWalletWidgetContent\n flowId={flowId}\n onBack={onBack}\n onPayAnotherWay={onPayAnotherWay}\n />\n </FlowOutcomeBoundary>\n </PanelHost>\n </div>\n);\n","// jsdoc-completeness-disable @see\nimport type { FC } from 'react';\n\nimport type { IconProps } from '../icon.types';\n\n/**\n * Bank glyph for payment-method rows.\n *\n * The source artwork is 18.4889×18.4889 (the method list's designed box); it\n * renders at that size by default and inherits its color from `currentColor`\n * so the row can tone it to its ink.\n *\n * @example\n * ```tsx\n * import { BankIcon } from '@/icons/BankIcon/BankIcon';\n *\n * const App = () => <BankIcon />;\n * ```\n * @param params.className - Extra class names for the svg element.\n * @param params.size - Rendered edge length in pixels.\n * @returns The bank glyph.\n * @see IconProps\n * @notInstrumented\n */\nexport const BankIcon: FC<IconProps> = ({ className, size = 18.4889 }) => (\n <svg\n aria-hidden=\"true\"\n className={className}\n fill=\"none\"\n focusable=\"false\"\n height={size}\n viewBox=\"0 0 18.4889 18.4889\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9.34077 4.42964H9.24447M9.43707 4.42964C9.43707 4.53601 9.35086 4.62224 9.24447 4.62224C9.13809 4.62224 9.05188 4.53601 9.05188 4.42964C9.05188 4.32328 9.13809 4.23705 9.24447 4.23705C9.35086 4.23705 9.43707 4.32328 9.43707 4.42964Z\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M3.85186 6.93336V14.6371M6.93336 6.93336V14.6371\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M11.5556 6.93336V14.6371M14.6371 6.93336V14.6371\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M16.4488 6.93336H2.04012C1.76432 6.93336 1.54075 6.70726 1.54075 6.42835C1.54075 6.25742 1.62625 6.09809 1.76797 6.00494L6.72541 2.74626C7.94801 1.94259 8.55938 1.54075 9.24447 1.54075C9.92957 1.54075 10.5409 1.94259 11.7635 2.74626L16.721 6.00494C16.8627 6.09809 16.9482 6.25742 16.9482 6.42835C16.9482 6.70726 16.7246 6.93336 16.4488 6.93336Z\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M16.2084 15.6331L15.6786 15.0884C15.4619 14.8657 15.3536 14.7543 15.2159 14.6957C15.0782 14.6371 14.9251 14.6371 14.6188 14.6371H3.87022C3.56391 14.6371 3.41075 14.6371 3.27303 14.6957C3.13532 14.7543 3.02702 14.8657 2.81043 15.0884L2.28054 15.6331C1.73608 16.1928 1.46386 16.4727 1.55967 16.7104C1.65548 16.9482 2.04046 16.9482 2.81043 16.9482H15.6786C16.4485 16.9482 16.8335 16.9482 16.9293 16.7104C17.0251 16.4727 16.7528 16.1928 16.2084 15.6331Z\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n </svg>\n);\n","// jsdoc-completeness-disable @see\nimport type { FC } from 'react';\n\nimport type { IconProps } from '../icon.types';\n\n/**\n * Wallet glyph for payment-method rows.\n *\n * The source artwork is 18.4889×18.4889 (the method list's designed box); it\n * renders at that size by default and inherits its color from `currentColor`\n * so the row can tone it to its ink.\n *\n * @example\n * ```tsx\n * import { WalletIcon } from '@/icons/WalletIcon/WalletIcon';\n *\n * const App = () => <WalletIcon />;\n * ```\n * @param params.className - Extra class names for the svg element.\n * @param params.size - Rendered edge length in pixels.\n * @returns The wallet glyph.\n * @see IconProps\n * @notInstrumented\n */\nexport const WalletIcon: FC<IconProps> = ({ className, size = 18.4889 }) => (\n <svg\n aria-hidden=\"true\"\n className={className}\n fill=\"none\"\n focusable=\"false\"\n height={size}\n viewBox=\"0 0 18.4889 18.4889\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M10.7852 2.31112H3.85186C3.00093 2.31112 2.31112 3.00093 2.31112 3.85186C2.31112 4.7028 3.00093 5.39261 3.85186 5.39261H13.8667C13.8667 4.67619 13.8667 4.31797 13.788 4.02407C13.5743 3.22653 12.9513 2.60357 12.1538 2.38987C11.8599 2.31112 11.5017 2.31112 10.7852 2.31112Z\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M2.31112 3.85186V11.5556C2.31112 13.7345 2.31112 14.824 2.98803 15.5009C3.66494 16.1778 4.75441 16.1778 6.93336 16.1778H11.5556C13.7345 16.1778 14.824 16.1778 15.5009 15.5009C16.1778 14.824 16.1778 13.7345 16.1778 11.5556V10.0148C16.1778 7.83592 16.1778 6.74643 15.5009 6.06952C14.824 5.39261 13.7345 5.39261 11.5556 5.39261H5.39261\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n <path\n d=\"M16.1778 9.24447H14.6371C14.2789 9.24447 14.0997 9.24447 13.9528 9.28384C13.554 9.39069 13.2426 9.70215 13.1357 10.101C13.0963 10.2479 13.0963 10.427 13.0963 10.7852C13.0963 11.1434 13.0963 11.3226 13.1357 11.4695C13.2426 11.8683 13.554 12.1797 13.9528 12.2866C14.0997 12.326 14.2789 12.326 14.6371 12.326H16.1778\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1.15556\"\n />\n </svg>\n);\n","'use client';\n\nimport { m } from 'motion/react';\nimport type { FC, ReactNode } from 'react';\n\nimport { PRESS_SCALE } from '../../../motion/motionTokens';\n\n/**\n * Props for {@link FlowPaymentMethodOption}.\n *\n * @example\n * ```tsx\n * const props: FlowPaymentMethodOptionProps = {\n * icon: <CardIcon />,\n * meta: ['Instant', 'No limit'],\n * name: 'Card',\n * };\n * ```\n * @see FlowPaymentMethodOption\n * @see Panel\n */\nexport type FlowPaymentMethodOptionProps = {\n className?: string;\n /** The method icon, rendered in the shared leading slot. */\n icon: ReactNode;\n /** Row identifier; the row's `data-testid` is `flow-payment-method-option-<id>`. */\n id?: string;\n /** Facts shown under the name, rendered dot-separated (\"Instant · No limit\"). */\n meta?: string[];\n /** Display name. */\n name: string;\n /** Fires when the row is chosen. */\n onClick?: () => void;\n /** Trailing slot — a `Badge`, a figure like \"$0 fee\", or any node. */\n trailing?: ReactNode;\n};\n\n/**\n * One pickable payment method: a leading icon slot, the method's name with an\n * optional line of dot-separated metadata under it, and an optional trailing\n * slot (a badge, a figure, any node). Carries its affordance on hover and\n * press rather than on a chevron.\n *\n * @example\n * ```tsx\n * import { FlowPaymentMethodOption } from '@/flow/components/FlowPaymentMethodOption/FlowPaymentMethodOption';\n *\n * const App = () => (\n * <FlowPaymentMethodOption\n * icon={<CardIcon />}\n * meta={['Instant', 'No limit']}\n * name=\"Card\"\n * onClick={() => {}}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the row element.\n * @param params.icon - The method icon.\n * @param params.id - Row identifier, exposed as `data-testid=\"flow-payment-method-option-<id>\"`.\n * @param params.meta - Facts rendered under the name, dot-separated.\n * @param params.name - The method's display name.\n * @param params.onClick - Fires when the row is chosen.\n * @param params.trailing - Trailing slot — a `Badge`, a figure, or any node.\n * @returns The payment method option.\n * @see FlowPaymentMethodOptionProps\n * @see Panel\n * @notInstrumented\n */\nexport const FlowPaymentMethodOption: FC<FlowPaymentMethodOptionProps> = ({\n className,\n icon,\n id,\n meta,\n name,\n onClick,\n trailing,\n}) => (\n <m.button\n className={className}\n data-slot=\"dyn-flow-payment-method-option\"\n data-testid={\n id !== undefined ? `flow-payment-method-option-${id}` : undefined\n }\n initial={false}\n onClick={onClick}\n type=\"button\"\n whileTap={{ scale: PRESS_SCALE.row }}\n >\n <span data-slot=\"dyn-flow-payment-method-option-lead\">\n <span aria-hidden data-slot=\"dyn-flow-payment-method-option-icon\">\n {icon}\n </span>\n <span data-slot=\"dyn-flow-payment-method-option-texts\">\n <span data-slot=\"dyn-flow-payment-method-option-name\">{name}</span>\n {meta !== undefined && meta.length > 0 && (\n <span data-slot=\"dyn-flow-payment-method-option-meta\">\n {meta.map((entry, index) => (\n <span\n data-slot=\"dyn-flow-payment-method-option-meta-item\"\n key={`${index}-${entry}`}\n >\n {index > 0 && (\n <span\n aria-hidden\n data-slot=\"dyn-flow-payment-method-option-meta-dot\"\n />\n )}\n {entry}\n </span>\n ))}\n </span>\n )}\n </span>\n </span>\n {trailing !== undefined && (\n <span data-slot=\"dyn-flow-payment-method-option-trailing\">\n {trailing}\n </span>\n )}\n </m.button>\n);\n","/** Default text for {@link FlowChoosePaymentSourceView}. */\nexport const FLOW_CHOOSE_PAYMENT_SOURCE_VIEW_TEXT = {\n connectWallet: 'Connect a wallet',\n depositTime: '~2 mins',\n exchangeLimit: 'Limits apply',\n exchangeTime: '~5 mins',\n instant: 'Instant',\n noLimit: 'No limit',\n payWithExchange: 'Pay with an exchange',\n sendToAddress: 'Send to an address',\n title: 'Pay with crypto',\n};\n\ndeclare module '../../../i18n/text.types' {\n interface TextSlots {\n 'dyn-flow-choose-payment-source-view': typeof FLOW_CHOOSE_PAYMENT_SOURCE_VIEW_TEXT;\n }\n}\n","'use client';\n\nimport type { FC } from 'react';\n\nimport { FLOW_PAYMENT_METHODS } from '../../constants';\nimport type { FlowPaymentMethod } from '../../flow.types';\nimport { useText } from '../../../i18n/useText';\nimport { BankIcon } from '../../../icons/BankIcon';\nimport { QrCodeIcon } from '../../../icons/QrCodeIcon';\nimport { WalletIcon } from '../../../icons/WalletIcon';\nimport { Panel } from '../../../components/Panel';\nimport { FlowPaymentMethodOption } from '../../components/FlowPaymentMethodOption';\nimport { FLOW_CHOOSE_PAYMENT_SOURCE_VIEW_TEXT } from './FlowChoosePaymentSourceView.text';\n\n/**\n * Props for {@link FlowChoosePaymentSourceView}.\n *\n * @example\n * ```tsx\n * const props: FlowChoosePaymentSourceViewProps = {\n * onSelect: (source) => console.log(source),\n * };\n * ```\n * @see FlowChoosePaymentSourceView\n * @see FlowPaymentMethodOption\n */\nexport type FlowChoosePaymentSourceViewProps = {\n /** Extra class names for the panel element. */\n className?: string;\n /** Fires when Back is pressed. Omit on a root screen to hide Back. */\n onBack?: () => void;\n /** Fires with the chosen source; the parent owns navigation to its next step. */\n onSelect?: (source: FlowPaymentMethod) => void;\n /** The methods to offer; defaults to every method. */\n paymentMethods?: readonly FlowPaymentMethod[];\n};\n\n/**\n * The Flow \"Pay with crypto\" screen: choose between connecting a wallet,\n * paying through an exchange and sending to an address, with timing and\n * limits. `paymentMethods` limits the rows shown.\n *\n * @example\n * ```tsx\n * import { FlowChoosePaymentSourceView } from '@/flow/views/FlowChoosePaymentSourceView/FlowChoosePaymentSourceView';\n *\n * const App = () => (\n * <FlowChoosePaymentSourceView\n * onBack={() => history.back()}\n * onSelect={(source) => console.log(source)}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the panel element.\n * @param params.onBack - Fires when Back is pressed. Omit to hide Back.\n * @param params.onSelect - Fires with the chosen source for the parent to navigate.\n * @param params.paymentMethods - The methods to offer; defaults to every method.\n * @returns The payment-source picker.\n * @see FlowChoosePaymentSourceViewProps\n * @see FlowPaymentMethodOption\n * @see Panel\n * @copy title - The centered header title.\n * @copy connectWallet - The wallet connection option label.\n * @copy payWithExchange - The exchange option label.\n * @copy sendToAddress - The address transfer option label.\n * @copy instant - The wallet option's estimated timing.\n * @copy depositTime - The address option's estimated timing.\n * @copy exchangeTime - The exchange option's estimated timing.\n * @copy exchangeLimit - The exchange option's limit description.\n * @copy noLimit - The limit description shown for the wallet and address options.\n * @notInstrumented\n */\nexport const FlowChoosePaymentSourceView: FC<\n FlowChoosePaymentSourceViewProps\n> = ({\n className,\n onBack,\n onSelect,\n paymentMethods = FLOW_PAYMENT_METHODS,\n}) => {\n const text = useText({\n defaults: FLOW_CHOOSE_PAYMENT_SOURCE_VIEW_TEXT,\n slot: 'dyn-flow-choose-payment-source-view',\n });\n\n return (\n <Panel className={className} onBack={onBack} title={text('title')}>\n <div data-slot=\"dyn-flow-choose-payment-source-view\">\n {paymentMethods.includes('wallet') && (\n <FlowPaymentMethodOption\n icon={<WalletIcon />}\n meta={[text('instant'), text('noLimit')]}\n name={text('connectWallet')}\n onClick={() => onSelect?.('wallet')}\n />\n )}\n {paymentMethods.includes('exchange') && (\n <FlowPaymentMethodOption\n icon={<BankIcon />}\n meta={[text('exchangeTime'), text('exchangeLimit')]}\n name={text('payWithExchange')}\n onClick={() => onSelect?.('exchange')}\n />\n )}\n {paymentMethods.includes('deposit_address') && (\n <FlowPaymentMethodOption\n icon={<QrCodeIcon />}\n meta={[text('depositTime'), text('noLimit')]}\n name={text('sendToAddress')}\n onClick={() => onSelect?.('deposit_address')}\n />\n )}\n </div>\n </Panel>\n );\n};\n","import { FlowChoosePaymentSourceView } from '../../../../views/FlowChoosePaymentSourceView';\nimport type { FlowWidgetRouteModule } from '../flowWidgetRoutes.types';\n\n/** The payment method choice route entry; it carries no params. */\nexport type ChoosePaymentMethodRoute = {\n name: 'choose-payment-method';\n};\n\n/**\n * The first route of {@link FlowWidget}: the payer chooses between the\n * payment methods the flow offers.\n * Retained in history, so Back from any method returns here.\n *\n * @see FlowWidgetRouteModule\n * @see flowWidgetRoutes\n * @see FlowChoosePaymentSourceView\n */\nexport const choosePaymentMethodRoute: FlowWidgetRouteModule<ChoosePaymentMethodRoute> =\n {\n render: ({ widget }) => (\n <FlowChoosePaymentSourceView\n onSelect={widget.chooseMethod}\n paymentMethods={widget.paymentMethods}\n />\n ),\n retainInHistory: true,\n };\n","import { FlowDepositAddressWidget } from '../../../FlowDepositAddressWidget';\nimport type { FlowWidgetRouteModule } from '../flowWidgetRoutes.types';\n\n/** The pay-to-deposit-address route entry; it carries no params. */\nexport type PayWithDepositAddressRoute = {\n name: 'pay-with-deposit-address';\n};\n\n/**\n * The pay-to-deposit-address route of {@link FlowWidget}: the deposit-address\n * steps with the host's refund addresses, whose Back returns to the payment\n * method choice. Outcome callbacks are not passed: the widget around the\n * route reports the outcome.\n *\n * @see FlowWidgetRouteModule\n * @see flowWidgetRoutes\n * @see FlowDepositAddressWidget\n */\nexport const payWithDepositAddressRoute: FlowWidgetRouteModule<PayWithDepositAddressRoute> =\n {\n render: ({ widget }) => (\n <FlowDepositAddressWidget\n flowId={widget.flowId}\n onBack={widget.goBack}\n refundAddresses={widget.refundAddresses}\n />\n ),\n };\n","import { FlowPayWithExchangeWidgetContent } from '../../../FlowPayWithExchangeWidget/FlowPayWithExchangeWidgetContent';\nimport type { FlowWidgetRouteModule } from '../flowWidgetRoutes.types';\n\n/** The pay-with-exchange route entry. */\nexport type PayWithExchangeRoute = {\n name: 'pay-with-exchange';\n /** Whether a payment waiting on an exchange reopens on it: only when the flow widget itself reopens on this route. */\n resumesWaitingExchange: boolean;\n};\n\n/**\n * The pay-with-exchange route of {@link FlowWidget}: the exchange steps, whose\n * Back on the exchange list returns to the payment method choice. It renders\n * the exchange widget's content, since the flow widget already reports the\n * outcome, and starts on the exchange list unless the route was resumed.\n *\n * @see FlowWidgetRouteModule\n * @see flowWidgetRoutes\n * @see FlowPayWithExchangeWidget\n */\nexport const payWithExchangeRoute: FlowWidgetRouteModule<PayWithExchangeRoute> =\n {\n render: ({ route, widget }) => (\n <FlowPayWithExchangeWidgetContent\n flowId={widget.flowId}\n onBack={widget.goBack}\n resumesWaitingExchange={route.resumesWaitingExchange}\n />\n ),\n };\n","import { FlowPayWithWalletWidget } from '../../../FlowPayWithWalletWidget';\nimport type { FlowWidgetRouteModule } from '../flowWidgetRoutes.types';\n\n/** The pay-with-wallet route entry; it carries no params. */\nexport type PayWithWalletRoute = {\n name: 'pay-with-wallet';\n};\n\n/**\n * The pay-with-wallet route of {@link FlowWidget}: the wallet steps, whose\n * Back on the wallet list and Pay another way after a decline both return to\n * the payment method choice. Outcome callbacks are not passed: the widget\n * around the route reports the outcome.\n *\n * @see FlowWidgetRouteModule\n * @see flowWidgetRoutes\n * @see FlowPayWithWalletWidget\n */\nexport const payWithWalletRoute: FlowWidgetRouteModule<PayWithWalletRoute> = {\n render: ({ widget }) => (\n <FlowPayWithWalletWidget\n flowId={widget.flowId}\n onBack={widget.goBack}\n onPayAnotherWay={widget.goBack}\n />\n ),\n};\n","import { choosePaymentMethodRoute } from './choosePaymentMethodRoute';\nimport type {\n FlowWidgetRouteByName,\n FlowWidgetRouteModule,\n FlowWidgetRouteName,\n} from './flowWidgetRoutes.types';\nimport { payWithDepositAddressRoute } from './payWithDepositAddressRoute';\nimport { payWithExchangeRoute } from './payWithExchangeRoute';\nimport { payWithWalletRoute } from './payWithWalletRoute';\n\n/**\n * The route table behind {@link FlowWidget}: the payment method choice and\n * one route per method. A route missing here, or a module filed under another\n * route's name, fails type checking.\n *\n * @see FlowWidgetRouteModule\n * @see renderFlowWidgetRoute\n */\nexport const flowWidgetRoutes: {\n [Name in FlowWidgetRouteName]: FlowWidgetRouteModule<\n FlowWidgetRouteByName[Name]\n >;\n} = {\n 'choose-payment-method': choosePaymentMethodRoute,\n 'pay-with-deposit-address': payWithDepositAddressRoute,\n 'pay-with-exchange': payWithExchangeRoute,\n 'pay-with-wallet': payWithWalletRoute,\n};\n","import type { ReactNode } from 'react';\n\nimport { flowWidgetRoutes } from '../routes/flowWidgetRoutes';\nimport type {\n FlowWidgetRouteByName,\n FlowWidgetRouteName,\n FlowWidgetRouteRenderParams,\n} from '../routes/flowWidgetRoutes.types';\n\n/**\n * Params for {@link renderFlowWidgetRoute}.\n *\n * @see renderFlowWidgetRoute\n * @see FlowWidgetRouteRenderParams\n */\nexport type RenderFlowWidgetRouteParams<Name extends FlowWidgetRouteName> =\n FlowWidgetRouteRenderParams<FlowWidgetRouteByName[Name] & { name: Name }>;\n\n/**\n * Renders the flow widget screen for a route through its route module. The\n * generic route name ties the route to its own module, so the lookup needs no\n * cast.\n *\n * @example\n * ```tsx\n * renderFlowWidgetRoute({ route: widget.currentRoute, widget });\n * ```\n * @param params.route - The route entry to render.\n * @param params.widget - The widget's state and actions.\n * @returns The route's screen.\n * @see flowWidgetRoutes\n * @see FlowWidgetRouteModule\n * @notInstrumented\n */\nexport const renderFlowWidgetRoute = <Name extends FlowWidgetRouteName>({\n route,\n widget,\n}: RenderFlowWidgetRouteParams<Name>): ReactNode =>\n flowWidgetRoutes[route.name].render({ route, widget });\n","import { FLOW_PAYMENT_METHODS } from '../../constants';\nimport type { FlowPaymentMethod, FlowUiSettings } from '../../flow.types';\n\n/** Params for {@link getFlowPaymentMethods}. */\nexport type GetFlowPaymentMethodsParams = {\n /** The flow's display settings, which may limit the payment methods offered. */\n uiSettings: FlowUiSettings;\n};\n\n/**\n * Returns the payment methods to offer the payer, in the method choice's\n * order: the ones the flow's `enabledPaymentMethods` setting lists, or every\n * method when it lists none.\n *\n * @example\n * ```ts\n * const paymentMethods = getFlowPaymentMethods({ uiSettings });\n * ```\n * @param params.uiSettings - The flow's display settings, which may limit the payment methods offered.\n * @returns The payment methods to offer, never empty.\n * @see FlowChoosePaymentSourceView\n * @see useFlowWidget\n * @notInstrumented\n */\nexport const getFlowPaymentMethods = ({\n uiSettings,\n}: GetFlowPaymentMethodsParams): readonly FlowPaymentMethod[] => {\n const enabledPaymentMethods = new Set<string>(\n uiSettings.enabledPaymentMethods\n );\n const paymentMethods = FLOW_PAYMENT_METHODS.filter((paymentMethod) =>\n enabledPaymentMethods.has(paymentMethod)\n );\n\n // A config listing no method this UI supports would leave nothing to pay with.\n if (paymentMethods.length === 0) {\n return FLOW_PAYMENT_METHODS;\n }\n\n return paymentMethods;\n};\n","import type { FlowPaymentMethod } from '../../../flow.types';\nimport type { PayWithDepositAddressRoute } from './payWithDepositAddressRoute';\nimport type { PayWithExchangeRoute } from './payWithExchangeRoute';\nimport type { PayWithWalletRoute } from './payWithWalletRoute';\n\n/**\n * The route each payment method opens when the payer chooses it; a chosen\n * exchange starts on the exchange list.\n */\nexport const FLOW_PAYMENT_METHOD_ROUTES: Record<\n FlowPaymentMethod,\n PayWithDepositAddressRoute | PayWithExchangeRoute | PayWithWalletRoute\n> = {\n deposit_address: { name: 'pay-with-deposit-address' },\n exchange: { name: 'pay-with-exchange', resumesWaitingExchange: false },\n wallet: { name: 'pay-with-wallet' },\n};\n","import type { Flow } from '@dynamic-labs-sdk/client';\n\nimport type { FlowPaymentMethod } from '../../../../flow.types';\n\n/** Params for {@link getResumedFlowPaymentMethod}. */\nexport type GetResumedFlowPaymentMethodParams = {\n /** The flow being paid, as loaded. */\n flow: Flow | undefined;\n};\n\n/**\n * Picks the payment method to reopen a flow on: the one the payer already\n * chose, once it has a quote to pay or an exchange purchase to wait for.\n * Before that the payer chooses again.\n *\n * @example\n * ```ts\n * const method = getResumedFlowPaymentMethod({ flow });\n * ```\n * @param params.flow - The flow being paid, as loaded.\n * @returns The method to resume, or `undefined` to let the payer choose.\n * @see useFlowWidget\n * @see FlowPaymentMethod\n * @notInstrumented\n */\nexport const getResumedFlowPaymentMethod = ({\n flow,\n}: GetResumedFlowPaymentMethodParams): FlowPaymentMethod | undefined => {\n // An exchange payment is never quoted: it waits on its exchange link.\n if (\n flow?.executionState === 'source_attached' &&\n flow.sourceType === 'exchange' &&\n flow.exchangeSource\n ) {\n return 'exchange';\n }\n // A wallet payment also resumes in `signing`: it reopens on review once the\n // payment can no longer be on its way. Deposit flows never reach `signing`.\n if (flow?.executionState !== 'quoted' && flow?.executionState !== 'signing') {\n return undefined;\n }\n if (flow.sourceType === 'wallet') {\n return 'wallet';\n }\n if (flow.sourceType === 'deposit_address') {\n return 'deposit_address';\n }\n\n return undefined;\n};\n","import type { UseViewRouterParams } from '../../../../../utils/hooks/useViewRouter';\nimport type { FlowPaymentMethod } from '../../../../flow.types';\nimport { FLOW_PAYMENT_METHOD_ROUTES } from '../../routes/flowWidgetRoutes.constants';\nimport { flowWidgetRoutes } from '../../routes/flowWidgetRoutes';\nimport type { FlowWidgetRoute } from '../../routes/flowWidgetRoutes.types';\n\n/** Params for {@link getRouterParams}. */\nexport type GetRouterParamsParams = {\n /** The payment methods offered to the payer, never empty. */\n paymentMethods: readonly FlowPaymentMethod[];\n /** The payment method a payment resumes on, or `undefined` to let the payer choose. */\n resumedMethod: FlowPaymentMethod | undefined;\n};\n\n/**\n * The flow widget's router setup: its route table and the screens it starts\n * with — the payment method choice, with the resumed method on top of it when\n * a payment is reopened on its way, so Back still returns to the choice. A\n * single payment method skips the choice and starts on that method.\n *\n * @example\n * ```ts\n * const router = useViewRouter(getRouterParams({ paymentMethods, resumedMethod }));\n * ```\n * @param params.paymentMethods - The payment methods offered to the payer.\n * @param params.resumedMethod - The payment method a payment resumes on.\n * @returns The params for the widget's router.\n * @see useFlowWidget\n * @see getResumedFlowPaymentMethod\n * @notInstrumented\n */\nexport const getRouterParams = ({\n paymentMethods,\n resumedMethod,\n}: GetRouterParamsParams): UseViewRouterParams<FlowWidgetRoute> => {\n const choiceStack: FlowWidgetRoute[] =\n paymentMethods.length > 1 ? [{ name: 'choose-payment-method' }] : [];\n\n // Only a reopened payment returns to the exchange it waits on.\n if (resumedMethod === 'exchange') {\n return {\n initialStack: [\n ...choiceStack,\n { name: 'pay-with-exchange', resumesWaitingExchange: true },\n ],\n routes: flowWidgetRoutes,\n };\n }\n if (resumedMethod) {\n return {\n initialStack: [...choiceStack, FLOW_PAYMENT_METHOD_ROUTES[resumedMethod]],\n routes: flowWidgetRoutes,\n };\n }\n if (paymentMethods.length === 1) {\n return {\n initialStack: [FLOW_PAYMENT_METHOD_ROUTES[paymentMethods[0]]],\n routes: flowWidgetRoutes,\n };\n }\n\n return {\n initialStack: [{ name: 'choose-payment-method' }],\n routes: flowWidgetRoutes,\n };\n};\n","import { useGetFlow } from '@dynamic-labs-sdk/react-hooks';\nimport { useCallback, useState } from 'react';\n\nimport { useViewRouter } from '../../../../utils/hooks/useViewRouter';\nimport type { FlowPaymentMethod, FlowRefundAddresses } from '../../../flow.types';\nimport { useFlowUiSettings } from '../../../hooks/useFlowUiSettings';\nimport { getFlowPaymentMethods } from '../../../utils/getFlowPaymentMethods';\nimport { FLOW_PAYMENT_METHOD_ROUTES } from '../routes/flowWidgetRoutes.constants';\nimport type { FlowWidgetRoute } from '../routes/flowWidgetRoutes.types';\nimport { getResumedFlowPaymentMethod } from './getResumedFlowPaymentMethod';\nimport { getRouterParams } from './getRouterParams';\n\n/**\n * Params for {@link useFlowWidget}.\n *\n * @example\n * ```ts\n * const params: UseFlowWidgetParams = { flowId: 'flow_123' };\n * ```\n * @see useFlowWidget\n * @see UseFlowWidgetResult\n */\nexport type UseFlowWidgetParams = {\n /** The flow the customer is paying for. */\n flowId: string;\n /** Refund addresses the host already holds for the payer, one per chain family. */\n refundAddresses?: FlowRefundAddresses;\n};\n\n/** What {@link useFlowWidget} returns. */\nexport type UseFlowWidgetResult = {\n /** Opens the chosen payment method. */\n chooseMethod: (method: FlowPaymentMethod) => void;\n /** The route on top of the stack — the screen to render. */\n currentRoute: FlowWidgetRoute;\n /** The flow the customer is paying for. */\n flowId: string;\n /** Returns from a payment method to the method choice; `undefined` when a single method leaves no choice. */\n goBack: (() => void) | undefined;\n /** The payment methods offered to the payer. */\n paymentMethods: readonly FlowPaymentMethod[];\n /** Refund addresses the host already holds for the payer, one per chain family. */\n refundAddresses: FlowRefundAddresses | undefined;\n};\n\n/**\n * Drives the flow widget's screens: the payment method choice, then the\n * chosen method, with Back to the choice. A flow reopened on its way through\n * one method starts on it, with the choice beneath. A flow offering a single\n * method starts on it, with no choice to go back to.\n *\n * @example\n * ```ts\n * const widget = useFlowWidget({ flowId });\n * renderFlowWidgetRoute({ route: widget.currentRoute, widget });\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @param params.refundAddresses - Refund addresses the host already holds for the payer.\n * @returns The current route and the verbs that move between routes.\n * @see FlowWidget\n * @see getRouterParams\n * @notInstrumented\n */\nexport const useFlowWidget = ({\n flowId,\n refundAddresses,\n}: UseFlowWidgetParams): UseFlowWidgetResult => {\n const { data: flow } = useGetFlow({ flowId });\n const uiSettings = useFlowUiSettings({ flow });\n // Captured on mount with the router, so the offered methods and Back always\n // match the stack it started with.\n const [paymentMethods] = useState(() =>\n getFlowPaymentMethods({ uiSettings })\n );\n // The router captures its starting stack on mount only: the widget mounts\n // this once the flow loaded, and later flow updates must not move the payer\n // off the method they are using.\n const router = useViewRouter(\n getRouterParams({\n paymentMethods,\n resumedMethod: getResumedFlowPaymentMethod({ flow }),\n })\n );\n\n const { navigate } = router;\n const chooseMethod = useCallback(\n (method: FlowPaymentMethod) => navigate(FLOW_PAYMENT_METHOD_ROUTES[method]),\n [navigate]\n );\n\n return {\n chooseMethod,\n currentRoute: router.current,\n flowId,\n // A single method starts without the choice beneath it.\n goBack: paymentMethods.length > 1 ? router.pop : undefined,\n paymentMethods,\n refundAddresses,\n };\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport type { FlowRefundAddresses } from '../../../flow.types';\nimport { renderFlowWidgetRoute } from '../renderFlowWidgetRoute';\nimport { useFlowWidget } from '../useFlowWidget';\n\n/**\n * Props for {@link FlowWidgetContent}.\n *\n * @example\n * ```tsx\n * const props: FlowWidgetContentProps = { flowId: 'flow_123' };\n * ```\n * @see FlowWidgetContent\n * @see FlowWidgetProps\n */\nexport type FlowWidgetContentProps = {\n /** The flow the customer is paying for. */\n flowId: string;\n /** Refund addresses you already hold for the payer, one per chain family. */\n refundAddresses?: FlowRefundAddresses;\n};\n\n/**\n * Renders the flow widget's current screen: the payment method choice, or the\n * chosen method's steps with Back to the choice.\n *\n * @example\n * ```tsx\n * <FlowWidgetContent flowId={flowId} />\n * ```\n * @param params.flowId - The flow the customer is paying for.\n * @param params.refundAddresses - Refund addresses you already hold for the payer.\n * @returns The current route's screen.\n * @see FlowWidget\n * @see useFlowWidget\n * @notInstrumented\n */\nexport const FlowWidgetContent: FC<FlowWidgetContentProps> = ({\n flowId,\n refundAddresses,\n}) => {\n const widget = useFlowWidget({ flowId, refundAddresses });\n\n return renderFlowWidgetRoute({ route: widget.currentRoute, widget });\n};\n","'use client';\n\nimport type { FC } from 'react';\n\nimport type { FlowWidgetSettings } from '../../flow.types';\nimport { PanelHost } from '../../../components/PanelHost';\nimport { FlowUiSettingsContext } from '../../hooks/useFlowUiSettings/FlowUiSettingsContext';\nimport { FlowOutcomeBoundary } from '../FlowOutcomeBoundary';\nimport type { FlowOutcomeCallbacks } from '../FlowOutcomeBoundary/FlowOutcomeBoundary.types';\nimport { FlowWidgetContent } from './FlowWidgetContent';\n\n/**\n * Props for {@link FlowWidget}.\n *\n * @example\n * ```tsx\n * const props: FlowWidgetProps = {\n * flowId: 'flow_123',\n * onPaymentCompleted: (flow) => console.log(flow.id),\n * settings: { merchantName: 'Acme' },\n * };\n * ```\n * @see FlowWidget\n * @see FlowPayWithWalletWidgetProps\n * @see FlowDepositAddressWidgetProps\n */\nexport type FlowWidgetProps = FlowOutcomeCallbacks & {\n className?: string;\n /** The flow the customer is paying for — fetched and polled by id. */\n flowId: string;\n /**\n * Display settings that replace the flow's own UI config values, plus the\n * refund addresses (e.g. `{ EVM: '0x…', SOL: '…' }`) used when the payer\n * pays to a deposit address; the payer is asked for one only when the\n * picked family's is missing or not valid.\n */\n settings?: FlowWidgetSettings;\n};\n\n/**\n * The complete payment widget: shows a loader while the payment loads, or an\n * error with a retry when it can't load, then lets the payer choose between\n * paying from a wallet, through an exchange and sending to a deposit address,\n * runs the chosen method and lets them go back to choose another. Once the\n * payment is sent it shows its progress and lands on payment-complete,\n * payment-failed, payment-refunded, payment-cancelled or expired as the flow's\n * own state decides. A payment reopened with a quote, or while waiting for an\n * exchange purchase, resumes on the method that started it. `settings`\n * replaces the flow's own UI config values it sets. Fires `onPaymentCompleted` or `onPaymentFailed` once per\n * mount, whichever method is used.\n *\n * Mount one per flow: a second widget for the same flow reports the outcome\n * a second time.\n *\n * @example\n * ```tsx\n * import { FlowWidget } from '@/flow/widgets/FlowWidget/FlowWidget';\n *\n * const App = () => (\n * <FlowWidget\n * flowId=\"flow_123\"\n * onPaymentCompleted={(flow) => console.log(flow.id)}\n * settings={{ enabledPaymentMethods: ['wallet'] }}\n * />\n * );\n * ```\n * @param params.className - Extra class names for the root element.\n * @param params.flowId - The flow the customer is paying for.\n * @param params.onPaymentCompleted - Fires once per mount with the settled flow when the payment completes, including one already paid when opened.\n * @param params.onPaymentFailed - Fires once per mount with the flow when it expires, is cancelled or fails.\n * @param params.settings - Display settings over the flow's own UI config, plus the payer's refund addresses.\n * @returns The payment widget.\n * @see FlowWidgetProps\n * @see FlowPayWithWalletWidget\n * @see FlowDepositAddressWidget\n * @see PanelHost\n * @notInstrumented\n */\nexport const FlowWidget: FC<FlowWidgetProps> = ({\n className,\n flowId,\n onPaymentCompleted,\n onPaymentFailed,\n settings,\n}) => (\n // The root sits outside the boundary so the host's class also applies while\n // the flow loads or fails to load.\n <div className={className} data-slot=\"dyn-flow-widget\">\n {/* Around the boundary, so the outcome screens use the settings too. */}\n <FlowUiSettingsContext.Provider value={settings}>\n {/* One card for every screen, including loading and the outcome. */}\n <PanelHost>\n {/* Keyed by flow so a new flowId starts a fresh payment. This boundary\n owns the flow, so the method widgets inside it only show their steps\n and never report the outcome themselves. */}\n <FlowOutcomeBoundary\n flowId={flowId}\n key={flowId}\n onPaymentCompleted={onPaymentCompleted}\n onPaymentFailed={onPaymentFailed}\n >\n <FlowWidgetContent\n flowId={flowId}\n refundAddresses={settings?.refundAddresses}\n />\n </FlowOutcomeBoundary>\n </PanelHost>\n </FlowUiSettingsContext.Provider>\n </div>\n);\n","import { assertPackageVersion } from '@dynamic-labs-sdk/assert-package-version';\n\nimport {\n name as packageName,\n version as packageVersion,\n} from '../../package.json';\n\nassertPackageVersion(packageName, packageVersion);\n\nexport { FlowDepositAddressWidget } from '../flow/widgets/FlowDepositAddressWidget';\nexport type { FlowDepositAddressWidgetProps } from '../flow/widgets/FlowDepositAddressWidget';\nexport { FlowPayWithExchangeWidget } from '../flow/widgets/FlowPayWithExchangeWidget';\nexport type { FlowPayWithExchangeWidgetProps } from '../flow/widgets/FlowPayWithExchangeWidget';\nexport { FlowPayWithWalletWidget } from '../flow/widgets/FlowPayWithWalletWidget';\nexport type { FlowPayWithWalletWidgetProps } from '../flow/widgets/FlowPayWithWalletWidget';\nexport { FlowWidget } from '../flow/widgets/FlowWidget';\nexport type { FlowWidgetProps } from '../flow/widgets/FlowWidget';\nexport type { FlowWidgetSettings } from '../flow/flow.types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,MAAaA,kBAA2C,EACtD,WACA,aACA,SACA,MACA,UAAU,gBACN;CACJ,IAAIC;AACJ,KAAI,YAAY,SACd,YAAW;KAEX,YAAW;AAGb,QACE,4CAAC;EAAe;EAAW,aAAU;aACnC,2CAACC,eAAE;GACD,SAAS;IAAE,SAAS;IAAG,OAAO;IAAG;GACjC,eAAY;GACZ,aAAU;GACV,gBAAc,SAAS,SAAY,UAAU;GAC7C,SAAS;IAAE,SAAS;IAAG,OAAO;IAAM;GACpC,YAAYC;aAEX,SAAS,SACR,2CAAC;IAAI,MAAK;IAAO,QAAO;IAAK,SAAQ;IAAY,OAAM;c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