@unifold/connect-react-native 0.1.29 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.mts +179 -1
- package/dist/index.d.ts +179 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +7 -3
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';require('expo-constants');var react=require('react'),reactNative=require('react-native'),ot=require('react-native-svg'),jsxRuntime=require('react/jsx-runtime'),stripeReactNative=require('@stripe/stripe-react-native'),reactNativeGestureHandler=require('react-native-gesture-handler'),fd=require('react-native-qrcode-svg'),reactNativeWebview=require('react-native-webview'),xs=require('@react-native-async-storage/async-storage');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ot__default=/*#__PURE__*/_interopDefault(ot);var fd__default=/*#__PURE__*/_interopDefault(fd);var xs__default=/*#__PURE__*/_interopDefault(xs);var Rl=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ii={light:{background:"#FFFFFF",card:"#F8FAFC",cardHover:"#F1F5F9",foreground:"#0F172A",foregroundMuted:"#64748B",foregroundSubtle:"#94A3B8",border:"#E2E8F0",borderSecondary:"#CBD5E1",primary:"#3B82F6",primaryForeground:"#FFFFFF",success:"#22C55E",successBackground:"#DCFCE7",warning:"#F59E0B",warningBackground:"#FEF3C7",error:"#EF4444",errorBackground:"#FEE2E2",overlay:"rgba(0, 0, 0, 0.5)"},dark:{background:"#2D2C2F",card:"#3A393C",cardHover:"#48474A",foreground:"#F8FAFC",foregroundMuted:"#94A3B8",foregroundSubtle:"#64748B",border:"#38383A",borderSecondary:"#48484A",primary:"#3B82F6",primaryForeground:"#FFFFFF",success:"#22C55E",successBackground:"rgba(34, 197, 94, 0.1)",warning:"#F59E0B",warningBackground:"rgba(245, 158, 11, 0.1)",error:"#EF4444",errorBackground:"rgba(239, 68, 68, 0.1)",overlay:"rgba(0, 0, 0, 0.7)"}},vi=Ii;function _n(e,t){return t?{...e,...t,shadowOffset:t.shadowOffset??e.shadowOffset,backShadowOffset:t.backShadowOffset??e.backShadowOffset}:e}function Kr(e,t,o){let n=o?t?.[o]:void 0,r=(a,g,T)=>{let C=n?.[a]?.[g];if(C!==void 0)return C;let h=t?.[a]?.[g];return h!==void 0?h:T},i={backgroundColor:r("card","backgroundColor",e.card),titleColor:r("card","titleColor",e.foreground),subtitleColor:r("card","subtitleColor",e.foregroundMuted),labelColor:r("card","labelColor",e.foregroundMuted),headerColor:r("card","headerColor",e.foregroundMuted),labelRightColor:r("card","labelRightColor",e.foregroundMuted),labelHighlightRightColor:r("card","labelHighlightRightColor",e.warning),textRightColor:r("card","textRightColor",e.foreground),subtextRightColor:r("card","subtextRightColor",e.foregroundMuted),rowLeftLabel:r("card","rowLeftLabel",e.foregroundMuted),rowRightLabel:r("card","rowRightLabel",e.foreground),iconColor:r("card","iconColor",e.primary),iconBackgroundColor:r("card","iconBackgroundColor",e.primary+"26"),actionColor:r("card","actionColor",e.foregroundMuted),actionIcon:r("card","actionIcon",e.foregroundMuted),descriptionColor:r("card","descriptionColor",e.foregroundMuted),borderRadius:r("card","borderRadius",12),borderWidth:r("card","borderWidth",0),borderColor:r("card","borderColor",e.border),shadowColor:r("card","shadowColor","#000"),shadowOffset:r("card","shadowOffset",{width:0,height:-4}),shadowOpacity:r("card","shadowOpacity",0),shadowRadius:r("card","shadowRadius",12),elevation:r("card","elevation",0),iconContainerBorderRadius:r("card","iconContainerBorderRadius",12),backShadowColor:"transparent",backShadowOffset:{top:4,left:4,right:-4,bottom:-4},backShadowSpacing:8},s=(n?.depositMenu??t?.depositMenu)?.card,c=(n?.transferCrypto??t?.transferCrypto)?.depositAddress?.card,d=(n?.depositCard??t?.depositCard)?.quoteProvider?.card,u=(n?.depositTracker??t?.depositTracker)?.executionRow?.card;return {header:{titleColor:r("header","titleColor",e.foreground),buttonColor:r("header","buttonColor",e.foreground)},card:i,input:{backgroundColor:r("input","backgroundColor",r("search","backgroundColor",e.card)),textColor:r("input","textColor",r("search","inputColor",e.foreground)),placeholderColor:r("input","placeholderColor",r("search","placeholderColor",e.foregroundMuted)),borderColor:r("input","borderColor",e.border),borderRadius:r("input","borderRadius",r("search","borderRadius",8)),borderWidth:r("input","borderWidth",1)},button:{primaryBackground:r("button","primaryBackground",e.primary),primaryText:r("button","primaryText",e.primaryForeground),secondaryBackground:r("button","secondaryBackground",e.card),secondaryText:r("button","secondaryText",e.foreground),borderRadius:r("button","borderRadius",12),borderWidth:r("button","borderWidth",0),borderColor:r("button","borderColor",e.border)},container:{titleColor:r("container","titleColor",e.foreground),subtitleColor:r("container","subtitleColor",e.foregroundMuted),actionColor:r("container","actionColor",e.foregroundMuted),actionTitle:r("container","actionTitle",e.foregroundMuted),buttonColor:r("container","buttonColor",e.primary),buttonTitleColor:r("container","buttonTitleColor",e.primaryForeground),iconBackgroundColor:r("container","iconBackgroundColor",e.success),iconColor:r("container","iconColor",e.foreground)},search:{backgroundColor:r("search","backgroundColor",e.card),inputColor:r("search","inputColor",e.foreground),placeholderColor:r("search","placeholderColor",e.foregroundMuted),borderRadius:r("search","borderRadius",8)},list:{titleSectionColor:r("list","titleSectionColor",e.foregroundMuted),rowBorderRadius:r("list","rowBorderRadius",12)},badge:{borderRadius:r("badge","borderRadius",8)},sheet:{shadowColor:r("sheet","shadowColor","#000"),shadowOffset:r("sheet","shadowOffset",{width:0,height:-4}),shadowOpacity:r("sheet","shadowOpacity",.1),shadowRadius:r("sheet","shadowRadius",12),elevation:r("sheet","elevation",16)},depositMenu:{card:_n(i,s)},transferCrypto:{depositAddress:{card:_n(i,c)}},depositCard:{quoteProvider:{card:_n(i,d)}},depositTracker:{executionRow:{card:_n(i,u)}}}}function Pi(e,t,o){let r={...Ii[e]};return o&&(r.primary=o),t&&(r={...r,...t}),r}var Li=react.createContext(null);function O(){let e=react.useContext(Li);if(!e){let t=vi.dark;return {mode:"dark",colors:t,fonts:{regular:void 0,medium:void 0,semibold:void 0,bold:void 0},components:Kr(t,void 0,"dark"),isDark:true}}return e}function Oi({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Path,{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Vi({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Rect,{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"1",y1:"10",x2:"23",y2:"10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Zo({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Circle,{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"12 6 12 12 16 14",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Yr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Line,{x1:"19",y1:"12",x2:"5",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"12 19 5 12 12 5",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function lt({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Line,{x1:"18",y1:"6",x2:"6",y2:"18",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"6",y1:"6",x2:"18",y2:"18",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Co({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Polyline,{points:"9 18 15 12 9 6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function wt({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Polyline,{points:"6 9 12 15 18 9",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xo({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Rect,{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Be({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Polyline,{points:"20 6 9 17 4 12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Di({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Line,{x1:"12",y1:"2",x2:"12",y2:"6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"12",y1:"18",x2:"12",y2:"22",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"2",y1:"12",x2:"6",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"18",y1:"12",x2:"22",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function er({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"15 3 21 3 21 9",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"10",y1:"14",x2:"21",y2:"3",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function wr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Line,{x1:"12",y1:"1",x2:"12",y2:"23",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Rn({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"14 2 14 8 20 8",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"16",y1:"13",x2:"8",y2:"13",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"16",y1:"17",x2:"8",y2:"17",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"10 9 9 9 8 9",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Wo({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Polyline,{points:"18 15 12 9 6 15",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Os({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Polyline,{points:"23 4 23 10 17 10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"1 20 1 14 7 14",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Sr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Circle,{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"12",y1:"16",x2:"12",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"12",y1:"8",x2:"12.01",y2:"8",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function kr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M9 12l2 2 4-4",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function In({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function vn({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M5.43 5.43A8.06 8.06 0 0 0 4 10c0 6 8 12 8 12a29.94 29.94 0 0 0 5-5",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M19.18 13.52A8.66 8.66 0 0 0 20 10a8 8 0 0 0-8-8 7.88 7.88 0 0 0-3.52.82",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M9.13 9.13A2.78 2.78 0 0 0 9 10a3 3 0 0 0 3 3 2.78 2.78 0 0 0 .87-.13",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M14.9 9.25a3 3 0 0 0-2.15-2.16",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"2",y1:"2",x2:"22",y2:"22",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ds({size:e=28}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 28 28",fill:"none",children:jsxRuntime.jsxs(ot.G,{fillRule:"evenodd",children:[jsxRuntime.jsx(ot.Path,{fill:"#0052FF",fillRule:"nonzero",d:"M14 28a14 14 0 1 0 0-28 14 14 0 0 0 0 28"}),jsxRuntime.jsx(ot.Path,{fill:"#FFF",d:"M13.967 23.86c5.445 0 9.86-4.415 9.86-9.86s-4.415-9.86-9.86-9.86c-5.166 0-9.403 3.974-9.825 9.03h14.63v1.642H4.142c.413 5.065 4.654 9.047 9.826 9.047Z"})]})})}function Fs({size:e=28}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 28 28",fill:"none",children:[jsxRuntime.jsxs(ot.G,{clipPath:"url(#eth_clip)",children:[jsxRuntime.jsx(ot.Path,{d:"M14 28C21.732 28 28 21.732 28 14C28 6.26801 21.732 0 14 0C6.26801 0 0 6.26801 0 14C0 21.732 6.26801 28 14 28Z",fill:"#627EEA"}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 3.5V11.2612L20.9956 14.1925L14.4357 3.5Z",fill:"white",fillOpacity:.602}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 3.5L7.875 14.1925L14.4357 11.2612V3.5Z",fill:"white"}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 19.222V24.4956L21 15.414L14.4357 19.222Z",fill:"white",fillOpacity:.602}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 24.4956V19.2211L7.875 15.414L14.4357 24.4956Z",fill:"white"}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 18.0014L20.9956 14.1925L14.4357 11.263V18.0014Z",fill:"white",fillOpacity:.2}),jsxRuntime.jsx(ot.Path,{d:"M7.875 14.1925L14.4357 18.0014V11.263L7.875 14.1925Z",fill:"white",fillOpacity:.602})]}),jsxRuntime.jsx(ot.Defs,{children:jsxRuntime.jsx(ot.ClipPath,{id:"eth_clip",children:jsxRuntime.jsx(ot.Rect,{width:28,height:28,fill:"white"})})})]})}function Es({size:e=28}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 28 28",fill:"none",children:[jsxRuntime.jsxs(ot.G,{clipPath:"url(#btc_clip)",children:[jsxRuntime.jsx(ot.Path,{d:"M14 28C21.732 28 28 21.732 28 14C28 6.26801 21.732 0 14 0C6.26801 0 0 6.26801 0 14C0 21.732 6.26801 28 14 28Z",fill:"#F7931A"}),jsxRuntime.jsx(ot.Path,{d:"M20.0594 12.1625C20.3438 10.2594 18.9 9.23124 16.9203 8.55311L17.5656 5.97186L15.9906 5.57811L15.3672 8.09374C14.9516 7.9953 14.525 7.89686 14.0985 7.79843L14.7328 5.27186L13.1578 4.87811L12.5125 7.45936C12.1735 7.3828 11.8344 7.30624 11.5063 7.22968V7.21874L9.34065 6.67186L8.92502 8.35624C8.92502 8.35624 10.0844 8.61874 10.0625 8.64061C10.6969 8.79374 10.8063 9.2203 10.7844 9.54843L10.0625 12.4578C10.1063 12.4687 10.161 12.4797 10.2266 12.5125C10.1828 12.5016 10.1281 12.4906 10.0735 12.4687L9.05627 16.5375C8.97971 16.7344 8.78284 17.0187 8.34534 16.9094C8.36721 16.9312 7.20784 16.625 7.20784 16.625L6.43127 18.4297L8.47659 18.9437C8.8594 19.0422 9.23127 19.1406 9.59221 19.2281L8.9469 21.8422L10.5219 22.2359L11.1672 19.6547C11.5938 19.775 12.0094 19.8734 12.4141 19.9828L11.7688 22.5531L13.3438 22.9469L13.9891 20.3328C16.6578 20.8359 18.6594 20.6281 19.5016 18.2219C20.1797 16.2859 19.4688 15.1703 18.0688 14.4375C19.086 14.2078 19.8516 13.5406 20.0594 12.1625ZM16.4938 17.1609C16.0125 19.0969 12.7531 18.0469 11.6922 17.7844L12.5453 14.35C13.6063 14.6125 16.9969 15.1484 16.4938 17.1609ZM16.975 12.1297C16.5375 13.8906 13.825 12.9937 12.95 12.775L13.7266 9.6578C14.6016 9.87655 17.4344 10.2812 16.975 12.1297Z",fill:"white"})]}),jsxRuntime.jsx(ot.Defs,{children:jsxRuntime.jsx(ot.ClipPath,{id:"btc_clip",children:jsxRuntime.jsx(ot.Rect,{width:28,height:28,fill:"white"})})})]})}function zs({size:e=28}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 256 256",fill:"none",children:[jsxRuntime.jsxs(ot.Defs,{children:[jsxRuntime.jsxs(ot.LinearGradient,{id:"sol1",x1:"360.9",y1:"-37.5",x2:"141.2",y2:"383.3",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx(ot.Stop,{offset:"0",stopColor:"#00FFA3"}),jsxRuntime.jsx(ot.Stop,{offset:"1",stopColor:"#DC1FFF"})]}),jsxRuntime.jsxs(ot.LinearGradient,{id:"sol2",x1:"264.8",y1:"-87.6",x2:"45.16",y2:"333.15",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx(ot.Stop,{offset:"0",stopColor:"#00FFA3"}),jsxRuntime.jsx(ot.Stop,{offset:"1",stopColor:"#DC1FFF"})]}),jsxRuntime.jsxs(ot.LinearGradient,{id:"sol3",x1:"312.55",y1:"-62.69",x2:"92.88",y2:"358.06",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx(ot.Stop,{offset:"0",stopColor:"#00FFA3"}),jsxRuntime.jsx(ot.Stop,{offset:"1",stopColor:"#DC1FFF"})]})]}),jsxRuntime.jsx(ot.Circle,{cx:128,cy:128,r:128,fill:"black"}),jsxRuntime.jsxs(ot.G,{transform:"translate(128,128) scale(0.35) translate(-198.85,-156)",children:[jsxRuntime.jsx(ot.Path,{fill:"url(#sol2)",d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z"}),jsxRuntime.jsx(ot.Path,{fill:"url(#sol3)",d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4c5.8,0,8.7-7,4.6-11.1L333.1,120.1z"}),jsxRuntime.jsx(ot.Path,{fill:"url(#sol1)",d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z"})]})]})}function Ms({size:e=28}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 32 32",fill:"none",children:jsxRuntime.jsxs(ot.G,{children:[jsxRuntime.jsx(ot.Circle,{cx:16,cy:16,r:16,fill:"#6F41D8"}),jsxRuntime.jsx(ot.Path,{fill:"#FFF",d:"M21.092 12.693c-.369-.215-.848-.215-1.254 0l-2.879 1.654-1.955 1.078-2.879 1.653c-.369.216-.848.216-1.254 0l-2.288-1.294c-.369-.215-.627-.61-.627-1.042V12.19c0-.431.221-.826.627-1.042l2.25-1.258c.37-.216.85-.216 1.256 0l2.25 1.258c.37.216.628.611.628 1.042v1.654l1.955-1.115v-1.653a1.16 1.16 0 0 0-.627-1.042l-4.17-2.372c-.369-.216-.848-.216-1.254 0l-4.244 2.372A1.16 1.16 0 0 0 6 11.076v4.78c0 .432.221.827.627 1.043l4.244 2.372c.369.215.849.215 1.254 0l2.879-1.618 1.955-1.114 2.879-1.617c.369-.216.848-.216 1.254 0l2.251 1.258c.37.215.627.61.627 1.042v2.552c0 .431-.22.826-.627 1.042l-2.25 1.294c-.37.216-.85.216-1.255 0l-2.251-1.258c-.37-.216-.628-.611-.628-1.042v-1.654l-1.955 1.115v1.653c0 .431.221.827.627 1.042l4.244 2.372c.369.216.848.216 1.254 0l4.244-2.372c.369-.215.627-.61.627-1.042v-4.78a1.16 1.16 0 0 0-.627-1.042l-4.28-2.409z"})]})})}var _r=[{label:"Base",value:stripeReactNative.Onramp.CryptoNetwork.base,defaultCrypto:"usdc",Icon:Ds},{label:"Ethereum",value:stripeReactNative.Onramp.CryptoNetwork.ethereum,defaultCrypto:"eth",Icon:Fs},{label:"Bitcoin",value:stripeReactNative.Onramp.CryptoNetwork.bitcoin,defaultCrypto:"btc",Icon:Es},{label:"Solana",value:stripeReactNative.Onramp.CryptoNetwork.solana,defaultCrypto:"sol",Icon:zs},{label:"Polygon",value:stripeReactNative.Onramp.CryptoNetwork.polygon,defaultCrypto:"matic",Icon:Ms}];function Hs(e,t=8,o=4){let n=e.trim();return n.length<=t+o+3?n:`${n.slice(0,t)}...${n.slice(-o)}`}function Pn(e,t){let o=parseFloat(e);if(isNaN(o))return e;let n=t.toLowerCase(),r=["eth","btc"].includes(n)?4:2;return o.toFixed(r)}function Ln(e){let t=e.trim().toLowerCase();if(!t)return e.trim();let o=_r.find(r=>r.label.toLowerCase()===t);if(o)return o.label;let n=_r.find(r=>String(r.value).toLowerCase()===t);return n?n.label:e.trim()}function $e({onPress:e,title:t}){let{components:o,fonts:n}=O(),r=jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Rr.closeBtn,onPress:e,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:"Close",children:jsxRuntime.jsx(lt,{size:20,color:o.header.buttonColor,strokeWidth:2})});return t?jsxRuntime.jsxs(reactNative.View,{style:Rr.headerWithTitle,children:[jsxRuntime.jsx(reactNative.View,{style:Rr.headerSide}),jsxRuntime.jsx(reactNative.Text,{style:[Rr.headerTitleText,{color:o.header.titleColor},...n.bold?[{fontFamily:n.bold}]:[]],numberOfLines:1,ellipsizeMode:"tail",accessibilityRole:"header",children:t}),r]}):jsxRuntime.jsxs(reactNative.View,{style:Rr.header,children:[jsxRuntime.jsx(reactNative.View,{style:Rr.headerSpacer}),r]})}var On={paddingTop:60,paddingBottom:16},Rr=reactNative.StyleSheet.create({header:{flexDirection:"row",justifyContent:"flex-end",...On},headerWithTitle:{flexDirection:"row",alignItems:"center",...On},headerSpacer:{flex:1},headerSide:{width:28},headerTitleText:{flex:1,textAlign:"center",fontSize:17},closeBtn:{width:28,height:28,borderRadius:8,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"}});function pt({error:e,progress:t,loading:o}){let{colors:n,fonts:r}=O();return e?jsxRuntime.jsx(reactNative.Text,{style:[Ns.errorText,{color:n.error},...r.regular?[{fontFamily:r.regular}]:[]],children:e.message}):t&&o&&__DEV__?jsxRuntime.jsx(reactNative.Text,{style:[Ns.progressText,{color:n.foregroundSubtle},...r.regular?[{fontFamily:r.regular}]:[]],children:t}):null}var Ns=reactNative.StyleSheet.create({errorText:{fontSize:14,textAlign:"center",lineHeight:20,marginTop:24},progressText:{fontSize:13,textAlign:"center",lineHeight:18,marginTop:24}});function Ao({quote:e,label:t,value:o,mono:n,last:r}){return jsxRuntime.jsxs(react.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:e.row,children:[jsxRuntime.jsx(reactNative.Text,{style:e.rowLabel,children:t}),jsxRuntime.jsx(reactNative.Text,{style:[e.rowValue,n&&e.rowMono],children:o})]}),r?null:jsxRuntime.jsx(reactNative.View,{style:e.rowDivider})]})}function Ei({quote:e,label:t,address:o,last:n}){let[r,i]=react.useState(false),{colors:s,components:c}=O(),d=()=>{reactNative.Clipboard.setString(o),i(true),setTimeout(()=>i(false),2e3);},u=Hs(o);return jsxRuntime.jsxs(react.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:e.row,children:[jsxRuntime.jsx(reactNative.Text,{style:e.rowLabel,children:t}),jsxRuntime.jsxs(reactNative.View,{style:e.rowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[e.rowValue,e.rowMono,{flexShrink:1,minWidth:0}],numberOfLines:1,ellipsizeMode:"middle",selectable:true,children:u}),jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:d,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:`Copy ${t}`,children:r?jsxRuntime.jsx(Be,{size:14,color:s.success,strokeWidth:2.5}):jsxRuntime.jsx(Xo,{size:14,color:c.card.actionIcon,strokeWidth:2})})]})]}),n?null:jsxRuntime.jsx(reactNative.View,{style:e.rowDivider})]})}function Ir(){let{colors:e,fonts:t,components:o}=O(),n=o.input,r=o.button,i=o.container,s=o.card,c=o.header;return react.useMemo(()=>{let d=s.borderRadius,u=reactNative.Platform.OS==="ios"?"Menlo":"monospace",a={flex:{flex:1},screen:{flex:1,backgroundColor:e.background,paddingHorizontal:24,paddingBottom:48},content:{flex:1,paddingTop:16},title:{fontSize:28,color:c.titleColor,marginBottom:8,...t.bold?{fontFamily:t.bold}:{}},subtitle:{fontSize:15,color:e.foregroundMuted,marginBottom:36,lineHeight:22,...t.regular?{fontFamily:t.regular}:{}},fieldWrap:{marginBottom:20},fieldLabel:{fontSize:13,color:e.foregroundSubtle,marginBottom:8,textTransform:"uppercase",letterSpacing:.5,...t.semibold?{fontFamily:t.semibold}:{}},input:{backgroundColor:n.backgroundColor,borderRadius:n.borderRadius,padding:16,fontSize:17,color:n.textColor,borderWidth:n.borderWidth,borderColor:n.borderColor,...t.regular?{fontFamily:t.regular}:{}},hint:{fontSize:12,color:e.foregroundSubtle,marginTop:8,...t.regular?{fontFamily:t.regular}:{}},emailRow:{flexDirection:"row",alignItems:"center",gap:6,marginTop:4,backgroundColor:e.card,paddingHorizontal:14,paddingVertical:10,borderRadius:Math.min(d,12)},emailLabel:{fontSize:13,color:e.foregroundSubtle,...t.regular?{fontFamily:t.regular}:{}},emailValue:{fontSize:13,color:e.foreground,...t.semibold?{fontFamily:t.semibold}:{}},footer:{gap:4},continueBtn:{backgroundColor:i.buttonColor,borderRadius:r.borderRadius,paddingVertical:18,alignItems:"center"},continueBtnDisabled:{backgroundColor:e.card},continueBtnText:{color:i.buttonTitleColor,fontSize:17,...t.bold?{fontFamily:t.bold}:{}},continueBtnTextDisabled:{color:e.foregroundSubtle,...t.regular?{fontFamily:t.regular}:{}},ghostBtn:{paddingVertical:16,alignItems:"center"},ghostBtnText:{color:e.foregroundMuted,fontSize:15,...t.medium?{fontFamily:t.medium}:{}},loaderInButton:{justifyContent:"center",alignItems:"center"}},g={amountContainer:{flex:1,alignItems:"center",justifyContent:"center",gap:8},amountText:{fontSize:64,color:e.foreground,letterSpacing:-2,minWidth:80,textAlign:"center",...t.regular?{fontFamily:t.regular}:{}},amountPlaceholder:{color:e.foregroundSubtle},currencyLabel:{fontSize:15,color:e.foregroundMuted,letterSpacing:1,...t.medium?{fontFamily:t.medium}:{}},numpad:{gap:4,marginBottom:24},numpadRow:{flexDirection:"row",justifyContent:"space-between"},numpadKey:{flex:1,height:68,alignItems:"center",justifyContent:"center",marginHorizontal:4},numpadKeyText:{fontSize:28,color:e.foreground,...t.regular?{fontFamily:t.regular}:{}},backspaceText:{fontSize:22,color:e.foregroundMuted,...t.regular?{fontFamily:t.regular}:{}}},T={heroBox:{backgroundColor:s.backgroundColor,borderRadius:d,padding:24,alignItems:"center",marginBottom:16,marginTop:8,borderWidth:s.borderWidth,borderColor:s.borderColor,gap:4},heroLabel:{fontSize:12,color:e.foregroundSubtle,letterSpacing:.5,textTransform:"uppercase",...t.semibold?{fontFamily:t.semibold}:{}},heroAmount:{fontSize:48,color:e.foreground,letterSpacing:-1,...t.bold?{fontFamily:t.bold}:{}},heroCurrency:{fontSize:22,color:e.primary,...t.medium?{fontFamily:t.medium}:{}},heroNetwork:{fontSize:15,color:e.foregroundSubtle,marginTop:2,...t.medium?{fontFamily:t.medium}:{}},card:{backgroundColor:s.backgroundColor,borderRadius:d,borderWidth:s.borderWidth,borderColor:s.borderColor,overflow:"hidden",marginBottom:12},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:14,paddingHorizontal:16},rowRight:{flex:1,minWidth:0,flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:8},rowDivider:{height:1,marginHorizontal:16,backgroundColor:e.border},rowLabel:{fontSize:14,color:s.rowLeftLabel,...t.regular?{fontFamily:t.regular}:{}},rowValue:{fontSize:14,fontWeight:"500",color:s.rowRightLabel,...t.medium?{fontFamily:t.medium}:{}},rowMono:{fontFamily:u,fontSize:13}},C=Math.max(16,Math.min(d,22)),h={stackWrapper:{width:"100%",marginBottom:8,marginTop:4},swapCard:{backgroundColor:e.card,borderWidth:s.borderWidth,borderColor:e.border,paddingHorizontal:16,paddingVertical:16},swapCardTop:{borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomLeftRadius:10,borderBottomRightRadius:10},swapCardBottom:{borderBottomLeftRadius:C,borderBottomRightRadius:C,borderTopLeftRadius:10,borderTopRightRadius:10,marginTop:16},swapConnectorWrap:{alignSelf:"center",zIndex:3,marginTop:-24,marginBottom:-32},swapConnectorCircle:{width:48,height:48,borderRadius:24,backgroundColor:e.primary,alignItems:"center",justifyContent:"center",borderWidth:4,borderColor:e.background},swapRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:8,gap:12},swapLeftCol:{flex:1,minWidth:0},swapSpendAmount:{fontSize:40,color:e.foreground,letterSpacing:-1,...t.regular?{fontFamily:t.regular}:{}},swapReceivePrimary:{fontSize:40,color:e.foreground,letterSpacing:-1,...t.regular?{fontFamily:t.regular}:{}},swapReceiveSub:{fontSize:13,color:e.foregroundMuted,marginTop:4,...t.regular?{fontFamily:t.regular}:{}},swapPill:{flexDirection:"row",alignItems:"center",gap:6,paddingVertical:10,paddingHorizontal:14,borderRadius:999,backgroundColor:e.cardHover,borderWidth:s.borderWidth,borderColor:e.border},swapPillText:{fontSize:16,color:e.foreground,...t.semibold?{fontFamily:t.semibold}:{}},payHint:{fontSize:15,color:e.foregroundMuted,textAlign:"center",marginBottom:18,marginTop:4,...t.regular?{fontFamily:t.regular}:{}},summaryLabel:{fontSize:12,color:e.foregroundSubtle,textTransform:"uppercase",letterSpacing:.3,...t.semibold?{fontFamily:t.semibold}:{}},applePayBtn:{backgroundColor:r.secondaryBackground,borderRadius:r.borderRadius,borderWidth:r.borderWidth>0?r.borderWidth:1,borderColor:r.borderWidth>0?r.borderColor:e.border,paddingVertical:18,alignItems:"center",marginBottom:10},applePayBtnText:{color:r.secondaryText,fontSize:17,...t.bold?{fontFamily:t.bold}:{}}},b={input:{fontSize:14,fontFamily:u},list:{gap:8},row:{flexDirection:"row",alignItems:"center",paddingVertical:14,paddingHorizontal:16,borderRadius:Math.min(d,14),borderWidth:s.borderWidth,borderColor:e.border,backgroundColor:e.card},rowSelected:{borderColor:e.primary,backgroundColor:e.successBackground},iconWrap:{width:32,height:32,alignItems:"center",justifyContent:"center",marginRight:12},rowText:{flex:1,fontSize:15,color:e.foregroundMuted,...t.medium?{fontFamily:t.medium}:{}},rowTextSelected:{color:e.foreground,...t.semibold?{fontFamily:t.semibold}:{}},checkCircle:{width:24,height:24,borderRadius:12,backgroundColor:e.primary,alignItems:"center",justifyContent:"center"}},p={centered:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:24},spinnerWrap:{width:80,height:80,borderRadius:40,backgroundColor:e.card,borderWidth:s.borderWidth,borderColor:e.border,alignItems:"center",justifyContent:"center",marginBottom:28},idIcon:{fontSize:36},checkCircle:{width:80,height:80,borderRadius:40,backgroundColor:e.successBackground,borderWidth:2,borderColor:e.success,alignItems:"center",justifyContent:"center",marginBottom:28},heading:{fontSize:28,color:c.titleColor,textAlign:"center",marginBottom:10,...t.bold?{fontFamily:t.bold}:{}},sub:{fontSize:15,color:e.foregroundMuted,textAlign:"center",lineHeight:22,marginBottom:36,...t.regular?{fontFamily:t.regular}:{}},successScrollContent:{flexGrow:1,width:"100%",alignItems:"center",paddingBottom:24},detailCard:{width:"100%"}};return {form:a,quote:T,pm:h,wallet:b,flow:p,amount:g}},[e,t,n,r,i,s,c])}var oc=[["1","2","3"],["4","5","6"],["7","8","9"],["\u232B","0","."]];function Bn({initialAmount:e="",currency:t="USD",onConfirm:o,onCancel:n}){let r=Ir(),[i,s]=react.useState(e),c=g=>{if(g==="\u232B"){s(T=>T.slice(0,-1));return}if(g==="."){if(i.includes("."))return;s(T=>T===""?"0.":T+".");return}s(T=>{let C=T.indexOf(".");return C!==-1&&T.length-C>2?T:T==="0"&&g!=="."?g:T+g});},d=i===""?"0":i,u=parseFloat(i),a=i!==""&&!isNaN(u)&&u>0;return jsxRuntime.jsxs(reactNative.View,{style:r.form.screen,children:[jsxRuntime.jsx($e,{onPress:n,title:"Enter amount"}),jsxRuntime.jsxs(reactNative.View,{style:r.form.content,children:[jsxRuntime.jsxs(reactNative.View,{style:r.amount.amountContainer,children:[jsxRuntime.jsxs(reactNative.Text,{style:[r.amount.amountText,d==="0"&&r.amount.amountPlaceholder],adjustsFontSizeToFit:true,numberOfLines:1,children:["$",d]}),jsxRuntime.jsx(reactNative.Text,{style:r.amount.currencyLabel,children:t.toUpperCase()})]}),jsxRuntime.jsx(reactNative.View,{style:r.amount.numpad,children:oc.map((g,T)=>jsxRuntime.jsx(reactNative.View,{style:r.amount.numpadRow,children:g.map(C=>jsxRuntime.jsx(reactNative.TouchableOpacity,{style:r.amount.numpadKey,onPress:()=>c(C),activeOpacity:.6,children:jsxRuntime.jsx(reactNative.Text,{style:C==="\u232B"?r.amount.backspaceText:r.amount.numpadKeyText,children:C})},C))},T))}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[r.form.continueBtn,!a&&r.form.continueBtnDisabled],onPress:()=>a&&o(i),disabled:!a,children:jsxRuntime.jsx(reactNative.Text,{style:[r.form.continueBtnText,!a&&r.form.continueBtnTextDisabled],children:"Continue"})})]})]})}function Ie({size:e=56,strokeWidth:t=3,children:o,iconSize:n,style:r,gradientFrom:i,gradientTo:s}){let{colors:c}=O(),d=i??c.warning,u=s??"#FBBF24",a=react.useRef(new reactNative.Animated.Value(0)).current,g=react.useId(),T=react.useMemo(()=>`circularProgressGrad_${g.replace(/[^a-zA-Z0-9_-]/g,"")}`,[g]),C=(e-t)/2,h=2*Math.PI*C,b=e/2,p=n??Math.max(0,Math.round(e-t*2-8)),y=(e-p)/2;react.useEffect(()=>{let l=reactNative.Animated.loop(reactNative.Animated.timing(a,{toValue:1,duration:1500,easing:reactNative.Easing.linear,useNativeDriver:true}));return l.start(),()=>l.stop()},[a]);let m=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return jsxRuntime.jsxs(reactNative.View,{style:[{width:e,height:e},r],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",top:0,left:0,width:e,height:e,transform:[{rotate:m}]},children:jsxRuntime.jsxs(ot__default.default,{width:e,height:e,children:[jsxRuntime.jsx(ot.Defs,{children:jsxRuntime.jsxs(ot.LinearGradient,{id:T,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[jsxRuntime.jsx(ot.Stop,{offset:"0%",stopColor:d}),jsxRuntime.jsx(ot.Stop,{offset:"100%",stopColor:u})]})}),jsxRuntime.jsx(ot.Circle,{cx:b,cy:b,r:C,stroke:`url(#${T})`,strokeWidth:t,fill:"none",strokeDasharray:`${h*.75} ${h*.25}`,strokeLinecap:"round",rotation:-90,origin:`${b}, ${b}`})]})}),o!=null?jsxRuntime.jsx(reactNative.View,{style:{position:"absolute",top:y+1.5,left:y,width:p,height:p},children:o}):null]})}var Zr=4;function Wn({initialData:e={},loading:t=false,onComplete:o,onCancel:n}){let r=Ir(),{colors:i,fonts:s,components:c}=O(),d=c.input.placeholderColor,[u,a]=react.useState(1),[g,T]=react.useState(e.firstName??""),[C,h]=react.useState(e.lastName??""),[b,p]=react.useState(e.dobMonth??""),[y,m]=react.useState(e.dobDay??""),[l,f]=react.useState(e.dobYear??""),[R,S]=react.useState(e.addressLine1??""),[A,B]=react.useState(e.addressLine2??""),[k,J]=react.useState(e.city??""),[q,M]=react.useState(e.state??""),[H,X]=react.useState(e.postalCode??""),[U,Qe]=react.useState(e.country??"US"),[We,Ge]=react.useState(e.idNumber??""),ee=react.useRef(null),Te=react.useRef(null),Ae=react.useRef(null),xe=react.useRef(null),Oe=react.useRef(null),te=react.useRef(null),Ee=react.useRef(null),it=react.useRef(null),st=()=>{switch(u){case 1:return g.trim().length>0&&C.trim().length>0;case 2:return b.length===2&&y.length===2&&l.length===4;case 3:return R.trim().length>0&&k.trim().length>0&&q.trim().length>0&&H.trim().length>0;case 4:return We.trim().length>0;default:return false}},dt=()=>{st()&&(u<Zr?a(ce=>ce+1):o({firstName:g,lastName:C,idNumber:We,dobMonth:b,dobDay:y,dobYear:l,addressLine1:R,addressLine2:A,city:k,state:q,postalCode:H,country:U}));},at=()=>{u>1?a(ce=>ce-1):n();},Ct=["Enter your name","Enter your date of birth","Enter your address","Enter your SSN"],Je=["Use your full legal name as it appears on your ID.","We use this to verify your identity.","Enter the address associated with your ID.","Your SSN is encrypted and used only for identity verification."],oo=[He.stepCounter,{color:i.foregroundMuted},...s.semibold?[{fontFamily:s.semibold}]:[]];return jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:r.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:r.form.screen,children:[jsxRuntime.jsxs(reactNative.View,{style:He.header,children:[jsxRuntime.jsx(reactNative.View,{style:He.headerSide,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:He.iconButton,onPress:at,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:u>1?"Back":"Cancel",children:jsxRuntime.jsx(Yr,{size:20,color:c.header.buttonColor,strokeWidth:2})})}),jsxRuntime.jsx(reactNative.View,{style:He.headerCenter,children:jsxRuntime.jsxs(reactNative.Text,{style:oo,children:[u," of ",Zr]})}),jsxRuntime.jsx(reactNative.View,{style:He.headerSide,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:He.iconButton,onPress:n,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:"Close",children:jsxRuntime.jsx(lt,{size:20,color:c.header.buttonColor,strokeWidth:2})})})]}),jsxRuntime.jsx(reactNative.View,{style:He.progressTrack,children:Array.from({length:Zr}).map((ce,j)=>jsxRuntime.jsx(reactNative.View,{style:[He.progressSegment,{backgroundColor:j<u||j+1===u?i.primary:i.border}]},j))}),jsxRuntime.jsxs(reactNative.ScrollView,{style:r.form.flex,contentContainerStyle:He.scrollContent,keyboardShouldPersistTaps:"handled",children:[jsxRuntime.jsx(reactNative.Text,{style:r.form.title,children:Ct[u-1]}),jsxRuntime.jsx(reactNative.Text,{style:r.form.subtitle,children:Je[u-1]}),u===1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(wo,{form:r.form,label:"First name",children:jsxRuntime.jsx(reactNative.TextInput,{style:r.form.input,placeholder:"Jane",placeholderTextColor:d,value:g,onChangeText:T,autoCapitalize:"words",returnKeyType:"next",onSubmitEditing:()=>ee.current?.focus()})}),jsxRuntime.jsx(wo,{form:r.form,label:"Last name",children:jsxRuntime.jsx(reactNative.TextInput,{ref:ee,style:r.form.input,placeholder:"Doe",placeholderTextColor:d,value:C,onChangeText:h,autoCapitalize:"words",returnKeyType:"done",onSubmitEditing:dt})})]}),u===2&&jsxRuntime.jsxs(reactNative.View,{style:He.dobRow,children:[jsxRuntime.jsxs(reactNative.View,{style:He.dobCol,children:[jsxRuntime.jsx(reactNative.Text,{style:[r.form.fieldLabel,He.dobLabel],children:"Month"}),jsxRuntime.jsx(reactNative.TextInput,{style:[r.form.input,He.dobInput],placeholder:"MM",placeholderTextColor:d,value:b,onChangeText:ce=>{let j=ce.replace(/\D/g,"").slice(0,2);p(j),j.length===2&&Te.current?.focus();},keyboardType:"number-pad",maxLength:2})]}),jsxRuntime.jsxs(reactNative.View,{style:He.dobCol,children:[jsxRuntime.jsx(reactNative.Text,{style:[r.form.fieldLabel,He.dobLabel],children:"Day"}),jsxRuntime.jsx(reactNative.TextInput,{ref:Te,style:[r.form.input,He.dobInput],placeholder:"DD",placeholderTextColor:d,value:y,onChangeText:ce=>{let j=ce.replace(/\D/g,"").slice(0,2);m(j),j.length===2&&Ae.current?.focus();},keyboardType:"number-pad",maxLength:2})]}),jsxRuntime.jsxs(reactNative.View,{style:He.dobColWide,children:[jsxRuntime.jsx(reactNative.Text,{style:[r.form.fieldLabel,He.dobLabel],children:"Year"}),jsxRuntime.jsx(reactNative.TextInput,{ref:Ae,style:[r.form.input,He.dobInput],placeholder:"YYYY",placeholderTextColor:d,value:l,onChangeText:ce=>{let j=ce.replace(/\D/g,"").slice(0,4);f(j);},keyboardType:"number-pad",maxLength:4,returnKeyType:"done",onSubmitEditing:dt})]})]}),u===3&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(wo,{form:r.form,label:"Street address",children:jsxRuntime.jsx(reactNative.TextInput,{style:r.form.input,placeholder:"123 Main St",placeholderTextColor:d,value:R,onChangeText:S,returnKeyType:"next",onSubmitEditing:()=>xe.current?.focus()})}),jsxRuntime.jsx(wo,{form:r.form,label:"Apt, suite, etc. (optional)",children:jsxRuntime.jsx(reactNative.TextInput,{ref:xe,style:r.form.input,placeholder:"Apt 2",placeholderTextColor:d,value:A,onChangeText:B,returnKeyType:"next",onSubmitEditing:()=>Oe.current?.focus()})}),jsxRuntime.jsx(wo,{form:r.form,label:"City",children:jsxRuntime.jsx(reactNative.TextInput,{ref:Oe,style:r.form.input,placeholder:"San Francisco",placeholderTextColor:d,value:k,onChangeText:J,autoCapitalize:"words",returnKeyType:"next",onSubmitEditing:()=>te.current?.focus()})}),jsxRuntime.jsxs(reactNative.View,{style:He.row,children:[jsxRuntime.jsx(reactNative.View,{style:[r.form.flex,{marginRight:8}],children:jsxRuntime.jsx(wo,{form:r.form,label:"State",children:jsxRuntime.jsx(reactNative.TextInput,{ref:te,style:r.form.input,placeholder:"NY",placeholderTextColor:d,value:q,onChangeText:ce=>M(ce.toUpperCase().slice(0,2)),autoCapitalize:"characters",maxLength:2,returnKeyType:"next",onSubmitEditing:()=>Ee.current?.focus()})})}),jsxRuntime.jsx(reactNative.View,{style:r.form.flex,children:jsxRuntime.jsx(wo,{form:r.form,label:"ZIP code",children:jsxRuntime.jsx(reactNative.TextInput,{ref:Ee,style:r.form.input,placeholder:"11201",placeholderTextColor:d,value:H,onChangeText:X,keyboardType:"number-pad",maxLength:10,returnKeyType:"next",onSubmitEditing:()=>it.current?.focus()})})})]}),jsxRuntime.jsx(wo,{form:r.form,label:"Country",children:jsxRuntime.jsx(reactNative.TextInput,{ref:it,style:r.form.input,placeholder:"US",placeholderTextColor:d,value:U,onChangeText:ce=>Qe(ce.toUpperCase().slice(0,2)),autoCapitalize:"characters",maxLength:2,returnKeyType:"done",onSubmitEditing:dt})})]}),u===4&&jsxRuntime.jsxs(wo,{form:r.form,label:"Social Security Number",children:[jsxRuntime.jsx(reactNative.TextInput,{style:r.form.input,placeholder:"123-45-6789",placeholderTextColor:d,value:We,onChangeText:Ge,keyboardType:"number-pad",secureTextEntry:true,returnKeyType:"done",onSubmitEditing:dt}),jsxRuntime.jsx(reactNative.Text,{style:[r.form.hint,He.ssnHint],children:"Your SSN is transmitted securely and never stored on this device."})]})]}),jsxRuntime.jsx(reactNative.View,{style:r.form.footer,children:t&&u===Zr?jsxRuntime.jsx(reactNative.View,{style:[r.form.continueBtn,r.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[r.form.continueBtn,!st()&&r.form.continueBtnDisabled],onPress:dt,disabled:!st(),children:jsxRuntime.jsx(reactNative.Text,{style:[r.form.continueBtnText,!st()&&r.form.continueBtnTextDisabled],children:u===Zr?"Submit":"Continue"})})})]})})}function wo({form:e,label:t,children:o}){return jsxRuntime.jsxs(reactNative.View,{style:e.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.fieldLabel,children:t}),o]})}var He=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:60,paddingBottom:16},headerSide:{width:40,alignItems:"center"},headerCenter:{flex:1,alignItems:"center",justifyContent:"center"},iconButton:{width:28,height:28,borderRadius:8,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},stepCounter:{fontSize:15},progressTrack:{flexDirection:"row",gap:4,marginBottom:32},progressSegment:{flex:1,height:3,borderRadius:2},scrollContent:{flexGrow:1,paddingBottom:16,paddingTop:16},dobRow:{flexDirection:"row",gap:10,marginBottom:20},dobCol:{flex:1},dobColWide:{flex:1.5},dobLabel:{textAlign:"center"},dobInput:{textAlign:"center"},row:{flexDirection:"row"},ssnHint:{marginTop:10,lineHeight:18}});var hc="https://api.unifold.io",Hi="__UnifoldDevApiBaseUrl__",Et="pk_test_123",An={};function yc(){if(typeof __DEV__>"u"||!__DEV__||typeof globalThis>"u")return;let e=globalThis[Hi];if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function ft(){return yc()??hc}function En(e){if(e.publishableKey!==void 0){if(!e.publishableKey||e.publishableKey.trim()==="")throw new Error("Unifold SDK: publishableKey cannot be empty. Please provide a valid publishable key.");!e.publishableKey.startsWith("pk_test_")&&!e.publishableKey.startsWith("pk_live_")&&console.warn('Unifold SDK: publishableKey should start with "pk_test_" or "pk_live_". Please ensure you are using a valid publishable key.'),Et=e.publishableKey;}e.defaultConfig&&(An=e.defaultConfig);}function Gs(e){if(typeof __DEV__>"u"||!__DEV__){console.warn("[Unifold] setDevApiUrl() is only available in development mode");return}if(typeof globalThis>"u")return;let t=e.trim();t.length>0?globalThis[Hi]=t:delete globalThis[Hi];}function Xr(){return ft()}function zn(){return Et}function Qt(e){if(!e||e.trim()==="")throw new Error("Unifold SDK: No publishable key configured. Please provide a valid publishable key via setApiConfig() or pass it directly to the API function.");e==="pk_test_123"&&console.warn('Unifold SDK: Using default test key "pk_test_123". This should only be used for local development. Please use a real publishable key in production.');}function _t(e){let t=e.startsWith("/")?e:`/${e}`;return `${ft()}/api/public${t}`}function se(e){return e?e.includes("localhost")||e.includes("127.0.0.1")?e.replace(/https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?/,ft()):e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("/api/public/")?`${ft()}${e}`:`${ft()}/api/public${e}`:""}async function nr(e,t){if(!e?.external_user_id)throw new Error("external_user_id is required");let o=e?.recipient_address||An.recipientAddress;if(!o)throw new Error("[Unifold] recipient_address is required for createDepositAddress. Pass recipientAddress in your beginDeposit() config.");let n={external_user_id:e.external_user_id,destination_chain_type:e?.destination_chain_type||"ethereum",destination_chain_id:e?.destination_chain_id||An.destinationChainId||"8453",destination_token_address:e?.destination_token_address||An.destinationTokenAddress||"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",recipient_address:o,client_metadata:e?.client_metadata||{}},r=t||Et;Qt(r);let i=await fetch(`${ft()}/v1/public/deposit_addresses`,{method:"POST",headers:{accept:"application/json","x-publishable-key":r,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw new Error(`Failed to create deposit address: ${i.statusText}`);return await i.json()}function ir(e,t){return e.find(o=>o.chain_type===t)}async function en(e,t){let o=t||Et;Qt(o);let n=await fetch(`${ft()}/v1/public/direct_executions/query`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify({external_user_id:e})});if(!n.ok)throw new Error(`Failed to query executions: ${n.statusText}`);return n.json()}async function Ni(e,t){let o=t||Et;Qt(o);let n=await fetch(`${ft()}/v1/public/direct_executions/poll`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify({deposit_wallet_id:e})});if(!n.ok)throw new Error(`Failed to poll executions: ${n.statusText}`);return n.json()}function Re(e,t="svg"){if(!e)return "";if(t==="svg"||!e.icon_urls||e.icon_urls.length===0)return e.icon_url;let o=e.icon_urls.find(n=>n.format===t);return o?o.url:e.icon_url}async function tn(e,t){let o=e||Et;Qt(o);let n=`${ft()}/v1/public/tokens/supported_deposit_tokens`;if(t?.destination_token_address&&t?.destination_chain_id&&t?.destination_chain_type){let i=new URLSearchParams({destination_token_address:t.destination_token_address,destination_chain_id:t.destination_chain_id,destination_chain_type:t.destination_chain_type});n=`${n}?${i.toString()}`;}let r=await fetch(n,{method:"GET",headers:{accept:"application/json","x-publishable-key":o}});if(!r.ok)throw new Error(`Failed to fetch supported deposit tokens: ${r.statusText}`);return r.json()}async function Ui(e,t){let o=t||Et;Qt(o);let n=new URLSearchParams({chainType:e.chain_type,chainId:e.chain_id,tokenAddress:e.token_address}),r=await fetch(`${ft()}/v1/public/tokens/token?${n.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":o}});if(!r.ok)throw new Error(`Failed to fetch token metadata: ${r.statusText}`);return r.json()}function Mn(e,t,o){return !e||e.length===0?o||"":e.find(r=>r.format===t)?.url||o||e[0]?.url||""}async function ji(e,t){let o=t||Et;Qt(o);let n=await fetch(`${ft()}/v1/public/onramps/quotes`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`Failed to fetch onramp quotes: ${n.statusText}`);return n.json()}async function $i(e,t){let o=t||Et;Qt(o);let n=await fetch(`${ft()}/v1/public/onramps/sessions`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`Failed to create onramp session: ${n.statusText}`);return n.json()}async function qi(e,t){let o=t||Et;Qt(o);let n=new URLSearchParams;e.country_code&&n.append("country_code",e.country_code),e.subdivision_code&&n.append("subdivision_code",e.subdivision_code),n.append("token_address",e.token_address),n.append("chain_id",e.chain_id),n.append("chain_type",e.chain_type);let r=await fetch(`${ft()}/v1/public/onramps/default_token?${n.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":o}});if(!r.ok)throw new Error(`Failed to fetch default onramp token: ${r.statusText}`);return r.json()}async function Ki(e){let t=e||Et;Qt(t);let o=await fetch(`${ft()}/v1/public/onramps/fiat_currencies`,{method:"GET",headers:{accept:"application/json","x-publishable-key":t}});if(!o.ok)throw new Error(`Failed to fetch fiat currencies: ${o.statusText}`);return o.json()}function Pr(e,t="png"){if(!e||e.length===0)return;let o=e.find(n=>n.format===t);return o?o.url:e[0]?.url}async function on(e){let t=e||Et;Qt(t);let o=await fetch(`${ft()}/v1/public/projects/config`,{method:"GET",headers:{accept:"application/json","x-publishable-key":t}});if(!o.ok)throw new Error(`Failed to fetch project config: ${o.statusText}`);return o.json()}async function rn(){let e=await fetch(`${ft()}/v1/public/ip_address`,{method:"GET",headers:{accept:"application/json"}});if(!e.ok)throw new Error(`Failed to fetch IP address information: ${e.statusText}`);return e.json()}async function Js(e,t,o,n,r){let i=r||Et;Qt(i);let s=await fetch(`${ft()}/v1/public/addresses/balance`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json","x-publishable-key":i},body:JSON.stringify({address:e,chain_type:t,chain_id:o,token_address:n})});if(!s.ok)throw new Error(`Failed to fetch address balance: ${s.statusText}`);return s.json()}var Zs="",Xs;function Hn(e){Zs=e;}function Nn(e){Xs=e;}function ao(){let e=Zs||zn();if(!e)throw new Error("[Unifold] No publishable key configured. Set via UnifoldProvider or setStripeOnrampPublishableKey().");return e}function lo(){return Xs??Xr()}async function Un(){let e=`${lo()}/v1/public/onramps/headless/stripe/config`,t=ao(),o=await fetch(e,{method:"GET",headers:{"x-publishable-key":t,"Content-Type":"application/json"}});if(!o.ok)throw new Error(`Failed to load Stripe config: ${o.status}`);let n=await o.json();if(!n?.publishable_key)throw new Error("Missing Stripe publishable key in config response");return n.publishable_key}async function ea(e){let t=await fetch(`${lo()}/v1/public/onramps/headless/stripe/oauth/start`,{method:"POST",headers:{"x-publishable-key":ao(),"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(!t.ok)throw new Error(`Failed to create auth intent: ${t.status}`);let o=await t.json();return o.auth_intent_id??o.id}async function ta(e){let t=await fetch(`${lo()}/v1/public/onramps/headless/stripe/oauth/token`,{method:"POST",headers:{"x-publishable-key":ao(),"Content-Type":"application/json"},body:JSON.stringify({auth_intent_id:e})});if(!t.ok)throw new Error(`Failed to exchange auth intent for tokens: ${t.status}`);return t.json()}async function oa(e,t){let o={crypto_customer_id:e.cryptoCustomerId,payment_token:e.paymentToken,source_amount:e.sourceAmount,source_currency:e.sourceCurrency,destination_currency:e.destinationCurrency,wallet_address:e.walletAddress,destination_network:e.destinationNetwork},n=await fetch(`${lo()}/v1/public/onramps/headless/stripe/sessions`,{method:"POST",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t,"Content-Type":"application/json"},body:JSON.stringify(o)}),r=await n.text();if(!n.ok)throw new Error(`Failed to create onramp session: ${n.status} ${r}`);return JSON.parse(r)}async function ra(e,t){let o=await fetch(`${lo()}/v1/public/onramps/headless/stripe/sessions/${e}/confirm`,{method:"POST",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t,"Content-Type":"application/json"}}),n=await o.text();if(!o.ok)throw new Error(`Failed to confirm onramp session: ${o.status} ${n}`);return JSON.parse(n)}async function na(e,t){let o=`${lo()}/v1/public/onramps/headless/stripe/customers/${e}`,n=await fetch(o,{method:"GET",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t}}),r=await n.text();if(!n.ok)throw new Error(`Failed to get onramp customer: ${n.status} ${r}`);return JSON.parse(r)}async function ia(e,t){let o=`${lo()}/v1/public/onramps/headless/stripe/sessions/${e}`,n=await fetch(o,{method:"GET",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t}}),r=await n.text();if(!n.ok)throw new Error(`Failed to get onramp session: ${n.status} ${r}`);return JSON.parse(r)}async function sa(e,t){let o=await fetch(`${lo()}/v1/public/onramps/headless/stripe/sessions/${e}/quote/refresh`,{method:"POST",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t,"Content-Type":"application/json"}});if(!o.ok){let n=await o.text();throw new Error(`Failed to refresh quote: ${o.status} ${n}`)}return o.json()}async function aa(e){if(!e.recipient_address)throw new Error("[Unifold] recipient_address is required for fetchDepositAddress. Pass recipientAddress in your onramp config.");let t={external_user_id:e.external_user_id,destination_chain_type:e.destination_chain_type||"ethereum",destination_chain_id:e.destination_chain_id||"8453",destination_token_address:e.destination_token_address||"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",recipient_address:e.recipient_address,client_metadata:{}},o=await fetch(`${lo()}/v1/public/deposit_addresses`,{method:"POST",headers:{accept:"application/json","x-publishable-key":ao(),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok)throw new Error(`Failed to create deposit address: ${o.status}`);return o.json()}async function la(e){let t=new URLSearchParams({token_address:e.token_address,chain_id:e.chain_id,chain_type:e.chain_type}),o=await fetch(`${lo()}/v1/public/onramps/headless/stripe/default_token?${t.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":ao()}});if(!o.ok)throw new Error(`Failed to fetch default onramp token: ${o.status}`);return o.json()}var kc=5,ca={firstName:"",lastName:"",idNumber:"",dobDay:"",dobMonth:"",dobYear:"",addressLine1:"",addressLine2:"",city:"",state:"",postalCode:"",country:"US"};function jn(e){let t=e?.flowOrder==="amount_first",o=t?"session_params":"email",{configure:n,hasLinkAccount:r,registerLinkUser:i,authorize:s,attachKycInfo:c,presentKycInfoVerification:d,verifyIdentity:u,registerWalletAddress:a,collectPaymentMethod:g,createCryptoPaymentToken:T}=stripeReactNative.useOnramp(),[C,h]=react.useState(o),[b,p]=react.useState(false),[y,m]=react.useState(""),[l,f]=react.useState(null),[R,S]=react.useState(e?.email??""),[A,B]=react.useState(e?.phone??""),[k,J]=react.useState(""),[q,M]=react.useState("US"),[H,X]=react.useState(""),[U,Qe]=react.useState(""),[We,Ge]=react.useState(false),[ee,Te]=react.useState(false),Ae=react.useRef(0),xe=react.useRef(false),Oe=react.useRef(false),te=react.useRef(false),Ee=react.useRef(""),it=react.useRef(null),[st,dt]=react.useState(ca),[at,Ct]=react.useState(e?.defaultWalletAddress??"0x102471956A026866171C44F326e1DfafB6C6e34c"),[Je,oo]=react.useState(""),[ce,j]=react.useState(e?.defaultNetwork??stripeReactNative.Onramp.CryptoNetwork.base),[_e,Kt]=react.useState(e?.defaultSourceAmount??"100"),[Ce,bt]=react.useState(e?.defaultSourceCurrency??"usd"),[Xe,ut]=react.useState(e?.defaultDestinationCurrency??"usdc"),[de,et]=react.useState(null),[ro,ze]=react.useState(false),ge=react.useRef(null),Ht=react.useRef(false),Dt=react.useRef(0),ho=react.useRef(e?.onComplete),Ze=react.useRef(e?.onError),Do=react.useRef(e?.onStepChange),je=react.useRef(o);react.useEffect(()=>{ho.current=e?.onComplete;},[e?.onComplete]),react.useEffect(()=>{Ze.current=e?.onError;},[e?.onError]),react.useEffect(()=>{Do.current=e?.onStepChange;},[e?.onStepChange]);let no=react.useRef(o);react.useEffect(()=>{C!==no.current&&(Do.current?.(C,no.current),no.current=C),je.current=C;},[C]);let F=react.useCallback((_,E,K)=>{let w={code:_,message:E,step:je.current,stripeErrorCode:K};f(w),m(""),Ze.current?.(w);},[]),Bt=react.useCallback(_=>{let E={sessionId:_.id,status:_.status,sourceAmount:_.transaction_details.source_amount,sourceCurrency:_.transaction_details.source_currency,destinationAmount:_.transaction_details.destination_amount,destinationCurrency:_.transaction_details.destination_currency,destinationNetwork:_.transaction_details.destination_network,walletAddress:_.transaction_details.wallet_address,fees:{networkFee:_.transaction_details.fees.network_fee_amount,transactionFee:_.transaction_details.fees.transaction_fee_amount}};return ho.current?.(E),E},[]),he=react.useCallback(()=>f(null),[]);react.useEffect(()=>{if(!(e?.merchantIdentifier?.trim()??"")){ze(false);return}let E=false;return stripeReactNative.isPlatformPaySupported().then(K=>{E||ze(K);}),()=>{E=true;}},[e?.merchantIdentifier]),react.useEffect(()=>(Ht.current=false,()=>{Ht.current=true,ge.current&&clearTimeout(ge.current);}),[]),react.useEffect(()=>{if(!e?.publishableKey||!e?.externalUserId||!e?.recipientAddress||We||ee)return;let _=false;Te(true);async function E(){try{let[K,w]=await Promise.all([aa({external_user_id:e.externalUserId,recipient_address:e.recipientAddress,destination_chain_type:e?.destinationChainType,destination_chain_id:e?.destinationChainId,destination_token_address:e?.destinationTokenAddress}),e?.destinationTokenAddress&&e?.destinationChainId&&e?.destinationChainType?la({token_address:e.destinationTokenAddress,chain_id:e.destinationChainId,chain_type:e.destinationChainType}).catch(Me=>(console.warn("[useStripeOnramp] fetchDefaultOnrampToken failed, using chain_id fallback:",Me?.message),null)):Promise.resolve(null)]);if(_)return;let P=e?.destinationChainType??"ethereum",ie=K.data.find(Me=>Me.chain_type===P);if(ie?.address){let Me=ie.address.toLowerCase();Ct(Me),Ee.current=Me,ie.recipient_address&&oo(ie.recipient_address);}else console.warn("[resolveWallet] No wallet found for chain_type",P,"in",K.data?.length,"wallets");let De={base:stripeReactNative.Onramp.CryptoNetwork.base,ethereum:stripeReactNative.Onramp.CryptoNetwork.ethereum,solana:stripeReactNative.Onramp.CryptoNetwork.solana,bitcoin:stripeReactNative.Onramp.CryptoNetwork.bitcoin,polygon:stripeReactNative.Onramp.CryptoNetwork.polygon},Bo={8453:"base",1:"ethereum",137:"polygon"},Ft=w?.destination_network,xt="none";if(Ft&&De[Ft])j(De[Ft]),xt=Ft+" (from default_token API)";else if(e?.destinationChainId&&Bo[e.destinationChainId]){let Me=Bo[e.destinationChainId];De[Me]&&j(De[Me]),xt=Me+" (from chain_id "+e.destinationChainId+")";}else De[P]&&(j(De[P]),xt=P+" (from chain_type fallback)");w?.destination_currency&&ut(w.destination_currency.toLowerCase()),Ge(!0),te.current=!0;}catch(K){console.error("[useStripeOnramp] Failed to resolve wallet:",K?.message),Ge(true),te.current=true;}finally{_||Te(false);}}return E(),()=>{_=true;}},[e?.publishableKey,e?.externalUserId]);let ne=react.useCallback(async()=>{if(it.current)return it.current;let _=n({merchantDisplayName:e?.merchantDisplayName??"Unifold",appearance:{lightColors:{primary:"#2d22a1",contentOnPrimary:"#ffffff",borderSelected:"#07b8b8"},darkColors:{primary:"#800080",contentOnPrimary:"#ffffff",borderSelected:"#526f3e"},style:"ALWAYS_DARK",primaryButton:{cornerRadius:8,height:48}}}).then(E=>(E.error&&(console.error("[useStripeOnramp] configureSDK error:",E.error.message,E.error.code),it.current=null),E)).catch(E=>{throw console.error("[useStripeOnramp] configureSDK threw:",E?.message??E),it.current=null,E});return it.current=_,_},[n,e?.merchantDisplayName]);react.useEffect(()=>{ne();},[]);let be=react.useCallback(async _=>{if(!xe.current){xe.current=true,p(true),he(),m("Creating auth intent...");try{let E=await ea(_);m("Waiting for authorization...");let K=await s(E);if(K?.error){F("authorization_error",K.error.message,K.error.code),h("email");return}if(K?.status==="Denied"){F("authorization_error","Authorization denied by user."),h("email");return}if(K?.status!=="Consented"||!K.customerId){F("authorization_error","Authorization was canceled."),h("email");return}m("Exchanging tokens...");let w=await ta(E),P=K.customerId,ie=w.access_token;X(P),Qe(ie),m("Checking verification status...");try{let De=await na(P,ie),Bo=De.verifications.find(yo=>yo.name==="kyc_verified"),Ft=De.verifications.find(yo=>yo.name==="id_document_verified"),xt=Bo?.status==="verified",Me=Bo?.status==="rejected",Fo=Ft?.status==="verified",Ri=De.provided_fields.includes("first_name");if(m(""),Me&&!Ri)F("kyc_error","KYC was previously rejected. Please submit with correct info."),h("kyc");else if(Me&&Ri)h(Fo?"wallet":"identity");else if(!xt&&!Ri)h("kyc");else if(!Fo)h("identity");else if(te.current&&Ee.current)try{let yo=await a(Ee.current,ce);yo?.error?(F("wallet_error",yo.error.message,yo.error.code),h("wallet")):h(t?"payment_method":"session_params");}catch(yo){console.warn("[proceedToAuthorize] Inline wallet registration failed, falling back to wallet step:",yo?.message),h("wallet");}else h("wallet");}catch(De){console.warn("[getOnrampCustomer] failed, defaulting to kyc:",De?.message),m(""),h("kyc");}}catch(E){F("authorization_error",E?.message??String(E)),h("email");}finally{xe.current=false,p(false);}}},[s,he,F,a,ce,t]),V=react.useCallback(async()=>{if(reactNative.Keyboard.dismiss(),!R){F("validation_error","Please enter an email address.");return}p(true),he(),m("");try{m("Configuring...");let _=await ne();if(_.error){F("configuration_error",_.error.message,_.error.code);return}m("Checking Link account...");let E=await r(R);if(E.error){F("authorization_error",E.error.message,E.error.code);return}E.hasLinkAccount?await be(R):(m(""),h("register"));}catch(_){F("unknown_error",_?.message??String(_));}finally{p(false);}},[he,ne,R,F,r,be]),N=react.useCallback(async()=>{if(!A){F("validation_error","Please enter your phone number.");return}p(true),he(),m("");try{m("Creating Link account...");let _=await i({email:R,phone:A,fullName:k||R,country:q||"US"});if(_.error){F("registration_error",_.error.message,_.error.code);return}await be(R);}catch(_){F("registration_error",_?.message??String(_));}finally{p(false);}},[he,q,R,F,k,A,i,be]);react.useEffect(()=>{if(C!=="email"||!e?.email)return;let _=++Ae.current,E=false,K=()=>E||Ae.current!==_;return e?.phone?(async()=>{p(true),he();try{m("Configuring...");let w=await ne();if(K())return;if(w.error){F("configuration_error",w.error.message,w.error.code);return}m("Checking Link account...");let P=await r(e.email);if(K())return;if(P.error){F("authorization_error",P.error.message,P.error.code);return}if(P.hasLinkAccount){if(K())return;await be(e.email);}else {m("Creating Link account...");let ie=await i({email:e.email,phone:e.phone,fullName:e.email,country:"US"});if(K())return;if(ie.error){F("registration_error",ie.error.message,ie.error.code);return}if(K())return;await be(e.email);}}catch(w){K()||F("unknown_error",w?.message??String(w));}finally{p(false);}})():(async()=>{p(true),he();try{m("Configuring...");let w=await ne();if(K())return;if(w.error){F("configuration_error",w.error.message,w.error.code);return}m("Checking Link account...");let P=await r(e.email);if(K())return;if(P.error){F("authorization_error",P.error.message,P.error.code);return}if(P.hasLinkAccount){if(K())return;await be(e.email);}else {if(K())return;m(""),h("register");}}catch(w){K()||F("unknown_error",w?.message??String(w));}finally{p(false);}})(),()=>{E=true;}},[C,e?.email,e?.phone]);let re=react.useCallback(async _=>{p(true),he(),m(""),dt(_);try{let E={firstName:_.firstName,lastName:_.lastName,idNumber:_.idNumber||void 0,dateOfBirth:{day:parseInt(_.dobDay,10),month:parseInt(_.dobMonth,10),year:parseInt(_.dobYear,10)},address:{line1:_.addressLine1,line2:_.addressLine2||void 0,city:_.city,state:_.state,postalCode:_.postalCode,country:_.country}},K=await c(E);if(K?.error){if(K.error.stripeErrorCode==="consumer_person_already_verified"){m(""),h("identity");return}F("kyc_error",K.error.message,K.error.stripeErrorCode??K.error.code),h("kyc");return}m("Please review your KYC information...");let w=await d(null);if(w?.error){F("kyc_error",w.error.message,w.error.stripeErrorCode??w.error.code),h("kyc");return}if(w?.status==="UpdateAddress"){F("kyc_error","Please update your address and resubmit."),h("kyc");return}m(""),h("identity");}catch(E){F("kyc_error",E?.message??String(E)),h("kyc");}finally{p(false);}},[c,he,F,d]),Q=react.useCallback(async()=>{if(!Oe.current){Oe.current=true,p(true),he(),m("Launching identity verification...");try{let _=await u();if(_?.error){F("identity_error",_.error.message,_.error.code);return}m(""),h("wallet");}catch(_){F("identity_error",_?.message??String(_));}finally{Oe.current=false,p(false);}}},[he,F,u]);react.useEffect(()=>{C==="identity"&&!b&&Q();},[C]);let Ve=react.useCallback(async()=>{if(!at){F("validation_error","Please enter a wallet address.");return}p(true),he(),m("");try{let _=await a(at.toLowerCase(),ce);if(_?.error){F("wallet_error",_.error.message,_.error.code);return}m(""),h(t?"payment_method":"session_params");}catch(_){F("wallet_error",_?.message??String(_));}finally{p(false);}},[he,F,at,ce,a,t]);react.useEffect(()=>{C==="wallet"&&We&&at&&!b&&Ve();},[C,We,at]);let we=react.useCallback((_,E)=>{Ht.current=false,Dt.current=0;let K=async()=>{try{let w=await ia(_,E);if(Ht.current)return;Dt.current=0,w.status==="fulfillment_complete"?(et(w),h("success"),Bt(w)):ge.current=setTimeout(K,3e3);}catch(w){if(Ht.current)return;if(Dt.current+=1,console.error("[pollSessionStatus] error:",w?.message),Dt.current>=kc){F("session_error","We couldn't confirm delivery status. Your purchase may still complete \u2014 try again, or close and check your wallet.");return}ge.current=setTimeout(K,5e3);}};ge.current=setTimeout(K,3e3);},[Bt,F]),Nt=react.useCallback(()=>{je.current==="processing"&&(!de?.id||!U||(he(),Dt.current=0,ge.current&&(clearTimeout(ge.current),ge.current=null),we(de.id,U)));},[U,he,we,de?.id]),Tt=react.useCallback(async _=>{p(true),he(),m("");try{m("Confirming purchase...");let E=await ra(_,U);et(E),h("processing"),m(""),we(E.id,U);}finally{p(false);}},[U,he,we]),xn=react.useCallback(async()=>{if(de)try{await Tt(de.id);}catch(_){F("session_error",_?.message??String(_)),h("quote");}},[F,Tt,de]),Ti=react.useCallback(async(_=false)=>{if(!_e||isNaN(Number(_e))||Number(_e)<=0){F("validation_error","Please enter a valid amount.");return}p(true),he(),m("");try{let E;if(_){if(!e?.merchantIdentifier?.trim()){F("configuration_error","Apple Pay is not configured. Pass merchantIdentifier on StripeOnramp or in onramp config."),h("payment_method");return}m("Opening Apple Pay...");let ie={applePay:{merchantCountryCode:"US",currencyCode:Ce.toUpperCase(),cartItems:[{paymentType:stripeReactNative.PlatformPay.PaymentType.Immediate,label:`${Xe.toUpperCase()} purchase + fees`,amount:_e||"0.00"}]}};E=await g("PlatformPay",ie);}else m("Select a payment method..."),E=await g("Card");if(E?.error){F("payment_error",E.error.message,E.error.code),h("payment_method");return}if(!E?.displayData){F("payment_error","Payment method selection was canceled."),h("payment_method");return}m("Creating payment token...");let K=await T();if(K?.error){F("payment_error",K.error.message,K.error.code),h("payment_method");return}let w=K.cryptoPaymentToken;m("Creating onramp session...");let P=await oa({cryptoCustomerId:H,paymentToken:w,sourceAmount:Number(_e),sourceCurrency:Ce,destinationCurrency:Xe,walletAddress:at.toLowerCase(),destinationNetwork:ce},U);et(P),m(""),_?await Tt(P.id):h("quote");}catch(E){F("session_error",E?.message??String(E)),h("payment_method");}finally{p(false);}},[U,he,g,T,H,Xe,F,Tt,_e,Ce,at,ce,e?.merchantIdentifier]),xi=react.useCallback(async()=>{if(de){p(true),he(),m("");try{let _=await sa(de.id,U);et(_);}catch(_){F("session_error",_?.message??String(_));}finally{p(false);}}},[U,he,F,de]),_i=react.useCallback(()=>{Ht.current=true,Dt.current=0,ge.current&&(clearTimeout(ge.current),ge.current=null),h(o),p(false),m(""),f(null),S(e?.email??""),B(e?.phone??""),J(""),M("US"),X(""),Qe(""),Ge(false),Te(false),dt(ca),Ct(e?.recipientAddress??""),j(stripeReactNative.Onramp.CryptoNetwork.ethereum),Kt(e?.defaultSourceAmount??"100"),bt(e?.defaultSourceCurrency??"usd"),ut(e?.defaultDestinationCurrency??"usdc"),et(null),Ae.current+=1,xe.current=false,Oe.current=false;},[e,o]);return {step:C,loading:b,status:y,error:l,email:R,phone:A,fullName:k,country:q,customerId:H,accessToken:U,session:de,kycData:st,walletAddress:at,resolvedRecipientAddress:Je,walletNetwork:ce,sourceAmount:_e,sourceCurrency:Ce,destinationCurrency:Xe,applePaySupported:ro,walletReady:We,walletLoading:ee,setStep:h,setStatus:m,setEmail:S,setPhone:B,setFullName:J,setCountry:M,setWalletAddress:Ct,setWalletNetwork:j,setSourceAmount:Kt,setSourceCurrency:bt,setDestinationCurrency:ut,checkEmail:V,register:N,attachKyc:re,verifyIdentity:Q,registerWallet:Ve,collectPaymentMethod:Ti,refreshQuote:xi,confirmCheckout:xn,reset:_i,clearError:he,resumeFulfillmentPolling:Nt,amountFirst:t}}function da({styles:e,placeholderColor:t,hasPrefilledEmail:o,loading:n,error:r,status:i,email:s,setEmail:c,checkEmail:d,onClose:u}){return o?jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:u}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[jsxRuntime.jsx(Ie,{size:56,strokeWidth:3}),jsxRuntime.jsx(pt,{error:r,progress:i,loading:n})]})]}):jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:e.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:u}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.title,children:"Enter your email"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.subtitle,children:"We'll check if you have a Link account or create one for you."}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Email address"}),jsxRuntime.jsx(reactNative.TextInput,{style:e.form.input,placeholder:"jane@example.com",placeholderTextColor:t,keyboardType:"email-address",autoCapitalize:"none",autoCorrect:false,value:s,onChangeText:c,autoFocus:true,returnKeyType:"done",onSubmitEditing:d})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[n?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[e.form.continueBtn,!s&&e.form.continueBtnDisabled],onPress:d,disabled:!s,children:jsxRuntime.jsx(reactNative.Text,{style:[e.form.continueBtnText,!s&&e.form.continueBtnTextDisabled],children:"Continue"})}),jsxRuntime.jsx(pt,{error:r,progress:i,loading:n})]})]})})}function pa({styles:e,loading:t,status:o,error:n,verifyIdentity:r,onClose:i}){return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:i}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.spinnerWrap,children:jsxRuntime.jsx(Ie,{size:48,strokeWidth:3})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Verifying identity"}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:o||"Preparing identity verification..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.spinnerWrap,children:jsxRuntime.jsx(reactNative.Text,{style:e.flow.idIcon,children:"\u{1FAAA}"})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Identity verification"}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:o||"Tap below to continue verification."})]}),jsxRuntime.jsx(pt,{error:n,progress:o,loading:false})]}),!t&&jsxRuntime.jsx(reactNative.View,{style:e.form.footer,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:r,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Continue Verification"})})})]})}function fa({styles:e,loading:t,error:o,status:n,sourceAmount:r,sourceCurrency:i,destinationCurrency:s,walletNetwork:c,applePaySupported:d,collectPaymentMethod:u,onClose:a}){let{colors:g}=O(),T=_r.find(b=>b.value===c)?.label??c,C=r===""||r===void 0?"0":r,h=g.primaryForeground;return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:a,title:"How do you want to pay?"}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.pm.payHint,children:"Select a payment method to continue"}),jsxRuntime.jsxs(reactNative.View,{style:e.pm.stackWrapper,children:[jsxRuntime.jsxs(reactNative.View,{style:[e.pm.swapCard,e.pm.swapCardTop],children:[jsxRuntime.jsx(reactNative.Text,{style:e.pm.summaryLabel,children:"You pay"}),jsxRuntime.jsxs(reactNative.View,{style:e.pm.swapRow,children:[jsxRuntime.jsxs(reactNative.Text,{style:e.pm.swapSpendAmount,numberOfLines:1,adjustsFontSizeToFit:true,children:["$",C]}),jsxRuntime.jsx(reactNative.View,{style:e.pm.swapPill,children:jsxRuntime.jsx(reactNative.Text,{style:e.pm.swapPillText,children:i.toUpperCase()})})]})]}),jsxRuntime.jsx(reactNative.View,{style:e.pm.swapConnectorWrap,pointerEvents:"none",children:jsxRuntime.jsx(reactNative.View,{style:e.pm.swapConnectorCircle,children:jsxRuntime.jsx(wt,{size:20,color:h,strokeWidth:2.5})})}),jsxRuntime.jsxs(reactNative.View,{style:[e.pm.swapCard,e.pm.swapCardBottom],children:[jsxRuntime.jsx(reactNative.Text,{style:e.pm.summaryLabel,children:"You receive"}),jsxRuntime.jsxs(reactNative.View,{style:e.pm.swapRow,children:[jsxRuntime.jsx(reactNative.View,{style:e.pm.swapLeftCol,children:jsxRuntime.jsx(reactNative.Text,{style:e.pm.swapReceivePrimary,numberOfLines:1,adjustsFontSizeToFit:true,children:s.toUpperCase()})}),jsxRuntime.jsx(reactNative.View,{style:e.pm.swapPill,children:jsxRuntime.jsx(reactNative.Text,{style:e.pm.swapPillText,children:T.toUpperCase()})})]})]})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[t?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d&&jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.pm.applePayBtn,onPress:()=>u(true),children:jsxRuntime.jsxs(reactNative.Text,{style:e.pm.applePayBtnText,children:["Pay with ","\uF8FF"," Pay"]})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:()=>u(false),children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Pay with Card"})})]}),jsxRuntime.jsx(pt,{error:o,progress:n,loading:t})]})]})}function ha({styles:e,error:t,status:o,loading:n,onClose:r,onRetryStatusCheck:i}){let s=!!t;return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[s?jsxRuntime.jsx($e,{onPress:r}):jsxRuntime.jsx(reactNative.View,{style:On}),jsxRuntime.jsx(reactNative.View,{style:e.flow.centered,children:t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Could not confirm status"}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:"Your payment may still be completing. Try checking again, or close this screen and verify your wallet balance."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.spinnerWrap,children:jsxRuntime.jsx(Ie,{size:48,strokeWidth:3})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Processing your purchase"}),jsxRuntime.jsxs(reactNative.Text,{style:e.flow.sub,children:["Your payment has been confirmed.",`
|
|
2
|
-
`,"We're sending your crypto \u2014 this usually takes less than a minute."]})]})}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[jsxRuntime.jsx(pt,{error:t,progress:o,loading:n}),t?jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.ghostBtn,onPress:i,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.ghostBtnText,children:"Check status again"})}):null]})]})}function Ca({styles:e,session:t,loading:o,error:n,status:r,confirmCheckout:i,refreshQuote:s,onClose:c}){let d=t.transaction_details,u=new Date(d.quote_expiration*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),a=d.wallet_address.slice(0,6)+"..."+d.wallet_address.slice(-4),g=Pn(d.destination_amount,d.destination_currency);return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:c,title:"Review your purchase"}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsxs(reactNative.View,{style:e.quote.heroBox,children:[jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroLabel,children:"You receive"}),jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroAmount,children:g}),jsxRuntime.jsxs(reactNative.Text,{style:e.quote.heroNetwork,children:[d.destination_currency.toUpperCase()," ",Ln(d.destination_network)]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.quote.card,children:[jsxRuntime.jsx(Ao,{quote:e.quote,label:"You pay",value:`${d.source_amount} ${d.source_currency.toUpperCase()}`}),jsxRuntime.jsx(Ao,{quote:e.quote,label:"Network fee",value:`$${d.fees.network_fee_amount}`}),jsxRuntime.jsx(Ao,{quote:e.quote,label:"Transaction fee",value:`$${d.fees.transaction_fee_amount}`}),jsxRuntime.jsx(Ao,{quote:e.quote,label:"Wallet",value:a,mono:true}),jsxRuntime.jsx(Ao,{quote:e.quote,label:"Quote expires",value:u,last:true})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[o?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:i,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Confirm Purchase"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.ghostBtn,onPress:s,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.ghostBtnText,children:"Refresh Quote"})})]}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]})}function ba({styles:e,hasPrefilledPhone:t,loading:o,error:n,status:r,email:i,phone:s,setPhone:c,register:d,onClose:u}){let a=O();return t?jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:u}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[jsxRuntime.jsx(Ie,{size:56,strokeWidth:3}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]}):jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:e.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:u}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.title,children:"Enter your phone"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.subtitle,children:"We'll send a verification code to confirm your number."}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Phone number"}),jsxRuntime.jsx(reactNative.TextInput,{style:e.form.input,placeholder:"+12125551234",placeholderTextColor:a.components.input.placeholderColor,keyboardType:"phone-pad",value:s,onChangeText:g=>c(g.replace(/[^\d+]/g,"").replace(/(?!^)\+/g,"")),autoFocus:true,returnKeyType:"done",onSubmitEditing:d}),jsxRuntime.jsx(reactNative.Text,{style:e.form.hint,children:"Include country code, e.g. +12125551234"})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.emailRow,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.emailLabel,children:"Signing up as"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.emailValue,children:i})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[o?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[e.form.continueBtn,!s&&e.form.continueBtnDisabled],onPress:d,disabled:!s,children:jsxRuntime.jsx(reactNative.Text,{style:[e.form.continueBtnText,!s&&e.form.continueBtnTextDisabled],children:"Continue"})}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]})})}function wa({styles:e,session:t,resolvedRecipientAddress:o,recipientFromConfig:n,onDone:r}){let{colors:i}=O(),s=t.transaction_details,c=Pn(s.destination_amount,s.destination_currency),d=o||n||"";return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:r,title:"Purchase complete"}),jsxRuntime.jsx(reactNative.View,{style:e.form.content,children:jsxRuntime.jsxs(reactNative.ScrollView,{style:e.form.flex,contentContainerStyle:e.flow.successScrollContent,showsVerticalScrollIndicator:false,children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.checkCircle,children:jsxRuntime.jsx(Be,{size:40,color:i.success,strokeWidth:2.5})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:"Your crypto is on its way to your wallet."}),jsxRuntime.jsxs(reactNative.View,{style:[e.quote.heroBox,e.flow.detailCard],children:[jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroLabel,children:"You received"}),jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroAmount,children:c}),jsxRuntime.jsxs(reactNative.Text,{style:e.quote.heroNetwork,children:[s.destination_currency.toUpperCase()," ",Ln(s.destination_network)]})]}),jsxRuntime.jsxs(reactNative.View,{style:[e.quote.card,e.flow.detailCard],children:[jsxRuntime.jsx(Ei,{quote:e.quote,label:"Deposit Address",address:s.wallet_address}),d?jsxRuntime.jsx(Ei,{quote:e.quote,label:"Recipient Address",address:d,last:true}):jsxRuntime.jsx(Ao,{quote:e.quote,label:"Session",value:t.id.slice(0,8)+"..."+t.id.slice(-6),mono:true,last:true})]})]})}),jsxRuntime.jsx(reactNative.View,{style:e.form.footer,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:r,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Done"})})})]})}function ka({styles:e,hasAutoWallet:t,loading:o,error:n,status:r,walletAddress:i,walletNetwork:s,setWalletAddress:c,setWalletNetwork:d,setDestinationCurrency:u,registerWallet:a,onClose:g}){let{components:T}=O();return t?jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:g}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[jsxRuntime.jsx(Ie,{size:56,strokeWidth:3}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]}):jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:e.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:g}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.title,children:"Your crypto wallet"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.subtitle,children:"Enter the wallet address where you'd like to receive your crypto."}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Wallet address"}),jsxRuntime.jsx(reactNative.TextInput,{style:[e.form.input,e.wallet.input],placeholder:"0x...",placeholderTextColor:T.input.placeholderColor,autoCapitalize:"none",autoCorrect:false,value:i,onChangeText:c})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Network"}),jsxRuntime.jsx(reactNative.View,{style:e.wallet.list,children:_r.map(C=>{let h=s===C.value;return jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[e.wallet.row,h&&e.wallet.rowSelected],onPress:()=>{d(C.value),u(C.defaultCrypto);},children:[jsxRuntime.jsx(reactNative.View,{style:e.wallet.iconWrap,children:jsxRuntime.jsx(C.Icon,{size:24})}),jsxRuntime.jsx(reactNative.Text,{style:[e.wallet.rowText,h&&e.wallet.rowTextSelected],children:C.label}),h&&jsxRuntime.jsx(reactNative.View,{style:e.wallet.checkCircle,children:jsxRuntime.jsx(Be,{size:14,color:T.container.buttonTitleColor,strokeWidth:2.5})})]},C.value)})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[o?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[e.form.continueBtn,!i&&e.form.continueBtnDisabled],onPress:a,disabled:!i,children:jsxRuntime.jsx(reactNative.Text,{style:[e.form.continueBtnText,!i&&e.form.continueBtnTextDisabled],children:"Continue"})}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]})})}function Kn({config:e,onComplete:t}){let o=O(),n=Ir(),{step:r,loading:i,status:s,error:c,email:d,phone:u,session:a,kycData:g,walletAddress:T,resolvedRecipientAddress:C,walletNetwork:h,sourceAmount:b,sourceCurrency:p,destinationCurrency:y,applePaySupported:m,setStep:l,setEmail:f,setPhone:R,setWalletAddress:S,setWalletNetwork:A,setSourceAmount:B,setDestinationCurrency:k,checkEmail:J,register:q,attachKyc:M,verifyIdentity:H,registerWallet:X,collectPaymentMethod:U,refreshQuote:Qe,confirmCheckout:We,reset:Ge,resumeFulfillmentPolling:ee,amountFirst:Te}=jn(e),Ae=!!e?.email,xe=!!e?.phone,Oe=!!e?.publishableKey&&!!e?.externalUserId,te=()=>{Ge(),t?.();};return r==="email"?jsxRuntime.jsx(da,{styles:n,placeholderColor:o.components.input.placeholderColor,hasPrefilledEmail:Ae,loading:i,error:c,status:s,email:d,setEmail:f,checkEmail:J,onClose:te}):r==="register"?jsxRuntime.jsx(ba,{styles:n,hasPrefilledPhone:xe,loading:i,error:c,status:s,email:d,phone:u,setPhone:R,register:q,onClose:te}):r==="kyc"?jsxRuntime.jsx(Wn,{initialData:g,loading:i,onComplete:M,onCancel:()=>l("email")}):r==="identity"?jsxRuntime.jsx(pa,{styles:n,loading:i,status:s,error:c,verifyIdentity:H,onClose:te}):r==="wallet"?jsxRuntime.jsx(ka,{styles:n,hasAutoWallet:Oe,loading:i,error:c,status:s,walletAddress:T,walletNetwork:h,setWalletAddress:S,setWalletNetwork:A,setDestinationCurrency:k,registerWallet:X,onClose:te}):r==="session_params"?jsxRuntime.jsx(Bn,{initialAmount:b,currency:p,onConfirm:Ee=>{B(Ee),l(Te?"email":"payment_method");},onCancel:()=>{Te?te():l("wallet");}}):r==="payment_method"?jsxRuntime.jsx(fa,{styles:n,loading:i,error:c,status:s,sourceAmount:b,sourceCurrency:p,destinationCurrency:y,walletNetwork:h,applePaySupported:m,collectPaymentMethod:U,onClose:te}):r==="quote"&&a?jsxRuntime.jsx(Ca,{styles:n,session:a,loading:i,error:c,status:s,confirmCheckout:We,refreshQuote:Qe,onClose:te}):r==="processing"?jsxRuntime.jsx(ha,{styles:n,error:c,status:s,loading:i,onClose:te,onRetryStatusCheck:ee}):r==="success"&&a?jsxRuntime.jsx(wa,{styles:n,session:a,resolvedRecipientAddress:C,recipientFromConfig:e?.recipientAddress,onDone:()=>{Ge(),t?.();}}):null}function Ta(){try{let t=Rl("expo-constants").default?.expoConfig?.plugins;if(!Array.isArray(t))return;for(let o of t){if(!Array.isArray(o))continue;let[n,r]=o;if(n!=="@stripe/stripe-react-native"||!r||typeof r!="object")continue;let i=r.merchantIdentifier;if(typeof i=="string"){let s=i.trim();if(s.length>0)return s}}}catch{}}function Yn({publishableKey:e,email:t,phone:o,externalUserId:n,flowOrder:r,destinationChainType:i="ethereum",destinationChainId:s="8453",destinationTokenAddress:c,recipientAddress:d,onComplete:u,onError:a,onStepChange:g,onClose:T,merchantIdentifier:C="",urlScheme:h="unifoldOnramp"}){let b=e||zn(),p=react.useMemo(()=>{let S=C.trim();return S.length>0?S:Ta()??""},[C]),[y,m]=react.useState("loading"),[l,f]=react.useState(null);react.useEffect(()=>{let S=false;async function A(){try{b&&(Hn(b),Nn(Xr()));let B=await Un();if(S)return;let k=p.trim();if(await stripeReactNative.initStripe({publishableKey:B,urlScheme:h,...k?{merchantIdentifier:k}:{}}),S)return;m("ready");}catch(B){if(S)return;console.error("[StripeOnramp] Init failed:",B),f(B?.message??"Failed to load Stripe configuration"),m("error");}}return A(),()=>{S=true;}},[b,p,h]);let R=react.useMemo(()=>{let S={publishableKey:b,externalUserId:n,destinationChainType:i,destinationChainId:s,onComplete:u,onError:a,onStepChange:g};return c&&(S.destinationTokenAddress=c),d&&(S.recipientAddress=d),t&&(S.email=t),o&&(S.phone=o),r&&(S.flowOrder=r),S.merchantIdentifier=p,S},[b,n,i,s,c,d,t,o,r,p,u,a,g]);return y==="error"?jsxRuntime.jsxs(reactNative.View,{style:Fr.centered,children:[jsxRuntime.jsx(reactNative.Text,{style:Fr.errorText,children:"Unable to initialize"}),jsxRuntime.jsx(reactNative.Text,{style:Fr.errorDetail,children:l}),T&&jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Fr.retryBtn,onPress:T,children:jsxRuntime.jsx(reactNative.Text,{style:Fr.retryBtnText,children:"Go Back"})})]}):y==="loading"?jsxRuntime.jsx(reactNative.View,{style:Fr.centered,children:jsxRuntime.jsx(Ie,{size:56,strokeWidth:3})}):jsxRuntime.jsx(Kn,{config:R,onComplete:T})}var Fr=reactNative.StyleSheet.create({centered:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"#000000",paddingHorizontal:24},errorText:{color:"#FF453A",fontSize:18,fontWeight:"600",marginBottom:8},errorDetail:{color:"#8E8E93",fontSize:14,textAlign:"center",marginBottom:24},retryBtn:{backgroundColor:"#00D924",borderRadius:24,paddingVertical:14,paddingHorizontal:32},retryBtnText:{color:"#000000",fontSize:16,fontWeight:"700"}});function Ia(){let{configure:e}=stripeReactNative.useOnramp(),t=react.useRef(false);return react.useEffect(()=>{t.current||(t.current=true,e({merchantDisplayName:"Unifold",appearance:{lightColors:{primary:"#2d22a1",contentOnPrimary:"#ffffff",borderSelected:"#07b8b8"},darkColors:{primary:"#800080",contentOnPrimary:"#ffffff",borderSelected:"#526f3e"},style:"ALWAYS_DARK",primaryButton:{cornerRadius:8,height:48}}}).then(o=>{o.error&&console.error("[StripeOnrampPreconfigure] error:",o.error.message);}).catch(o=>{console.error("[StripeOnrampPreconfigure] threw:",o?.message);}));},[e]),null}var va="__unifold_stripe_onramp__";function Qn(e){globalThis[va]=e;}function Pa(){return globalThis[va]}Qn(Yn);function Wr({children:e,mode:t="auto",accentColor:o,theme:n,fontFamily:r,fonts:i,components:s}){let c=reactNative.useColorScheme(),d=react.useMemo(()=>t==="auto"?c==="dark"?"dark":"light":t,[t,c]),u=react.useMemo(()=>{let C=n?.[d];return Pi(d,C,o)},[d,n,o]),a=react.useMemo(()=>Kr(u,s,d),[u,s,d]),g=react.useMemo(()=>i?{regular:i.regular||r,medium:i.medium||r,semibold:i.semibold||r,bold:i.bold||r}:r?{regular:r,medium:r,semibold:r,bold:r}:{regular:void 0,medium:void 0,semibold:void 0,bold:void 0},[r,i]),T=react.useMemo(()=>({mode:d,colors:u,fonts:g,components:a,isDark:d==="dark"}),[d,u,g,a]);return jsxRuntime.jsx(Li.Provider,{value:T,children:e})}function Pe({visible:e,onClose:t,children:o,closeOnBackdropPress:n=true,showHandle:r=true,heightPercent:i,noPadding:s=false,borderTopLeftRadius:c=24,borderTopRightRadius:d=24}){let{colors:u,components:a}=O(),{height:g}=reactNative.useWindowDimensions(),T=react.useRef(g);T.current=g;let C=react.useRef(new reactNative.Animated.Value(g)).current,h=react.useRef(new reactNative.Animated.Value(0)).current,b=i!=null&&i>=1;react.useEffect(()=>{let y=T.current;e?(C.setValue(y),h.setValue(0),reactNative.Animated.parallel([reactNative.Animated.spring(C,{toValue:0,useNativeDriver:true,tension:65,friction:11}),reactNative.Animated.timing(h,{toValue:.5,duration:200,useNativeDriver:true})]).start()):reactNative.Animated.parallel([reactNative.Animated.spring(C,{toValue:y,useNativeDriver:true,tension:65,friction:11}),reactNative.Animated.timing(h,{toValue:0,duration:200,useNativeDriver:true})]).start();},[e,C,h]);let p=()=>{n&&t();};return jsxRuntime.jsx(reactNative.Modal,{visible:e,transparent:true,animationType:"none",statusBarTranslucent:true,onRequestClose:t,children:jsxRuntime.jsxs(reactNativeGestureHandler.GestureHandlerRootView,{style:[No.container,reactNative.Platform.OS==="android"&&{paddingTop:reactNative.StatusBar.currentHeight}],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[No.backdrop,{backgroundColor:"#000000",opacity:h}],pointerEvents:"none"}),!b&&jsxRuntime.jsx(reactNative.TouchableWithoutFeedback,{onPress:p,children:jsxRuntime.jsx(reactNative.View,{style:No.backdropTouchArea})}),jsxRuntime.jsxs(reactNative.Animated.View,{style:[No.sheet,{maxHeight:g*.9,backgroundColor:u.background,borderTopLeftRadius:c,borderTopRightRadius:d,transform:[{translateY:C}],shadowColor:a.sheet.shadowColor,shadowOffset:a.sheet.shadowOffset,shadowOpacity:a.sheet.shadowOpacity,shadowRadius:a.sheet.shadowRadius,elevation:a.sheet.elevation,...i&&{height:g*i,maxHeight:g*i},...b&&{paddingBottom:0},...s&&{paddingBottom:0}}],children:[r&&jsxRuntime.jsx(reactNative.View,{style:No.handleContainer,children:jsxRuntime.jsx(reactNative.View,{style:[No.handle,{backgroundColor:u.border}]})}),jsxRuntime.jsx(reactNative.View,{style:[No.content,i&&No.contentFlex],children:o})]})]})})}var No=reactNative.StyleSheet.create({container:{flex:1},backdrop:{...reactNative.StyleSheet.absoluteFillObject},backdropTouchArea:{flex:1},sheet:{paddingBottom:reactNative.Platform.OS==="ios"?34:24},handleContainer:{alignItems:"center",paddingTop:12,paddingBottom:4},handle:{width:36,height:4,borderRadius:2},content:{},contentFlex:{flex:1}});var Er=new Map;function Da({width:e,height:t,borderRadius:o,color:n}){let r=react.useRef(new reactNative.Animated.Value(.3)).current;return react.useEffect(()=>{let i=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(r,{toValue:.7,duration:800,useNativeDriver:true}),reactNative.Animated.timing(r,{toValue:.3,duration:800,useNativeDriver:true})]));return i.start(),()=>i.stop()},[r]),jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",width:e,height:t,borderRadius:o,backgroundColor:n,opacity:r}})}function jo({uri:e,width:t,height:o,borderRadius:n=0,borderWidth:r=0,borderColor:i="transparent",backgroundColor:s="transparent",style:c}){let{colors:d}=O(),[u,a]=react.useState(false),[g,T]=react.useState(false),[C,h]=react.useState(()=>{if(!e||!e.toLowerCase().endsWith(".svg"))return null;let R=Er.get(e);return R?{uri:e,xml:R}:null}),b=e?.toLowerCase().endsWith(".svg"),p=b&&e&&C?.uri===e?C.xml:null;react.useEffect(()=>{a(false),T(false);},[e]),react.useEffect(()=>{if(!b||!e)return;if(Er.has(e)){h({uri:e,xml:Er.get(e)});return}let R=false;return fetch(e).then(S=>{if(!S.ok)throw new Error(`HTTP ${S.status}`);return S.text()}).then(S=>{R||(Er.set(e,S),h({uri:e,xml:S}));}).catch(()=>{R||a(true);}),()=>{R=true;}},[e,b]);let y=d.card;if(!e)return jsxRuntime.jsx(reactNative.View,{style:[{width:t,height:o,borderRadius:n,backgroundColor:y},c]});let m={width:t,height:o,borderRadius:n,borderWidth:r,borderColor:i,backgroundColor:s,overflow:"hidden",alignItems:"center",justifyContent:"center",...c},l=t-r*2,f=o-r*2;return u?jsxRuntime.jsx(reactNative.View,{style:[m,{backgroundColor:s||y}]}):b?jsxRuntime.jsxs(reactNative.View,{style:m,children:[!!!p&&jsxRuntime.jsx(Da,{width:l,height:f,borderRadius:n,color:y}),p?jsxRuntime.jsx(ot.SvgXml,{xml:p,width:l,height:f,onError:()=>a(true)}):jsxRuntime.jsx(ot.SvgUri,{uri:e,width:l,height:f,onError:()=>a(true)})]}):jsxRuntime.jsxs(reactNative.View,{style:m,children:[!g&&jsxRuntime.jsx(Da,{width:l,height:f,borderRadius:n,color:y}),jsxRuntime.jsx(reactNative.Image,{source:{uri:e,cache:"force-cache"},style:{width:l,height:f},resizeMode:"contain",onLoad:()=>T(true),onError:()=>a(true)})]})}function Zi(e){let t=[];for(let o of e)if(o)if(o.toLowerCase().endsWith(".svg")){if(Er.has(o))continue;t.push(fetch(o).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.text()}).then(n=>{Er.set(o,n);}).catch(()=>{}));}else t.push(reactNative.Image.prefetch(o).then(()=>{}).catch(()=>{}));return Promise.all(t).then(()=>{})}function $t({title:e,showBack:t=false,showClose:o=true,onBack:n,onClose:r,badge:i,showBalance:s=false,balanceAddress:c,balanceChainType:d,balanceChainId:u,balanceTokenAddress:a,publishableKey:g,projectName:T}){let{colors:C,fonts:h,components:b}=O(),[p,y]=react.useState(null),[m,l]=react.useState(false),f=react.useState(()=>new reactNative.Animated.Value(0))[0];react.useEffect(()=>{if(!m)return;let S=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(f,{toValue:1,duration:700,useNativeDriver:true}),reactNative.Animated.timing(f,{toValue:0,duration:700,useNativeDriver:true})]));return S.start(),()=>S.stop()},[m,f]),react.useEffect(()=>{if(!s||!c||!d||!u||!a||!g){y(null),l(false);return}let S=false;return l(true),Js(c,d,u,a,g).then(A=>{if(S)return;let B=A.balance,k=null;B&&(B.amount_usd!=null&&B.amount_usd!==""?k=`$${B.amount_usd}`:k="$0.00"),y(k);}).catch(()=>{S||y(null);}).finally(()=>{S||l(false);}),()=>{S=true;}},[s,c,d,u,a,g]);let R=f.interpolate({inputRange:[0,1],outputRange:[.4,1]});return jsxRuntime.jsxs(reactNative.View,{style:Vt.header,children:[jsxRuntime.jsx(reactNative.View,{style:Vt.leftContainer,children:t&&n?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:n,style:[Vt.iconButton,{backgroundColor:"transparent"}],hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(Yr,{size:20,color:b.header.buttonColor,strokeWidth:2})}):jsxRuntime.jsx(reactNative.View,{style:Vt.spacer})}),jsxRuntime.jsxs(reactNative.View,{style:Vt.titleContainer,children:[jsxRuntime.jsxs(reactNative.View,{style:Vt.titleRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[Vt.title,{color:b.header.titleColor,fontFamily:h.medium}],children:e}),i&&i.count>0&&jsxRuntime.jsx(reactNative.View,{style:[Vt.titleBadge,{backgroundColor:C.card}],children:jsxRuntime.jsx(reactNative.Text,{style:[Vt.titleBadgeText,{color:C.foregroundMuted,fontFamily:h.regular}],children:i.count})})]}),s&&(m?jsxRuntime.jsx(reactNative.Animated.View,{style:[Vt.balanceSkeleton,{backgroundColor:C.cardHover,opacity:R}]}):p!=null?jsxRuntime.jsxs(reactNative.Text,{style:[Vt.balanceText,{color:C.foregroundMuted,fontFamily:h.regular}],children:[T?`${T} `:"","Balance: ",p]}):null)]}),jsxRuntime.jsx(reactNative.View,{style:Vt.rightContainer,children:o?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:r,style:[Vt.iconButton,{backgroundColor:"transparent"}],hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(lt,{size:20,color:b.header.buttonColor,strokeWidth:2})}):jsxRuntime.jsx(reactNative.View,{style:Vt.spacer})})]})}var Vt=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},leftContainer:{width:40,alignItems:"flex-start"},rightContainer:{width:40,alignItems:"flex-end"},titleContainer:{flex:1,alignItems:"center"},titleRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},title:{fontSize:16,textAlign:"center"},titleBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:12},titleBadgeText:{fontSize:10,fontWeight:"400"},balanceSkeleton:{height:10,width:120,borderRadius:5,marginTop:4},balanceText:{fontSize:14,marginTop:3,textAlign:"center"},iconButton:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},spacer:{width:28,height:28}});function ct({children:e,style:t,contentStyle:o,onPress:n,activeOpacity:r=.7,cardTokens:i}){let{components:s}=O(),c=i??s.card,d=c.backShadowColor!=="transparent",u={backgroundColor:c.backgroundColor,borderRadius:c.borderRadius,borderWidth:c.borderWidth,borderColor:c.borderColor},a=[Ea.wrapper,t,d&&{marginBottom:c.backShadowSpacing}],g=[u,o];return jsxRuntime.jsxs(reactNative.View,{style:a,children:[d&&jsxRuntime.jsx(reactNative.View,{style:[Ea.backShadow,{top:c.backShadowOffset.top,left:c.backShadowOffset.left,right:c.backShadowOffset.right,bottom:c.backShadowOffset.bottom,backgroundColor:c.backShadowColor,borderRadius:c.borderRadius}]}),n!=null?jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:n,activeOpacity:r,style:g,children:e}):jsxRuntime.jsx(reactNative.View,{style:g,children:e})]})}var Ea=reactNative.StyleSheet.create({wrapper:{position:"relative"},backShadow:{position:"absolute"}});function mn({onPress:e,title:t,subtitle:o,featuredTokens:n}){let{fonts:r,components:i}=O(),s=i.depositMenu.card,c=n?[...n].sort((d,u)=>d.position-u.position):[];return jsxRuntime.jsxs(ct,{cardTokens:s,onPress:e,style:po.wrapper,contentStyle:po.container,children:[jsxRuntime.jsxs(reactNative.View,{style:po.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[po.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:jsxRuntime.jsx(Oi,{size:20,color:s.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:po.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[po.title,{color:s.titleColor,fontFamily:r.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[po.subtitle,{color:s.subtitleColor,fontFamily:r.regular}],children:o})]})]}),jsxRuntime.jsx(reactNative.View,{style:po.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:po.networkIcons,children:c.map((d,u)=>{let a=d.icon_urls.find(g=>g.format==="png")?.url||d.icon_urls.find(g=>g.format==="svg")?.url;return jsxRuntime.jsx(reactNative.View,{style:[po.networkIconWrapper,{marginLeft:u===0?0:-6,zIndex:c.length-u}],children:jsxRuntime.jsx(jo,{uri:se(a),width:20,height:20})},d.name)})})})]})}var po=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},networkIcons:{flexDirection:"row",alignItems:"center"},networkIconWrapper:{}});function gn({onPress:e,title:t,subtitle:o,paymentNetworks:n}){let{fonts:r,components:i}=O(),s=i.depositMenu.card;return jsxRuntime.jsxs(ct,{cardTokens:s,onPress:e,style:To.wrapper,contentStyle:To.container,children:[jsxRuntime.jsxs(reactNative.View,{style:To.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[To.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:jsxRuntime.jsx(Vi,{size:20,color:s.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:To.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[To.title,{color:s.titleColor,fontFamily:r.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[To.subtitle,{color:s.subtitleColor,fontFamily:r.regular}],children:o})]})]}),jsxRuntime.jsx(reactNative.View,{style:To.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:To.paymentIcons,children:n?.map(c=>{let d=c.icon_urls.find(u=>u.format==="png")?.url||c.icon_urls.find(u=>u.format==="svg")?.url;return jsxRuntime.jsx(jo,{uri:se(d),width:32,height:20,borderRadius:4},c.name)})})})]})}var To=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},paymentIcons:{flexDirection:"row",alignItems:"center",gap:6}});function hn({onPress:e,title:t,subtitle:o,badge:n}){let{fonts:r,components:i}=O(),s=i.depositMenu.card;return jsxRuntime.jsx(ct,{cardTokens:s,onPress:e,style:xo.wrapper,contentStyle:xo.container,children:jsxRuntime.jsxs(reactNative.View,{style:xo.leftContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[xo.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:[jsxRuntime.jsx(Zo,{size:20,color:s.iconColor,strokeWidth:2}),n!==void 0&&n>0&&jsxRuntime.jsx(reactNative.View,{style:[xo.badge,{backgroundColor:s.iconColor,borderRadius:i.badge.borderRadius}],children:jsxRuntime.jsx(reactNative.Text,{style:[xo.badgeText,{fontFamily:r.semibold}],children:n>99?"99+":n})})]}),jsxRuntime.jsxs(reactNative.View,{style:xo.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[xo.title,{color:s.titleColor,fontFamily:r.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[xo.subtitle,{color:s.subtitleColor,fontFamily:r.regular}],children:o})]})]})})}var xo=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center",position:"relative"},badge:{position:"absolute",top:-4,right:-4,minWidth:18,height:18,alignItems:"center",justifyContent:"center",paddingHorizontal:4},badgeText:{color:"#FFFFFF",fontSize:10,fontWeight:"600"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"}});function Cn({onPress:e,title:t,subtitle:o}){let{fonts:n,components:r}=O(),i=r.depositMenu.card;return jsxRuntime.jsxs(ct,{cardTokens:i,onPress:e,style:mo.wrapper,contentStyle:mo.container,children:[jsxRuntime.jsxs(reactNative.View,{style:mo.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[mo.iconContainer,{borderRadius:i.iconContainerBorderRadius}],children:jsxRuntime.jsx(In,{size:20,color:i.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:mo.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[mo.title,{color:i.titleColor,fontFamily:n.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[mo.subtitle,{color:i.subtitleColor,fontFamily:n.regular}],children:o})]})]}),jsxRuntime.jsx(reactNative.View,{style:mo.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:mo.badge,children:jsxRuntime.jsx(reactNative.Text,{style:[mo.badgeText,{fontFamily:n.regular}],children:"Stripe"})})})]})}var mo=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},badge:{paddingHorizontal:10,paddingVertical:4,borderRadius:6,backgroundColor:"#635BFF"},badgeText:{fontSize:12,fontWeight:"600",color:"#FFFFFF"}});var Na=1e4,Ua=2500,ja=3e3,$a=6e4;function bn(e){let{depositConfirmationMode:t,depositAddress:o,chain:n,externalUserId:r,publishableKey:i,modalOpenedAt:s,depositWalletId:c,depositExecutions:d,trackedExecutions:u,setDepositExecutions:a,setTrackedExecutions:g,setLatestExecution:T,setShowStatusSheet:C,onDepositSuccess:h,onExecutionsChange:b,onDepositError:p}=e,[y,m]=react.useState(false),[l,f]=react.useState(false);return react.useEffect(()=>{if(t!=="auto_ui"&&t!=="auto_silent"||!o)return;m(false),t==="auto_ui"&&f(false);let S=setTimeout(()=>{m(true),t==="auto_ui"&&f(true);},Na);return ()=>clearTimeout(S)},[t,o,n]),react.useEffect(()=>{if(!r||!s)return;let S=new Date(s.getTime()-$a),A=setInterval(async()=>{try{let J=[...(await en(r,i)).data??[]].sort((M,H)=>{let X=M.created_at?new Date(M.created_at).getTime():0;return (H.created_at?new Date(H.created_at).getTime():0)-X}),q=null;for(let M of J){let H=M.created_at?new Date(M.created_at):null;if(!H||H<=S)continue;let X=u.get(M.id);if(!X){q=M;break}if(["pending","waiting","delayed"].includes(X)&&M.status==="succeeded"){q=M;break}}if(q){let M=q;a(H=>{let X=H.findIndex(U=>U.id===M.id);if(X>=0){let U=[...H];return U[X]=M,U}return [...H,M]}),g(H=>{let X=new Map(H);return X.set(M.id,M.status),X}),T(M),C(!0),M.status==="succeeded"&&h?.({message:"Deposit completed successfully",executionId:M.id}),b?.([...d,M]);}}catch(B){p?.({message:"Failed to check deposit status",error:B});}},Ua);return ()=>clearInterval(A)},[r,i,s,u,d,b,h,p]),react.useEffect(()=>{if(!y||!c)return;let S=async()=>{try{await Ni(c,i);}catch{}};S();let A=setInterval(S,ja);return ()=>clearInterval(A)},[y,c,i]),{pollingEnabled:y,showWaitingUi:l,handleIveDeposited:()=>{m(true),f(true);}}}function Nr({value:e,size:t=180,logoUri:o,logoSize:n=40,logoBackgroundColor:r}){let{colors:i,isDark:s}=O(),c=s?"#1a1a1a":"#ffffff",d=s?"#ffffff":"#000000",u=r||c;return jsxRuntime.jsxs(reactNative.View,{style:[Ka.container,{width:t,height:t}],children:[jsxRuntime.jsx(fd__default.default,{value:e||"placeholder",size:t,backgroundColor:c,color:d,ecl:"H",quietZone:4}),o&&jsxRuntime.jsx(reactNative.View,{style:[Ka.logoContainer,{width:n+12,height:n+12,backgroundColor:u,borderRadius:(n+12)/2}],children:jsxRuntime.jsx(jo,{uri:o,width:n,height:n,borderRadius:n/2})})]})}var Ka=reactNative.StyleSheet.create({container:{alignItems:"center",justifyContent:"center",position:"relative"},logoContainer:{position:"absolute",alignItems:"center",justifyContent:"center"}});function Ga(e){let t=e.split("/"),o=t[t.length-1];return o&&o.length>10?`${o.slice(0,6)}...${o.slice(-3)}`:o||""}function Cd(e){let o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],n=e.getDate(),r=e.getFullYear(),i=e.getHours(),s=e.getMinutes(),c=i>=12?"pm":"am";i=i%12,i=i||12;let d=s<10?`0${s}`:s;return `${o} ${n}, ${r} at ${i}:${d}${c}`}function Ur({visible:e,status:t,tokenIconUrl:o,explorerUrl:n,completionExplorerUrl:r,date:i,amountUsd:s,onClose:c,borderTopLeftRadius:d,borderTopRightRadius:u}){let{colors:a,fonts:g,components:T}=O(),[C,h]=react.useState(false),b=t==="pending"||t==="waiting"||t==="delayed",p=t==="succeeded",y=()=>{n&&reactNative.Linking.openURL(n);},m=()=>{r&&reactNative.Linking.openURL(r);};return jsxRuntime.jsx(Pe,{visible:e,onClose:c,closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:d,borderTopRightRadius:u,children:jsxRuntime.jsxs(reactNative.View,{style:Fe.container,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Fe.closeButton,onPress:c,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(lt,{size:20,color:T.header.buttonColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.View,{style:Fe.iconContainer,children:b?jsxRuntime.jsx(Ie,{size:80,strokeWidth:4,iconSize:68,children:o?jsxRuntime.jsx(reactNative.Image,{source:{uri:se(o)},style:Fe.tokenIconFill}):jsxRuntime.jsx(reactNative.View,{style:[Fe.tokenIconFill,{backgroundColor:a.cardHover}]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o?jsxRuntime.jsx(reactNative.Image,{source:{uri:se(o)},style:Fe.tokenIconLarge}):jsxRuntime.jsx(reactNative.View,{style:[Fe.tokenIconLarge,{backgroundColor:a.cardHover}]}),jsxRuntime.jsx(reactNative.View,{style:[Fe.statusBadge,{backgroundColor:T.container.iconBackgroundColor}],children:jsxRuntime.jsx(Be,{size:16,color:T.container.iconColor,strokeWidth:3})})]})}),jsxRuntime.jsx(reactNative.Text,{style:[Fe.title,{color:T.container.titleColor,fontFamily:g.semibold}],children:b?"Deposit Processing":"Deposit Complete"}),s!==void 0&&jsxRuntime.jsxs(reactNative.Text,{style:[Fe.amount,{color:T.container.titleColor,fontFamily:g.bold}],children:["$",s.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),i&&jsxRuntime.jsx(reactNative.Text,{style:[Fe.date,{color:T.container.subtitleColor,fontFamily:g.regular}],children:Cd(i)}),jsxRuntime.jsx(reactNative.Text,{style:[Fe.subtitle,{color:T.container.subtitleColor,fontFamily:g.regular}],children:b?"This usually takes less than a minute.":"Your account has been credited successfully!"}),p&&(n||r)&&jsxRuntime.jsxs(reactNative.View,{style:Fe.detailsSection,children:[jsxRuntime.jsx(reactNative.View,{style:[Fe.divider,{backgroundColor:a.border}]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:Fe.detailsToggle,onPress:()=>h(!C),children:[jsxRuntime.jsx(reactNative.Text,{style:[Fe.detailsToggleText,{color:T.container.actionTitle,fontFamily:g.medium}],children:C?"See less":"See more details"}),C?jsxRuntime.jsx(Wo,{size:18,color:T.container.actionColor,strokeWidth:2}):jsxRuntime.jsx(wt,{size:18,color:T.container.actionColor,strokeWidth:2})]}),C&&jsxRuntime.jsxs(reactNative.View,{style:Fe.txButtonsContainer,children:[n&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[Fe.txButton,{backgroundColor:T.card.backgroundColor,borderColor:a.border}],onPress:y,children:[jsxRuntime.jsx(reactNative.Text,{style:[Fe.txLabel,{color:T.card.titleColor,fontFamily:g.medium}],children:"Deposit tx"}),jsxRuntime.jsx(reactNative.Text,{style:[Fe.txHash,{color:T.card.subtitleColor,fontFamily:g.regular}],children:Ga(n)}),jsxRuntime.jsx(er,{size:16,color:T.card.actionColor,strokeWidth:2})]}),r&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[Fe.txButton,{backgroundColor:T.card.backgroundColor,borderColor:a.border}],onPress:m,children:[jsxRuntime.jsx(reactNative.Text,{style:[Fe.txLabel,{color:T.card.titleColor,fontFamily:g.medium}],children:"Completion tx"}),jsxRuntime.jsx(reactNative.Text,{style:[Fe.txHash,{color:T.card.subtitleColor,fontFamily:g.regular}],children:Ga(r)}),jsxRuntime.jsx(er,{size:16,color:T.card.actionColor,strokeWidth:2})]})]})]})]})})}var Fe=reactNative.StyleSheet.create({container:{alignItems:"center",paddingHorizontal:24,paddingTop:40},closeButton:{position:"absolute",top:16,right:16,padding:4,zIndex:1},iconContainer:{position:"relative",marginBottom:16},tokenIcon:{width:64,height:64,borderRadius:32},tokenIconLarge:{width:68,height:68,borderRadius:34},tokenIconFill:{width:"100%",height:"100%",borderRadius:34},statusBadge:{position:"absolute",bottom:-2,right:-2,width:28,height:28,borderRadius:14,alignItems:"center",justifyContent:"center"},title:{fontSize:18,fontWeight:"600",marginBottom:4,textAlign:"center"},amount:{fontSize:28,fontWeight:"700",marginBottom:4,textAlign:"center"},date:{fontSize:13,textAlign:"center",marginBottom:12},detailsSection:{width:"100%",marginTop:16,paddingHorizontal:16},divider:{height:1,width:"100%",opacity:.15},detailsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",paddingVertical:12},detailsToggleText:{fontSize:14,fontWeight:"500"},txButtonsContainer:{width:"100%",gap:10,marginTop:10},txButton:{flexDirection:"row",alignItems:"center",width:"100%",paddingVertical:12,paddingHorizontal:14,borderRadius:10,borderWidth:1,gap:8},txLabel:{fontSize:14,fontWeight:"500"},txHash:{fontSize:14,flex:1,textAlign:"right"},subtitle:{fontSize:14,textAlign:"center",lineHeight:20,paddingTop:8},buttonRow:{flexDirection:"row",gap:10,width:"100%"},button:{paddingVertical:14,paddingHorizontal:20,borderRadius:10,alignItems:"center",justifyContent:"center"},halfButton:{flex:1},successButton:{backgroundColor:"#22C55E"},buttonText:{color:"#fff",fontSize:14,fontWeight:"600"},hint:{fontSize:12,marginTop:12,textAlign:"center"}});function oi({depositConfirmationMode:e,depositAddress:t,showWaitingUi:o,latestExecution:n,onIveDeposited:r}){let{colors:i,fonts:s,components:c}=O();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e==="manual"&&t&&!o&&jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:r,activeOpacity:.8,style:[gr.iveDepositedButton,{backgroundColor:i.primary,borderRadius:c.button.borderRadius,borderWidth:c.button.borderWidth,borderColor:c.button.borderColor}],children:jsxRuntime.jsx(reactNative.Text,{style:[gr.iveDepositedButtonText,{color:i.primaryForeground??"#FFF",fontFamily:s.semibold}],children:"I've made the deposit"})}),o&&!n&&jsxRuntime.jsxs(reactNative.View,{style:[gr.processingCard,{backgroundColor:c.card.backgroundColor,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth,borderColor:c.card.borderColor,shadowColor:c.card.shadowOpacity>0?c.card.shadowColor:void 0,shadowOffset:c.card.shadowOpacity>0?c.card.shadowOffset:void 0,shadowOpacity:c.card.shadowOpacity,shadowRadius:c.card.shadowRadius,elevation:c.card.elevation}],children:[jsxRuntime.jsx(reactNative.View,{style:[gr.detailIcon,{backgroundColor:c.card.iconBackgroundColor,borderRadius:c.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Di,{size:14,color:c.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:gr.processingCardText,children:[jsxRuntime.jsx(reactNative.Text,{style:[gr.processingCardTitle,{color:c.card.titleColor,fontFamily:s.semibold}],children:"Processing deposit transactions."}),jsxRuntime.jsx(reactNative.Text,{style:[gr.processingCardSubtitle,{color:c.card.subtitleColor,fontFamily:s.regular}],children:"We're checking if your deposit has landed."})]})]})]})}var gr=reactNative.StyleSheet.create({iveDepositedButton:{paddingVertical:14,alignItems:"center",justifyContent:"center",marginBottom:12},iveDepositedButtonText:{fontSize:16},processingCard:{flexDirection:"row",alignItems:"center",padding:12,marginBottom:12,gap:12},processingCardText:{flex:1,gap:4},processingCardTitle:{fontSize:14},processingCardSubtitle:{fontSize:12,lineHeight:18},detailIcon:{width:24,height:24,alignItems:"center",justifyContent:"center"}});var wn=(e,t)=>`${t}:${e}`,Id=e=>{let[t,o]=e.split(":");return {chainType:t,chainId:o}};function ni({externalUserId:e,publishableKey:t,recipientAddress:o,destinationChainType:n,destinationChainId:r,destinationTokenAddress:i,destinationTokenSymbol:s,defaultChainType:c,defaultChainId:d,defaultTokenAddress:u,depositConfirmationMode:a="auto_ui",onExecutionsChange:g,onDepositSuccess:T,onDepositError:C,borderTopLeftRadius:h,borderTopRightRadius:b,sheetBorderRadius:p}){let{colors:y,fonts:m,components:l}=O(),f=c&&d?`${c}:${d}`:"solana:mainnet",[R,S]=react.useState("USDC"),[A,B]=react.useState(f),[k,J]=react.useState([]),[q,M]=react.useState(true),[H,X]=react.useState([]),[U,Qe]=react.useState(true),[We,Ge]=react.useState(false),[ee,Te]=react.useState(false),[Ae,xe]=react.useState(false),[Oe,te]=react.useState(false),[Ee,it]=react.useState([]),[st,dt]=react.useState(new Map),[at]=react.useState(()=>new Date),[Ct,Je]=react.useState(null),[oo,ce]=react.useState(false),[j,_e]=react.useState(null),[Kt,Ce]=react.useState(false),bt=new Map;H.forEach(V=>{V.chains.forEach(N=>{let re=`${N.chain_type}:${N.chain_id}`;bt.has(re)||bt.set(re,N);});});let Xe=Array.from(bt.values()),ut=Id(A),et=Xe.find(V=>V.chain_type===ut.chainType&&V.chain_id===ut.chainId)?.chain_type||"ethereum",ro=ir(k,et),ze=ro?.address||"",ge=react.useRef(false);react.useEffect(()=>{async function V(){try{Qe(!0),Je(null);let re=await tn(t,i&&r&&n?{destination_token_address:i,destination_chain_id:r,destination_chain_type:n}:void 0);if(X(re.data),re.data.length>0&&!ge.current){ge.current=!0;let Q,Ve;if(c&&d)if(u)for(let we of re.data){let Nt=we.chains.find(Tt=>Tt.chain_type===c&&Tt.chain_id===d&&Tt.token_address.toLowerCase()===u.toLowerCase());if(Nt){Q=we,Ve=Nt;break}}else for(let we of re.data){let Nt=we.chains.find(Tt=>Tt.chain_type===c&&Tt.chain_id===d);if(Nt){Q=we,Ve=Nt;break}}if(!Q&&i)for(let we of re.data){let Nt=we.chains.find(Tt=>Tt.token_address.toLowerCase()===i.toLowerCase());if(Nt){Q=we,Ve=Nt;break}}Q||(Q=re.data.find(we=>we.symbol==="USDC"),Q&&Q.chains.length>0&&(Ve=Q.chains[0])),Q||(Q=re.data.find(we=>we.symbol==="USDT"),Q&&Q.chains.length>0&&(Ve=Q.chains[0])),Q||(Q=re.data[0],Q.chains.length>0&&(Ve=Q.chains[0])),Q&&S(Q.symbol),Ve&&B(wn(Ve.chain_id,Ve.chain_type));}}catch(N){console.error("Error fetching supported tokens:",N),Je("Failed to load supported tokens"),C?.({message:"Failed to load supported tokens",error:N});}finally{Qe(false);}}V();},[t,C,c,d,u,i,r,n]),react.useEffect(()=>{async function V(){try{M(!0),Je(null);let N=await nr({external_user_id:e,recipient_address:o,destination_chain_type:n,destination_chain_id:r,destination_token_address:i},t);J(N.data);}catch(N){console.error("Error fetching wallets:",N),Je("Failed to load wallets"),C?.({message:"Failed to load wallets",error:N});}finally{M(false);}}V();},[e,o,n,r,i,t,C]);let Ht=ro?.id??"",{showWaitingUi:Dt,handleIveDeposited:ho}=bn({depositConfirmationMode:a,depositAddress:ze,chain:A,externalUserId:e,publishableKey:t,modalOpenedAt:at,depositWalletId:Ht,depositExecutions:Ee,trackedExecutions:st,setDepositExecutions:it,setTrackedExecutions:dt,setLatestExecution:_e,setShowStatusSheet:ce,onDepositSuccess:T,onExecutionsChange:g,onDepositError:C});react.useEffect(()=>{if(!H.length)return;let V=H.find(re=>re.symbol===R);if(!V||V.chains.length===0)return;if(!V.chains.some(re=>wn(re.chain_id,re.chain_type)===A)){let re=V.chains[0];B(wn(re.chain_id,re.chain_type));}},[R,H,A]);let Ze=H.find(V=>V.symbol===R),Do=Ze?.chains||[],je=Do.find(V=>wn(V.chain_id,V.chain_type)===A),no=async()=>{if(ze)try{reactNative.Clipboard.setString(ze),Ge(!0),setTimeout(()=>Ge(!1),2e3);}catch(V){console.error("Failed to copy:",V);}},F=je?.estimated_price_impact_percent??0,Bt=je?.max_slippage_percent??.25,he=je?.minimum_deposit_amount_usd??3;if(U)return jsxRuntime.jsxs(reactNative.View,{style:x.loadingContainer,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:y.primary}),jsxRuntime.jsx(reactNative.Text,{style:[x.loadingText,{color:y.foregroundMuted,fontFamily:m.regular}],children:"Loading currencies..."})]});if(Ct&&H.length===0)return jsxRuntime.jsxs(reactNative.View,{style:x.errorContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.errorText,{color:y.error,fontFamily:m.regular}],children:Ct}),jsxRuntime.jsx(reactNative.Text,{style:[x.errorHint,{color:y.foregroundMuted,fontFamily:m.regular}],children:"Please check your network connection and try again."})]});let ne=()=>jsxRuntime.jsxs(Pe,{visible:Ae,onClose:()=>xe(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:p?.tokenSelector?.borderTopLeftRadius??h,borderTopRightRadius:p?.tokenSelector?.borderTopRightRadius??b,children:[jsxRuntime.jsxs(reactNative.View,{style:[x.sheetHeader,{borderBottomColor:y.border}],children:[jsxRuntime.jsx(reactNative.View,{style:x.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[x.sheetTitle,{color:l.header.titleColor,fontFamily:m.medium}],children:"Select Token"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>xe(false),style:x.sheetCloseButton,children:jsxRuntime.jsx(lt,{size:20,color:l.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.ScrollView,{style:x.sheetList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:H.map(V=>jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>{S(V.symbol),xe(false);},activeOpacity:.7,style:[x.sheetItem,{backgroundColor:R===V.symbol?l.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(V,"png"))},style:x.sheetItemIcon}),jsxRuntime.jsxs(reactNative.View,{style:x.sheetItemText,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.sheetItemTitle,{color:l.card.titleColor,fontFamily:m.medium}],children:V.symbol}),jsxRuntime.jsxs(reactNative.Text,{style:[x.sheetItemSubtitle,{color:l.card.subtitleColor,fontFamily:m.regular}],children:[V.chains.length," network",V.chains.length!==1?"s":""," available"]})]}),R===V.symbol&&jsxRuntime.jsx(Be,{size:20,color:y.primary,strokeWidth:2})]},V.symbol))})]}),be=()=>jsxRuntime.jsxs(Pe,{visible:Oe,onClose:()=>te(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:p?.chainSelector?.borderTopLeftRadius??h,borderTopRightRadius:p?.chainSelector?.borderTopRightRadius??b,children:[jsxRuntime.jsxs(reactNative.View,{style:[x.sheetHeader,{borderBottomColor:y.border}],children:[jsxRuntime.jsx(reactNative.View,{style:x.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[x.sheetTitle,{color:l.header.titleColor,fontFamily:m.medium}],children:"Select Network"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>te(false),style:x.sheetCloseButton,children:jsxRuntime.jsx(lt,{size:20,color:l.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.ScrollView,{style:x.sheetList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:Do.map(V=>{let N=wn(V.chain_id,V.chain_type),re=A===N;return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>{B(N),te(false);},activeOpacity:.7,style:[x.sheetItem,{backgroundColor:re?l.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(V,"png"))},style:x.sheetItemIcon}),jsxRuntime.jsxs(reactNative.View,{style:x.sheetItemText,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.sheetItemTitle,{color:l.card.titleColor,fontFamily:m.medium}],children:V.chain_name}),jsxRuntime.jsxs(reactNative.Text,{style:[x.sheetItemSubtitle,{color:l.card.subtitleColor,fontFamily:m.regular}],children:["Min deposit: $",V.minimum_deposit_amount_usd]})]}),re&&jsxRuntime.jsx(Be,{size:20,color:y.primary,strokeWidth:2})]},N)})})]});return jsxRuntime.jsxs(reactNative.View,{style:x.container,children:[jsxRuntime.jsxs(reactNative.View,{style:x.selectorSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.selectorLabel,{color:l.card.labelColor,fontFamily:m.regular}],children:"Token"}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>xe(true),style:[x.selector,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[Ze&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(Ze,"png"))},style:x.selectorIcon}),jsxRuntime.jsx(reactNative.Text,{style:[x.selectorText,{color:l.card.titleColor,fontFamily:m.medium}],children:R}),jsxRuntime.jsx(wt,{size:16,color:l.card.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsxs(reactNative.View,{style:x.selectorSection,children:[jsxRuntime.jsxs(reactNative.Text,{style:[x.selectorLabel,{color:l.card.labelColor,fontFamily:m.regular}],children:["Network"," ",jsxRuntime.jsxs(reactNative.Text,{style:[x.minDeposit,{fontFamily:m.regular}],children:["($",he," min)"]})]}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>te(true),style:[x.selector,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[je&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(je,"png"))},style:x.selectorIcon}),jsxRuntime.jsx(reactNative.Text,{style:[x.selectorText,{color:l.card.titleColor,fontFamily:m.medium}],numberOfLines:1,children:je?.chain_name||"Select network"}),jsxRuntime.jsx(wt,{size:16,color:l.card.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsx(reactNative.View,{style:x.qrContainer,children:jsxRuntime.jsx(reactNative.View,{style:[x.qrWrapper,{backgroundColor:y.background,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth>0?l.card.borderWidth:1,borderColor:l.card.borderColor}],children:q?jsxRuntime.jsxs(reactNative.View,{style:x.qrLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:y.primary}),jsxRuntime.jsx(reactNative.Text,{style:[x.loadingText,{color:y.foregroundMuted,fontFamily:m.regular}],children:"Loading..."})]}):ze?jsxRuntime.jsx(Nr,{value:ze,size:160,logoUri:se(Re(je,"png")||_t("/icons/networks/png/ethereum.png")),logoSize:40}):jsxRuntime.jsx(reactNative.View,{style:x.qrLoading,children:jsxRuntime.jsx(reactNative.Text,{style:[x.errorText,{color:y.error,fontFamily:m.regular}],children:"No address available"})})})}),jsxRuntime.jsxs(reactNative.View,{style:x.addressSection,children:[jsxRuntime.jsxs(reactNative.View,{style:x.addressHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.addressLabel,{color:l.card.labelColor,fontFamily:m.medium}],children:"Deposit Address"}),We&&jsxRuntime.jsxs(reactNative.View,{style:x.copiedIndicator,children:[jsxRuntime.jsx(Be,{size:14,color:y.success,strokeWidth:2}),jsxRuntime.jsx(reactNative.Text,{style:[x.copiedText,{color:y.success,fontFamily:m.regular}],children:"Copied"})]})]}),jsxRuntime.jsxs(ct,{cardTokens:l.transferCrypto.depositAddress.card,onPress:!q&&ze?no:void 0,contentStyle:x.addressBox,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.addressText,{color:l.card.titleColor,fontFamily:m.regular}],numberOfLines:2,children:q?"Loading...":ze||"No address available"}),jsxRuntime.jsx(reactNative.View,{style:x.addressCopyIcon,children:jsxRuntime.jsx(Xo,{size:16,color:l.card.actionColor,strokeWidth:1})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:[x.detailsCard,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Te(!ee),style:x.detailsHeader,children:[jsxRuntime.jsxs(reactNative.View,{style:x.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[x.detailIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Zo,{size:12,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[x.detailsLabel,{color:l.card.titleColor,fontFamily:m.regular}],children:"Processing time: < 1 min"})]}),jsxRuntime.jsx(reactNative.View,{style:x.chevronContainer,children:ee?jsxRuntime.jsx(Wo,{size:16,color:l.card.actionColor,strokeWidth:2}):jsxRuntime.jsx(wt,{size:16,color:l.card.actionColor,strokeWidth:2})})]}),ee&&jsxRuntime.jsxs(reactNative.View,{style:x.detailsContent,children:[jsxRuntime.jsxs(reactNative.View,{style:x.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[x.detailIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wr,{size:12,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[x.detailsLabel,{color:l.card.titleColor,fontFamily:m.regular}],children:["Price impact: ",F.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(Sr,{size:14,color:l.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:x.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[x.detailIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(kr,{size:12,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[x.detailsLabel,{color:l.card.titleColor,fontFamily:m.regular}],children:["Slippage: Auto \u2022 ",Bt.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(Sr,{size:14,color:l.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:x.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[x.detailIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Rn,{size:12,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[x.detailsLabel,{color:l.card.titleColor,fontFamily:m.regular}],children:["Need help?"," ",jsxRuntime.jsx(reactNative.Text,{style:{textDecorationLine:"underline"},children:"Contact support"})]})]})]})]}),jsxRuntime.jsx(oi,{depositConfirmationMode:a,depositAddress:ze,showWaitingUi:Dt,latestExecution:j,onIveDeposited:ho}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{style:x.termsContainer,onPress:()=>reactNative.Linking.openURL("https://unifold.io/terms"),children:jsxRuntime.jsx(reactNative.Text,{style:[x.termsText,{color:y.primary,fontFamily:m.regular}],children:"Terms apply"})}),ne(),be(),jsxRuntime.jsxs(Pe,{visible:Kt,onClose:()=>Ce(false),closeOnBackdropPress:true,showHandle:true,borderTopLeftRadius:p?.infoSheet?.borderTopLeftRadius??h,borderTopRightRadius:p?.infoSheet?.borderTopRightRadius??b,children:[jsxRuntime.jsxs(reactNative.View,{style:[x.sheetHeader,{borderBottomColor:y.border}],children:[jsxRuntime.jsx(reactNative.View,{style:x.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[x.sheetTitle,{color:l.header.titleColor,fontFamily:m.medium}],children:"Price Impact & Slippage"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(false),style:x.sheetCloseButton,children:jsxRuntime.jsx(lt,{size:20,color:l.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:x.infoSheetContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[x.infoCard,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:x.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[x.infoCardIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wr,{size:16,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[x.infoCardTitle,{color:l.card.titleColor,fontFamily:m.medium}],children:"Price Impact"}),jsxRuntime.jsxs(reactNative.Text,{style:[x.infoCardValue,{color:l.card.titleColor,fontFamily:m.medium}],children:[F.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[x.infoCardDescription,{color:l.card.descriptionColor,fontFamily:m.regular}],children:"Price impact is the difference between the current market price and the price you'll receive for your swap. This occurs due to liquidity pool mechanics and trade size."})]}),jsxRuntime.jsxs(reactNative.View,{style:[x.infoCard,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:x.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[x.infoCardIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(kr,{size:16,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[x.infoCardTitle,{color:l.card.titleColor,fontFamily:m.medium}],children:"Max Slippage"}),jsxRuntime.jsxs(reactNative.Text,{style:[x.infoCardValue,{color:l.card.titleColor,fontFamily:m.medium}],children:[Bt.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[x.infoCardDescription,{color:l.card.descriptionColor,fontFamily:m.regular}],children:"Max slippage is the maximum price difference you're willing to accept between when you submit a transaction and when it executes. Your transaction will revert if the price moves beyond this threshold."})]})]})]}),j&&jsxRuntime.jsx(Ur,{visible:oo,status:j.status,tokenIconUrl:j.destination_token_metadata?.icon_urls?.find(V=>V.format==="png")?.url||j.destination_token_metadata?.icon_url||Re(Ze,"png"),explorerUrl:j.explorer_url,completionExplorerUrl:j.destination_explorer_url,date:j.created_at?new Date(j.created_at):void 0,amountUsd:j.source_amount_usd?parseFloat(j.source_amount_usd):void 0,onClose:()=>ce(false),borderTopLeftRadius:p?.depositStatus?.borderTopLeftRadius??h,borderTopRightRadius:p?.depositStatus?.borderTopRightRadius??b})]})}var x=reactNative.StyleSheet.create({container:{flex:1,padding:16},loadingContainer:{padding:40,alignItems:"center",gap:12},loadingText:{fontSize:14},errorContainer:{padding:40,alignItems:"center",gap:8},errorText:{fontSize:14,textAlign:"center"},errorHint:{fontSize:12,textAlign:"center"},selectorSection:{marginBottom:12},selectorLabel:{fontSize:13,marginBottom:8},minDeposit:{fontSize:10},selector:{flexDirection:"row",alignItems:"center",gap:10,padding:12,borderRadius:12},selectorIcon:{width:24,height:24,borderRadius:12},selectorText:{flex:1,fontSize:14,fontWeight:"500"},qrContainer:{alignItems:"center",marginVertical:16},qrWrapper:{padding:16},qrLoading:{width:160,height:160,alignItems:"center",justifyContent:"center"},addressSection:{marginBottom:16},addressHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},addressLabel:{fontSize:13},copiedIndicator:{flexDirection:"row",alignItems:"center",gap:4},copiedText:{fontSize:12,fontWeight:"500"},addressBox:{position:"relative",paddingHorizontal:12,paddingVertical:16},addressText:{fontSize:12,fontFamily:"monospace"},addressCopyIcon:{position:"absolute",right:12,top:0,bottom:0,justifyContent:"center"},detailsCard:{borderRadius:8,padding:4,marginBottom:16},detailsHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,paddingLeft:8,paddingRight:8},detailsContent:{paddingRight:12,paddingLeft:8,paddingBottom:12,gap:10},detailsRow:{flexDirection:"row",alignItems:"center",gap:8},detailIcon:{width:24,height:24,borderRadius:12,alignItems:"center",justifyContent:"center"},detailsLabel:{fontSize:13},chevronContainer:{},spacer:{flex:1},termsContainer:{alignItems:"center"},termsText:{fontSize:12,textDecorationLine:"underline"},sheetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},sheetHeaderSpacer:{width:28},sheetTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},sheetCloseButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},sheetList:{maxHeight:400,paddingTop:8},sheetItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,marginHorizontal:8,borderRadius:12,gap:12},sheetItemIcon:{width:40,height:40,borderRadius:20},sheetItemText:{flex:1},sheetItemTitle:{fontSize:16,fontWeight:"500"},sheetItemSubtitle:{fontSize:12,marginTop:2},infoSheetContent:{paddingHorizontal:16,paddingBottom:32,gap:16},infoCard:{borderRadius:12,padding:16,gap:12},infoCardHeader:{flexDirection:"row",alignItems:"center",gap:10},infoCardIcon:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center"},infoCardTitle:{fontSize:15,fontWeight:"600",flex:1},infoCardValue:{fontSize:15,fontWeight:"600"},infoCardDescription:{fontSize:13,lineHeight:20}});function ii({currency:e,isSelected:t,onSelect:o}){let{colors:n,fonts:r,components:i}=O();return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>o(e.currency_code),activeOpacity:.7,style:[hr.container,{backgroundColor:i.card.backgroundColor,borderRadius:i.list.rowBorderRadius,borderWidth:i.card.borderWidth,borderColor:i.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:hr.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[hr.iconContainer,{backgroundColor:n.background}],children:jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(e,"png"))},style:hr.icon})}),jsxRuntime.jsxs(reactNative.View,{style:hr.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[hr.name,{color:i.card.titleColor,fontFamily:r.medium}],children:e.name}),jsxRuntime.jsx(reactNative.Text,{style:[hr.code,{color:i.card.subtitleColor,fontFamily:r.regular}],children:e.currency_code.toUpperCase()})]})]}),t&&jsxRuntime.jsx(Be,{size:16,color:n.primary,strokeWidth:2})]})}var hr=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,marginHorizontal:8,marginVertical:4},leftContent:{flexDirection:"row",alignItems:"center",gap:12},iconContainer:{width:40,height:40,borderRadius:20,overflow:"hidden",alignItems:"center",justifyContent:"center"},icon:{width:40,height:40,borderRadius:20},textContainer:{gap:2},name:{fontSize:14,fontWeight:"400"},code:{fontSize:12,fontWeight:"300"}});function kn({title:e,currencies:t,selectedCurrency:o,onSelect:n}){let{fonts:r,components:i}=O();return t.length===0?null:jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.View,{style:tl.headerContainer,children:jsxRuntime.jsx(reactNative.Text,{style:[tl.title,{color:i.list.titleSectionColor,fontFamily:r.medium}],children:e})}),t.map(s=>jsxRuntime.jsx(ii,{currency:s,isSelected:o.toLowerCase()===s.currency_code.toLowerCase(),onSelect:n},s.currency_code))]})}var tl=reactNative.StyleSheet.create({headerContainer:{paddingHorizontal:12,paddingBottom:8,paddingTop:4},title:{fontSize:14,fontWeight:"500"}});function ai({open:e,onOpenChange:t,currencies:o,preferredCurrencyCodes:n,selectedCurrency:r,onSelectCurrency:i,borderTopLeftRadius:s,borderTopRightRadius:c}){let{colors:d,fonts:u,components:a}=O(),[g,T]=react.useState(""),C=n.map(f=>o.find(R=>R.currency_code.toLowerCase()===f.toLowerCase())).filter(f=>f!==void 0),h=o.filter(f=>!n.includes(f.currency_code.toLowerCase())),b=f=>{if(!g)return f;let R=g.toLowerCase();return f.filter(S=>S.name.toLowerCase().includes(R)||S.currency_code.toLowerCase().includes(R))},p=b(C),y=b(h),m=f=>{i(f),t(false),T("");},l=()=>{t(false),T("");};return jsxRuntime.jsxs(Pe,{visible:e,onClose:l,closeOnBackdropPress:true,showHandle:false,heightPercent:.9,borderTopLeftRadius:s,borderTopRightRadius:c,children:[jsxRuntime.jsx($t,{title:"Currency",showBack:false,onClose:l}),jsxRuntime.jsx(reactNative.View,{style:yr.searchContainer,children:jsxRuntime.jsx(reactNative.TextInput,{style:[yr.searchInput,{backgroundColor:a.search.backgroundColor,color:a.search.inputColor,fontFamily:u.regular,borderRadius:a.input.borderRadius,borderWidth:a.input.borderWidth,borderColor:a.input.borderColor}],value:g,onChangeText:T,placeholder:"Search",placeholderTextColor:a.search.placeholderColor})}),jsxRuntime.jsx(reactNative.ScrollView,{style:yr.listContainer,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:jsxRuntime.jsxs(reactNative.View,{style:yr.listContent,children:[jsxRuntime.jsx(kn,{title:"Popular currencies",currencies:p,selectedCurrency:r,onSelect:m}),p.length>0&&y.length>0&&jsxRuntime.jsx(reactNative.View,{style:yr.sectionSpacer}),jsxRuntime.jsx(kn,{title:"All currencies",currencies:y,selectedCurrency:r,onSelect:m}),p.length===0&&y.length===0&&jsxRuntime.jsx(reactNative.View,{style:yr.noResultsContainer,children:jsxRuntime.jsx(reactNative.Text,{style:[yr.noResultsText,{color:a.container.subtitleColor,fontFamily:u.regular}],children:"No currencies found"})})]})})]})}var yr=reactNative.StyleSheet.create({searchContainer:{marginTop:8,paddingHorizontal:18,paddingBottom:12},searchInput:{padding:16,fontSize:14},listContainer:{flex:1,paddingHorizontal:12},listContent:{paddingBottom:24},sectionSpacer:{height:8},noResultsContainer:{paddingVertical:32,alignItems:"center"},noResultsText:{fontSize:14}});function bs(e){try{return new Intl.NumberFormat("en",{style:"currency",currency:e.toUpperCase(),minimumFractionDigits:0,maximumFractionDigits:0}).format(0).replace(/\d/g,"").trim()}catch{return e.toUpperCase()}}function di({externalUserId:e,publishableKey:t,view:o,onViewChange:n,destinationTokenSymbol:r,recipientAddress:i,destinationChainType:s,destinationChainId:c,destinationTokenAddress:d,onDepositSuccess:u,onDepositError:a,borderTopLeftRadius:g,borderTopRightRadius:T,sheetBorderRadius:C}){let{colors:h,fonts:b,components:p}=O(),[y,m]=react.useState(""),[l,f]=react.useState("usd"),[R,S]=react.useState(false),[A,B]=react.useState(false),[k,J]=react.useState([]),[q,M]=react.useState(false),[H,X]=react.useState(null),[U,Qe]=react.useState(null),[We,Ge]=react.useState("amount"),[ee,Te]=react.useState(null),[Ae,xe]=react.useState(true),[Oe,te]=react.useState(null),[Ee,it]=react.useState(false),st=react.useRef(null),dt=react.useRef(false);react.useEffect(()=>{st.current=ee;},[ee]),react.useEffect(()=>{dt.current=Ee;},[Ee]);let[at,Ct]=react.useState([]),[Je,oo]=react.useState(true),[ce,j]=react.useState(60),[_e,Kt]=react.useState([]),[Ce,bt]=react.useState([]),[Xe,ut]=react.useState(null),[de,et]=react.useState(null),[ro,ze]=react.useState(true),[ge,Ht]=react.useState(null),[Dt,ho]=react.useState(false),[Ze,Do]=react.useState(null),[je,no]=react.useState(false),[F,Bt]=react.useState(false),[he,ne]=react.useState(false),[be,V]=react.useState(null),N=o??We,re=react.useRef(null),Q=_e.find(w=>w.currency_code.toLowerCase()===l.toLowerCase()),Ve=react.useCallback(w=>{Ge(w),w==="quotes"?n?.(w,k.length):n?.(w);},[k.length,n]);react.useEffect(()=>{async function w(){try{let P=await rn();et(P);}catch(P){console.error("Error fetching user IP:",P);}finally{ze(false);}}w();},[]),react.useEffect(()=>{async function w(){try{let P=await nr({external_user_id:e,recipient_address:i,destination_chain_type:s,destination_chain_id:c,destination_token_address:d},t);Ct(P.data);}catch(P){console.error("Error fetching wallets:",P),X("Failed to load wallet addresses");}finally{oo(false);}}w();},[e,i,s,c,d,t]);let we=r||Xe?.symbol.toUpperCase()||"USDC",Nt=Pr(Xe?.icon_urls,"png")||Xe?.icon_url,Tt=Pr(Xe?.chain_icon_urls,"png")||Xe?.chain_icon_url;react.useEffect(()=>{async function w(){try{let P=await Ki(t);Kt(P.data),bt(P.preferred||[]);}catch(P){console.error("Error fetching fiat currencies:",P);}}w();},[t]),react.useEffect(()=>{if(R||_e.length===0||!de?.alpha2)return;let w=de.alpha2.toUpperCase(),P=_e.find(ie=>ie.country_codes.includes(w));if(P)f(P.currency_code.toLowerCase()),!y&&!A&&m(String(P.default_amount??100));else if(!y&&!A){let ie=_e.find(De=>De.currency_code.toLowerCase()==="usd");ie&&m(String(ie.default_amount??100));}},[_e,de,R,y,A]),react.useEffect(()=>{if(_e.length!==0){if(re.current!==null&&re.current!==l){let w=_e.find(P=>P.currency_code.toLowerCase()===l.toLowerCase());w&&m(String(w.default_amount??100));}re.current=l;}},[l,_e]),react.useEffect(()=>{async function w(){try{let P=await Ui({chain_type:s||"",chain_id:c||"",token_address:d||""},t);ut(P);}catch(P){console.error("Error fetching supported tokens:",P);}}w();},[s,c,d,t]),react.useEffect(()=>{async function w(){if(!(!d||!c||!s)&&!ro){ho(true);try{let P=await qi({country_code:de?.alpha2?.toUpperCase()||"US",subdivision_code:de?.state||void 0,token_address:d,chain_id:c,chain_type:s},t);Ht(P);}catch(P){console.error("Error fetching default onramp token:",P);}finally{ho(false);}}}w();},[d,c,s,de,ro,t]),react.useEffect(()=>{let w=parseFloat(y);if(isNaN(w)||w<=0){J([]),Qe(null);return}if(!ge||Dt){J([]),Te(null);return}let P=_e.find(De=>De.currency_code.toLowerCase()===l.toLowerCase());if(P){if(w<P.minimum_amount){J([]),Te(null),Qe(`Minimum amount is ${bs(l)}${P.minimum_amount.toLocaleString()}`);return}if(w>P.maximum_amount){J([]),Te(null),Qe(`Maximum amount is ${bs(l)}${P.maximum_amount.toLocaleString()}`);return}}Qe(null);let ie=setTimeout(()=>{xn(w);},500);return ()=>clearTimeout(ie)},[y,l,t,ge,Dt,_e]);let xn=async w=>{if(!ge){X("Loading token information...");return}M(true),X(null);try{let P={country_code:de?.alpha2?.toUpperCase()||"US",source_amount:w.toString(),source_currency:l.toLowerCase(),destination_currency:ge.destination_currency,destination_network:ge.destination_network,subdivision_code:de?.state||void 0},ie=await ji(P,t);J(ie.data);let De=dt.current,Bo=st.current;if(De&&Bo){let Ft=ie.data.find(xt=>xt.service_provider===Bo.service_provider);if(Ft){if(Te(Ft),ie.data.length>0){let xt=ie.data.reduce((Me,Fo)=>Fo.destination_amount>Me.destination_amount?Fo:Me);Oe||te(xt.service_provider),xe(Ft.service_provider===Oe);}}else if(ie.data.length>0){let xt=ie.data.reduce((Me,Fo)=>Fo.destination_amount>Me.destination_amount?Fo:Me);Te(xt),te(xt.service_provider),xe(!0),it(!1);}}else if(ie.data.length>0){let Ft=ie.data.reduce((xt,Me)=>Me.destination_amount>xt.destination_amount?Me:xt);Te(Ft),te(Ft.service_provider),xe(!0);}j(60);}catch(P){console.error("Failed to fetch quotes:",P),X("Failed to fetch quotes. Please try again."),J([]);}finally{M(false);}};react.useEffect(()=>{if(k.length===0)return;let w=setInterval(()=>{j(P=>{if(P<=1){let ie=parseFloat(y);return !isNaN(ie)&&ie>0&&xn(ie),60}return P-1});},1e3);return ()=>clearInterval(w)},[k.length,y]);let Ti=w=>{(/^\d*\.?\d{0,2}$/.test(w)||w==="")&&(m(w),B(true));},xi=w=>{m(w.toString()),B(true);},_i=async()=>{if(ee&&ge)try{let w=ge.destination_token_metadata.chain_type,P=ir(at,w);if(!P?.address){X("Wallet address not available");return}let ie={service_provider:ee.service_provider,country_code:ee.country_code?.toUpperCase()||de?.alpha2?.toUpperCase()||"US",source_currency:ee.source_currency,source_amount:y,destination_currency:ee.destination_currency,destination_network:ee.destination_network,wallet_address:P.address,subdivision_code:de?.state||void 0},De=await $i(ie,t);Do({provider:ee,sourceCurrency:l,sourceAmount:y,sessionUrl:De.url}),V(De.url),ne(!0);}catch(w){console.error("Failed to create session:",w),X("Failed to start payment flow"),a?.({message:"Failed to start payment flow",error:w});}},_=bs(l),E=()=>{ne(false),Ve("onramp"),u?.({message:"Payment flow completed"});},K=()=>jsxRuntime.jsx(Nd,{visible:he,onClose:E,url:be,providerName:ee?.service_provider_display_name||"Complete Payment",colors:h,fonts:b,borderTopLeftRadius:C?.webView?.borderTopLeftRadius??g,borderTopRightRadius:C?.webView?.borderTopRightRadius??T});return N==="amount"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:L.amountViewContainer,children:[jsxRuntime.jsxs(reactNative.ScrollView,{style:L.scrollContainer,contentContainerStyle:L.scrollContent,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",bounces:false,children:[jsxRuntime.jsx(reactNative.View,{style:L.currencySelector,children:jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>no(true),style:[L.currencyButton,{backgroundColor:p.card.backgroundColor,borderRadius:p.input.borderRadius,borderWidth:p.input.borderWidth,borderColor:p.input.borderColor}],children:[Q&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(Q,"png"))},style:L.currencyIcon}),jsxRuntime.jsx(reactNative.Text,{style:[L.currencyText,{color:p.card.titleColor,fontFamily:b.medium}],children:l.toUpperCase()}),jsxRuntime.jsx(wt,{size:16,color:p.card.actionColor,strokeWidth:2})]})}),jsxRuntime.jsx(ai,{open:je,onOpenChange:no,currencies:_e,preferredCurrencyCodes:Ce,selectedCurrency:l,onSelectCurrency:w=>{f(w.toLowerCase()),S(true);},borderTopLeftRadius:C?.currencyModal?.borderTopLeftRadius??g,borderTopRightRadius:C?.currencyModal?.borderTopRightRadius??T}),jsxRuntime.jsx(reactNative.View,{style:L.amountContainer,children:jsxRuntime.jsxs(reactNative.View,{style:L.amountInputRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[L.currencySymbol,{color:p.container.titleColor,fontFamily:b.medium}],children:_}),jsxRuntime.jsx(reactNative.TextInput,{style:[L.amountInput,{color:p.container.titleColor,fontFamily:b.medium}],value:y,onChangeText:Ti,keyboardType:"decimal-pad",placeholder:"0",placeholderTextColor:h.foregroundMuted})]})}),Q?.suggested_amounts&&Q.suggested_amounts.length>0&&jsxRuntime.jsx(reactNative.View,{style:L.quickAmounts,children:Q.suggested_amounts.map(w=>jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>xi(w),style:[L.quickAmountButton,{backgroundColor:p.card.backgroundColor,borderRadius:p.button.borderRadius,borderWidth:parseFloat(y)===w?2:p.button.borderWidth,borderColor:parseFloat(y)===w?h.primary:p.button.borderColor}],children:jsxRuntime.jsxs(reactNative.Text,{style:[L.quickAmountText,{color:p.card.titleColor,fontFamily:b.medium}],children:[_,w.toLocaleString()]})},w))}),U&&jsxRuntime.jsx(reactNative.Text,{style:[L.validationError,{color:h.error,fontFamily:b.regular}],children:U}),jsxRuntime.jsxs(reactNative.View,{style:L.providerSection,children:[jsxRuntime.jsxs(reactNative.View,{style:L.providerHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[L.providerLabel,{color:p.card.labelColor,fontFamily:b.medium}],children:"Provider"}),k.length>0&&!q&&jsxRuntime.jsxs(reactNative.Text,{style:[L.refreshText,{color:p.card.labelRightColor,fontFamily:b.regular}],children:["Refreshing in ",ce,"s"]})]}),jsxRuntime.jsx(ct,{cardTokens:p.depositCard.quoteProvider.card,onPress:q||k.length===0?void 0:()=>Bt(true),contentStyle:reactNative.StyleSheet.flatten([L.providerButton,(q||k.length===0)&&L.disabled]),children:q?jsxRuntime.jsxs(reactNative.View,{style:L.providerLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:p.container.subtitleColor}),jsxRuntime.jsx(reactNative.Text,{style:[L.loadingText,{color:p.container.subtitleColor,fontFamily:b.regular}],children:"Finding best rates..."})]}):ee?jsxRuntime.jsxs(reactNative.View,{style:L.providerContent,children:[jsxRuntime.jsxs(reactNative.View,{style:L.providerInfo,children:[Ae&&jsxRuntime.jsx(reactNative.Text,{style:[L.autoPickedText,{color:p.container.subtitleColor,fontFamily:b.regular}],children:"Auto-picked for you"}),jsxRuntime.jsxs(reactNative.View,{style:L.providerRow,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Mn(ee.icon_urls,"png",ee.icon_url))},style:L.providerIconImage},`provider-${ee.service_provider}`),jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.Text,{style:[L.providerName,{color:p.card.titleColor,fontFamily:b.medium}],children:ee.service_provider_display_name}),jsxRuntime.jsxs(reactNative.Text,{style:[L.bestPriceText,{color:h.success,fontFamily:b.regular}],children:["Best price \u2022 ",ee.destination_amount.toFixed(2)," ","USDC"]})]})]})]}),jsxRuntime.jsx(Co,{size:20,color:p.card.actionColor,strokeWidth:2})]}):jsxRuntime.jsx(reactNative.Text,{style:[L.noProviderText,{color:p.container.subtitleColor,fontFamily:b.regular}],children:parseFloat(y)>0?"No providers available":"Enter an amount to see providers"})}),H&&jsxRuntime.jsx(reactNative.Text,{style:[L.errorText,{color:h.error,fontFamily:b.regular}],children:H})]}),jsxRuntime.jsxs(Pe,{visible:F,onClose:()=>Bt(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:C?.providerModal?.borderTopLeftRadius??g,borderTopRightRadius:C?.providerModal?.borderTopRightRadius??T,children:[jsxRuntime.jsx($t,{title:"Select Provider",showBack:false,onClose:()=>Bt(false)}),jsxRuntime.jsx(reactNative.ScrollView,{style:L.providerModalList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:jsxRuntime.jsx(reactNative.View,{style:L.quotesList,children:[...k].sort((w,P)=>P.destination_amount-w.destination_amount).map((w,P)=>{let ie=ee?.service_provider===w.service_provider,De=P===0;return jsxRuntime.jsxs(ct,{cardTokens:p.depositCard.quoteProvider.card,onPress:()=>{Te(w),it(true),xe(w.service_provider===Oe),Bt(false);},contentStyle:reactNative.StyleSheet.flatten([L.quoteItem,ie&&{borderWidth:2,borderColor:h.primary}]),children:[jsxRuntime.jsxs(reactNative.View,{style:L.quoteLeft,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Mn(w.icon_urls,"png",w.icon_url))},style:L.providerIconImage}),jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.Text,{style:[L.quoteName,{color:p.card.titleColor,fontFamily:b.medium}],children:w.service_provider_display_name}),De&&jsxRuntime.jsx(reactNative.Text,{style:[L.bestPriceLabel,{color:h.success,fontFamily:b.regular}],children:"\u2713 Best price"})]})]}),jsxRuntime.jsxs(reactNative.View,{style:L.quoteRight,children:[jsxRuntime.jsxs(reactNative.Text,{style:[L.quoteAmount,{color:p.card.textRightColor,fontFamily:b.medium}],children:[w.destination_amount.toFixed(2)," USDC"]}),jsxRuntime.jsxs(reactNative.Text,{style:[L.quoteSource,{color:p.card.subtextRightColor,fontFamily:b.regular}],children:["Fee: ",_,w.total_fee.toFixed(2)]})]})]},w.service_provider)})})})]})]}),jsxRuntime.jsx(reactNative.View,{style:[L.continueButtonContainer,{backgroundColor:h.background}],children:jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:_i,disabled:q||Je||!ee||parseFloat(y)<=0,style:[L.continueButton,{backgroundColor:p.container.buttonColor,borderRadius:p.button.borderRadius,borderWidth:p.button.borderWidth,borderColor:p.button.borderColor},(q||Je||!ee)&&L.disabledButton],children:jsxRuntime.jsx(reactNative.Text,{style:[L.continueButtonText,{color:p.container.buttonTitleColor,fontFamily:b.medium}],children:Je?"Loading...":"Continue"})})})]}),K()]}):N==="onramp"&&Ze?jsxRuntime.jsxs(reactNative.View,{style:L.onrampContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Mn(Ze.provider.icon_urls,"png",Ze.provider.icon_url))},style:L.onrampProviderIcon}),jsxRuntime.jsxs(reactNative.Text,{style:[L.onrampTitle,{color:p.container.titleColor,fontFamily:b.medium}],children:["Complete transaction with ",Ze.provider.service_provider_display_name]}),jsxRuntime.jsx(reactNative.Text,{style:[L.onrampSubtitle,{color:p.container.subtitleColor,fontFamily:b.regular}],children:"You can close this modal."}),jsxRuntime.jsxs(reactNative.View,{style:[L.flowDiagram,{backgroundColor:p.card.backgroundColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:L.flowStep,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:_t(`/icons/currencies/png/${Ze.sourceCurrency.toLowerCase()}.png`)},style:L.flowIconImage}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowLabel,{color:p.card.subtitleColor,fontFamily:b.regular}],children:"You use"}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowValue,{color:p.card.titleColor,fontFamily:b.medium}],children:Ze.sourceCurrency.toUpperCase()})]}),jsxRuntime.jsx(Co,{size:16,color:p.card.actionColor,strokeWidth:2}),jsxRuntime.jsxs(reactNative.View,{style:L.flowStep,children:[jsxRuntime.jsxs(reactNative.View,{style:L.flowIconWithBadge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:Pr(ge?.destination_token_metadata?.icon_urls,"png")||ge?.destination_token_metadata?.icon_url||_t("/icons/tokens/png/usdc.png")},style:L.flowIconImageNoBadge}),jsxRuntime.jsx(reactNative.Image,{source:{uri:Pr(ge?.destination_token_metadata?.chain?.icon_urls,"png")||ge?.destination_token_metadata?.chain?.icon_url||_t("/icons/networks/png/polygon.png")},style:[L.flowNetworkBadge,{borderColor:h.background,borderRadius:p.badge.borderRadius}]})]}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowLabel,{color:p.card.subtitleColor,fontFamily:b.regular}],children:"You buy"}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowValue,{color:p.card.titleColor,fontFamily:b.medium}],children:"USDC"})]}),jsxRuntime.jsx(Co,{size:16,color:p.card.actionColor,strokeWidth:2}),jsxRuntime.jsxs(reactNative.View,{style:L.flowStep,children:[jsxRuntime.jsxs(reactNative.View,{style:L.flowIconWithBadge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:Nt||_t("/icons/tokens/png/usdc.png")},style:L.flowIconImageNoBadge}),jsxRuntime.jsx(reactNative.Image,{source:{uri:Tt||_t("/icons/networks/png/polygon.png")},style:[L.flowNetworkBadge,{borderColor:h.background,borderRadius:p.badge.borderRadius}]})]}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowLabel,{color:p.card.subtitleColor,fontFamily:b.regular}],children:"You receive"}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowValue,{color:p.card.titleColor,fontFamily:b.medium}],children:we})]})]}),jsxRuntime.jsx(reactNative.View,{style:[L.onrampInfoBox,{backgroundColor:p.card.backgroundColor,borderRadius:p.card.borderRadius,borderWidth:p.card.borderWidth,borderColor:p.card.borderColor}],children:jsxRuntime.jsx(reactNative.Text,{style:[L.onrampInfoText,{color:p.card.descriptionColor,fontFamily:b.regular}],children:"The wallet address displayed in the payment provider is a temporary deposit address. Your funds will be automatically converted and deposited into your account."})})]}):null}function Nd({visible:e,onClose:t,url:o,providerName:n,colors:r,fonts:i,borderTopLeftRadius:s,borderTopRightRadius:c}){return jsxRuntime.jsxs(Pe,{visible:e,onClose:t,closeOnBackdropPress:false,showHandle:false,heightPercent:.92,noPadding:true,borderTopLeftRadius:s,borderTopRightRadius:c,children:[jsxRuntime.jsxs(reactNative.View,{style:Cr.header,children:[jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:t,style:Cr.headerButton,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(Be,{size:20,color:r.foregroundMuted,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[Cr.headerTitle,{color:r.foreground,fontFamily:i.medium}],children:n}),jsxRuntime.jsx(reactNative.View,{style:Cr.headerSpacer})]}),o&&jsxRuntime.jsx(reactNative.View,{style:Cr.container,children:jsxRuntime.jsx(reactNativeWebview.WebView,{source:{uri:o},style:Cr.webView,startInLoadingState:true,renderLoading:()=>jsxRuntime.jsx(reactNative.View,{style:Cr.loading,children:jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:r.primary})})})})]})}var Cr=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},headerButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},headerTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},headerSpacer:{width:28,height:28},container:{flex:1},webView:{flex:1},loading:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"}}),L=reactNative.StyleSheet.create({amountViewContainer:{flex:1},scrollContainer:{flex:1},scrollContent:{padding:16,paddingBottom:16},currencySelector:{alignItems:"center",marginBottom:16},currencyButton:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:8},currencyText:{fontSize:14,fontWeight:"500"},currencyIcon:{width:24,height:24,borderRadius:12},amountContainer:{alignItems:"center",marginBottom:24},amountInputRow:{flexDirection:"row",alignItems:"center",marginBottom:8},currencySymbol:{fontSize:48,fontWeight:"300"},amountInput:{fontSize:48,fontWeight:"300",minWidth:50},usdcPreview:{fontSize:14},quickAmounts:{flexDirection:"row",justifyContent:"center",gap:12,marginBottom:24},quickAmountButton:{paddingHorizontal:20,paddingVertical:10},quickAmountText:{fontSize:14,fontWeight:"500"},validationError:{fontSize:12,textAlign:"center",marginTop:12,paddingHorizontal:16},providerSection:{marginBottom:24},providerHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},providerLabel:{fontSize:12,fontWeight:"500"},refreshText:{fontSize:10},providerButton:{padding:16},disabled:{opacity:.5},providerLoading:{flexDirection:"row",alignItems:"center",gap:12},loadingText:{fontSize:14},providerContent:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},providerInfo:{flex:1},autoPickedText:{fontSize:12,marginBottom:6},providerRow:{flexDirection:"row",alignItems:"center",gap:12},providerIcon:{width:32,height:32,borderRadius:16},providerIconPlaceholder:{width:32,height:32,borderRadius:8},providerIconImage:{width:32,height:32,borderRadius:8},providerName:{fontSize:14,fontWeight:"500"},bestPriceText:{fontSize:11,marginTop:2},noProviderText:{fontSize:14,textAlign:"center"},errorText:{fontSize:12,marginTop:8},continueButtonContainer:{padding:16,paddingBottom:24},continueButton:{paddingVertical:16,alignItems:"center"},disabledButton:{opacity:.5},continueButtonText:{fontSize:16,fontWeight:"600"},webViewHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},webViewHeaderButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},webViewHeaderTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},webViewHeaderSpacer:{width:28,height:28},webViewContainer:{flex:1},webView:{flex:1},webViewLoading:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"},providerModalList:{height:468,paddingHorizontal:12,marginTop:8},quotesList:{gap:8,paddingBottom:24,minHeight:468},quoteItem:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:12},quoteLeft:{flexDirection:"row",alignItems:"center",gap:12},quoteIcon:{width:40,height:40,borderRadius:20},quoteName:{fontSize:14,fontWeight:"500"},bestPriceLabel:{fontSize:11,marginTop:2},quoteRight:{alignItems:"flex-end"},quoteAmount:{fontSize:14,fontWeight:"500"},quoteSource:{fontSize:12},onrampContainer:{flex:1,padding:16,alignItems:"center",paddingTop:24},onrampProviderIcon:{width:64,height:64,borderRadius:16},onrampTitle:{fontSize:18,fontWeight:"600",textAlign:"center",marginTop:20,marginBottom:8,paddingHorizontal:16},onrampSubtitle:{fontSize:14,textAlign:"center",marginBottom:24},flowDiagram:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:20,paddingHorizontal:24,borderRadius:12,width:"100%"},flowIconWithBadge:{position:"relative",width:24,height:24,marginBottom:4},flowIconImageNoBadge:{width:24,height:24,borderRadius:12},flowNetworkBadge:{position:"absolute",bottom:-4,right:-6,width:14,height:14,borderWidth:2},onrampInfoBox:{marginTop:16,padding:16,width:"100%"},onrampInfoText:{fontSize:13,lineHeight:20},flowStep:{alignItems:"center"},flowIcon:{width:28,height:28,borderRadius:14,marginBottom:4},flowIconImage:{width:24,height:24,borderRadius:12,marginBottom:4},flowLabel:{fontSize:10},flowValue:{fontSize:14,fontWeight:"500"}});function qd(e){try{let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" at "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e}}function Kd(e){return e?`$${parseFloat(e).toFixed(2)}`:"$0.00"}function mi({execution:e,onPress:t}){let {colors:o,fonts:n,components:r}=O(),i=r.depositTracker.executionRow.card,s=e.status==="pending"||e.status==="waiting"||e.status==="delayed";e.status==="succeeded";let d=se(Re(e.destination_token_metadata,"png")||_t("/icons/tokens/png/usdc.png")),u=s?"Deposit Processing":"Deposit Completed",a=qd(e.created_at||new Date().toISOString()),g=Kd(e.source_amount_usd);return jsxRuntime.jsxs(ct,{cardTokens:i,onPress:t,contentStyle:vo.container,children:[jsxRuntime.jsxs(reactNative.View,{style:vo.iconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:d},style:vo.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[vo.statusBadge,{backgroundColor:s?o.warning:o.success,borderColor:i.backgroundColor}],children:s?jsxRuntime.jsx(Os,{size:12,color:"#FFFFFF",strokeWidth:2.5}):jsxRuntime.jsx(Be,{size:12,color:"#FFFFFF",strokeWidth:3})})]}),jsxRuntime.jsxs(reactNative.View,{style:vo.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[vo.title,{color:i.titleColor,fontFamily:n.medium}],children:u}),jsxRuntime.jsx(reactNative.Text,{style:[vo.dateTime,{color:i.subtitleColor,fontFamily:n.regular}],children:a})]}),jsxRuntime.jsxs(reactNative.View,{style:vo.rightContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[vo.amount,{color:i.textRightColor,fontFamily:n.medium}],children:g}),jsxRuntime.jsx(Co,{size:20,color:i.actionColor,strokeWidth:2})]})]})}var vo=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",paddingHorizontal:16,paddingVertical:12},iconContainer:{position:"relative",marginRight:12},tokenIcon:{width:40,height:40,borderRadius:20},statusBadge:{position:"absolute",bottom:-4,right:-4,width:22,height:22,borderRadius:11,alignItems:"center",justifyContent:"center",borderWidth:2},textContainer:{flex:1,gap:2},title:{fontSize:16,fontWeight:"500"},dateTime:{fontSize:13},rightContainer:{flexDirection:"row",alignItems:"center",gap:8},amount:{fontSize:16,fontWeight:"500"}});function al(e,t){let o={solana:"Solana",ethereum:"Ethereum",bitcoin:"Bitcoin"};return e==="ethereum"?{1:"Ethereum",137:"Polygon",8453:"Base",42161:"Arbitrum",10:"Optimism"}[t]||o[e]||e:o[e]||e}function ll(e,t=6){if(!e)return "\u2014";try{let o=Number(e)/Math.pow(10,t);return o===0?"0.00":o>=1?o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:8,minimumSignificantDigits:2,maximumSignificantDigits:6})}catch{return "0.00"}}function Zd(e){return e?`$${parseFloat(e).toFixed(2)}`:"$0.00"}var cl=e=>!e||e.length<12?e:`${e.slice(0,12)}...${e.slice(-4)}`;function dl(e){if(!e)return "";let t=e.indexOf(".");return t===-1?e.toUpperCase():e.slice(0,t).toUpperCase()+e.slice(t)}function Xd(e){try{let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" at "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e}}function gi({visible:e,onClose:t,executions:o,externalUserId:n,publishableKey:r,borderTopLeftRadius:i,borderTopRightRadius:s}){let{height:c}=reactNative.useWindowDimensions(),{colors:d,fonts:u,components:a}=O(),[g,T]=react.useState(o),[C,h]=react.useState(false),[b,p]=react.useState(null),[y,m]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{if(!e||!n)return;let k=async()=>{h(true);try{let M=[...(await en(n,r)).data].sort((H,X)=>{let U=H.created_at?new Date(H.created_at).getTime():0;return (X.created_at?new Date(X.created_at).getTime():0)-U});T(M);}catch(q){console.error("Failed to fetch executions:",q),T(o);}finally{h(false);}};k();let J=setInterval(k,1e4);return ()=>clearInterval(J)},[e,n,r,o]),react.useEffect(()=>{o.length>0&&T(k=>{let J=new Set(k.map(M=>M.id)),q=o.filter(M=>!J.has(M.id));return q.length>0?[...q,...k]:k});},[o]),react.useEffect(()=>{e||p(null);},[e]);let f=k=>{p(k);},R=()=>{p(null),m(false);},S=()=>{p(null),t();};return jsxRuntime.jsxs(Pe,{visible:e,onClose:S,closeOnBackdropPress:true,showHandle:false,heightPercent:.6,borderTopLeftRadius:i,borderTopRightRadius:s,children:[jsxRuntime.jsx($t,{title:b?"Deposit Details":"Deposit Tracker",onClose:S,showClose:!b,showBack:!!b,onBack:R}),b?(()=>{if(!b)return null;let k=b,J=k.status==="pending"||k.status==="waiting"||k.status==="delayed",q=k.status==="succeeded",M=se(Re(k.destination_token_metadata,"png")||_t("/icons/tokens/png/usdc.png")),H=k.provider_metadata?.details,X=H?.currencyIn,U=H?.currencyOut;X?.currency?.symbol||"USDC";U?.currency?.symbol||"USDC";let Ge=ll(k.source_amount_base_unit,k.source_token_metadata?.decimals),ee=ll(k.destination_amount_base_unit,k.destination_token_metadata?.decimals),Te=Zd(k.source_amount_usd),Ae=al(k.source_chain_type,k.source_chain_id),xe=al(k.destination_chain_type,k.destination_chain_id),Oe=()=>{k.explorer_url&&reactNative.Linking.openURL(k.explorer_url);},te=()=>{k.destination_explorer_url&&reactNative.Linking.openURL(k.destination_explorer_url);};return jsxRuntime.jsxs(reactNative.ScrollView,{ref:l,style:[$.scrollContainer,{maxHeight:c*.7}],contentContainerStyle:$.detailsContent,showsVerticalScrollIndicator:false,children:[jsxRuntime.jsxs(reactNative.View,{style:$.iconSection,children:[jsxRuntime.jsxs(reactNative.View,{style:$.iconWrapper,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:M},style:$.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[$.statusBadge,{backgroundColor:J?d.warning:d.success,borderColor:d.background}],children:J?jsxRuntime.jsx(wt,{size:14,color:"#FFFFFF",strokeWidth:2}):jsxRuntime.jsx(Be,{size:14,color:"#FFFFFF",strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:$.statusRow,children:[jsxRuntime.jsx(reactNative.View,{style:[$.statusDot,{backgroundColor:J?d.warning:d.success}]}),jsxRuntime.jsx(reactNative.Text,{style:[$.statusText,{color:a.container.titleColor,fontFamily:u.semibold}],children:J?"Processing":"Completed"})]}),jsxRuntime.jsx(reactNative.Text,{style:[$.dateText,{color:a.container.subtitleColor,fontFamily:u.regular}],children:Xd(k.created_at||new Date().toISOString())})]}),jsxRuntime.jsxs(reactNative.View,{style:[$.card,{backgroundColor:a.card.backgroundColor,borderRadius:a.card.borderRadius,borderWidth:a.card.borderWidth,borderColor:a.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Amount Sent"}),jsxRuntime.jsxs(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:[Ge," ",dl(k.source_currency)]})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Amount Received"}),jsxRuntime.jsxs(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:[ee," ",dl(k.destination_currency)]})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"USD Value"}),jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:Te})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Source Network"}),jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:Ae})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Destination Network"}),jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:xe})]})]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:()=>{let Ee=!y;m(Ee),Ee?setTimeout(()=>{l.current?.scrollToEnd({animated:true});},100):l.current?.scrollTo({y:0,animated:true});},style:$.toggleButton,activeOpacity:.7,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.toggleText,{color:a.container.actionTitle,fontFamily:u.regular}],children:y?"See less":"See more details"}),y?jsxRuntime.jsx(Wo,{size:14,color:a.container.actionColor,strokeWidth:2}):jsxRuntime.jsx(wt,{size:14,color:a.container.actionColor,strokeWidth:2})]}),y&&jsxRuntime.jsxs(reactNative.View,{style:[$.card,{backgroundColor:a.card.backgroundColor,borderRadius:a.card.borderRadius,borderWidth:a.card.borderWidth,borderColor:a.card.borderColor}],children:[k.explorer_url&&jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:Oe,style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Deposit Tx"}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:cl(k.transaction_hash)}),jsxRuntime.jsx(er,{size:14,color:a.card.actionIcon,strokeWidth:2})]})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]})]}),k.destination_explorer_url&&q&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:te,style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Completion Tx"}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:cl(k.destination_transaction_hashes[0])}),jsxRuntime.jsx(er,{size:14,color:a.card.actionIcon,strokeWidth:2})]})]})]})]})})():jsxRuntime.jsx(reactNative.ScrollView,{style:[$.scrollContainer,{maxHeight:c*.7}],contentContainerStyle:$.scrollContent,showsVerticalScrollIndicator:false,children:g.length===0?jsxRuntime.jsxs(reactNative.View,{style:$.emptyContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.emptyText,{color:a.container.titleColor,fontFamily:u.medium}],children:"No deposits yet"}),jsxRuntime.jsx(reactNative.Text,{style:[$.emptySubtext,{color:a.container.subtitleColor,fontFamily:u.regular}],children:"Your deposit history will appear here"})]}):jsxRuntime.jsx(reactNative.View,{style:$.executionsList,children:g.map(k=>jsxRuntime.jsx(mi,{execution:k,onPress:()=>f(k)},k.id))})})]})}var $=reactNative.StyleSheet.create({scrollContainer:{paddingTop:16},scrollContent:{paddingHorizontal:16,paddingBottom:16},emptyContainer:{paddingVertical:40,paddingHorizontal:16,alignItems:"center"},emptyText:{fontSize:14,marginBottom:4},emptySubtext:{fontSize:12},executionsList:{paddingTop:8,gap:12},detailsContent:{paddingHorizontal:16,paddingBottom:32},iconSection:{alignItems:"center",marginBottom:24},iconWrapper:{position:"relative",marginBottom:12},tokenIcon:{width:72,height:72,borderRadius:36},statusBadge:{position:"absolute",bottom:0,right:0,width:28,height:28,borderRadius:14,alignItems:"center",justifyContent:"center",borderWidth:3},statusRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},statusDot:{width:8,height:8,borderRadius:4},statusText:{fontSize:16,fontWeight:"600"},dateText:{fontSize:14},card:{borderRadius:12,marginBottom:12,overflow:"hidden"},cardRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:14,paddingHorizontal:16},cardRowRight:{flexDirection:"row",alignItems:"center",gap:8},cardDivider:{height:1,marginHorizontal:16},cardLabel:{fontSize:14},cardValue:{fontSize:14,fontWeight:"500"},toggleButton:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:12,paddingHorizontal:4},toggleText:{fontSize:14},buttonSection:{marginTop:12,gap:10},actionButton:{flexDirection:"row",alignItems:"center",paddingVertical:16,paddingHorizontal:16,borderRadius:12},buttonIconLeft:{marginRight:12},buttonIconRight:{marginLeft:12},buttonText:{color:"#FFFFFF",fontSize:14,fontWeight:"600",flex:1,textAlign:"left"},hintText:{fontSize:12,textAlign:"center",marginTop:8}});function Tn(e,t=true){let[o,n]=react.useState(null),[r,i]=react.useState(null),[s,c]=react.useState(false),[d,u]=react.useState(false),[a,g]=react.useState(null),[T,C]=react.useState(null);react.useEffect(()=>{!t||o||(c(true),rn().then(y=>{n(y),g(null);}).catch(y=>{g(y instanceof Error?y:new Error(String(y)));}).finally(()=>{c(false);}));},[t,o]),react.useEffect(()=>{!t||!e||r||(u(true),on(e).then(y=>{i(y),C(null);}).catch(y=>{C(y instanceof Error?y:new Error(String(y)));}).finally(()=>{u(false);}));},[t,e,r]);let h=s||d,b=a||T||null,p=null;if(o&&r){let y=r.blocked_country_codes||[],m=o.alpha2.toUpperCase();p=!y.some(l=>l.toUpperCase()===m);}return {isAllowed:p,alpha2:o?.alpha2?.toLowerCase()??null,country:o?.country??null,isLoading:h,error:b}}var _s="unifold_recent_tokens",ou=5,gl=[{symbol:"ETH",chainType:"ethereum",chainId:"1"},{symbol:"SOL",chainType:"solana",chainId:"mainnet"},{symbol:"USDC",chainType:"solana",chainId:"mainnet"},{symbol:"POL",chainType:"ethereum",chainId:"137"},{symbol:"BNB",chainType:"ethereum",chainId:"56"},{symbol:"BTC",chainType:"bitcoin",chainId:"mainnet"}];async function Ci(){try{let e=await xs__default.default.getItem(_s);return e?JSON.parse(e):[]}catch{return []}}async function ru(e){try{let o=(await Ci()).filter(r=>!(r.symbol===e.symbol&&r.chainType===e.chainType&&r.chainId===e.chainId));o.unshift(e);let n=o.slice(0,ou);await xs__default.default.setItem(_s,JSON.stringify(n));}catch{}}async function nu(e){try{let o=(await Ci()).filter(n=>!(n.symbol===e.symbol&&n.chainType===e.chainType&&n.chainId===e.chainId));return await xs__default.default.setItem(_s,JSON.stringify(o)),o}catch{return []}}function Rs({visible:e,onClose:t,tokens:o,selectedToken:n,selectedChainKey:r,onSelect:i,borderTopLeftRadius:s,borderTopRightRadius:c}){let{colors:d,fonts:u,components:a}=O(),[g,T]=react.useState(""),[C,h]=react.useState([]);react.useEffect(()=>{e&&Ci().then(h);},[e]),react.useEffect(()=>{e||T("");},[e]);let b=react.useMemo(()=>{let R=[];return o.forEach(S=>{S.chains.forEach(A=>{R.push({token:S,chain:A});});}),R},[o]),p=react.useMemo(()=>{let R=[],S=new Set,A=(B,k,J,q)=>{let M=`${B}-${k}:${J}`;if(S.has(M))return;let H=o.find(U=>U.symbol===B);if(!H)return;let X=H.chains.find(U=>U.chain_type===k&&U.chain_id===J);X&&(S.add(M),R.push({token:H,chain:X,isRecent:q}));};return C.forEach(B=>{A(B.symbol,B.chainType,B.chainId,true);}),gl.forEach(B=>{A(B.symbol,B.chainType,B.chainId,false);}),R},[o,C]),y=react.useMemo(()=>{if(!g.trim())return b;let R=g.toLowerCase();return b.filter(({token:S,chain:A})=>S.symbol.toLowerCase().includes(R)||S.name.toLowerCase().includes(R)||A.chain_name.toLowerCase().includes(R))},[b,g]),m=(R,S,A)=>gl.some(B=>B.symbol===R&&B.chainType===S&&B.chainId===A),l=async(R,S)=>{let A=`${S.chain_type}:${S.chain_id}`;if(!m(R.symbol,S.chain_type,S.chain_id)){await ru({symbol:R.symbol,chainType:S.chain_type,chainId:S.chain_id});let B=await Ci();h(B);}T(""),i(R.symbol,A),t();},f=async(R,S)=>{let A=await nu({symbol:R.symbol,chainType:S.chain_type,chainId:S.chain_id});h(A);};return jsxRuntime.jsxs(Pe,{visible:e,onClose:t,closeOnBackdropPress:true,showHandle:false,heightPercent:.9,borderTopLeftRadius:s,borderTopRightRadius:c,children:[jsxRuntime.jsxs(reactNative.View,{style:fe.header,children:[jsxRuntime.jsx(reactNative.View,{style:fe.headerSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[fe.headerTitle,{color:a.header.titleColor,fontFamily:u.medium}],children:"Select token to deposit"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:t,style:fe.closeButton,children:jsxRuntime.jsx(lt,{size:20,color:a.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.View,{style:fe.searchContainer,children:jsxRuntime.jsx(reactNative.TextInput,{style:[fe.searchInput,{backgroundColor:a.search.backgroundColor,color:a.search.inputColor,fontFamily:u.regular,borderRadius:a.input.borderRadius,borderWidth:a.input.borderWidth,borderColor:a.input.borderColor}],placeholder:"Search",placeholderTextColor:a.search.placeholderColor,value:g,onChangeText:T,autoCapitalize:"none",autoCorrect:false})}),p.length>0&&!g&&jsxRuntime.jsxs(reactNative.View,{style:fe.quickSelectSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[fe.sectionLabel,{color:a.list.titleSectionColor,fontFamily:u.regular}],children:"Quick select"}),jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,keyboardShouldPersistTaps:"handled",contentContainerStyle:fe.quickSelectScroll,children:p.map(({token:R,chain:S,isRecent:A})=>{let B=`${S.chain_type}:${S.chain_id}`;R.symbol===n&&B===r;return jsxRuntime.jsxs(reactNative.View,{children:[A&&jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>f(R,S),style:fe.removeButton,children:jsxRuntime.jsx(lt,{size:12,color:d.foregroundMuted,strokeWidth:2})}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>l(R,S),activeOpacity:.7,style:[fe.quickSelectItem,{backgroundColor:a.card.backgroundColor,borderRadius:a.card.borderRadius,borderWidth:a.card.borderWidth,borderColor:a.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:fe.tokenIconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(R,"png"))},style:fe.quickSelectIcon}),jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(S,"png"))},style:[fe.quickSelectChainBadge,{borderColor:a.card.backgroundColor,borderRadius:a.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:fe.quickSelectText,children:[jsxRuntime.jsx(reactNative.Text,{style:[fe.quickSelectSymbol,{color:a.card.titleColor,fontFamily:u.medium}],children:R.symbol}),jsxRuntime.jsx(reactNative.Text,{style:[fe.quickSelectChain,{color:a.card.subtitleColor,fontFamily:u.regular}],children:S.chain_name})]})]})]},`quick-${R.symbol}-${B}`)})})]}),jsxRuntime.jsx(reactNative.Text,{style:[fe.sectionLabel,{color:a.list.titleSectionColor,fontFamily:u.regular}],children:"All supported tokens"}),jsxRuntime.jsx(reactNative.ScrollView,{style:fe.tokenList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",contentContainerStyle:fe.tokenListContent,children:y.length===0?jsxRuntime.jsx(reactNative.View,{style:fe.emptyState,children:jsxRuntime.jsx(reactNative.Text,{style:[fe.emptyText,{color:d.foregroundMuted,fontFamily:u.regular}],children:"No tokens found"})}):y.map(({token:R,chain:S})=>{let A=`${S.chain_type}:${S.chain_id}`,B=R.symbol===n&&A===r;return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>l(R,S),activeOpacity:.7,style:[fe.tokenItem,{backgroundColor:B?a.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsxs(reactNative.View,{style:fe.tokenIconContainerLarge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(R,"png"))},style:fe.tokenIcon}),jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(S,"png"))},style:[fe.tokenChainBadge,{borderColor:a.card.backgroundColor,borderRadius:a.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:fe.tokenInfo,children:[jsxRuntime.jsx(reactNative.Text,{style:[fe.tokenSymbol,{color:a.card.titleColor,fontFamily:u.medium}],children:R.symbol}),jsxRuntime.jsx(reactNative.Text,{style:[fe.tokenChainName,{color:a.card.subtitleColor,fontFamily:u.regular}],children:S.chain_name})]}),jsxRuntime.jsxs(reactNative.Text,{style:[fe.minDeposit,{color:a.card.labelColor,fontFamily:u.regular}],children:["Minimum:"," ",jsxRuntime.jsxs(reactNative.Text,{style:{color:a.card.labelHighlightRightColor,fontFamily:u.regular},children:["$",S.minimum_deposit_amount_usd]})]})]},`${R.symbol}-${A}`)})})]})}var fe=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},closeButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},headerTitle:{fontSize:16,fontWeight:"500",textAlign:"center",flex:1},headerSpacer:{width:28},searchContainer:{paddingHorizontal:16,paddingBottom:12},searchInput:{height:40,paddingHorizontal:16,fontSize:14},quickSelectSection:{marginBottom:12},sectionLabel:{fontSize:12,paddingHorizontal:16,marginBottom:8},quickSelectScroll:{paddingHorizontal:16,gap:8},quickSelectItem:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12},removeButton:{position:"absolute",top:-2,right:-6,zIndex:1,padding:2},tokenIconContainer:{position:"relative"},quickSelectIcon:{width:28,height:28,borderRadius:14},quickSelectChainBadge:{position:"absolute",bottom:-2,right:-2,width:14,height:14,borderRadius:7,borderWidth:2},quickSelectText:{alignItems:"flex-start"},quickSelectSymbol:{fontSize:12,fontWeight:"500"},quickSelectChain:{fontSize:10},tokenList:{flex:1},tokenListContent:{paddingHorizontal:16,paddingBottom:24,gap:4},emptyState:{padding:32,alignItems:"center"},emptyText:{fontSize:14},tokenItem:{flexDirection:"row",alignItems:"center",gap:12,padding:12,borderRadius:12},tokenIconContainerLarge:{position:"relative"},tokenIcon:{width:40,height:40,borderRadius:20},tokenChainBadge:{position:"absolute",bottom:-4,right:-4,width:20,height:20,borderRadius:10,borderWidth:2},tokenInfo:{flex:1},tokenSymbol:{fontSize:14,fontWeight:"500"},tokenChainName:{fontSize:12},minDeposit:{fontSize:12}});var wi=(e,t)=>`${t}:${e}`,cu=e=>{let[t,o]=e.split(":");return {chainType:t,chainId:o}};function Is({externalUserId:e,publishableKey:t,recipientAddress:o,destinationChainType:n,destinationChainId:r,destinationTokenAddress:i,destinationTokenSymbol:s,defaultChainType:c,defaultChainId:d,defaultTokenAddress:u,depositConfirmationMode:a="auto_ui",onExecutionsChange:g,onDepositSuccess:T,onDepositError:C,wallets:h,borderTopLeftRadius:b,borderTopRightRadius:p,sheetBorderRadius:y}){let{colors:m,fonts:l,components:f}=O(),R=c&&d?`${c}:${d}`:"solana:mainnet",[S,A]=react.useState("USDC"),[B,k]=react.useState(R),[J,q]=react.useState([]),[M,H]=react.useState(!h?.length),X=h?.length?h:J,[U,Qe]=react.useState([]),[We,Ge]=react.useState(true),[ee,Te]=react.useState(false),[Ae,xe]=react.useState(false),[Oe,te]=react.useState(false),[Ee,it]=react.useState([]),[st,dt]=react.useState(new Map),[at]=react.useState(()=>new Date),[Ct,Je]=react.useState(null),[oo,ce]=react.useState(false),[j,_e]=react.useState(null),[Kt,Ce]=react.useState(false),bt=new Map;U.forEach(ne=>{ne.chains.forEach(be=>{let V=`${be.chain_type}:${be.chain_id}`;bt.has(V)||bt.set(V,be);});});let Xe=Array.from(bt.values()),ut=cu(B),de=Xe.find(ne=>ne.chain_type===ut.chainType&&ne.chain_id===ut.chainId),et=de?.chain_type||"ethereum",ro=ir(X,et),ze=ro?.address||"",ge=react.useRef(false);react.useEffect(()=>{async function ne(){try{Ge(!0),Je(null);let V=await tn(t,i&&r&&n?{destination_token_address:i,destination_chain_id:r,destination_chain_type:n}:void 0);if(Qe(V.data),V.data.length>0&&!ge.current){ge.current=!0;let N,re;if(c&&d)if(u)for(let Q of V.data){let Ve=Q.chains.find(we=>we.chain_type===c&&we.chain_id===d&&we.token_address.toLowerCase()===u.toLowerCase());if(Ve){N=Q,re=Ve;break}}else for(let Q of V.data){let Ve=Q.chains.find(we=>we.chain_type===c&&we.chain_id===d);if(Ve){N=Q,re=Ve;break}}if(!N&&i)for(let Q of V.data){let Ve=Q.chains.find(we=>we.token_address.toLowerCase()===i.toLowerCase());if(Ve){N=Q,re=Ve;break}}N||(N=V.data.find(Q=>Q.symbol==="USDC"),N&&N.chains.length>0&&(re=N.chains[0])),N||(N=V.data.find(Q=>Q.symbol==="USDT"),N&&N.chains.length>0&&(re=N.chains[0])),N||(N=V.data[0],N.chains.length>0&&(re=N.chains[0])),N&&A(N.symbol),re&&k(wi(re.chain_id,re.chain_type));}}catch(be){console.error("Error fetching supported tokens:",be),Je("Failed to load supported tokens"),C?.({message:"Failed to load supported tokens",error:be});}finally{Ge(false);}}ne();},[t,i,r,n,c,d,u,C]),react.useEffect(()=>{g&&g(Ee);},[Ee,g]),react.useEffect(()=>{if(h?.length){H(false);return}if(J.length>0){H(false);return}let ne=null,be=false,V=async()=>{if(!be){H(true);try{let N=await nr({external_user_id:e,recipient_address:o,destination_chain_type:n,destination_chain_id:r,destination_token_address:i},t);be||(q(N.data),Je(null),H(!1));}catch(N){console.error("Error fetching wallets, retrying in 5s:",N),be||(Je(N instanceof Error?N.message:"Failed to load wallets"),H(false),ne=setTimeout(V,5e3));}}};return V(),()=>{be=true,ne&&clearTimeout(ne);}},[e,o,n,r,i,t,h,J.length]);let Ht=ro?.id??"",{showWaitingUi:Dt,handleIveDeposited:ho}=bn({depositConfirmationMode:a,depositAddress:ze,chain:B,externalUserId:e,publishableKey:t,modalOpenedAt:at,depositWalletId:Ht,depositExecutions:Ee,trackedExecutions:st,setDepositExecutions:it,setTrackedExecutions:dt,setLatestExecution:_e,setShowStatusSheet:ce,onDepositSuccess:T,onExecutionsChange:g,onDepositError:C});react.useEffect(()=>{if(!U.length)return;let ne=U.find(V=>V.symbol===S);if(!ne||ne.chains.length===0)return;if(!ne.chains.some(V=>wi(V.chain_id,V.chain_type)===B)){let V=ne.chains[0];k(wi(V.chain_id,V.chain_type));}},[S,U,B]);let Ze=U.find(ne=>ne.symbol===S),je=(Ze?.chains||[]).find(ne=>wi(ne.chain_id,ne.chain_type)===B),no=async()=>{if(ze)try{reactNative.Clipboard.setString(ze),Te(!0),setTimeout(()=>Te(!1),2e3);}catch(ne){console.error("Failed to copy:",ne);}},F=je?.estimated_price_impact_percent??0,Bt=je?.max_slippage_percent??.25,he=je?.minimum_deposit_amount_usd??3;return We?jsxRuntime.jsxs(reactNative.View,{style:v.loadingContainer,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:m.primary}),jsxRuntime.jsx(reactNative.Text,{style:[v.loadingText,{color:m.foregroundMuted,fontFamily:l.regular}],children:"Loading currencies..."})]}):Ct&&U.length===0?jsxRuntime.jsxs(reactNative.View,{style:v.errorContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.errorText,{color:m.error,fontFamily:l.regular}],children:Ct}),jsxRuntime.jsx(reactNative.Text,{style:[v.errorHint,{color:m.foregroundMuted,fontFamily:l.regular}],children:"Please check your network connection and try again."})]}):jsxRuntime.jsxs(reactNative.View,{style:v.container,children:[jsxRuntime.jsxs(reactNative.View,{style:v.selectorSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.selectorLabel,{color:f.card.labelColor,fontFamily:l.medium}],children:"Select token to deposit"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>te(true),disabled:We||U.length===0,style:[v.tokenSelectorButton,{backgroundColor:f.card.backgroundColor,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth,borderColor:f.card.borderColor}],activeOpacity:.7,children:We?jsxRuntime.jsxs(reactNative.View,{style:v.tokenSelectorLoading,children:[jsxRuntime.jsx(reactNative.View,{style:[v.loadingIcon,{backgroundColor:m.cardHover}]}),jsxRuntime.jsxs(reactNative.View,{style:v.loadingTextContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[v.loadingLine,{backgroundColor:m.cardHover,width:60}]}),jsxRuntime.jsx(reactNative.View,{style:[v.loadingLine,{backgroundColor:m.cardHover,width:100,marginTop:4}]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:v.tokenIconWrapper,children:[Ze&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(Ze,"png"))},style:v.tokenMainIcon}),(je||de)&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(je||de,"png"))},style:[v.tokenChainBadge,{borderColor:f.card.backgroundColor,borderRadius:f.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:v.tokenSelectorInfo,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.tokenSelectorSymbol,{color:f.card.titleColor,fontFamily:l.semibold}],children:Ze?.symbol||S}),jsxRuntime.jsx(reactNative.Text,{style:[v.tokenSelectorNetwork,{color:f.card.subtitleColor,fontFamily:l.regular}],numberOfLines:1,children:je?.chain_name||de?.chain_name||"Select network"})]}),jsxRuntime.jsxs(reactNative.View,{style:v.tokenSelectorRight,children:[jsxRuntime.jsxs(reactNative.Text,{style:[v.minDepositText,{color:f.card.labelHighlightRightColor,fontFamily:l.medium}],children:["$",he," min"]}),jsxRuntime.jsx(Co,{size:16,color:f.card.actionColor,strokeWidth:2})]})]})})]}),jsxRuntime.jsx(Rs,{visible:Oe,onClose:()=>te(false),tokens:U,selectedToken:S,selectedChainKey:B,onSelect:(ne,be)=>{A(ne),k(be);},borderTopLeftRadius:y?.tokenSelector?.borderTopLeftRadius??b,borderTopRightRadius:y?.tokenSelector?.borderTopRightRadius??p}),jsxRuntime.jsx(reactNative.View,{style:v.qrContainer,children:jsxRuntime.jsx(reactNative.View,{style:[v.qrWrapper,{backgroundColor:m.background,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth>0?f.card.borderWidth:1,borderColor:f.card.borderColor}],children:M?jsxRuntime.jsxs(reactNative.View,{style:v.qrLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:m.primary}),jsxRuntime.jsx(reactNative.Text,{style:[v.loadingText,{color:m.foregroundMuted,fontFamily:l.regular}],children:"Loading..."})]}):ze?jsxRuntime.jsx(Nr,{value:ze,size:180,logoUri:se(Re(je,"png")||_t("/icons/networks/png/ethereum.png")),logoSize:45}):jsxRuntime.jsx(reactNative.View,{style:v.qrLoading,children:jsxRuntime.jsx(reactNative.Text,{style:[v.errorText,{color:m.error,fontFamily:l.regular}],children:"No address available"})})})}),jsxRuntime.jsxs(reactNative.View,{style:v.addressSection,children:[jsxRuntime.jsxs(reactNative.View,{style:v.addressHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.addressLabel,{color:f.card.labelColor,fontFamily:l.medium}],children:"Deposit Address"}),ee&&jsxRuntime.jsxs(reactNative.View,{style:v.copiedIndicator,children:[jsxRuntime.jsx(Be,{size:14,color:m.success,strokeWidth:2}),jsxRuntime.jsx(reactNative.Text,{style:[v.copiedText,{color:m.success,fontFamily:l.regular}],children:"Copied"})]})]}),jsxRuntime.jsxs(ct,{cardTokens:f.transferCrypto.depositAddress.card,onPress:!M&&ze?no:void 0,contentStyle:v.addressBox,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.addressText,{color:f.card.titleColor,fontFamily:l.regular}],numberOfLines:2,children:M?"Loading...":ze||"No address available"}),jsxRuntime.jsx(reactNative.View,{style:v.addressCopyIcon,children:jsxRuntime.jsx(Xo,{size:16,color:f.card.actionColor,strokeWidth:1})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:[v.detailsCard,{backgroundColor:f.card.backgroundColor,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth,borderColor:f.card.borderColor}],children:[jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>xe(!Ae),style:v.detailsHeader,children:[jsxRuntime.jsxs(reactNative.View,{style:v.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[v.detailIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Zo,{size:12,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[v.detailsLabel,{color:f.card.titleColor,fontFamily:l.regular}],children:"Processing time: < 1 min"})]}),jsxRuntime.jsx(reactNative.View,{style:v.chevronContainer,children:Ae?jsxRuntime.jsx(Wo,{size:16,color:f.card.actionColor,strokeWidth:2}):jsxRuntime.jsx(wt,{size:16,color:f.card.actionColor,strokeWidth:2})})]}),Ae&&jsxRuntime.jsxs(reactNative.View,{style:v.detailsContent,children:[jsxRuntime.jsxs(reactNative.View,{style:v.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[v.detailIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wr,{size:12,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[v.detailsLabel,{color:f.card.titleColor,fontFamily:l.regular}],children:["Price impact: ",F.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(Sr,{size:14,color:f.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:v.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[v.detailIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(kr,{size:12,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[v.detailsLabel,{color:f.card.titleColor,fontFamily:l.regular}],children:["Slippage: Auto \u2022 ",Bt.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(Sr,{size:14,color:f.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:v.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[v.detailIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Rn,{size:12,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[v.detailsLabel,{color:f.card.titleColor,fontFamily:l.regular}],children:["Need help?"," ",jsxRuntime.jsx(reactNative.Text,{style:{textDecorationLine:"underline"},children:"Contact support"})]})]})]})]}),jsxRuntime.jsx(oi,{depositConfirmationMode:a,depositAddress:ze,showWaitingUi:Dt,latestExecution:j,onIveDeposited:ho}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{style:v.termsContainer,onPress:()=>reactNative.Linking.openURL("https://unifold.io/terms"),children:jsxRuntime.jsx(reactNative.Text,{style:[v.termsText,{color:m.primary,fontFamily:l.regular}],children:"Terms apply"})}),jsxRuntime.jsxs(Pe,{visible:Kt,onClose:()=>Ce(false),closeOnBackdropPress:true,showHandle:true,borderTopLeftRadius:y?.infoSheet?.borderTopLeftRadius??b,borderTopRightRadius:y?.infoSheet?.borderTopRightRadius??p,children:[jsxRuntime.jsxs(reactNative.View,{style:[v.sheetHeader,{borderBottomColor:m.border}],children:[jsxRuntime.jsx(reactNative.View,{style:v.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[v.sheetTitle,{color:f.header.titleColor,fontFamily:l.medium}],children:"Price Impact & Slippage"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(false),style:v.sheetCloseButton,children:jsxRuntime.jsx(lt,{size:20,color:f.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:v.infoSheetContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[v.infoCard,{backgroundColor:f.card.backgroundColor,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth,borderColor:f.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:v.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[v.infoCardIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wr,{size:16,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[v.infoCardTitle,{color:f.card.titleColor,fontFamily:l.medium}],children:"Price Impact"}),jsxRuntime.jsxs(reactNative.Text,{style:[v.infoCardValue,{color:f.card.titleColor,fontFamily:l.medium}],children:[F.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[v.infoCardDescription,{color:f.card.descriptionColor,fontFamily:l.regular}],children:"Price impact is the difference between the current market price and the price you'll receive for your swap. This occurs due to liquidity pool mechanics and trade size."})]}),jsxRuntime.jsxs(reactNative.View,{style:[v.infoCard,{backgroundColor:f.card.backgroundColor,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth,borderColor:f.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:v.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[v.infoCardIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(kr,{size:16,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[v.infoCardTitle,{color:f.card.titleColor,fontFamily:l.medium}],children:"Max Slippage"}),jsxRuntime.jsxs(reactNative.Text,{style:[v.infoCardValue,{color:f.card.titleColor,fontFamily:l.medium}],children:[Bt.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[v.infoCardDescription,{color:f.card.descriptionColor,fontFamily:l.regular}],children:"Max slippage is the maximum price difference you're willing to accept between when you submit a transaction and when it executes. Your transaction will revert if the price moves beyond this threshold."})]})]})]}),j&&jsxRuntime.jsx(Ur,{visible:oo,status:j.status,tokenIconUrl:j.destination_token_metadata?.icon_urls?.find(ne=>ne.format==="png")?.url||j.destination_token_metadata?.icon_url||Re(Ze,"png"),explorerUrl:j.explorer_url,completionExplorerUrl:j.destination_explorer_url,date:j.created_at?new Date(j.created_at):void 0,amountUsd:j.source_amount_usd?parseFloat(j.source_amount_usd):void 0,onClose:()=>ce(false),borderTopLeftRadius:y?.depositStatus?.borderTopLeftRadius??b,borderTopRightRadius:y?.depositStatus?.borderTopRightRadius??p})]})}var v=reactNative.StyleSheet.create({container:{flex:1,paddingHorizontal:16},loadingContainer:{padding:40,alignItems:"center",gap:12},loadingText:{fontSize:14},errorContainer:{padding:40,alignItems:"center",gap:8},errorText:{fontSize:14,textAlign:"center"},errorHint:{fontSize:12,textAlign:"center"},selectorSection:{marginBottom:12},selectorLabel:{fontSize:12,marginBottom:8},tokenSelectorButton:{flexDirection:"row",alignItems:"center",gap:12,padding:12},tokenSelectorLoading:{flexDirection:"row",alignItems:"center",gap:12,flex:1},loadingIcon:{width:40,height:40,borderRadius:20},loadingTextContainer:{flex:1},loadingLine:{height:12,borderRadius:6},tokenIconWrapper:{position:"relative"},tokenMainIcon:{width:40,height:40,borderRadius:20},tokenChainBadge:{position:"absolute",bottom:-4,right:-4,width:20,height:20,borderRadius:10,borderWidth:2},tokenSelectorInfo:{flex:1},tokenSelectorSymbol:{fontSize:14,fontWeight:"500"},tokenSelectorNetwork:{fontSize:12,marginTop:2},tokenSelectorRight:{flexDirection:"row",alignItems:"center",gap:8},minDepositText:{fontSize:12,fontWeight:"500"},qrContainer:{alignItems:"center",marginVertical:8},qrWrapper:{padding:16},qrLoading:{width:160,height:160,alignItems:"center",justifyContent:"center"},addressSection:{marginBottom:16},addressHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},addressLabel:{fontSize:12},copiedIndicator:{flexDirection:"row",alignItems:"center",gap:4},copiedText:{fontSize:12,fontWeight:"500"},addressBox:{position:"relative",paddingHorizontal:12,paddingVertical:16},addressText:{fontSize:12,fontFamily:"monospace"},addressCopyIcon:{position:"absolute",right:12,top:0,bottom:0,justifyContent:"center"},detailsCard:{borderRadius:8,padding:4,marginBottom:16},detailsHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,paddingLeft:8,paddingRight:8},detailsContent:{paddingRight:12,paddingLeft:8,paddingBottom:12,gap:10},detailsRow:{flexDirection:"row",alignItems:"center",gap:8},detailIcon:{width:24,height:24,borderRadius:12,alignItems:"center",justifyContent:"center"},detailsLabel:{fontSize:13},chevronContainer:{},termsContainer:{alignItems:"center",paddingVertical:8},termsText:{fontSize:12,textDecorationLine:"underline"},sheetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},sheetHeaderSpacer:{width:28},sheetTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},sheetCloseButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},infoSheetContent:{paddingHorizontal:16,paddingBottom:32,gap:16},infoCard:{borderRadius:12,padding:16,gap:12},infoCardHeader:{flexDirection:"row",alignItems:"center",gap:10},infoCardIcon:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center"},infoCardTitle:{fontSize:15,fontWeight:"600",flex:1},infoCardValue:{fontSize:15,fontWeight:"600"},infoCardDescription:{fontSize:13,lineHeight:20}});var Lo={transferCrypto:{title:"Transfer Crypto",subtitle:"No limit \u2022 Instant"},depositWithCard:{title:"Deposit with Card",subtitle:"$50,000 limit \u2022 2 min"},stripeLinkPay:{title:"Pay with Stripe Link",subtitle:"Apple Pay or Card"},depositTracker:{title:"Deposit Tracker",subtitle:"Track your deposit progress"}};function mu(){let{colors:e,components:t}=O(),o=react.useRef(new reactNative.Animated.Value(.5)).current,n=t.depositMenu.card.backgroundColor,r=e.cardHover;react.useEffect(()=>{let s=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(o,{toValue:1,duration:800,useNativeDriver:true}),reactNative.Animated.timing(o,{toValue:.5,duration:800,useNativeDriver:true})]));return s.start(),()=>s.stop()},[o]);let i=({rightIcons:s=2})=>jsxRuntime.jsxs(reactNative.View,{style:[Go.card,{backgroundColor:n,borderRadius:t.depositMenu.card.borderRadius}],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[Go.leftIcon,{backgroundColor:r,opacity:o,borderRadius:t.depositMenu.card.iconContainerBorderRadius}]}),jsxRuntime.jsxs(reactNative.View,{style:Go.textBlock,children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[Go.titleBar,{backgroundColor:r,opacity:o}]}),jsxRuntime.jsx(reactNative.Animated.View,{style:[Go.subtitleBar,{backgroundColor:r,opacity:o}]})]}),jsxRuntime.jsx(reactNative.View,{style:Go.rightIcons,children:Array.from({length:s}).map((c,d)=>jsxRuntime.jsx(reactNative.Animated.View,{style:[Go.rightIcon,{backgroundColor:r,opacity:o}]},d))})]});return jsxRuntime.jsxs(reactNative.View,{style:Go.container,children:[jsxRuntime.jsx(i,{rightIcons:3}),jsxRuntime.jsx(i,{rightIcons:2}),jsxRuntime.jsx(i,{rightIcons:0})]})}var Go=reactNative.StyleSheet.create({container:{paddingTop:8,paddingBottom:24,gap:8},card:{marginHorizontal:16,flexDirection:"row",alignItems:"center",paddingVertical:16,paddingHorizontal:12,gap:12},leftIcon:{width:36,height:36},textBlock:{flex:1,gap:6},titleBar:{height:12,width:"70%",borderRadius:6},subtitleBar:{height:10,width:"50%",borderRadius:5},rightIcons:{flexDirection:"row",alignItems:"center",gap:4},rightIcon:{width:20,height:20,borderRadius:10}});function fu({visible:e,onClose:t,externalUserId:o,publishableKey:n,modalTitle:r="Deposit",destinationTokenSymbol:i,recipientAddress:s,destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,defaultChainType:a,defaultChainId:g,defaultTokenAddress:T,showBalance:C=false,hideDepositTracker:h=false,enableStripeLinkPay:b=false,StripeOnrampComponent:p,stripeOnrampEmail:y,stripeOnrampPhone:m,stripeMerchantIdentifier:l,stripeTheme:f,depositConfirmationMode:R="auto_ui",transferInputVariant:S="double_input",onDepositSuccess:A,onDepositError:B,sheetBorderRadius:k}){let J=k?.globalBorderTopLeftRadius,q=k?.globalBorderTopRightRadius,{colors:M,fonts:H}=O(),[X,U]=react.useState([]),[Qe,We]=react.useState(false),[Ge,ee]=react.useState(false),[Te,Ae]=react.useState(false),[xe,Oe]=react.useState(false),[te,Ee]=react.useState(null),[it,st]=react.useState("amount"),{isAllowed:dt,isLoading:at}=Tn(n,e);react.useEffect(()=>{if(!e||te)return;let Ce=false;return on(n).then(async bt=>{if(Ce)return;let Xe=[];for(let ut of bt?.transfer_crypto?.networks??[]){let de=ut.icon_urls.find(et=>et.format==="png")?.url||ut.icon_urls.find(et=>et.format==="svg")?.url;de&&Xe.push(se(de));}for(let ut of bt?.payment_networks?.networks??[]){let de=ut.icon_urls.find(et=>et.format==="png")?.url||ut.icon_urls.find(et=>et.format==="svg")?.url;de&&Xe.push(se(de));}Xe.length>0&&await Zi(Xe),Ce||Ee(bt);}).catch(console.error),()=>{Ce=true;}},[e,te,n]);let Ct=()=>{t();},Je=X.filter(Ce=>Ce.status==="pending"||Ce.status==="waiting").length,ce=!!(s&&c&&d&&u&&n)&&C!==false&&!!te,j=at||e&&!te,_e=dt===false,Kt=null;if(xe&&p){let Ce=jsxRuntime.jsx(p,{publishableKey:n,email:y,phone:m,externalUserId:o,recipientAddress:s??"",destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,merchantIdentifier:l,onClose:()=>Oe(false)});Kt=f?jsxRuntime.jsx(Wr,{...f,children:Ce}):Ce;}return jsxRuntime.jsxs(Pe,{visible:e,onClose:Ct,closeOnBackdropPress:false,showHandle:false,borderTopLeftRadius:k?.main?.borderTopLeftRadius??J,borderTopRightRadius:k?.main?.borderTopRightRadius??q,children:[jsxRuntime.jsx($t,{title:r,showBack:false,onClose:Ct,showBalance:ce,balanceAddress:s,balanceChainType:c,balanceChainId:d,balanceTokenAddress:u,publishableKey:n,projectName:te?.project_name}),j&&jsxRuntime.jsx(mu,{}),!j&&_e&&jsxRuntime.jsxs(reactNative.View,{style:Oo.centeredContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[Oo.iconContainer,{backgroundColor:M.cardHover}],children:jsxRuntime.jsx(vn,{size:32,color:M.foreground,strokeWidth:1.5})}),jsxRuntime.jsx(reactNative.Text,{style:[Oo.blockedTitle,{color:M.foreground,fontFamily:H.semibold}],children:"No Tokens Available"}),jsxRuntime.jsx(reactNative.Text,{style:[Oo.blockedDescription,{color:M.foreground,opacity:.7,fontFamily:H.regular}],children:"There are no supported tokens available from your current location."})]}),!j&&!_e&&jsxRuntime.jsxs(reactNative.View,{style:Oo.optionsContainer,children:[jsxRuntime.jsx(mn,{onPress:()=>ee(true),title:Lo.transferCrypto.title,subtitle:Lo.transferCrypto.subtitle,featuredTokens:te?.transfer_crypto?.networks}),jsxRuntime.jsx(gn,{onPress:()=>Ae(true),title:Lo.depositWithCard.title,subtitle:Lo.depositWithCard.subtitle,paymentNetworks:te?.payment_networks?.networks}),b&&p&&jsxRuntime.jsx(Cn,{onPress:()=>Oe(true),title:Lo.stripeLinkPay.title,subtitle:Lo.stripeLinkPay.subtitle}),!h&&jsxRuntime.jsx(hn,{onPress:()=>We(true),title:Lo.depositTracker.title,subtitle:Lo.depositTracker.subtitle,badge:Je>0?Je:void 0})]}),jsxRuntime.jsx(gi,{visible:Qe,onClose:()=>We(false),executions:X,externalUserId:o,publishableKey:n,borderTopLeftRadius:k?.depositsTracker?.borderTopLeftRadius??J,borderTopRightRadius:k?.depositsTracker?.borderTopRightRadius??q}),jsxRuntime.jsxs(Pe,{visible:Ge,onClose:()=>ee(false),closeOnBackdropPress:false,showHandle:false,heightPercent:.9,borderTopLeftRadius:k?.transferCrypto?.borderTopLeftRadius??J,borderTopRightRadius:k?.transferCrypto?.borderTopRightRadius??q,children:[jsxRuntime.jsx($t,{title:Lo.transferCrypto.title,showBack:false,onClose:()=>ee(false),showBalance:ce,balanceAddress:s,balanceChainType:c,balanceChainId:d,balanceTokenAddress:u,publishableKey:n,projectName:te?.project_name}),jsxRuntime.jsx(reactNative.ScrollView,{style:Oo.transferScrollContainer,contentContainerStyle:Oo.scrollContent,showsVerticalScrollIndicator:false,children:S==="single_input"?jsxRuntime.jsx(Is,{externalUserId:o,publishableKey:n,recipientAddress:s,destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,destinationTokenSymbol:i,defaultChainType:a,defaultChainId:g,defaultTokenAddress:T,depositConfirmationMode:R,onExecutionsChange:U,onDepositSuccess:A,onDepositError:B,borderTopLeftRadius:J,borderTopRightRadius:q,sheetBorderRadius:{tokenSelector:k?.tokenSelector,infoSheet:k?.infoSheet,depositStatus:k?.depositStatus}}):jsxRuntime.jsx(ni,{externalUserId:o,publishableKey:n,recipientAddress:s,destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,destinationTokenSymbol:i,defaultChainType:a,defaultChainId:g,defaultTokenAddress:T,depositConfirmationMode:R,onExecutionsChange:U,onDepositSuccess:A,onDepositError:B,borderTopLeftRadius:J,borderTopRightRadius:q,sheetBorderRadius:{tokenSelector:k?.tokenSelector,chainSelector:k?.chainSelector,infoSheet:k?.infoSheet,depositStatus:k?.depositStatus}})})]}),jsxRuntime.jsxs(Pe,{visible:Te,onClose:()=>{Ae(false),st("amount");},closeOnBackdropPress:false,showHandle:false,heightPercent:.9,borderTopLeftRadius:k?.buyWithCard?.borderTopLeftRadius??J,borderTopRightRadius:k?.buyWithCard?.borderTopRightRadius??q,children:[jsxRuntime.jsx($t,{title:`Deposit ${i||"USDC"}`,showBack:it==="onramp",onBack:()=>st("amount"),onClose:()=>{Ae(false),st("amount");},showBalance:ce,balanceAddress:s,balanceChainType:c,balanceChainId:d,balanceTokenAddress:u,publishableKey:n,projectName:te?.project_name}),jsxRuntime.jsx(reactNative.View,{style:Oo.buyWithCardContainer,children:jsxRuntime.jsx(di,{externalUserId:o,publishableKey:n,destinationTokenSymbol:i,recipientAddress:s,destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,onDepositSuccess:A,onDepositError:B,view:it,onViewChange:Ce=>st(Ce),borderTopLeftRadius:J,borderTopRightRadius:q,sheetBorderRadius:{providerModal:k?.providerModal,webView:k?.webView,currencyModal:k?.currencyModal}})})]}),b&&p&&jsxRuntime.jsx(Pe,{visible:xe,onClose:()=>Oe(false),closeOnBackdropPress:false,showHandle:false,heightPercent:1,borderTopLeftRadius:0,borderTopRightRadius:0,children:jsxRuntime.jsx(reactNative.View,{style:Oo.stripeLinkPayContainer,children:Kt})})]})}function Si({theme:e="auto",...t}){return jsxRuntime.jsx(fu,{...t})}var Oo=reactNative.StyleSheet.create({optionsContainer:{paddingTop:8,paddingBottom:24,gap:8},transferScrollContainer:{flex:1},scrollContent:{paddingBottom:24},buyWithCardContainer:{flex:1},stripeLinkPayContainer:{flex:1},centeredContainer:{alignItems:"center",justifyContent:"center",paddingVertical:48,paddingHorizontal:16,minHeight:200},iconContainer:{width:64,height:64,borderRadius:32,alignItems:"center",justifyContent:"center",marginBottom:16},blockedTitle:{fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},blockedDescription:{fontSize:14,textAlign:"center",maxWidth:280,lineHeight:20}});reactNative.StyleSheet.create({base:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},text:{fontWeight:"600",textAlign:"center"},fullWidth:{width:"100%"},disabled:{opacity:.5}});reactNative.StyleSheet.create({icon:{backgroundColor:"transparent"}});var _l=react.createContext(null);function Su({children:e,publishableKey:t,config:o}){let[n,r]=react.useState(false),[i,s]=react.useState(null),c=reactNative.useColorScheme(),d=react.useRef(false);d.current||(En({publishableKey:t}),d.current=true);let u=react.useMemo(()=>{let y=o?.appearance||"dark";return y==="auto"?c==="dark"?"dark":"light":y},[o?.appearance,c]);react.useEffect(()=>{if(!t||t.trim()===""){console.error("Unifold: publishableKey is required. Please provide a valid publishable key.");return}!t.startsWith("pk_test_")&&!t.startsWith("pk_live_")&&console.warn('Unifold: publishableKey should start with "pk_test_" or "pk_live_". Please ensure you are using a valid publishable key.'),En({publishableKey:t});},[t]),react.useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]);let a=react.useRef(null),g=react.useRef(null),T=react.useCallback(y=>{g.current&&(clearTimeout(g.current),g.current=null),a.current&&(console.warn("[UnifoldProvider] A deposit is already in progress. Cancelling previous deposit."),a.current.reject({message:"Deposit cancelled - new deposit started",code:"DEPOSIT_SUPERSEDED"}),a.current=null);let m=new Promise((l,f)=>{a.current={resolve:l,reject:f};});return s(y),r(true),m},[]),C=react.useCallback(()=>{a.current&&(a.current.reject({message:"Deposit cancelled by user",code:"DEPOSIT_CANCELLED"}),a.current=null),r(false),g.current=setTimeout(()=>{s(null),g.current=null;},200);},[]),h=react.useCallback(y=>{i?.onSuccess&&i.onSuccess(y),a.current&&(a.current.resolve(y),a.current=null);},[i]),b=react.useCallback(y=>{console.error("[UnifoldProvider] Deposit error:",y),i?.onError&&i.onError(y),a.current&&(a.current.reject(y),a.current=null);},[i]),p=react.useMemo(()=>({publishableKey:t,beginDeposit:T,closeDeposit:C}),[t,T,C]);return jsxRuntime.jsx(_l.Provider,{value:p,children:jsxRuntime.jsxs(Wr,{mode:u,accentColor:o?.accentColor,theme:o?.theme,fontFamily:o?.fontFamily,fonts:o?.fonts,components:o?.components,children:[e,i&&jsxRuntime.jsx(Si,{visible:n,onClose:C,publishableKey:t,modalTitle:o?.modalTitle,externalUserId:i.externalUserId,destinationChainType:i.destinationChainType,destinationChainId:i.destinationChainId,destinationTokenSymbol:i.destinationTokenSymbol,recipientAddress:i.recipientAddress,destinationTokenAddress:i.destinationTokenAddress,defaultChainType:i.defaultChainType,defaultChainId:i.defaultChainId,defaultTokenAddress:i.defaultTokenAddress,showBalance:i.showBalance,stripeOnrampEmail:i.stripeOnrampEmail,stripeOnrampPhone:i.stripeOnrampPhone,stripeTheme:{mode:u,accentColor:o?.accentColor,theme:o?.theme,fontFamily:o?.fontFamily,fonts:o?.fonts,components:o?.components},depositConfirmationMode:i.depositConfirmationMode??"auto_ui",hideDepositTracker:o?.hideDepositTracker,transferInputVariant:o?.transferInputVariant,enableStripeLinkPay:o?.enableStripeLinkPay,stripeMerchantIdentifier:o?.stripeMerchantIdentifier,StripeOnrampComponent:o?.enableStripeLinkPay?Pa():void 0,onDepositSuccess:h,onDepositError:b,theme:u,sheetBorderRadius:o?.sheetBorderRadius})]})})}function ku(){let e=react.useContext(_l);if(!e)throw new Error("useUnifold must be used within UnifoldProvider");return e}
|
|
3
|
-
exports.AmountScreen=
|
|
1
|
+
'use strict';var on=require('react'),reactNative=require('react-native'),St=require('react-native-svg'),jsxRuntime=require('react/jsx-runtime'),stripeReactNative=require('@stripe/stripe-react-native'),df=require('expo-constants'),reactNativeGestureHandler=require('react-native-gesture-handler'),Xf=require('react-native-qrcode-svg'),reactNativeWebview=require('react-native-webview'),Wc=require('@react-native-async-storage/async-storage');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var on__namespace=/*#__PURE__*/_interopNamespace(on);var St__default=/*#__PURE__*/_interopDefault(St);var df__default=/*#__PURE__*/_interopDefault(df);var Xf__default=/*#__PURE__*/_interopDefault(Xf);var Wc__default=/*#__PURE__*/_interopDefault(Wc);var Jc=e=>{throw TypeError(e)};var Gp=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var hl=(e,t,r)=>t.has(e)||Jc("Cannot "+r);var u=(e,t,r)=>(hl(e,t,"read from private field"),r?r.call(e):t.get(e)),Q=(e,t,r)=>t.has(e)?Jc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),D=(e,t,r,o)=>(hl(e,t,"write to private field"),t.set(e,r),r),be=(e,t,r)=>(hl(e,t,"access private method"),r);var qi=(e,t,r,o)=>({set _(n){D(e,t,n);},get _(){return u(e,t,o)}});var gl={light:{background:"#FFFFFF",card:"#F8FAFC",cardHover:"#F1F5F9",foreground:"#0F172A",foregroundMuted:"#64748B",foregroundSubtle:"#94A3B8",border:"#E2E8F0",borderSecondary:"#CBD5E1",primary:"#3B82F6",primaryForeground:"#FFFFFF",success:"#22C55E",successBackground:"#DCFCE7",warning:"#F59E0B",warningBackground:"#FEF3C7",error:"#EF4444",errorBackground:"#FEE2E2",overlay:"rgba(0, 0, 0, 0.5)"},dark:{background:"#2D2C2F",card:"#3A393C",cardHover:"#48474A",foreground:"#F8FAFC",foregroundMuted:"#94A3B8",foregroundSubtle:"#64748B",border:"#38383A",borderSecondary:"#48484A",primary:"#3B82F6",primaryForeground:"#FFFFFF",success:"#22C55E",successBackground:"rgba(34, 197, 94, 0.1)",warning:"#F59E0B",warningBackground:"rgba(245, 158, 11, 0.1)",error:"#EF4444",errorBackground:"rgba(239, 68, 68, 0.1)",overlay:"rgba(0, 0, 0, 0.7)"}},yl=gl;function Ms(e,t){return t?{...e,...t,shadowOffset:t.shadowOffset??e.shadowOffset,backShadowOffset:t.backShadowOffset??e.backShadowOffset}:e}function Qi(e,t,r){let o=r?t?.[r]:void 0,n=(c,g,w)=>{let f=o?.[c]?.[g];if(f!==void 0)return f;let y=t?.[c]?.[g];return y!==void 0?y:w},i={backgroundColor:n("card","backgroundColor",e.card),titleColor:n("card","titleColor",e.foreground),subtitleColor:n("card","subtitleColor",e.foregroundMuted),labelColor:n("card","labelColor",e.foregroundMuted),headerColor:n("card","headerColor",e.foregroundMuted),labelRightColor:n("card","labelRightColor",e.foregroundMuted),labelHighlightRightColor:n("card","labelHighlightRightColor",e.warning),textRightColor:n("card","textRightColor",e.foreground),subtextRightColor:n("card","subtextRightColor",e.foregroundMuted),rowLeftLabel:n("card","rowLeftLabel",e.foregroundMuted),rowRightLabel:n("card","rowRightLabel",e.foreground),iconColor:n("card","iconColor",e.primary),iconBackgroundColor:n("card","iconBackgroundColor",e.primary+"26"),actionColor:n("card","actionColor",e.foregroundMuted),actionIcon:n("card","actionIcon",e.foregroundMuted),descriptionColor:n("card","descriptionColor",e.foregroundMuted),borderRadius:n("card","borderRadius",12),borderWidth:n("card","borderWidth",0),borderColor:n("card","borderColor",e.border),shadowColor:n("card","shadowColor","#000"),shadowOffset:n("card","shadowOffset",{width:0,height:-4}),shadowOpacity:n("card","shadowOpacity",0),shadowRadius:n("card","shadowRadius",12),elevation:n("card","elevation",0),iconContainerBorderRadius:n("card","iconContainerBorderRadius",12),backShadowColor:"transparent",backShadowOffset:{top:4,left:4,right:-4,bottom:-4},backShadowSpacing:8},s=(o?.depositMenu??t?.depositMenu)?.card,a=(o?.transferCrypto??t?.transferCrypto)?.depositAddress?.card,l=(o?.depositCard??t?.depositCard)?.quoteProvider?.card,d=(o?.depositTracker??t?.depositTracker)?.executionRow?.card;return {header:{titleColor:n("header","titleColor",e.foreground),buttonColor:n("header","buttonColor",e.foreground)},card:i,input:{backgroundColor:n("input","backgroundColor",n("search","backgroundColor",e.card)),textColor:n("input","textColor",n("search","inputColor",e.foreground)),placeholderColor:n("input","placeholderColor",n("search","placeholderColor",e.foregroundMuted)),borderColor:n("input","borderColor",e.border),borderRadius:n("input","borderRadius",n("search","borderRadius",8)),borderWidth:n("input","borderWidth",1)},button:{primaryBackground:n("button","primaryBackground",e.primary),primaryText:n("button","primaryText",e.primaryForeground),secondaryBackground:n("button","secondaryBackground",e.card),secondaryText:n("button","secondaryText",e.foreground),borderRadius:n("button","borderRadius",12),borderWidth:n("button","borderWidth",0),borderColor:n("button","borderColor",e.border)},container:{titleColor:n("container","titleColor",e.foreground),subtitleColor:n("container","subtitleColor",e.foregroundMuted),actionColor:n("container","actionColor",e.foregroundMuted),actionTitle:n("container","actionTitle",e.foregroundMuted),buttonColor:n("container","buttonColor",e.primary),buttonTitleColor:n("container","buttonTitleColor",e.primaryForeground),iconBackgroundColor:n("container","iconBackgroundColor",e.success),iconColor:n("container","iconColor",e.foreground)},search:{backgroundColor:n("search","backgroundColor",e.card),inputColor:n("search","inputColor",e.foreground),placeholderColor:n("search","placeholderColor",e.foregroundMuted),borderRadius:n("search","borderRadius",8)},list:{titleSectionColor:n("list","titleSectionColor",e.foregroundMuted),rowBorderRadius:n("list","rowBorderRadius",12)},badge:{borderRadius:n("badge","borderRadius",8)},sheet:{shadowColor:n("sheet","shadowColor","#000"),shadowOffset:n("sheet","shadowOffset",{width:0,height:-4}),shadowOpacity:n("sheet","shadowOpacity",.1),shadowRadius:n("sheet","shadowRadius",12),elevation:n("sheet","elevation",16)},depositMenu:{card:Ms(i,s)},transferCrypto:{depositAddress:{card:Ms(i,a)}},depositCard:{quoteProvider:{card:Ms(i,l)}},depositTracker:{executionRow:{card:Ms(i,d)}}}}function bl(e,t,r){let n={...gl[e]};return r&&(n.primary=r),t&&(n={...n,...t}),n}var Cl=on.createContext(null);function O(){let e=on.useContext(Cl);if(!e){let t=yl.dark;return {mode:"dark",colors:t,fonts:{regular:void 0,medium:void 0,semibold:void 0,bold:void 0},components:Qi(t,void 0,"dark"),isDark:true}}return e}function Tl({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsx(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(St.Path,{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})})}function Sl({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Rect,{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"1",y1:"10",x2:"23",y2:"10",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function jr({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Circle,{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Polyline,{points:"12 6 12 12 16 14",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ki({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Line,{x1:"19",y1:"12",x2:"5",y2:"12",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Polyline,{points:"12 19 5 12 12 5",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function tt({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Line,{x1:"18",y1:"6",x2:"6",y2:"18",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"6",y1:"6",x2:"18",y2:"18",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Br({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsx(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(St.Polyline,{points:"9 18 15 12 9 6",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xc({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsx(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(St.Polyline,{points:"15 18 9 12 15 6",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})})}function yt({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsx(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(St.Polyline,{points:"6 9 12 15 18 9",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})})}function Cn({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Rect,{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ae({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsx(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(St.Polyline,{points:"20 6 9 17 4 12",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})})}function Gi({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Circle,{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"12",y1:"8",x2:"12",y2:"12",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"12",y1:"16",x2:"12.01",y2:"16",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function kl({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Line,{x1:"12",y1:"2",x2:"12",y2:"6",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"12",y1:"18",x2:"12",y2:"22",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"2",y1:"12",x2:"6",y2:"12",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"18",y1:"12",x2:"22",y2:"12",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function $r({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Path,{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Polyline,{points:"15 3 21 3 21 9",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"10",y1:"14",x2:"21",y2:"3",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ho({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Line,{x1:"12",y1:"1",x2:"12",y2:"23",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function zs({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Path,{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Polyline,{points:"14 2 14 8 20 8",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"16",y1:"13",x2:"8",y2:"13",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"16",y1:"17",x2:"8",y2:"17",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Polyline,{points:"10 9 9 9 8 9",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function qr({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsx(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(St.Polyline,{points:"18 15 12 9 6 15",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})})}function Us({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Polyline,{points:"23 4 23 10 17 10",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Polyline,{points:"1 20 1 14 7 14",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ri({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Circle,{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"12",y1:"16",x2:"12",y2:"12",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"12",y1:"8",x2:"12.01",y2:"8",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function No({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Path,{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M9 12l2 2 4-4",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Hs({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Path,{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ns({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Path,{d:"M5.43 5.43A8.06 8.06 0 0 0 4 10c0 6 8 12 8 12a29.94 29.94 0 0 0 5-5",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M19.18 13.52A8.66 8.66 0 0 0 20 10a8 8 0 0 0-8-8 7.88 7.88 0 0 0-3.52.82",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M9.13 9.13A2.78 2.78 0 0 0 9 10a3 3 0 0 0 3 3 2.78 2.78 0 0 0 .87-.13",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M14.9 9.25a3 3 0 0 0-2.15-2.16",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Line,{x1:"2",y1:"2",x2:"22",y2:"22",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ed({size:e=24,color:t="#fff",strokeWidth:r=2}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(St.Path,{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M11 14h10",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(St.Path,{d:"M17 10l4 4-4 4",stroke:t,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"})]})}function rd({size:e=28}){return jsxRuntime.jsx(St__default.default,{width:e,height:e,viewBox:"0 0 28 28",fill:"none",children:jsxRuntime.jsxs(St.G,{fillRule:"evenodd",children:[jsxRuntime.jsx(St.Path,{fill:"#0052FF",fillRule:"nonzero",d:"M14 28a14 14 0 1 0 0-28 14 14 0 0 0 0 28"}),jsxRuntime.jsx(St.Path,{fill:"#FFF",d:"M13.967 23.86c5.445 0 9.86-4.415 9.86-9.86s-4.415-9.86-9.86-9.86c-5.166 0-9.403 3.974-9.825 9.03h14.63v1.642H4.142c.413 5.065 4.654 9.047 9.826 9.047Z"})]})})}function nd({size:e=28}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 28 28",fill:"none",children:[jsxRuntime.jsxs(St.G,{clipPath:"url(#eth_clip)",children:[jsxRuntime.jsx(St.Path,{d:"M14 28C21.732 28 28 21.732 28 14C28 6.26801 21.732 0 14 0C6.26801 0 0 6.26801 0 14C0 21.732 6.26801 28 14 28Z",fill:"#627EEA"}),jsxRuntime.jsx(St.Path,{d:"M14.4357 3.5V11.2612L20.9956 14.1925L14.4357 3.5Z",fill:"white",fillOpacity:.602}),jsxRuntime.jsx(St.Path,{d:"M14.4357 3.5L7.875 14.1925L14.4357 11.2612V3.5Z",fill:"white"}),jsxRuntime.jsx(St.Path,{d:"M14.4357 19.222V24.4956L21 15.414L14.4357 19.222Z",fill:"white",fillOpacity:.602}),jsxRuntime.jsx(St.Path,{d:"M14.4357 24.4956V19.2211L7.875 15.414L14.4357 24.4956Z",fill:"white"}),jsxRuntime.jsx(St.Path,{d:"M14.4357 18.0014L20.9956 14.1925L14.4357 11.263V18.0014Z",fill:"white",fillOpacity:.2}),jsxRuntime.jsx(St.Path,{d:"M7.875 14.1925L14.4357 18.0014V11.263L7.875 14.1925Z",fill:"white",fillOpacity:.602})]}),jsxRuntime.jsx(St.Defs,{children:jsxRuntime.jsx(St.ClipPath,{id:"eth_clip",children:jsxRuntime.jsx(St.Rect,{width:28,height:28,fill:"white"})})})]})}function ad({size:e=28}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 28 28",fill:"none",children:[jsxRuntime.jsxs(St.G,{clipPath:"url(#btc_clip)",children:[jsxRuntime.jsx(St.Path,{d:"M14 28C21.732 28 28 21.732 28 14C28 6.26801 21.732 0 14 0C6.26801 0 0 6.26801 0 14C0 21.732 6.26801 28 14 28Z",fill:"#F7931A"}),jsxRuntime.jsx(St.Path,{d:"M20.0594 12.1625C20.3438 10.2594 18.9 9.23124 16.9203 8.55311L17.5656 5.97186L15.9906 5.57811L15.3672 8.09374C14.9516 7.9953 14.525 7.89686 14.0985 7.79843L14.7328 5.27186L13.1578 4.87811L12.5125 7.45936C12.1735 7.3828 11.8344 7.30624 11.5063 7.22968V7.21874L9.34065 6.67186L8.92502 8.35624C8.92502 8.35624 10.0844 8.61874 10.0625 8.64061C10.6969 8.79374 10.8063 9.2203 10.7844 9.54843L10.0625 12.4578C10.1063 12.4687 10.161 12.4797 10.2266 12.5125C10.1828 12.5016 10.1281 12.4906 10.0735 12.4687L9.05627 16.5375C8.97971 16.7344 8.78284 17.0187 8.34534 16.9094C8.36721 16.9312 7.20784 16.625 7.20784 16.625L6.43127 18.4297L8.47659 18.9437C8.8594 19.0422 9.23127 19.1406 9.59221 19.2281L8.9469 21.8422L10.5219 22.2359L11.1672 19.6547C11.5938 19.775 12.0094 19.8734 12.4141 19.9828L11.7688 22.5531L13.3438 22.9469L13.9891 20.3328C16.6578 20.8359 18.6594 20.6281 19.5016 18.2219C20.1797 16.2859 19.4688 15.1703 18.0688 14.4375C19.086 14.2078 19.8516 13.5406 20.0594 12.1625ZM16.4938 17.1609C16.0125 19.0969 12.7531 18.0469 11.6922 17.7844L12.5453 14.35C13.6063 14.6125 16.9969 15.1484 16.4938 17.1609ZM16.975 12.1297C16.5375 13.8906 13.825 12.9937 12.95 12.775L13.7266 9.6578C14.6016 9.87655 17.4344 10.2812 16.975 12.1297Z",fill:"white"})]}),jsxRuntime.jsx(St.Defs,{children:jsxRuntime.jsx(St.ClipPath,{id:"btc_clip",children:jsxRuntime.jsx(St.Rect,{width:28,height:28,fill:"white"})})})]})}function ld({size:e=28}){return jsxRuntime.jsxs(St__default.default,{width:e,height:e,viewBox:"0 0 256 256",fill:"none",children:[jsxRuntime.jsxs(St.Defs,{children:[jsxRuntime.jsxs(St.LinearGradient,{id:"sol1",x1:"360.9",y1:"-37.5",x2:"141.2",y2:"383.3",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx(St.Stop,{offset:"0",stopColor:"#00FFA3"}),jsxRuntime.jsx(St.Stop,{offset:"1",stopColor:"#DC1FFF"})]}),jsxRuntime.jsxs(St.LinearGradient,{id:"sol2",x1:"264.8",y1:"-87.6",x2:"45.16",y2:"333.15",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx(St.Stop,{offset:"0",stopColor:"#00FFA3"}),jsxRuntime.jsx(St.Stop,{offset:"1",stopColor:"#DC1FFF"})]}),jsxRuntime.jsxs(St.LinearGradient,{id:"sol3",x1:"312.55",y1:"-62.69",x2:"92.88",y2:"358.06",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx(St.Stop,{offset:"0",stopColor:"#00FFA3"}),jsxRuntime.jsx(St.Stop,{offset:"1",stopColor:"#DC1FFF"})]})]}),jsxRuntime.jsx(St.Circle,{cx:128,cy:128,r:128,fill:"black"}),jsxRuntime.jsxs(St.G,{transform:"translate(128,128) scale(0.35) translate(-198.85,-156)",children:[jsxRuntime.jsx(St.Path,{fill:"url(#sol2)",d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z"}),jsxRuntime.jsx(St.Path,{fill:"url(#sol3)",d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4c5.8,0,8.7-7,4.6-11.1L333.1,120.1z"}),jsxRuntime.jsx(St.Path,{fill:"url(#sol1)",d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z"})]})]})}function cd({size:e=28}){return jsxRuntime.jsx(St__default.default,{width:e,height:e,viewBox:"0 0 32 32",fill:"none",children:jsxRuntime.jsxs(St.G,{children:[jsxRuntime.jsx(St.Circle,{cx:16,cy:16,r:16,fill:"#6F41D8"}),jsxRuntime.jsx(St.Path,{fill:"#FFF",d:"M21.092 12.693c-.369-.215-.848-.215-1.254 0l-2.879 1.654-1.955 1.078-2.879 1.653c-.369.216-.848.216-1.254 0l-2.288-1.294c-.369-.215-.627-.61-.627-1.042V12.19c0-.431.221-.826.627-1.042l2.25-1.258c.37-.216.85-.216 1.256 0l2.25 1.258c.37.216.628.611.628 1.042v1.654l1.955-1.115v-1.653a1.16 1.16 0 0 0-.627-1.042l-4.17-2.372c-.369-.216-.848-.216-1.254 0l-4.244 2.372A1.16 1.16 0 0 0 6 11.076v4.78c0 .432.221.827.627 1.043l4.244 2.372c.369.215.849.215 1.254 0l2.879-1.618 1.955-1.114 2.879-1.617c.369-.216.848-.216 1.254 0l2.251 1.258c.37.215.627.61.627 1.042v2.552c0 .431-.22.826-.627 1.042l-2.25 1.294c-.37.216-.85.216-1.255 0l-2.251-1.258c-.37-.216-.628-.611-.628-1.042v-1.654l-1.955 1.115v1.653c0 .431.221.827.627 1.042l4.244 2.372c.369.216.848.216 1.254 0l4.244-2.372c.369-.215.627-.61.627-1.042v-4.78a1.16 1.16 0 0 0-.627-1.042l-4.28-2.409z"})]})})}var ii=[{label:"Base",value:stripeReactNative.Onramp.CryptoNetwork.base,defaultCrypto:"usdc",Icon:rd},{label:"Ethereum",value:stripeReactNative.Onramp.CryptoNetwork.ethereum,defaultCrypto:"eth",Icon:nd},{label:"Bitcoin",value:stripeReactNative.Onramp.CryptoNetwork.bitcoin,defaultCrypto:"btc",Icon:ad},{label:"Solana",value:stripeReactNative.Onramp.CryptoNetwork.solana,defaultCrypto:"sol",Icon:ld},{label:"Polygon",value:stripeReactNative.Onramp.CryptoNetwork.polygon,defaultCrypto:"matic",Icon:cd}];function dd(e,t=8,r=4){let o=e.trim();return o.length<=t+r+3?o:`${o.slice(0,t)}...${o.slice(-r)}`}function js(e,t){let r=parseFloat(e);if(isNaN(r))return e;let o=t.toLowerCase(),n=["eth","btc"].includes(o)?4:2;return r.toFixed(n)}function $s(e){let t=e.trim().toLowerCase();if(!t)return e.trim();let r=ii.find(n=>n.label.toLowerCase()===t);if(r)return r.label;let o=ii.find(n=>String(n.value).toLowerCase()===t);return o?o.label:e.trim()}function It({onPress:e,title:t}){let{components:r,fonts:o}=O(),n=jsxRuntime.jsx(reactNative.TouchableOpacity,{style:si.closeBtn,onPress:e,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:"Close",children:jsxRuntime.jsx(tt,{size:20,color:r.header.buttonColor,strokeWidth:2})});return t?jsxRuntime.jsxs(reactNative.View,{style:si.headerWithTitle,children:[jsxRuntime.jsx(reactNative.View,{style:si.headerSide}),jsxRuntime.jsx(reactNative.Text,{style:[si.headerTitleText,{color:r.header.titleColor},...o.bold?[{fontFamily:o.bold}]:[]],numberOfLines:1,ellipsizeMode:"tail",accessibilityRole:"header",children:t}),n]}):jsxRuntime.jsxs(reactNative.View,{style:si.header,children:[jsxRuntime.jsx(reactNative.View,{style:si.headerSpacer}),n]})}var qs={paddingTop:60,paddingBottom:16},si=reactNative.StyleSheet.create({header:{flexDirection:"row",justifyContent:"flex-end",...qs},headerWithTitle:{flexDirection:"row",alignItems:"center",...qs},headerSpacer:{flex:1},headerSide:{width:28},headerTitleText:{flex:1,textAlign:"center",fontSize:17},closeBtn:{width:28,height:28,borderRadius:8,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"}});function Kt({error:e,progress:t,loading:r}){let{colors:o,fonts:n}=O();return e?jsxRuntime.jsx(reactNative.Text,{style:[ud.errorText,{color:o.error},...n.regular?[{fontFamily:n.regular}]:[]],children:e.message}):t&&r&&__DEV__?jsxRuntime.jsx(reactNative.Text,{style:[ud.progressText,{color:o.foregroundSubtle},...n.regular?[{fontFamily:n.regular}]:[]],children:t}):null}var ud=reactNative.StyleSheet.create({errorText:{fontSize:14,textAlign:"center",lineHeight:20,marginTop:24},progressText:{fontSize:13,textAlign:"center",lineHeight:18,marginTop:24}});function jo({quote:e,label:t,value:r,mono:o,last:n}){return jsxRuntime.jsxs(on.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:e.row,children:[jsxRuntime.jsx(reactNative.Text,{style:e.rowLabel,children:t}),jsxRuntime.jsx(reactNative.Text,{style:[e.rowValue,o&&e.rowMono],children:r})]}),n?null:jsxRuntime.jsx(reactNative.View,{style:e.rowDivider})]})}function Il({quote:e,label:t,address:r,last:o}){let[n,i]=on.useState(false),{colors:s,components:a}=O(),l=()=>{reactNative.Clipboard.setString(r),i(true),setTimeout(()=>i(false),2e3);},d=dd(r);return jsxRuntime.jsxs(on.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:e.row,children:[jsxRuntime.jsx(reactNative.Text,{style:e.rowLabel,children:t}),jsxRuntime.jsxs(reactNative.View,{style:e.rowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[e.rowValue,e.rowMono,{flexShrink:1,minWidth:0}],numberOfLines:1,ellipsizeMode:"middle",selectable:true,children:d}),jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:l,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:`Copy ${t}`,children:n?jsxRuntime.jsx(Ae,{size:14,color:s.success,strokeWidth:2.5}):jsxRuntime.jsx(Cn,{size:14,color:a.card.actionIcon,strokeWidth:2})})]})]}),o?null:jsxRuntime.jsx(reactNative.View,{style:e.rowDivider})]})}function ai(){let{colors:e,fonts:t,components:r}=O(),o=r.input,n=r.button,i=r.container,s=r.card,a=r.header;return on.useMemo(()=>{let l=s.borderRadius,d=reactNative.Platform.OS==="ios"?"Menlo":"monospace",c={flex:{flex:1},screen:{flex:1,backgroundColor:e.background,paddingHorizontal:24,paddingBottom:48},content:{flex:1,paddingTop:16},title:{fontSize:28,color:a.titleColor,marginBottom:8,...t.bold?{fontFamily:t.bold}:{}},subtitle:{fontSize:15,color:e.foregroundMuted,marginBottom:36,lineHeight:22,...t.regular?{fontFamily:t.regular}:{}},fieldWrap:{marginBottom:20},fieldLabel:{fontSize:13,color:e.foregroundSubtle,marginBottom:8,textTransform:"uppercase",letterSpacing:.5,...t.semibold?{fontFamily:t.semibold}:{}},input:{backgroundColor:o.backgroundColor,borderRadius:o.borderRadius,padding:16,fontSize:17,color:o.textColor,borderWidth:o.borderWidth,borderColor:o.borderColor,...t.regular?{fontFamily:t.regular}:{}},hint:{fontSize:12,color:e.foregroundSubtle,marginTop:8,...t.regular?{fontFamily:t.regular}:{}},emailRow:{flexDirection:"row",alignItems:"center",gap:6,marginTop:4,backgroundColor:e.card,paddingHorizontal:14,paddingVertical:10,borderRadius:Math.min(l,12)},emailLabel:{fontSize:13,color:e.foregroundSubtle,...t.regular?{fontFamily:t.regular}:{}},emailValue:{fontSize:13,color:e.foreground,...t.semibold?{fontFamily:t.semibold}:{}},footer:{gap:4},continueBtn:{backgroundColor:i.buttonColor,borderRadius:n.borderRadius,paddingVertical:18,alignItems:"center"},continueBtnDisabled:{backgroundColor:e.card},continueBtnText:{color:i.buttonTitleColor,fontSize:17,...t.bold?{fontFamily:t.bold}:{}},continueBtnTextDisabled:{color:e.foregroundSubtle,...t.regular?{fontFamily:t.regular}:{}},ghostBtn:{paddingVertical:16,alignItems:"center"},ghostBtnText:{color:e.foregroundMuted,fontSize:15,...t.medium?{fontFamily:t.medium}:{}},loaderInButton:{justifyContent:"center",alignItems:"center"}},g={amountContainer:{flex:1,alignItems:"center",justifyContent:"center",gap:8},amountText:{fontSize:64,color:e.foreground,letterSpacing:-2,minWidth:80,textAlign:"center",...t.regular?{fontFamily:t.regular}:{}},amountPlaceholder:{color:e.foregroundSubtle},currencyLabel:{fontSize:15,color:e.foregroundMuted,letterSpacing:1,...t.medium?{fontFamily:t.medium}:{}},numpad:{gap:4,marginBottom:24},numpadRow:{flexDirection:"row",justifyContent:"space-between"},numpadKey:{flex:1,height:68,alignItems:"center",justifyContent:"center",marginHorizontal:4},numpadKeyText:{fontSize:28,color:e.foreground,...t.regular?{fontFamily:t.regular}:{}},backspaceText:{fontSize:22,color:e.foregroundMuted,...t.regular?{fontFamily:t.regular}:{}}},w={heroBox:{backgroundColor:s.backgroundColor,borderRadius:l,padding:24,alignItems:"center",marginBottom:16,marginTop:8,borderWidth:s.borderWidth,borderColor:s.borderColor,gap:4},heroLabel:{fontSize:12,color:e.foregroundSubtle,letterSpacing:.5,textTransform:"uppercase",...t.semibold?{fontFamily:t.semibold}:{}},heroAmount:{fontSize:48,color:e.foreground,letterSpacing:-1,...t.bold?{fontFamily:t.bold}:{}},heroCurrency:{fontSize:22,color:e.primary,...t.medium?{fontFamily:t.medium}:{}},heroNetwork:{fontSize:15,color:e.foregroundSubtle,marginTop:2,...t.medium?{fontFamily:t.medium}:{}},card:{backgroundColor:s.backgroundColor,borderRadius:l,borderWidth:s.borderWidth,borderColor:s.borderColor,overflow:"hidden",marginBottom:12},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:14,paddingHorizontal:16},rowRight:{flex:1,minWidth:0,flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:8},rowDivider:{height:1,marginHorizontal:16,backgroundColor:e.border},rowLabel:{fontSize:14,color:s.rowLeftLabel,...t.regular?{fontFamily:t.regular}:{}},rowValue:{fontSize:14,fontWeight:"500",color:s.rowRightLabel,...t.medium?{fontFamily:t.medium}:{}},rowMono:{fontFamily:d,fontSize:13}},f=Math.max(16,Math.min(l,22)),y={stackWrapper:{width:"100%",marginBottom:8,marginTop:4},swapCard:{backgroundColor:e.card,borderWidth:s.borderWidth,borderColor:e.border,paddingHorizontal:16,paddingVertical:16},swapCardTop:{borderTopLeftRadius:f,borderTopRightRadius:f,borderBottomLeftRadius:10,borderBottomRightRadius:10},swapCardBottom:{borderBottomLeftRadius:f,borderBottomRightRadius:f,borderTopLeftRadius:10,borderTopRightRadius:10,marginTop:16},swapConnectorWrap:{alignSelf:"center",zIndex:3,marginTop:-24,marginBottom:-32},swapConnectorCircle:{width:48,height:48,borderRadius:24,backgroundColor:e.primary,alignItems:"center",justifyContent:"center",borderWidth:4,borderColor:e.background},swapRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:8,gap:12},swapLeftCol:{flex:1,minWidth:0},swapSpendAmount:{fontSize:40,color:e.foreground,letterSpacing:-1,...t.regular?{fontFamily:t.regular}:{}},swapReceivePrimary:{fontSize:40,color:e.foreground,letterSpacing:-1,...t.regular?{fontFamily:t.regular}:{}},swapReceiveSub:{fontSize:13,color:e.foregroundMuted,marginTop:4,...t.regular?{fontFamily:t.regular}:{}},swapPill:{flexDirection:"row",alignItems:"center",gap:6,paddingVertical:10,paddingHorizontal:14,borderRadius:999,backgroundColor:e.cardHover,borderWidth:s.borderWidth,borderColor:e.border},swapPillText:{fontSize:16,color:e.foreground,...t.semibold?{fontFamily:t.semibold}:{}},payHint:{fontSize:15,color:e.foregroundMuted,textAlign:"center",marginBottom:18,marginTop:4,...t.regular?{fontFamily:t.regular}:{}},summaryLabel:{fontSize:12,color:e.foregroundSubtle,textTransform:"uppercase",letterSpacing:.3,...t.semibold?{fontFamily:t.semibold}:{}},applePayBtn:{backgroundColor:n.secondaryBackground,borderRadius:n.borderRadius,borderWidth:n.borderWidth>0?n.borderWidth:1,borderColor:n.borderWidth>0?n.borderColor:e.border,paddingVertical:18,alignItems:"center",marginBottom:10},applePayBtnText:{color:n.secondaryText,fontSize:17,...t.bold?{fontFamily:t.bold}:{}}},b={input:{fontSize:14,fontFamily:d},list:{gap:8},row:{flexDirection:"row",alignItems:"center",paddingVertical:14,paddingHorizontal:16,borderRadius:Math.min(l,14),borderWidth:s.borderWidth,borderColor:e.border,backgroundColor:e.card},rowSelected:{borderColor:e.primary,backgroundColor:e.successBackground},iconWrap:{width:32,height:32,alignItems:"center",justifyContent:"center",marginRight:12},rowText:{flex:1,fontSize:15,color:e.foregroundMuted,...t.medium?{fontFamily:t.medium}:{}},rowTextSelected:{color:e.foreground,...t.semibold?{fontFamily:t.semibold}:{}},checkCircle:{width:24,height:24,borderRadius:12,backgroundColor:e.primary,alignItems:"center",justifyContent:"center"}},m={centered:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:24},spinnerWrap:{width:80,height:80,borderRadius:40,backgroundColor:e.card,borderWidth:s.borderWidth,borderColor:e.border,alignItems:"center",justifyContent:"center",marginBottom:28},idIcon:{fontSize:36},checkCircle:{width:80,height:80,borderRadius:40,backgroundColor:e.successBackground,borderWidth:2,borderColor:e.success,alignItems:"center",justifyContent:"center",marginBottom:28},heading:{fontSize:28,color:a.titleColor,textAlign:"center",marginBottom:10,...t.bold?{fontFamily:t.bold}:{}},sub:{fontSize:15,color:e.foregroundMuted,textAlign:"center",lineHeight:22,marginBottom:36,...t.regular?{fontFamily:t.regular}:{}},successScrollContent:{flexGrow:1,width:"100%",alignItems:"center",paddingBottom:24},detailCard:{width:"100%"}};return {form:c,quote:w,pm:y,wallet:b,flow:m,amount:g}},[e,t,o,n,i,s,a])}var _m=[["1","2","3"],["4","5","6"],["7","8","9"],["\u232B","0","."]];function Gs({initialAmount:e="",currency:t="USD",onConfirm:r,onCancel:o}){let n=ai(),[i,s]=on.useState(e),a=g=>{if(g==="\u232B"){s(w=>w.slice(0,-1));return}if(g==="."){if(i.includes("."))return;s(w=>w===""?"0.":w+".");return}s(w=>{let f=w.indexOf(".");return f!==-1&&w.length-f>2?w:w==="0"&&g!=="."?g:w+g});},l=i===""?"0":i,d=parseFloat(i),c=i!==""&&!isNaN(d)&&d>0;return jsxRuntime.jsxs(reactNative.View,{style:n.form.screen,children:[jsxRuntime.jsx(It,{onPress:o,title:"Enter amount"}),jsxRuntime.jsxs(reactNative.View,{style:n.form.content,children:[jsxRuntime.jsxs(reactNative.View,{style:n.amount.amountContainer,children:[jsxRuntime.jsxs(reactNative.Text,{style:[n.amount.amountText,l==="0"&&n.amount.amountPlaceholder],adjustsFontSizeToFit:true,numberOfLines:1,children:["$",l]}),jsxRuntime.jsx(reactNative.Text,{style:n.amount.currencyLabel,children:t.toUpperCase()})]}),jsxRuntime.jsx(reactNative.View,{style:n.amount.numpad,children:_m.map((g,w)=>jsxRuntime.jsx(reactNative.View,{style:n.amount.numpadRow,children:g.map(f=>jsxRuntime.jsx(reactNative.TouchableOpacity,{style:n.amount.numpadKey,onPress:()=>a(f),activeOpacity:.6,children:jsxRuntime.jsx(reactNative.Text,{style:f==="\u232B"?n.amount.backspaceText:n.amount.numpadKeyText,children:f})},f))},w))}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[n.form.continueBtn,!c&&n.form.continueBtnDisabled],onPress:()=>c&&r(i),disabled:!c,children:jsxRuntime.jsx(reactNative.Text,{style:[n.form.continueBtnText,!c&&n.form.continueBtnTextDisabled],children:"Continue"})})]})]})}function it({size:e=56,strokeWidth:t=3,children:r,iconSize:o,style:n,gradientFrom:i,gradientTo:s}){let{colors:a}=O(),l=i??a.warning,d=s??"#FBBF24",c=on.useRef(new reactNative.Animated.Value(0)).current,g=on.useId(),w=on.useMemo(()=>`circularProgressGrad_${g.replace(/[^a-zA-Z0-9_-]/g,"")}`,[g]),f=(e-t)/2,y=2*Math.PI*f,b=e/2,m=o??Math.max(0,Math.round(e-t*2-8)),S=(e-m)/2;on.useEffect(()=>{let p=reactNative.Animated.loop(reactNative.Animated.timing(c,{toValue:1,duration:1500,easing:reactNative.Easing.linear,useNativeDriver:true}));return p.start(),()=>p.stop()},[c]);let h=c.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return jsxRuntime.jsxs(reactNative.View,{style:[{width:e,height:e},n],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",top:0,left:0,width:e,height:e,transform:[{rotate:h}]},children:jsxRuntime.jsxs(St__default.default,{width:e,height:e,children:[jsxRuntime.jsx(St.Defs,{children:jsxRuntime.jsxs(St.LinearGradient,{id:w,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[jsxRuntime.jsx(St.Stop,{offset:"0%",stopColor:l}),jsxRuntime.jsx(St.Stop,{offset:"100%",stopColor:d})]})}),jsxRuntime.jsx(St.Circle,{cx:b,cy:b,r:f,stroke:`url(#${w})`,strokeWidth:t,fill:"none",strokeDasharray:`${y*.75} ${y*.25}`,strokeLinecap:"round",rotation:-90,origin:`${b}, ${b}`})]})}),r!=null?jsxRuntime.jsx(reactNative.View,{style:{position:"absolute",top:S+1.5,left:S,width:m,height:m},children:r}):null]})}var Xi=4;function Js({initialData:e={},loading:t=false,onComplete:r,onCancel:o}){let n=ai(),{colors:i,fonts:s,components:a}=O(),l=a.input.placeholderColor,[d,c]=on.useState(1),[g,w]=on.useState(e.firstName??""),[f,y]=on.useState(e.lastName??""),[b,m]=on.useState(e.dobMonth??""),[S,h]=on.useState(e.dobDay??""),[p,T]=on.useState(e.dobYear??""),[x,_]=on.useState(e.addressLine1??""),[F,k]=on.useState(e.addressLine2??""),[C,B]=on.useState(e.city??""),[E,L]=on.useState(e.state??""),[R,H]=on.useState(e.postalCode??""),[V,we]=on.useState(e.country??"US"),[We,Xe]=on.useState(e.idNumber??""),ee=on.useRef(null),ye=on.useRef(null),ze=on.useRef(null),Fe=on.useRef(null),Ue=on.useRef(null),ie=on.useRef(null),Ge=on.useRef(null),Ve=on.useRef(null),Ye=()=>{switch(d){case 1:return g.trim().length>0&&f.trim().length>0;case 2:return b.length===2&&S.length===2&&p.length===4;case 3:return x.trim().length>0&&C.trim().length>0&&E.trim().length>0&&R.trim().length>0;case 4:return We.trim().length>0;default:return false}},dt=()=>{Ye()&&(d<Xi?c(J=>J+1):r({firstName:g,lastName:f,idNumber:We,dobMonth:b,dobDay:S,dobYear:p,addressLine1:x,addressLine2:F,city:C,state:E,postalCode:R,country:V}));},at=()=>{d>1?c(J=>J-1):o();},ht=["Enter your name","Enter your date of birth","Enter your address","Enter your SSN"],He=["Use your full legal name as it appears on your ID.","We use this to verify your identity.","Enter the address associated with your ID.","Your SSN is encrypted and used only for identity verification."],Lt=[kt.stepCounter,{color:i.foregroundMuted},...s.semibold?[{fontFamily:s.semibold}]:[]];return jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:n.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:n.form.screen,children:[jsxRuntime.jsxs(reactNative.View,{style:kt.header,children:[jsxRuntime.jsx(reactNative.View,{style:kt.headerSide,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:kt.iconButton,onPress:at,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:d>1?"Back":"Cancel",children:jsxRuntime.jsx(Ki,{size:20,color:a.header.buttonColor,strokeWidth:2})})}),jsxRuntime.jsx(reactNative.View,{style:kt.headerCenter,children:jsxRuntime.jsxs(reactNative.Text,{style:Lt,children:[d," of ",Xi]})}),jsxRuntime.jsx(reactNative.View,{style:kt.headerSide,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:kt.iconButton,onPress:o,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:"Close",children:jsxRuntime.jsx(tt,{size:20,color:a.header.buttonColor,strokeWidth:2})})})]}),jsxRuntime.jsx(reactNative.View,{style:kt.progressTrack,children:Array.from({length:Xi}).map((J,q)=>jsxRuntime.jsx(reactNative.View,{style:[kt.progressSegment,{backgroundColor:q<d||q+1===d?i.primary:i.border}]},q))}),jsxRuntime.jsxs(reactNative.ScrollView,{style:n.form.flex,contentContainerStyle:kt.scrollContent,keyboardShouldPersistTaps:"handled",children:[jsxRuntime.jsx(reactNative.Text,{style:n.form.title,children:ht[d-1]}),jsxRuntime.jsx(reactNative.Text,{style:n.form.subtitle,children:He[d-1]}),d===1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ho,{form:n.form,label:"First name",children:jsxRuntime.jsx(reactNative.TextInput,{style:n.form.input,placeholder:"Jane",placeholderTextColor:l,value:g,onChangeText:w,autoCapitalize:"words",returnKeyType:"next",onSubmitEditing:()=>ee.current?.focus()})}),jsxRuntime.jsx(ho,{form:n.form,label:"Last name",children:jsxRuntime.jsx(reactNative.TextInput,{ref:ee,style:n.form.input,placeholder:"Doe",placeholderTextColor:l,value:f,onChangeText:y,autoCapitalize:"words",returnKeyType:"done",onSubmitEditing:dt})})]}),d===2&&jsxRuntime.jsxs(reactNative.View,{style:kt.dobRow,children:[jsxRuntime.jsxs(reactNative.View,{style:kt.dobCol,children:[jsxRuntime.jsx(reactNative.Text,{style:[n.form.fieldLabel,kt.dobLabel],children:"Month"}),jsxRuntime.jsx(reactNative.TextInput,{style:[n.form.input,kt.dobInput],placeholder:"MM",placeholderTextColor:l,value:b,onChangeText:J=>{let q=J.replace(/\D/g,"").slice(0,2);m(q),q.length===2&&ye.current?.focus();},keyboardType:"number-pad",maxLength:2})]}),jsxRuntime.jsxs(reactNative.View,{style:kt.dobCol,children:[jsxRuntime.jsx(reactNative.Text,{style:[n.form.fieldLabel,kt.dobLabel],children:"Day"}),jsxRuntime.jsx(reactNative.TextInput,{ref:ye,style:[n.form.input,kt.dobInput],placeholder:"DD",placeholderTextColor:l,value:S,onChangeText:J=>{let q=J.replace(/\D/g,"").slice(0,2);h(q),q.length===2&&ze.current?.focus();},keyboardType:"number-pad",maxLength:2})]}),jsxRuntime.jsxs(reactNative.View,{style:kt.dobColWide,children:[jsxRuntime.jsx(reactNative.Text,{style:[n.form.fieldLabel,kt.dobLabel],children:"Year"}),jsxRuntime.jsx(reactNative.TextInput,{ref:ze,style:[n.form.input,kt.dobInput],placeholder:"YYYY",placeholderTextColor:l,value:p,onChangeText:J=>{let q=J.replace(/\D/g,"").slice(0,4);T(q);},keyboardType:"number-pad",maxLength:4,returnKeyType:"done",onSubmitEditing:dt})]})]}),d===3&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ho,{form:n.form,label:"Street address",children:jsxRuntime.jsx(reactNative.TextInput,{style:n.form.input,placeholder:"123 Main St",placeholderTextColor:l,value:x,onChangeText:_,returnKeyType:"next",onSubmitEditing:()=>Fe.current?.focus()})}),jsxRuntime.jsx(ho,{form:n.form,label:"Apt, suite, etc. (optional)",children:jsxRuntime.jsx(reactNative.TextInput,{ref:Fe,style:n.form.input,placeholder:"Apt 2",placeholderTextColor:l,value:F,onChangeText:k,returnKeyType:"next",onSubmitEditing:()=>Ue.current?.focus()})}),jsxRuntime.jsx(ho,{form:n.form,label:"City",children:jsxRuntime.jsx(reactNative.TextInput,{ref:Ue,style:n.form.input,placeholder:"San Francisco",placeholderTextColor:l,value:C,onChangeText:B,autoCapitalize:"words",returnKeyType:"next",onSubmitEditing:()=>ie.current?.focus()})}),jsxRuntime.jsxs(reactNative.View,{style:kt.row,children:[jsxRuntime.jsx(reactNative.View,{style:[n.form.flex,{marginRight:8}],children:jsxRuntime.jsx(ho,{form:n.form,label:"State",children:jsxRuntime.jsx(reactNative.TextInput,{ref:ie,style:n.form.input,placeholder:"NY",placeholderTextColor:l,value:E,onChangeText:J=>L(J.toUpperCase().slice(0,2)),autoCapitalize:"characters",maxLength:2,returnKeyType:"next",onSubmitEditing:()=>Ge.current?.focus()})})}),jsxRuntime.jsx(reactNative.View,{style:n.form.flex,children:jsxRuntime.jsx(ho,{form:n.form,label:"ZIP code",children:jsxRuntime.jsx(reactNative.TextInput,{ref:Ge,style:n.form.input,placeholder:"11201",placeholderTextColor:l,value:R,onChangeText:H,keyboardType:"number-pad",maxLength:10,returnKeyType:"next",onSubmitEditing:()=>Ve.current?.focus()})})})]}),jsxRuntime.jsx(ho,{form:n.form,label:"Country",children:jsxRuntime.jsx(reactNative.TextInput,{ref:Ve,style:n.form.input,placeholder:"US",placeholderTextColor:l,value:V,onChangeText:J=>we(J.toUpperCase().slice(0,2)),autoCapitalize:"characters",maxLength:2,returnKeyType:"done",onSubmitEditing:dt})})]}),d===4&&jsxRuntime.jsxs(ho,{form:n.form,label:"Social Security Number",children:[jsxRuntime.jsx(reactNative.TextInput,{style:n.form.input,placeholder:"123-45-6789",placeholderTextColor:l,value:We,onChangeText:Xe,keyboardType:"number-pad",secureTextEntry:true,returnKeyType:"done",onSubmitEditing:dt}),jsxRuntime.jsx(reactNative.Text,{style:[n.form.hint,kt.ssnHint],children:"Your SSN is transmitted securely and never stored on this device."})]})]}),jsxRuntime.jsx(reactNative.View,{style:n.form.footer,children:t&&d===Xi?jsxRuntime.jsx(reactNative.View,{style:[n.form.continueBtn,n.form.loaderInButton],children:jsxRuntime.jsx(it,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[n.form.continueBtn,!Ye()&&n.form.continueBtnDisabled],onPress:dt,disabled:!Ye(),children:jsxRuntime.jsx(reactNative.Text,{style:[n.form.continueBtnText,!Ye()&&n.form.continueBtnTextDisabled],children:d===Xi?"Submit":"Continue"})})})]})})}function ho({form:e,label:t,children:r}){return jsxRuntime.jsxs(reactNative.View,{style:e.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.fieldLabel,children:t}),r]})}var kt=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:60,paddingBottom:16},headerSide:{width:40,alignItems:"center"},headerCenter:{flex:1,alignItems:"center",justifyContent:"center"},iconButton:{width:28,height:28,borderRadius:8,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},stepCounter:{fontSize:15},progressTrack:{flexDirection:"row",gap:4,marginBottom:32},progressSegment:{flex:1,height:3,borderRadius:2},scrollContent:{flexGrow:1,paddingBottom:16,paddingTop:16},dobRow:{flexDirection:"row",gap:10,marginBottom:20},dobCol:{flex:1},dobColWide:{flex:1.5},dobLabel:{textAlign:"center"},dobInput:{textAlign:"center"},row:{flexDirection:"row"},ssnHint:{marginTop:10,lineHeight:18}});var Mm="https://api.unifold.io",Dl="__UnifoldDevApiBaseUrl__",sr="pk_test_123",Zs={};function zm(){if(typeof __DEV__>"u"||!__DEV__||typeof globalThis>"u")return;let e=globalThis[Dl];if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function Wt(){return zm()??Mm}function Xs(e){if(e.publishableKey!==void 0){if(!e.publishableKey||e.publishableKey.trim()==="")throw new Error("Unifold SDK: publishableKey cannot be empty. Please provide a valid publishable key.");!e.publishableKey.startsWith("pk_test_")&&!e.publishableKey.startsWith("pk_live_")&&console.warn('Unifold SDK: publishableKey should start with "pk_test_" or "pk_live_". Please ensure you are using a valid publishable key.'),sr=e.publishableKey;}e.defaultConfig&&(Zs=e.defaultConfig);}function Cd(e){if(typeof __DEV__>"u"||!__DEV__){console.warn("[Unifold] setDevApiUrl() is only available in development mode");return}if(typeof globalThis>"u")return;let t=e.trim();t.length>0?globalThis[Dl]=t:delete globalThis[Dl];}function es(){return Wt()}function ea(){return sr}function kr(e){if(!e||e.trim()==="")throw new Error("Unifold SDK: No publishable key configured. Please provide a valid publishable key via setApiConfig() or pass it directly to the API function.");e==="pk_test_123"&&console.warn('Unifold SDK: Using default test key "pk_test_123". This should only be used for local development. Please use a real publishable key in production.');}function Mt(e){let t=e.startsWith("/")?e:`/${e}`;return `${Wt()}/api/public${t}`}function K(e){return e?e.includes("localhost")||e.includes("127.0.0.1")?e.replace(/https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?/,Wt()):e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("/api/public/")?`${Wt()}${e}`:`${Wt()}/api/public${e}`:""}async function yo(e,t){if(!e?.external_user_id)throw new Error("external_user_id is required");let r=e?.recipient_address||Zs.recipientAddress;if(!r)throw new Error("[Unifold] recipient_address is required for createDepositAddress. Pass recipientAddress in your beginDeposit() config.");let o={external_user_id:e.external_user_id,destination_chain_type:e?.destination_chain_type||"ethereum",destination_chain_id:e?.destination_chain_id||Zs.destinationChainId||"8453",destination_token_address:e?.destination_token_address||Zs.destinationTokenAddress||"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",recipient_address:r,...e?.action_type&&{action_type:e.action_type},client_metadata:e?.client_metadata||{}},n=t||sr;kr(n);let i=await fetch(`${Wt()}/v1/public/deposit_addresses`,{method:"POST",headers:{accept:"application/json","x-publishable-key":n,"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok)throw new Error(`Failed to create deposit address: ${i.statusText}`);return await i.json()}function bo(e,t){return e.find(r=>r.chain_type===t)}async function Co(e,t,r){let o=t||sr;kr(o);let n=await fetch(`${Wt()}/v1/public/direct_executions/query`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify({external_user_id:e,...r&&{action_type:r}})});if(!n.ok)throw new Error(`Failed to query executions: ${n.statusText}`);return n.json()}async function ta(e,t){let r=t||sr;kr(r);let o=await fetch(`${Wt()}/v1/public/direct_executions/poll`,{method:"POST",headers:{accept:"application/json","x-publishable-key":r,"Content-Type":"application/json"},body:JSON.stringify({deposit_wallet_id:e})});if(!o.ok)throw new Error(`Failed to poll executions: ${o.statusText}`);return o.json()}function ae(e,t="svg"){if(!e)return "";if(t==="svg"||!e.icon_urls||e.icon_urls.length===0)return e.icon_url;let r=e.icon_urls.find(o=>o.format===t);return r?r.url:e.icon_url}async function kn(e,t){let r=e||sr;kr(r);let o=`${Wt()}/v1/public/tokens/supported_deposit_tokens`;if(t?.destination_token_address&&t?.destination_chain_id&&t?.destination_chain_type){let i=new URLSearchParams({destination_token_address:t.destination_token_address,destination_chain_id:t.destination_chain_id,destination_chain_type:t.destination_chain_type});o=`${o}?${i.toString()}`;}let n=await fetch(o,{method:"GET",headers:{accept:"application/json","x-publishable-key":r}});if(!n.ok)throw new Error(`Failed to fetch supported deposit tokens: ${n.statusText}`);return n.json()}async function Fl(e,t){let r=t||sr;kr(r);let o=new URLSearchParams({chainType:e.chain_type,chainId:e.chain_id,tokenAddress:e.token_address}),n=await fetch(`${Wt()}/v1/public/tokens/token?${o.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":r}});if(!n.ok)throw new Error(`Failed to fetch token metadata: ${n.statusText}`);return n.json()}function ra(e,t,r){return !e||e.length===0?r||"":e.find(n=>n.format===t)?.url||r||e[0]?.url||""}async function Vl(e,t){let r=t||sr;kr(r);let o=await fetch(`${Wt()}/v1/public/onramps/quotes`,{method:"POST",headers:{accept:"application/json","x-publishable-key":r,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok)throw new Error(`Failed to fetch onramp quotes: ${o.statusText}`);return o.json()}async function Ll(e,t){let r=t||sr;kr(r);let o=await fetch(`${Wt()}/v1/public/onramps/sessions`,{method:"POST",headers:{accept:"application/json","x-publishable-key":r,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok)throw new Error(`Failed to create onramp session: ${o.statusText}`);return o.json()}async function Bl(e,t){let r=t||sr;kr(r);let o=new URLSearchParams;e.country_code&&o.append("country_code",e.country_code),e.subdivision_code&&o.append("subdivision_code",e.subdivision_code),o.append("token_address",e.token_address),o.append("chain_id",e.chain_id),o.append("chain_type",e.chain_type);let n=await fetch(`${Wt()}/v1/public/onramps/default_token?${o.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":r}});if(!n.ok)throw new Error(`Failed to fetch default onramp token: ${n.statusText}`);return n.json()}async function Wl(e){let t=e||sr;kr(t);let r=await fetch(`${Wt()}/v1/public/onramps/fiat_currencies`,{method:"GET",headers:{accept:"application/json","x-publishable-key":t}});if(!r.ok)throw new Error(`Failed to fetch fiat currencies: ${r.statusText}`);return r.json()}function ci(e,t="png"){if(!e||e.length===0)return;let r=e.find(o=>o.format===t);return r?r.url:e[0]?.url}async function ts(e){let t=e||sr;kr(t);let r=await fetch(`${Wt()}/v1/public/projects/config`,{method:"GET",headers:{accept:"application/json","x-publishable-key":t}});if(!r.ok)throw new Error(`Failed to fetch project config: ${r.statusText}`);return r.json()}async function Al(){let e=await fetch(`${Wt()}/v1/public/tokens/chains`,{method:"GET",headers:{accept:"application/json"}});if(!e.ok)throw new Error(`Failed to fetch token chains: ${e.statusText}`);return e.json()}function oa(e,t,r){let o=e.find(i=>i.chain_id===r);if(o)return o.chain_name;let n=e.find(i=>i.chain_type===t);return n?n.chain_name:t.charAt(0).toUpperCase()+t.slice(1)}async function rs(){let e=await fetch(`${Wt()}/v1/public/ip_address`,{method:"GET",headers:{accept:"application/json"}});if(!e.ok)throw new Error(`Failed to fetch IP address information: ${e.statusText}`);return e.json()}async function na(e){let t=e||sr;kr(t);let r=await fetch(`${Wt()}/v1/public/tokens/supported_destination_tokens`,{method:"GET",headers:{accept:"application/json","x-publishable-key":t}});if(!r.ok)throw new Error(`Failed to fetch supported destination tokens: ${r.statusText}`);return r.json()}async function El(e,t){let r=t||sr;kr(r);let o=await fetch(`${Wt()}/v1/public/addresses/verify`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json","x-publishable-key":r},body:JSON.stringify(e)});if(!o.ok)throw new Error(`Failed to verify address: ${o.statusText}`);return o.json()}async function Ml(e,t){return ta(e.deposit_wallet_id,t)}async function ia(e,t,r,o,n){let i=n||sr;kr(i);let s=await fetch(`${Wt()}/v1/public/addresses/balance`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json","x-publishable-key":i},body:JSON.stringify({address:e,chain_type:t,chain_id:r,token_address:o})});if(!s.ok)throw new Error(`Failed to fetch address balance: ${s.statusText}`);return s.json()}var wd="",Td;function sa(e){wd=e;}function aa(e){Td=e;}function Gr(){let e=wd||ea();if(!e)throw new Error("[Unifold] No publishable key configured. Set via UnifoldProvider or setStripeOnrampPublishableKey().");return e}function Yr(){return Td??es()}async function la(){let e=`${Yr()}/v1/public/onramps/headless/stripe/config`,t=Gr(),r=await fetch(e,{method:"GET",headers:{"x-publishable-key":t,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to load Stripe config: ${r.status}`);let o=await r.json();if(!o?.publishable_key)throw new Error("Missing Stripe publishable key in config response");return o.publishable_key}async function Sd(e){let t=await fetch(`${Yr()}/v1/public/onramps/headless/stripe/oauth/start`,{method:"POST",headers:{"x-publishable-key":Gr(),"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(!t.ok)throw new Error(`Failed to create auth intent: ${t.status}`);let r=await t.json();return r.auth_intent_id??r.id}async function kd(e){let t=await fetch(`${Yr()}/v1/public/onramps/headless/stripe/oauth/token`,{method:"POST",headers:{"x-publishable-key":Gr(),"Content-Type":"application/json"},body:JSON.stringify({auth_intent_id:e})});if(!t.ok)throw new Error(`Failed to exchange auth intent for tokens: ${t.status}`);return t.json()}async function xd(e,t){let r={crypto_customer_id:e.cryptoCustomerId,payment_token:e.paymentToken,source_amount:e.sourceAmount,source_currency:e.sourceCurrency,destination_currency:e.destinationCurrency,wallet_address:e.walletAddress,destination_network:e.destinationNetwork},o=await fetch(`${Yr()}/v1/public/onramps/headless/stripe/sessions`,{method:"POST",headers:{"x-publishable-key":Gr(),"x-stripe-oauth-token":t,"Content-Type":"application/json"},body:JSON.stringify(r)}),n=await o.text();if(!o.ok)throw new Error(`Failed to create onramp session: ${o.status} ${n}`);return JSON.parse(n)}async function _d(e,t){let r=await fetch(`${Yr()}/v1/public/onramps/headless/stripe/sessions/${e}/confirm`,{method:"POST",headers:{"x-publishable-key":Gr(),"x-stripe-oauth-token":t,"Content-Type":"application/json"}}),o=await r.text();if(!r.ok)throw new Error(`Failed to confirm onramp session: ${r.status} ${o}`);return JSON.parse(o)}async function Rd(e,t){let r=`${Yr()}/v1/public/onramps/headless/stripe/customers/${e}`,o=await fetch(r,{method:"GET",headers:{"x-publishable-key":Gr(),"x-stripe-oauth-token":t}}),n=await o.text();if(!o.ok)throw new Error(`Failed to get onramp customer: ${o.status} ${n}`);return JSON.parse(n)}async function vd(e,t){let r=`${Yr()}/v1/public/onramps/headless/stripe/sessions/${e}`,o=await fetch(r,{method:"GET",headers:{"x-publishable-key":Gr(),"x-stripe-oauth-token":t}}),n=await o.text();if(!o.ok)throw new Error(`Failed to get onramp session: ${o.status} ${n}`);return JSON.parse(n)}async function Id(e,t){let r=await fetch(`${Yr()}/v1/public/onramps/headless/stripe/sessions/${e}/quote/refresh`,{method:"POST",headers:{"x-publishable-key":Gr(),"x-stripe-oauth-token":t,"Content-Type":"application/json"}});if(!r.ok){let o=await r.text();throw new Error(`Failed to refresh quote: ${r.status} ${o}`)}return r.json()}async function Pd(e){if(!e.recipient_address)throw new Error("[Unifold] recipient_address is required for fetchDepositAddress. Pass recipientAddress in your onramp config.");let t={external_user_id:e.external_user_id,destination_chain_type:e.destination_chain_type||"ethereum",destination_chain_id:e.destination_chain_id||"8453",destination_token_address:e.destination_token_address||"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",recipient_address:e.recipient_address,client_metadata:{}},r=await fetch(`${Yr()}/v1/public/deposit_addresses`,{method:"POST",headers:{accept:"application/json","x-publishable-key":Gr(),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok)throw new Error(`Failed to create deposit address: ${r.status}`);return r.json()}async function Od(e){let t=new URLSearchParams({token_address:e.token_address,chain_id:e.chain_id,chain_type:e.chain_type}),r=await fetch(`${Yr()}/v1/public/onramps/headless/stripe/default_token?${t.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":Gr()}});if(!r.ok)throw new Error(`Failed to fetch default onramp token: ${r.status}`);return r.json()}var $m=5,Dd={firstName:"",lastName:"",idNumber:"",dobDay:"",dobMonth:"",dobYear:"",addressLine1:"",addressLine2:"",city:"",state:"",postalCode:"",country:"US"};function ca(e){let t=e?.flowOrder==="amount_first",r=t?"session_params":"email",{configure:o,hasLinkAccount:n,registerLinkUser:i,authorize:s,attachKycInfo:a,presentKycInfoVerification:l,verifyIdentity:d,registerWalletAddress:c,collectPaymentMethod:g,createCryptoPaymentToken:w}=stripeReactNative.useOnramp(),[f,y]=on.useState(r),[b,m]=on.useState(false),[S,h]=on.useState(""),[p,T]=on.useState(null),[x,_]=on.useState(e?.email??""),[F,k]=on.useState(e?.phone??""),[C,B]=on.useState(""),[E,L]=on.useState("US"),[R,H]=on.useState(""),[V,we]=on.useState(""),[We,Xe]=on.useState(false),[ee,ye]=on.useState(false),ze=on.useRef(0),Fe=on.useRef(false),Ue=on.useRef(false),ie=on.useRef(false),Ge=on.useRef(""),Ve=on.useRef(null),[Ye,dt]=on.useState(Dd),[at,ht]=on.useState(e?.defaultWalletAddress??"0x102471956A026866171C44F326e1DfafB6C6e34c"),[He,Lt]=on.useState(""),[J,q]=on.useState(e?.defaultNetwork??stripeReactNative.Onramp.CryptoNetwork.base),[Te,wt]=on.useState(e?.defaultSourceAmount??"100"),[he,_e]=on.useState(e?.defaultSourceCurrency??"usd"),[Je,mt]=on.useState(e?.defaultDestinationCurrency??"usdc"),[Se,et]=on.useState(null),[Ht,lt]=on.useState(false),Re=on.useRef(null),Nt=on.useRef(false),Bt=on.useRef(0),Cr=on.useRef(e?.onComplete),xe=on.useRef(e?.onError),je=on.useRef(e?.onStepChange),$e=on.useRef(r);on.useEffect(()=>{Cr.current=e?.onComplete;},[e?.onComplete]),on.useEffect(()=>{xe.current=e?.onError;},[e?.onError]),on.useEffect(()=>{je.current=e?.onStepChange;},[e?.onStepChange]);let ur=on.useRef(r);on.useEffect(()=>{f!==ur.current&&(je.current?.(f,ur.current),ur.current=f),$e.current=f;},[f]);let N=on.useCallback((P,Y,ne)=>{let v={code:P,message:Y,step:$e.current,stripeErrorCode:ne};T(v),h(""),xe.current?.(v);},[]),re=on.useCallback(P=>{let Y={sessionId:P.id,status:P.status,sourceAmount:P.transaction_details.source_amount,sourceCurrency:P.transaction_details.source_currency,destinationAmount:P.transaction_details.destination_amount,destinationCurrency:P.transaction_details.destination_currency,destinationNetwork:P.transaction_details.destination_network,walletAddress:P.transaction_details.wallet_address,fees:{networkFee:P.transaction_details.fees.network_fee_amount,transactionFee:P.transaction_details.fees.transaction_fee_amount}};return Cr.current?.(Y),Y},[]),ue=on.useCallback(()=>T(null),[]);on.useEffect(()=>{if(!(e?.merchantIdentifier?.trim()??"")){lt(false);return}let Y=false;return stripeReactNative.isPlatformPaySupported().then(ne=>{Y||lt(ne);}),()=>{Y=true;}},[e?.merchantIdentifier]),on.useEffect(()=>(Nt.current=false,()=>{Nt.current=true,Re.current&&clearTimeout(Re.current);}),[]),on.useEffect(()=>{if(!e?.publishableKey||!e?.externalUserId||!e?.recipientAddress||We||ee)return;let P=false;ye(true);async function Y(){try{let[ne,v]=await Promise.all([Pd({external_user_id:e.externalUserId,recipient_address:e.recipientAddress,destination_chain_type:e?.destinationChainType,destination_chain_id:e?.destinationChainId,destination_token_address:e?.destinationTokenAddress}),e?.destinationTokenAddress&&e?.destinationChainId&&e?.destinationChainType?Od({token_address:e.destinationTokenAddress,chain_id:e.destinationChainId,chain_type:e.destinationChainType}).catch(Tt=>(console.warn("[useStripeOnramp] fetchDefaultOnrampToken failed, using chain_id fallback:",Tt?.message),null)):Promise.resolve(null)]);if(P)return;let M=e?.destinationChainType??"ethereum",ke=ne.data.find(Tt=>Tt.chain_type===M);if(ke?.address){let Tt=ke.address.toLowerCase();ht(Tt),Ge.current=Tt,ke.recipient_address&&Lt(ke.recipient_address);}else console.warn("[resolveWallet] No wallet found for chain_type",M,"in",ne.data?.length,"wallets");let gt={base:stripeReactNative.Onramp.CryptoNetwork.base,ethereum:stripeReactNative.Onramp.CryptoNetwork.ethereum,solana:stripeReactNative.Onramp.CryptoNetwork.solana,bitcoin:stripeReactNative.Onramp.CryptoNetwork.bitcoin,polygon:stripeReactNative.Onramp.CryptoNetwork.polygon},zo={8453:"base",1:"ethereum",137:"polygon"},wr=v?.destination_network,ir="none";if(wr&>[wr])q(gt[wr]),ir=wr+" (from default_token API)";else if(e?.destinationChainId&&zo[e.destinationChainId]){let Tt=zo[e.destinationChainId];gt[Tt]&&q(gt[Tt]),ir=Tt+" (from chain_id "+e.destinationChainId+")";}else gt[M]&&(q(gt[M]),ir=M+" (from chain_type fallback)");v?.destination_currency&&mt(v.destination_currency.toLowerCase()),Xe(!0),ie.current=!0;}catch(ne){console.error("[useStripeOnramp] Failed to resolve wallet:",ne?.message),Xe(true),ie.current=true;}finally{P||ye(false);}}return Y(),()=>{P=true;}},[e?.publishableKey,e?.externalUserId]);let le=on.useCallback(async()=>{if(Ve.current)return Ve.current;let P=o({merchantDisplayName:e?.merchantDisplayName??"Unifold",appearance:{lightColors:{primary:"#2d22a1",contentOnPrimary:"#ffffff",borderSelected:"#07b8b8"},darkColors:{primary:"#800080",contentOnPrimary:"#ffffff",borderSelected:"#526f3e"},style:"ALWAYS_DARK",primaryButton:{cornerRadius:8,height:48}}}).then(Y=>(Y.error&&(console.error("[useStripeOnramp] configureSDK error:",Y.error.message,Y.error.code),Ve.current=null),Y)).catch(Y=>{throw console.error("[useStripeOnramp] configureSDK threw:",Y?.message??Y),Ve.current=null,Y});return Ve.current=P,P},[o,e?.merchantDisplayName]);on.useEffect(()=>{le();},[]);let Le=on.useCallback(async P=>{if(!Fe.current){Fe.current=true,m(true),ue(),h("Creating auth intent...");try{let Y=await Sd(P);h("Waiting for authorization...");let ne=await s(Y);if(ne?.error){N("authorization_error",ne.error.message,ne.error.code),y("email");return}if(ne?.status==="Denied"){N("authorization_error","Authorization denied by user."),y("email");return}if(ne?.status!=="Consented"||!ne.customerId){N("authorization_error","Authorization was canceled."),y("email");return}h("Exchanging tokens...");let v=await kd(Y),M=ne.customerId,ke=v.access_token;H(M),we(ke),h("Checking verification status...");try{let gt=await Rd(M,ke),zo=gt.verifications.find(mo=>mo.name==="kyc_verified"),wr=gt.verifications.find(mo=>mo.name==="id_document_verified"),ir=zo?.status==="verified",Tt=zo?.status==="rejected",Uo=wr?.status==="verified",fl=gt.provided_fields.includes("first_name");if(h(""),Tt&&!fl)N("kyc_error","KYC was previously rejected. Please submit with correct info."),y("kyc");else if(Tt&&fl)y(Uo?"wallet":"identity");else if(!ir&&!fl)y("kyc");else if(!Uo)y("identity");else if(ie.current&&Ge.current)try{let mo=await c(Ge.current,J);mo?.error?(N("wallet_error",mo.error.message,mo.error.code),y("wallet")):y(t?"payment_method":"session_params");}catch(mo){console.warn("[proceedToAuthorize] Inline wallet registration failed, falling back to wallet step:",mo?.message),y("wallet");}else y("wallet");}catch(gt){console.warn("[getOnrampCustomer] failed, defaulting to kyc:",gt?.message),h(""),y("kyc");}}catch(Y){N("authorization_error",Y?.message??String(Y)),y("email");}finally{Fe.current=false,m(false);}}},[s,ue,N,c,J,t]),U=on.useCallback(async()=>{if(reactNative.Keyboard.dismiss(),!x){N("validation_error","Please enter an email address.");return}m(true),ue(),h("");try{h("Configuring...");let P=await le();if(P.error){N("configuration_error",P.error.message,P.error.code);return}h("Checking Link account...");let Y=await n(x);if(Y.error){N("authorization_error",Y.error.message,Y.error.code);return}Y.hasLinkAccount?await Le(x):(h(""),y("register"));}catch(P){N("unknown_error",P?.message??String(P));}finally{m(false);}},[ue,le,x,N,n,Le]),Z=on.useCallback(async()=>{if(!F){N("validation_error","Please enter your phone number.");return}m(true),ue(),h("");try{h("Creating Link account...");let P=await i({email:x,phone:F,fullName:C||x,country:E||"US"});if(P.error){N("registration_error",P.error.message,P.error.code);return}await Le(x);}catch(P){N("registration_error",P?.message??String(P));}finally{m(false);}},[ue,E,x,N,C,F,i,Le]);on.useEffect(()=>{if(f!=="email"||!e?.email)return;let P=++ze.current,Y=false,ne=()=>Y||ze.current!==P;return e?.phone?(async()=>{m(true),ue();try{h("Configuring...");let v=await le();if(ne())return;if(v.error){N("configuration_error",v.error.message,v.error.code);return}h("Checking Link account...");let M=await n(e.email);if(ne())return;if(M.error){N("authorization_error",M.error.message,M.error.code);return}if(M.hasLinkAccount){if(ne())return;await Le(e.email);}else {h("Creating Link account...");let ke=await i({email:e.email,phone:e.phone,fullName:e.email,country:"US"});if(ne())return;if(ke.error){N("registration_error",ke.error.message,ke.error.code);return}if(ne())return;await Le(e.email);}}catch(v){ne()||N("unknown_error",v?.message??String(v));}finally{m(false);}})():(async()=>{m(true),ue();try{h("Configuring...");let v=await le();if(ne())return;if(v.error){N("configuration_error",v.error.message,v.error.code);return}h("Checking Link account...");let M=await n(e.email);if(ne())return;if(M.error){N("authorization_error",M.error.message,M.error.code);return}if(M.hasLinkAccount){if(ne())return;await Le(e.email);}else {if(ne())return;h(""),y("register");}}catch(v){ne()||N("unknown_error",v?.message??String(v));}finally{m(false);}})(),()=>{Y=true;}},[f,e?.email,e?.phone]);let pe=on.useCallback(async P=>{m(true),ue(),h(""),dt(P);try{let Y={firstName:P.firstName,lastName:P.lastName,idNumber:P.idNumber||void 0,dateOfBirth:{day:parseInt(P.dobDay,10),month:parseInt(P.dobMonth,10),year:parseInt(P.dobYear,10)},address:{line1:P.addressLine1,line2:P.addressLine2||void 0,city:P.city,state:P.state,postalCode:P.postalCode,country:P.country}},ne=await a(Y);if(ne?.error){if(ne.error.stripeErrorCode==="consumer_person_already_verified"){h(""),y("identity");return}N("kyc_error",ne.error.message,ne.error.stripeErrorCode??ne.error.code),y("kyc");return}h("Please review your KYC information...");let v=await l(null);if(v?.error){N("kyc_error",v.error.message,v.error.stripeErrorCode??v.error.code),y("kyc");return}if(v?.status==="UpdateAddress"){N("kyc_error","Please update your address and resubmit."),y("kyc");return}h(""),y("identity");}catch(Y){N("kyc_error",Y?.message??String(Y)),y("kyc");}finally{m(false);}},[a,ue,N,l]),oe=on.useCallback(async()=>{if(!Ue.current){Ue.current=true,m(true),ue(),h("Launching identity verification...");try{let P=await d();if(P?.error){N("identity_error",P.error.message,P.error.code);return}h(""),y("wallet");}catch(P){N("identity_error",P?.message??String(P));}finally{Ue.current=false,m(false);}}},[ue,N,d]);on.useEffect(()=>{f==="identity"&&!b&&oe();},[f]);let X=on.useCallback(async()=>{if(!at){N("validation_error","Please enter a wallet address.");return}m(true),ue(),h("");try{let P=await c(at.toLowerCase(),J);if(P?.error){N("wallet_error",P.error.message,P.error.code);return}h(""),y(t?"payment_method":"session_params");}catch(P){N("wallet_error",P?.message??String(P));}finally{m(false);}},[ue,N,at,J,c,t]);on.useEffect(()=>{f==="wallet"&&We&&at&&!b&&X();},[f,We,at]);let ce=on.useCallback((P,Y)=>{Nt.current=false,Bt.current=0;let ne=async()=>{try{let v=await vd(P,Y);if(Nt.current)return;Bt.current=0,v.status==="fulfillment_complete"?(et(v),y("success"),re(v)):Re.current=setTimeout(ne,3e3);}catch(v){if(Nt.current)return;if(Bt.current+=1,console.error("[pollSessionStatus] error:",v?.message),Bt.current>=$m){N("session_error","We couldn't confirm delivery status. Your purchase may still complete \u2014 try again, or close and check your wallet.");return}Re.current=setTimeout(ne,5e3);}};Re.current=setTimeout(ne,3e3);},[re,N]),nt=on.useCallback(()=>{$e.current==="processing"&&(!Se?.id||!V||(ue(),Bt.current=0,Re.current&&(clearTimeout(Re.current),Re.current=null),ce(Se.id,V)));},[V,ue,ce,Se?.id]),Xt=on.useCallback(async P=>{m(true),ue(),h("");try{h("Confirming purchase...");let Y=await _d(P,V);et(Y),y("processing"),h(""),ce(Y.id,V);}finally{m(false);}},[V,ue,ce]),bn=on.useCallback(async()=>{if(Se)try{await Xt(Se.id);}catch(P){N("session_error",P?.message??String(P)),y("quote");}},[N,Xt,Se]),ul=on.useCallback(async(P=false)=>{if(!Te||isNaN(Number(Te))||Number(Te)<=0){N("validation_error","Please enter a valid amount.");return}m(true),ue(),h("");try{let Y;if(P){if(!e?.merchantIdentifier?.trim()){N("configuration_error","Apple Pay is not configured. Pass merchantIdentifier on StripeOnramp or in onramp config."),y("payment_method");return}h("Opening Apple Pay...");let ke={applePay:{merchantCountryCode:"US",currencyCode:he.toUpperCase(),cartItems:[{paymentType:stripeReactNative.PlatformPay.PaymentType.Immediate,label:`${Je.toUpperCase()} purchase + fees`,amount:Te||"0.00"}]}};Y=await g("PlatformPay",ke);}else h("Select a payment method..."),Y=await g("Card");if(Y?.error){N("payment_error",Y.error.message,Y.error.code),y("payment_method");return}if(!Y?.displayData){N("payment_error","Payment method selection was canceled."),y("payment_method");return}h("Creating payment token...");let ne=await w();if(ne?.error){N("payment_error",ne.error.message,ne.error.code),y("payment_method");return}let v=ne.cryptoPaymentToken;h("Creating onramp session...");let M=await xd({cryptoCustomerId:R,paymentToken:v,sourceAmount:Number(Te),sourceCurrency:he,destinationCurrency:Je,walletAddress:at.toLowerCase(),destinationNetwork:J},V);et(M),h(""),P?await Xt(M.id):y("quote");}catch(Y){N("session_error",Y?.message??String(Y)),y("payment_method");}finally{m(false);}},[V,ue,g,w,R,Je,N,Xt,Te,he,at,J,e?.merchantIdentifier]),pl=on.useCallback(async()=>{if(Se){m(true),ue(),h("");try{let P=await Id(Se.id,V);et(P);}catch(P){N("session_error",P?.message??String(P));}finally{m(false);}}},[V,ue,N,Se]),ml=on.useCallback(()=>{Nt.current=true,Bt.current=0,Re.current&&(clearTimeout(Re.current),Re.current=null),y(r),m(false),h(""),T(null),_(e?.email??""),k(e?.phone??""),B(""),L("US"),H(""),we(""),Xe(false),ye(false),dt(Dd),ht(e?.recipientAddress??""),q(stripeReactNative.Onramp.CryptoNetwork.ethereum),wt(e?.defaultSourceAmount??"100"),_e(e?.defaultSourceCurrency??"usd"),mt(e?.defaultDestinationCurrency??"usdc"),et(null),ze.current+=1,Fe.current=false,Ue.current=false;},[e,r]);return {step:f,loading:b,status:S,error:p,email:x,phone:F,fullName:C,country:E,customerId:R,accessToken:V,session:Se,kycData:Ye,walletAddress:at,resolvedRecipientAddress:He,walletNetwork:J,sourceAmount:Te,sourceCurrency:he,destinationCurrency:Je,applePaySupported:Ht,walletReady:We,walletLoading:ee,setStep:y,setStatus:h,setEmail:_,setPhone:k,setFullName:B,setCountry:L,setWalletAddress:ht,setWalletNetwork:q,setSourceAmount:wt,setSourceCurrency:_e,setDestinationCurrency:mt,checkEmail:U,register:Z,attachKyc:pe,verifyIdentity:oe,registerWallet:X,collectPaymentMethod:ul,refreshQuote:pl,confirmCheckout:bn,reset:ml,clearError:ue,resumeFulfillmentPolling:nt,amountFirst:t}}function Fd({styles:e,placeholderColor:t,hasPrefilledEmail:r,loading:o,error:n,status:i,email:s,setEmail:a,checkEmail:l,onClose:d}){return r?jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:d}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[jsxRuntime.jsx(it,{size:56,strokeWidth:3}),jsxRuntime.jsx(Kt,{error:n,progress:i,loading:o})]})]}):jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:e.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:d}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.title,children:"Enter your email"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.subtitle,children:"We'll check if you have a Link account or create one for you."}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Email address"}),jsxRuntime.jsx(reactNative.TextInput,{style:e.form.input,placeholder:"jane@example.com",placeholderTextColor:t,keyboardType:"email-address",autoCapitalize:"none",autoCorrect:false,value:s,onChangeText:a,autoFocus:true,returnKeyType:"done",onSubmitEditing:l})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[o?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(it,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[e.form.continueBtn,!s&&e.form.continueBtnDisabled],onPress:l,disabled:!s,children:jsxRuntime.jsx(reactNative.Text,{style:[e.form.continueBtnText,!s&&e.form.continueBtnTextDisabled],children:"Continue"})}),jsxRuntime.jsx(Kt,{error:n,progress:i,loading:o})]})]})})}function Ld({styles:e,loading:t,status:r,error:o,verifyIdentity:n,onClose:i}){return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:i}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.spinnerWrap,children:jsxRuntime.jsx(it,{size:48,strokeWidth:3})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Verifying identity"}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:r||"Preparing identity verification..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.spinnerWrap,children:jsxRuntime.jsx(reactNative.Text,{style:e.flow.idIcon,children:"\u{1FAAA}"})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Identity verification"}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:r||"Tap below to continue verification."})]}),jsxRuntime.jsx(Kt,{error:o,progress:r,loading:false})]}),!t&&jsxRuntime.jsx(reactNative.View,{style:e.form.footer,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:n,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Continue Verification"})})})]})}function Wd({styles:e,loading:t,error:r,status:o,sourceAmount:n,sourceCurrency:i,destinationCurrency:s,walletNetwork:a,applePaySupported:l,collectPaymentMethod:d,onClose:c}){let{colors:g}=O(),w=ii.find(b=>b.value===a)?.label??a,f=n===""||n===void 0?"0":n,y=g.primaryForeground;return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:c,title:"How do you want to pay?"}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.pm.payHint,children:"Select a payment method to continue"}),jsxRuntime.jsxs(reactNative.View,{style:e.pm.stackWrapper,children:[jsxRuntime.jsxs(reactNative.View,{style:[e.pm.swapCard,e.pm.swapCardTop],children:[jsxRuntime.jsx(reactNative.Text,{style:e.pm.summaryLabel,children:"You pay"}),jsxRuntime.jsxs(reactNative.View,{style:e.pm.swapRow,children:[jsxRuntime.jsxs(reactNative.Text,{style:e.pm.swapSpendAmount,numberOfLines:1,adjustsFontSizeToFit:true,children:["$",f]}),jsxRuntime.jsx(reactNative.View,{style:e.pm.swapPill,children:jsxRuntime.jsx(reactNative.Text,{style:e.pm.swapPillText,children:i.toUpperCase()})})]})]}),jsxRuntime.jsx(reactNative.View,{style:e.pm.swapConnectorWrap,pointerEvents:"none",children:jsxRuntime.jsx(reactNative.View,{style:e.pm.swapConnectorCircle,children:jsxRuntime.jsx(yt,{size:20,color:y,strokeWidth:2.5})})}),jsxRuntime.jsxs(reactNative.View,{style:[e.pm.swapCard,e.pm.swapCardBottom],children:[jsxRuntime.jsx(reactNative.Text,{style:e.pm.summaryLabel,children:"You receive"}),jsxRuntime.jsxs(reactNative.View,{style:e.pm.swapRow,children:[jsxRuntime.jsx(reactNative.View,{style:e.pm.swapLeftCol,children:jsxRuntime.jsx(reactNative.Text,{style:e.pm.swapReceivePrimary,numberOfLines:1,adjustsFontSizeToFit:true,children:s.toUpperCase()})}),jsxRuntime.jsx(reactNative.View,{style:e.pm.swapPill,children:jsxRuntime.jsx(reactNative.Text,{style:e.pm.swapPillText,children:w.toUpperCase()})})]})]})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[t?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(it,{size:28,strokeWidth:2})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l&&jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.pm.applePayBtn,onPress:()=>d(true),children:jsxRuntime.jsxs(reactNative.Text,{style:e.pm.applePayBtnText,children:["Pay with ","\uF8FF"," Pay"]})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:()=>d(false),children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Pay with Card"})})]}),jsxRuntime.jsx(Kt,{error:r,progress:o,loading:t})]})]})}function Ed({styles:e,error:t,status:r,loading:o,onClose:n,onRetryStatusCheck:i}){let s=!!t;return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[s?jsxRuntime.jsx(It,{onPress:n}):jsxRuntime.jsx(reactNative.View,{style:qs}),jsxRuntime.jsx(reactNative.View,{style:e.flow.centered,children:t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Could not confirm status"}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:"Your payment may still be completing. Try checking again, or close this screen and verify your wallet balance."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.spinnerWrap,children:jsxRuntime.jsx(it,{size:48,strokeWidth:3})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Processing your purchase"}),jsxRuntime.jsxs(reactNative.Text,{style:e.flow.sub,children:["Your payment has been confirmed.",`
|
|
2
|
+
`,"We're sending your crypto \u2014 this usually takes less than a minute."]})]})}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[jsxRuntime.jsx(Kt,{error:t,progress:r,loading:o}),t?jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.ghostBtn,onPress:i,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.ghostBtnText,children:"Check status again"})}):null]})]})}function zd({styles:e,session:t,loading:r,error:o,status:n,confirmCheckout:i,refreshQuote:s,onClose:a}){let l=t.transaction_details,d=new Date(l.quote_expiration*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),c=l.wallet_address.slice(0,6)+"..."+l.wallet_address.slice(-4),g=js(l.destination_amount,l.destination_currency);return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:a,title:"Review your purchase"}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsxs(reactNative.View,{style:e.quote.heroBox,children:[jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroLabel,children:"You receive"}),jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroAmount,children:g}),jsxRuntime.jsxs(reactNative.Text,{style:e.quote.heroNetwork,children:[l.destination_currency.toUpperCase()," ",$s(l.destination_network)]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.quote.card,children:[jsxRuntime.jsx(jo,{quote:e.quote,label:"You pay",value:`${l.source_amount} ${l.source_currency.toUpperCase()}`}),jsxRuntime.jsx(jo,{quote:e.quote,label:"Network fee",value:`$${l.fees.network_fee_amount}`}),jsxRuntime.jsx(jo,{quote:e.quote,label:"Transaction fee",value:`$${l.fees.transaction_fee_amount}`}),jsxRuntime.jsx(jo,{quote:e.quote,label:"Wallet",value:c,mono:true}),jsxRuntime.jsx(jo,{quote:e.quote,label:"Quote expires",value:d,last:true})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[r?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(it,{size:28,strokeWidth:2})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:i,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Confirm Purchase"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.ghostBtn,onPress:s,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.ghostBtnText,children:"Refresh Quote"})})]}),jsxRuntime.jsx(Kt,{error:o,progress:n,loading:r})]})]})}function Ud({styles:e,hasPrefilledPhone:t,loading:r,error:o,status:n,email:i,phone:s,setPhone:a,register:l,onClose:d}){let c=O();return t?jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:d}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[jsxRuntime.jsx(it,{size:56,strokeWidth:3}),jsxRuntime.jsx(Kt,{error:o,progress:n,loading:r})]})]}):jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:e.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:d}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.title,children:"Enter your phone"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.subtitle,children:"We'll send a verification code to confirm your number."}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Phone number"}),jsxRuntime.jsx(reactNative.TextInput,{style:e.form.input,placeholder:"+12125551234",placeholderTextColor:c.components.input.placeholderColor,keyboardType:"phone-pad",value:s,onChangeText:g=>a(g.replace(/[^\d+]/g,"").replace(/(?!^)\+/g,"")),autoFocus:true,returnKeyType:"done",onSubmitEditing:l}),jsxRuntime.jsx(reactNative.Text,{style:e.form.hint,children:"Include country code, e.g. +12125551234"})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.emailRow,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.emailLabel,children:"Signing up as"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.emailValue,children:i})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[r?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(it,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[e.form.continueBtn,!s&&e.form.continueBtnDisabled],onPress:l,disabled:!s,children:jsxRuntime.jsx(reactNative.Text,{style:[e.form.continueBtnText,!s&&e.form.continueBtnTextDisabled],children:"Continue"})}),jsxRuntime.jsx(Kt,{error:o,progress:n,loading:r})]})]})})}function Hd({styles:e,session:t,resolvedRecipientAddress:r,recipientFromConfig:o,onDone:n}){let{colors:i}=O(),s=t.transaction_details,a=js(s.destination_amount,s.destination_currency),l=r||o||"";return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:n,title:"Purchase complete"}),jsxRuntime.jsx(reactNative.View,{style:e.form.content,children:jsxRuntime.jsxs(reactNative.ScrollView,{style:e.form.flex,contentContainerStyle:e.flow.successScrollContent,showsVerticalScrollIndicator:false,children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.checkCircle,children:jsxRuntime.jsx(Ae,{size:40,color:i.success,strokeWidth:2.5})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:"Your crypto is on its way to your wallet."}),jsxRuntime.jsxs(reactNative.View,{style:[e.quote.heroBox,e.flow.detailCard],children:[jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroLabel,children:"You received"}),jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroAmount,children:a}),jsxRuntime.jsxs(reactNative.Text,{style:e.quote.heroNetwork,children:[s.destination_currency.toUpperCase()," ",$s(s.destination_network)]})]}),jsxRuntime.jsxs(reactNative.View,{style:[e.quote.card,e.flow.detailCard],children:[jsxRuntime.jsx(Il,{quote:e.quote,label:"Deposit Address",address:s.wallet_address}),l?jsxRuntime.jsx(Il,{quote:e.quote,label:"Recipient Address",address:l,last:true}):jsxRuntime.jsx(jo,{quote:e.quote,label:"Session",value:t.id.slice(0,8)+"..."+t.id.slice(-6),mono:true,last:true})]})]})}),jsxRuntime.jsx(reactNative.View,{style:e.form.footer,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:n,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Done"})})})]})}function jd({styles:e,hasAutoWallet:t,loading:r,error:o,status:n,walletAddress:i,walletNetwork:s,setWalletAddress:a,setWalletNetwork:l,setDestinationCurrency:d,registerWallet:c,onClose:g}){let{components:w}=O();return t?jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:g}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[jsxRuntime.jsx(it,{size:56,strokeWidth:3}),jsxRuntime.jsx(Kt,{error:o,progress:n,loading:r})]})]}):jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:e.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx(It,{onPress:g}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.title,children:"Your crypto wallet"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.subtitle,children:"Enter the wallet address where you'd like to receive your crypto."}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Wallet address"}),jsxRuntime.jsx(reactNative.TextInput,{style:[e.form.input,e.wallet.input],placeholder:"0x...",placeholderTextColor:w.input.placeholderColor,autoCapitalize:"none",autoCorrect:false,value:i,onChangeText:a})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Network"}),jsxRuntime.jsx(reactNative.View,{style:e.wallet.list,children:ii.map(f=>{let y=s===f.value;return jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[e.wallet.row,y&&e.wallet.rowSelected],onPress:()=>{l(f.value),d(f.defaultCrypto);},children:[jsxRuntime.jsx(reactNative.View,{style:e.wallet.iconWrap,children:jsxRuntime.jsx(f.Icon,{size:24})}),jsxRuntime.jsx(reactNative.Text,{style:[e.wallet.rowText,y&&e.wallet.rowTextSelected],children:f.label}),y&&jsxRuntime.jsx(reactNative.View,{style:e.wallet.checkCircle,children:jsxRuntime.jsx(Ae,{size:14,color:w.container.buttonTitleColor,strokeWidth:2.5})})]},f.value)})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[r?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(it,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[e.form.continueBtn,!i&&e.form.continueBtnDisabled],onPress:c,disabled:!i,children:jsxRuntime.jsx(reactNative.Text,{style:[e.form.continueBtnText,!i&&e.form.continueBtnTextDisabled],children:"Continue"})}),jsxRuntime.jsx(Kt,{error:o,progress:n,loading:r})]})]})})}function pa({config:e,onComplete:t}){let r=O(),o=ai(),{step:n,loading:i,status:s,error:a,email:l,phone:d,session:c,kycData:g,walletAddress:w,resolvedRecipientAddress:f,walletNetwork:y,sourceAmount:b,sourceCurrency:m,destinationCurrency:S,applePaySupported:h,setStep:p,setEmail:T,setPhone:x,setWalletAddress:_,setWalletNetwork:F,setSourceAmount:k,setDestinationCurrency:C,checkEmail:B,register:E,attachKyc:L,verifyIdentity:R,registerWallet:H,collectPaymentMethod:V,refreshQuote:we,confirmCheckout:We,reset:Xe,resumeFulfillmentPolling:ee,amountFirst:ye}=ca(e),ze=!!e?.email,Fe=!!e?.phone,Ue=!!e?.publishableKey&&!!e?.externalUserId,ie=()=>{Xe(),t?.();};return n==="email"?jsxRuntime.jsx(Fd,{styles:o,placeholderColor:r.components.input.placeholderColor,hasPrefilledEmail:ze,loading:i,error:a,status:s,email:l,setEmail:T,checkEmail:B,onClose:ie}):n==="register"?jsxRuntime.jsx(Ud,{styles:o,hasPrefilledPhone:Fe,loading:i,error:a,status:s,email:l,phone:d,setPhone:x,register:E,onClose:ie}):n==="kyc"?jsxRuntime.jsx(Js,{initialData:g,loading:i,onComplete:L,onCancel:()=>p("email")}):n==="identity"?jsxRuntime.jsx(Ld,{styles:o,loading:i,status:s,error:a,verifyIdentity:R,onClose:ie}):n==="wallet"?jsxRuntime.jsx(jd,{styles:o,hasAutoWallet:Ue,loading:i,error:a,status:s,walletAddress:w,walletNetwork:y,setWalletAddress:_,setWalletNetwork:F,setDestinationCurrency:C,registerWallet:H,onClose:ie}):n==="session_params"?jsxRuntime.jsx(Gs,{initialAmount:b,currency:m,onConfirm:Ge=>{k(Ge),p(ye?"email":"payment_method");},onCancel:()=>{ye?ie():p("wallet");}}):n==="payment_method"?jsxRuntime.jsx(Wd,{styles:o,loading:i,error:a,status:s,sourceAmount:b,sourceCurrency:m,destinationCurrency:S,walletNetwork:y,applePaySupported:h,collectPaymentMethod:V,onClose:ie}):n==="quote"&&c?jsxRuntime.jsx(zd,{styles:o,session:c,loading:i,error:a,status:s,confirmCheckout:We,refreshQuote:we,onClose:ie}):n==="processing"?jsxRuntime.jsx(Ed,{styles:o,error:a,status:s,loading:i,onClose:ie,onRetryStatusCheck:ee}):n==="success"&&c?jsxRuntime.jsx(Hd,{styles:o,session:c,resolvedRecipientAddress:f,recipientFromConfig:e?.recipientAddress,onDone:()=>{Xe(),t?.();}}):null}function $d(){try{let e=df__default.default.expoConfig?.plugins;if(!Array.isArray(e))return;for(let t of e){if(!Array.isArray(t))continue;let[r,o]=t;if(r!=="@stripe/stripe-react-native"||!o||typeof o!="object")continue;let n=o.merchantIdentifier;if(typeof n=="string"){let i=n.trim();if(i.length>0)return i}}}catch{}}function ma({publishableKey:e,email:t,phone:r,externalUserId:o,flowOrder:n,destinationChainType:i="ethereum",destinationChainId:s="8453",destinationTokenAddress:a,recipientAddress:l,onComplete:d,onError:c,onStepChange:g,onClose:w,merchantIdentifier:f="",urlScheme:y="unifoldOnramp"}){let b=e||ea(),m=on.useMemo(()=>{let _=f.trim();return _.length>0?_:$d()??""},[f]),[S,h]=on.useState("loading"),[p,T]=on.useState(null);on.useEffect(()=>{let _=false;async function F(){try{b&&(sa(b),aa(es()));let k=await la();if(_)return;let C=m.trim();if(await stripeReactNative.initStripe({publishableKey:k,urlScheme:y,...C?{merchantIdentifier:C}:{}}),_)return;h("ready");}catch(k){if(_)return;console.error("[StripeOnramp] Init failed:",k),T(k?.message??"Failed to load Stripe configuration"),h("error");}}return F(),()=>{_=true;}},[b,m,y]);let x=on.useMemo(()=>{let _={publishableKey:b,externalUserId:o,destinationChainType:i,destinationChainId:s,onComplete:d,onError:c,onStepChange:g};return a&&(_.destinationTokenAddress=a),l&&(_.recipientAddress=l),t&&(_.email=t),r&&(_.phone=r),n&&(_.flowOrder=n),_.merchantIdentifier=m,_},[b,o,i,s,a,l,t,r,n,m,d,c,g]);return S==="error"?jsxRuntime.jsxs(reactNative.View,{style:hi.centered,children:[jsxRuntime.jsx(reactNative.Text,{style:hi.errorText,children:"Unable to initialize"}),jsxRuntime.jsx(reactNative.Text,{style:hi.errorDetail,children:p}),w&&jsxRuntime.jsx(reactNative.TouchableOpacity,{style:hi.retryBtn,onPress:w,children:jsxRuntime.jsx(reactNative.Text,{style:hi.retryBtnText,children:"Go Back"})})]}):S==="loading"?jsxRuntime.jsx(reactNative.View,{style:hi.centered,children:jsxRuntime.jsx(it,{size:56,strokeWidth:3})}):jsxRuntime.jsx(pa,{config:x,onComplete:w})}var hi=reactNative.StyleSheet.create({centered:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"#000000",paddingHorizontal:24},errorText:{color:"#FF453A",fontSize:18,fontWeight:"600",marginBottom:8},errorDetail:{color:"#8E8E93",fontSize:14,textAlign:"center",marginBottom:24},retryBtn:{backgroundColor:"#00D924",borderRadius:24,paddingVertical:14,paddingHorizontal:32},retryBtnText:{color:"#000000",fontSize:16,fontWeight:"700"}});function Gd(){let{configure:e}=stripeReactNative.useOnramp(),t=on.useRef(false);return on.useEffect(()=>{t.current||(t.current=true,e({merchantDisplayName:"Unifold",appearance:{lightColors:{primary:"#2d22a1",contentOnPrimary:"#ffffff",borderSelected:"#07b8b8"},darkColors:{primary:"#800080",contentOnPrimary:"#ffffff",borderSelected:"#526f3e"},style:"ALWAYS_DARK",primaryButton:{cornerRadius:8,height:48}}}).then(r=>{r.error&&console.error("[StripeOnrampPreconfigure] error:",r.error.message);}).catch(r=>{console.error("[StripeOnrampPreconfigure] threw:",r?.message);}));},[e]),null}var Yd="__unifold_stripe_onramp__";function fa(e){globalThis[Yd]=e;}function Jd(){return globalThis[Yd]}fa(ma);var Zr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this);}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe();}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var On,Go,gi,Zd,Cf=(Zd=class extends Zr{constructor(){super();Q(this,On);Q(this,Go);Q(this,gi);D(this,gi,t=>{if(typeof window<"u"&&window.addEventListener){let r=()=>t();return window.addEventListener("visibilitychange",r,false),()=>{window.removeEventListener("visibilitychange",r);}}});}onSubscribe(){u(this,Go)||this.setEventListener(u(this,gi));}onUnsubscribe(){var t;this.hasListeners()||((t=u(this,Go))==null||t.call(this),D(this,Go,void 0));}setEventListener(t){var r;D(this,gi,t),(r=u(this,Go))==null||r.call(this),D(this,Go,t(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus();}));}setFocused(t){u(this,On)!==t&&(D(this,On,t),this.onFocus());}onFocus(){let t=this.isFocused();this.listeners.forEach(r=>{r(t);});}isFocused(){return typeof u(this,On)=="boolean"?u(this,On):globalThis.document?.visibilityState!=="hidden"}},On=new WeakMap,Go=new WeakMap,gi=new WeakMap,Zd),yi=new Cf;var wf={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Xr,Dn,Xd,Tf=(Xd=class{constructor(){Q(this,Xr,wf);Q(this,Dn,false);}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&u(this,Dn)&&e!==u(this,Xr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:u(this,Xr),provider:e}),D(this,Xr,e),process.env.NODE_ENV!=="production"&&D(this,Dn,false);}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&D(this,Dn,true),u(this,Xr).setTimeout(e,t)}clearTimeout(e){u(this,Xr).clearTimeout(e);}setInterval(e,t){return process.env.NODE_ENV!=="production"&&D(this,Dn,true),u(this,Xr).setInterval(e,t)}clearInterval(e){u(this,Xr).clearInterval(e);}},Xr=new WeakMap,Dn=new WeakMap,Xd),eo=new Tf;function eu(e){setTimeout(e,0);}var Hl=typeof window>"u"||"Deno"in globalThis;function At(){}function ou(e,t){return typeof e=="function"?e(t):e}function ds(e){return typeof e=="number"&&e>=0&&e!==1/0}function ga(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zr(e,t){return typeof e=="function"?e(t):e}function hr(e,t){return typeof e=="function"?e(t):e}function ya(e,t){let{type:r="all",exact:o,fetchStatus:n,predicate:i,queryKey:s,stale:a}=e;if(s){if(o){if(t.queryHash!==us(s,t.options))return false}else if(!Ln(t.queryKey,s))return false}if(r!=="all"){let l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return false}return !(typeof a=="boolean"&&t.isStale()!==a||n&&n!==t.state.fetchStatus||i&&!i(t))}function ba(e,t){let{exact:r,status:o,predicate:n,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return false;if(r){if(Fn(t.options.mutationKey)!==Fn(i))return false}else if(!Ln(t.options.mutationKey,i))return false}return !(o&&t.state.status!==o||n&&!n(t))}function us(e,t){return (t?.queryKeyHashFn||Fn)(e)}function Fn(e){return JSON.stringify(e,(t,r)=>Ul(r)?Object.keys(r).sort().reduce((o,n)=>(o[n]=r[n],o),{}):r)}function Ln(e,t){return e===t?true:typeof e!=typeof t?false:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ln(e[r],t[r])):false}var Sf=Object.prototype.hasOwnProperty;function ha(e,t,r=0){if(e===t)return e;if(r>500)return t;let o=tu(e)&&tu(t);if(!o&&!(Ul(e)&&Ul(t)))return t;let i=(o?e:Object.keys(e)).length,s=o?t:Object.keys(t),a=s.length,l=o?new Array(a):{},d=0;for(let c=0;c<a;c++){let g=o?c:s[c],w=e[g],f=t[g];if(w===f){l[g]=w,(o?c<i:Sf.call(e,g))&&d++;continue}if(w===null||f===null||typeof w!="object"||typeof f!="object"){l[g]=f;continue}let y=ha(w,f,r+1);l[g]=y,y===w&&d++;}return i===a&&d===i?e:l}function Ca(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return false;for(let r in e)if(e[r]!==t[r])return false;return true}function tu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ul(e){if(!ru(e))return false;let t=e.constructor;if(t===void 0)return true;let r=t.prototype;return !(!ru(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ru(e){return Object.prototype.toString.call(e)==="[object Object]"}function nu(e){return new Promise(t=>{eo.setTimeout(t,e);})}function ps(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==false){if(process.env.NODE_ENV!=="production")try{return ha(e,t)}catch(o){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${o}`),o}return ha(e,t)}return t}function iu(e,t,r=0){let o=[...e,t];return r&&o.length>r?o.slice(1):o}function su(e,t,r=0){let o=[t,...e];return r&&o.length>r?o.slice(0,-1):o}var Vn=Symbol();function wa(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Vn&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Vn?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ta(e,t){return typeof e=="function"?e(...t):!!e}function au(e,t,r){let o=false,n;return Object.defineProperty(e,"signal",{enumerable:true,get:()=>(n??(n=t()),o||(o=true,n.aborted?r():n.addEventListener("abort",r,{once:true})),n)}),e}var to=(()=>{let e=()=>Hl;return {isServer(){return e()},setIsServer(t){e=t;}}})();function ms(){let e,t,r=new Promise((n,i)=>{e=n,t=i;});r.status="pending",r.catch(()=>{});function o(n){Object.assign(r,n),delete r.resolve,delete r.reject;}return r.resolve=n=>{o({status:"fulfilled",value:n}),e(n);},r.reject=n=>{o({status:"rejected",reason:n}),t(n);},r}var lu=eu;function kf(){let e=[],t=0,r=a=>{a();},o=a=>{a();},n=lu,i=a=>{t?e.push(a):n(()=>{r(a);});},s=()=>{let a=e;e=[],a.length&&n(()=>{o(()=>{a.forEach(l=>{r(l);});});});};return {batch:a=>{let l;t++;try{l=a();}finally{t--,t||s();}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l);});},schedule:i,setNotifyFunction:a=>{r=a;},setBatchNotifyFunction:a=>{o=a;},setScheduler:a=>{n=a;}}}var ut=kf();var bi,Yo,Ci,cu,xf=(cu=class extends Zr{constructor(){super();Q(this,bi,true);Q(this,Yo);Q(this,Ci);D(this,Ci,t=>{if(typeof window<"u"&&window.addEventListener){let r=()=>t(true),o=()=>t(false);return window.addEventListener("online",r,false),window.addEventListener("offline",o,false),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",o);}}});}onSubscribe(){u(this,Yo)||this.setEventListener(u(this,Ci));}onUnsubscribe(){var t;this.hasListeners()||((t=u(this,Yo))==null||t.call(this),D(this,Yo,void 0));}setEventListener(t){var r;D(this,Ci,t),(r=u(this,Yo))==null||r.call(this),D(this,Yo,t(this.setOnline.bind(this)));}setOnline(t){u(this,bi)!==t&&(D(this,bi,t),this.listeners.forEach(o=>{o(t);}));}isOnline(){return u(this,bi)}},bi=new WeakMap,Yo=new WeakMap,Ci=new WeakMap,cu),wi=new xf;function _f(e){return Math.min(1e3*2**e,3e4)}function Nl(e){return (e??"online")==="online"?wi.isOnline():true}var Sa=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent;}};function ka(e){let t=false,r=0,o,n=ms(),i=()=>n.status!=="pending",s=b=>{if(!i()){let m=new Sa(b);w(m),e.onCancel?.(m);}},a=()=>{t=true;},l=()=>{t=false;},d=()=>yi.isFocused()&&(e.networkMode==="always"||wi.isOnline())&&e.canRun(),c=()=>Nl(e.networkMode)&&e.canRun(),g=b=>{i()||(o?.(),n.resolve(b));},w=b=>{i()||(o?.(),n.reject(b));},f=()=>new Promise(b=>{o=m=>{(i()||d())&&b(m);},e.onPause?.();}).then(()=>{o=void 0,i()||e.onContinue?.();}),y=()=>{if(i())return;let b,m=r===0?e.initialPromise:void 0;try{b=m??e.fn();}catch(S){b=Promise.reject(S);}Promise.resolve(b).then(g).catch(S=>{if(i())return;let h=e.retry??(to.isServer()?0:3),p=e.retryDelay??_f,T=typeof p=="function"?p(r,S):p,x=h===true||typeof h=="number"&&r<h||typeof h=="function"&&h(r,S);if(t||!x){w(S);return}r++,e.onFail?.(r,S),nu(T).then(()=>d()?void 0:f()).then(()=>{t?w(S):y();});});};return {promise:n,status:()=>n.status,cancel:s,continue:()=>(o?.(),n),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?y():f().then(y),n)}}var Bn,du,xa=(du=class{constructor(){Q(this,Bn);}destroy(){this.clearGcTimeout();}scheduleGc(){this.clearGcTimeout(),ds(this.gcTime)&&D(this,Bn,eo.setTimeout(()=>{this.optionalRemove();},this.gcTime));}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(to.isServer()?1/0:300*1e3));}clearGcTimeout(){u(this,Bn)!==void 0&&(eo.clearTimeout(u(this,Bn)),D(this,Bn,void 0));}},Bn=new WeakMap,du);var Wn,Ti,Fr,An,$t,fs,En,Rr,hu,To,mu,fu=(mu=class extends xa{constructor(t){super();Q(this,Rr);Q(this,Wn);Q(this,Ti);Q(this,Fr);Q(this,An);Q(this,$t);Q(this,fs);Q(this,En);D(this,En,false),D(this,fs,t.defaultOptions),this.setOptions(t.options),this.observers=[],D(this,An,t.client),D(this,Fr,u(this,An).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,D(this,Wn,pu(this.options)),this.state=t.state??u(this,Wn),this.scheduleGc();}get meta(){return this.options.meta}get promise(){return u(this,$t)?.promise}setOptions(t){if(this.options={...u(this,fs),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let r=pu(this.options);r.data!==void 0&&(this.setState(uu(r.data,r.dataUpdatedAt)),D(this,Wn,r));}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&u(this,Fr).remove(this);}setData(t,r){let o=ps(this.state.data,t,this.options);return be(this,Rr,To).call(this,{data:o,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),o}setState(t,r){be(this,Rr,To).call(this,{type:"setState",state:t,setStateOptions:r});}cancel(t){let r=u(this,$t)?.promise;return u(this,$t)?.cancel(t),r?r.then(At).catch(At):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:true});}get resetState(){return u(this,Wn)}reset(){this.destroy(),this.setState(this.resetState);}isActive(){return this.observers.some(t=>hr(t.options.enabled,this)!==false)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vn||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zr(t.options.staleTime,this)==="static"):false}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?true:t==="static"?false:this.state.isInvalidated?true:!ga(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:false}),u(this,$t)?.continue();}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:false}),u(this,$t)?.continue();}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),u(this,Fr).notify({type:"observerAdded",query:this,observer:t}));}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(u(this,$t)&&(u(this,En)||be(this,Rr,hu).call(this)?u(this,$t).cancel({revert:true}):u(this,$t).cancelRetry()),this.scheduleGc()),u(this,Fr).notify({type:"observerRemoved",query:this,observer:t}));}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||be(this,Rr,To).call(this,{type:"invalidate"});}async fetch(t,r){if(this.state.fetchStatus!=="idle"&&u(this,$t)?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:true});else if(u(this,$t))return u(this,$t).continueRetry(),u(this,$t).promise}if(t&&this.setOptions(t),!this.options.queryFn){let l=this.observers.find(d=>d.options.queryFn);l&&this.setOptions(l.options);}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));let o=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:true,get:()=>(D(this,En,true),o.signal)});},i=()=>{let l=wa(this.options,r),c=(()=>{let g={client:u(this,An),queryKey:this.queryKey,meta:this.meta};return n(g),g})();return D(this,En,false),this.options.persister?this.options.persister(l,c,this):l(c)},a=(()=>{let l={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:u(this,An),state:this.state,fetchFn:i};return n(l),l})();this.options.behavior?.onFetch(a,this),D(this,Ti,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&be(this,Rr,To).call(this,{type:"fetch",meta:a.fetchOptions?.meta}),D(this,$t,ka({initialPromise:r?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof Sa&&l.revert&&this.setState({...u(this,Ti),fetchStatus:"idle"}),o.abort();},onFail:(l,d)=>{be(this,Rr,To).call(this,{type:"failed",failureCount:l,error:d});},onPause:()=>{be(this,Rr,To).call(this,{type:"pause"});},onContinue:()=>{be(this,Rr,To).call(this,{type:"continue"});},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>true}));try{let l=await u(this,$t).start();if(l===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(l),u(this,Fr).config.onSuccess?.(l,this),u(this,Fr).config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof Sa){if(l.silent)return u(this,$t).promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw be(this,Rr,To).call(this,{type:"error",error:l}),u(this,Fr).config.onError?.(l,this),u(this,Fr).config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc();}}},Wn=new WeakMap,Ti=new WeakMap,Fr=new WeakMap,An=new WeakMap,$t=new WeakMap,fs=new WeakMap,En=new WeakMap,Rr=new WeakSet,hu=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},To=function(t){let r=o=>{switch(t.type){case "failed":return {...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case "pause":return {...o,fetchStatus:"paused"};case "continue":return {...o,fetchStatus:"fetching"};case "fetch":return {...o,...jl(o.data,this.options),fetchMeta:t.meta??null};case "success":let n={...o,...uu(t.data,t.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return D(this,Ti,t.manual?n:void 0),n;case "error":let i=t.error;return {...o,error:i,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:true};case "invalidate":return {...o,isInvalidated:true};case "setState":return {...o,...t.state}}};this.state=r(this.state),ut.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate();}),u(this,Fr).notify({query:this,type:"updated",action:t});});},mu);function jl(e,t){return {fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Nl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uu(e,t){return {data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:false,status:"success"}}function pu(e){let t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,o=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return {data:t,dataUpdateCount:0,dataUpdatedAt:r?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:false,status:r?"success":"pending",fetchStatus:"idle"}}var gr,ve,gs,lr,Mn,Si,So,Jo,ys,ki,xi,zn,Un,Zo,_i,qe,hs,$l,ql,Ql,Kl,Gl,Yl,Jl,Cu,bu,Xl=(bu=class extends Zr{constructor(t,r){super();Q(this,qe);Q(this,gr);Q(this,ve);Q(this,gs);Q(this,lr);Q(this,Mn);Q(this,Si);Q(this,So);Q(this,Jo);Q(this,ys);Q(this,ki);Q(this,xi);Q(this,zn);Q(this,Un);Q(this,Zo);Q(this,_i,new Set);this.options=r,D(this,gr,t),D(this,Jo,null),D(this,So,ms()),this.bindMethods(),this.setOptions(r);}bindMethods(){this.refetch=this.refetch.bind(this);}onSubscribe(){this.listeners.size===1&&(u(this,ve).addObserver(this),gu(u(this,ve),this.options)?be(this,qe,hs).call(this):this.updateResult(),be(this,qe,Kl).call(this));}onUnsubscribe(){this.hasListeners()||this.destroy();}shouldFetchOnReconnect(){return Zl(u(this,ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zl(u(this,ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,be(this,qe,Gl).call(this),be(this,qe,Yl).call(this),u(this,ve).removeObserver(this);}setOptions(t){let r=this.options,o=u(this,ve);if(this.options=u(this,gr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hr(this.options.enabled,u(this,ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");be(this,qe,Jl).call(this),u(this,ve).setOptions(this.options),r._defaulted&&!Ca(this.options,r)&&u(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:u(this,ve),observer:this});let n=this.hasListeners();n&&yu(u(this,ve),o,this.options,r)&&be(this,qe,hs).call(this),this.updateResult(),n&&(u(this,ve)!==o||hr(this.options.enabled,u(this,ve))!==hr(r.enabled,u(this,ve))||zr(this.options.staleTime,u(this,ve))!==zr(r.staleTime,u(this,ve)))&&be(this,qe,$l).call(this);let i=be(this,qe,ql).call(this);n&&(u(this,ve)!==o||hr(this.options.enabled,u(this,ve))!==hr(r.enabled,u(this,ve))||i!==u(this,Zo))&&be(this,qe,Ql).call(this,i);}getOptimisticResult(t){let r=u(this,gr).getQueryCache().build(u(this,gr),t),o=this.createResult(r,t);return vf(this,o)&&(D(this,lr,o),D(this,Si,this.options),D(this,Mn,u(this,ve).state)),o}getCurrentResult(){return u(this,lr)}trackResult(t,r){return new Proxy(t,{get:(o,n)=>(this.trackProp(n),r?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&u(this,So).status==="pending"&&u(this,So).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,n))})}trackProp(t){u(this,_i).add(t);}getCurrentQuery(){return u(this,ve)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let r=u(this,gr).defaultQueryOptions(t),o=u(this,gr).getQueryCache().build(u(this,gr),r);return o.fetch().then(()=>this.createResult(o,r))}fetch(t){return be(this,qe,hs).call(this,{...t,cancelRefetch:t.cancelRefetch??true}).then(()=>(this.updateResult(),u(this,lr)))}createResult(t,r){let o=u(this,ve),n=this.options,i=u(this,lr),s=u(this,Mn),a=u(this,Si),d=t!==o?t.state:u(this,gs),{state:c}=t,g={...c},w=false,f;if(r._optimisticResults){let C=this.hasListeners(),B=!C&&gu(t,r),E=C&&yu(t,o,r,n);(B||E)&&(g={...g,...jl(c.data,t.options)}),r._optimisticResults==="isRestoring"&&(g.fetchStatus="idle");}let{error:y,errorUpdatedAt:b,status:m}=g;f=g.data;let S=false;if(r.placeholderData!==void 0&&f===void 0&&m==="pending"){let C;i?.isPlaceholderData&&r.placeholderData===a?.placeholderData?(C=i.data,S=true):C=typeof r.placeholderData=="function"?r.placeholderData(u(this,xi)?.state.data,u(this,xi)):r.placeholderData,C!==void 0&&(m="success",f=ps(i?.data,C,r),w=true);}if(r.select&&f!==void 0&&!S)if(i&&f===s?.data&&r.select===u(this,ys))f=u(this,ki);else try{D(this,ys,r.select),f=r.select(f),f=ps(i?.data,f,r),D(this,ki,f),D(this,Jo,null);}catch(C){D(this,Jo,C);}u(this,Jo)&&(y=u(this,Jo),f=u(this,ki),b=Date.now(),m="error");let h=g.fetchStatus==="fetching",p=m==="pending",T=m==="error",x=p&&h,_=f!==void 0,k={status:m,fetchStatus:g.fetchStatus,isPending:p,isSuccess:m==="success",isError:T,isInitialLoading:x,isLoading:x,data:f,dataUpdatedAt:g.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>d.dataUpdateCount||g.errorUpdateCount>d.errorUpdateCount,isFetching:h,isRefetching:h&&!p,isLoadingError:T&&!_,isPaused:g.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:T&&_,isStale:ec(t,r),refetch:this.refetch,promise:u(this,So),isEnabled:hr(r.enabled,t)!==false};if(this.options.experimental_prefetchInRender){let C=k.data!==void 0,B=k.status==="error"&&!C,E=H=>{B?H.reject(k.error):C&&H.resolve(k.data);},L=()=>{let H=D(this,So,k.promise=ms());E(H);},R=u(this,So);switch(R.status){case "pending":t.queryHash===o.queryHash&&E(R);break;case "fulfilled":(B||k.data!==R.value)&&L();break;case "rejected":(!B||k.error!==R.reason)&&L();break}}return k}updateResult(){let t=u(this,lr),r=this.createResult(u(this,ve),this.options);if(D(this,Mn,u(this,ve).state),D(this,Si,this.options),u(this,Mn).data!==void 0&&D(this,xi,u(this,ve)),Ca(r,t))return;D(this,lr,r);let o=()=>{if(!t)return true;let{notifyOnChangeProps:n}=this.options,i=typeof n=="function"?n():n;if(i==="all"||!i&&!u(this,_i).size)return true;let s=new Set(i??u(this,_i));return this.options.throwOnError&&s.add("error"),Object.keys(u(this,lr)).some(a=>{let l=a;return u(this,lr)[l]!==t[l]&&s.has(l)})};be(this,qe,Cu).call(this,{listeners:o()});}onQueryUpdate(){this.updateResult(),this.hasListeners()&&be(this,qe,Kl).call(this);}},gr=new WeakMap,ve=new WeakMap,gs=new WeakMap,lr=new WeakMap,Mn=new WeakMap,Si=new WeakMap,So=new WeakMap,Jo=new WeakMap,ys=new WeakMap,ki=new WeakMap,xi=new WeakMap,zn=new WeakMap,Un=new WeakMap,Zo=new WeakMap,_i=new WeakMap,qe=new WeakSet,hs=function(t){be(this,qe,Jl).call(this);let r=u(this,ve).fetch(this.options,t);return t?.throwOnError||(r=r.catch(At)),r},$l=function(){be(this,qe,Gl).call(this);let t=zr(this.options.staleTime,u(this,ve));if(to.isServer()||u(this,lr).isStale||!ds(t))return;let o=ga(u(this,lr).dataUpdatedAt,t)+1;D(this,zn,eo.setTimeout(()=>{u(this,lr).isStale||this.updateResult();},o));},ql=function(){return (typeof this.options.refetchInterval=="function"?this.options.refetchInterval(u(this,ve)):this.options.refetchInterval)??false},Ql=function(t){be(this,qe,Yl).call(this),D(this,Zo,t),!(to.isServer()||hr(this.options.enabled,u(this,ve))===false||!ds(u(this,Zo))||u(this,Zo)===0)&&D(this,Un,eo.setInterval(()=>{(this.options.refetchIntervalInBackground||yi.isFocused())&&be(this,qe,hs).call(this);},u(this,Zo)));},Kl=function(){be(this,qe,$l).call(this),be(this,qe,Ql).call(this,be(this,qe,ql).call(this));},Gl=function(){u(this,zn)!==void 0&&(eo.clearTimeout(u(this,zn)),D(this,zn,void 0));},Yl=function(){u(this,Un)!==void 0&&(eo.clearInterval(u(this,Un)),D(this,Un,void 0));},Jl=function(){let t=u(this,gr).getQueryCache().build(u(this,gr),this.options);if(t===u(this,ve))return;let r=u(this,ve);D(this,ve,t),D(this,gs,t.state),this.hasListeners()&&(r?.removeObserver(this),t.addObserver(this));},Cu=function(t){ut.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(u(this,lr));}),u(this,gr).getQueryCache().notify({query:u(this,ve),type:"observerResultsUpdated"});});},bu);function Rf(e,t){return hr(t.enabled,e)!==false&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===false)}function gu(e,t){return Rf(e,t)||e.state.data!==void 0&&Zl(e,t,t.refetchOnMount)}function Zl(e,t,r){if(hr(t.enabled,e)!==false&&zr(t.staleTime,e)!=="static"){let o=typeof r=="function"?r(e):r;return o==="always"||o!==false&&ec(e,t)}return false}function yu(e,t,r,o){return (e!==t||hr(o.enabled,e)===false)&&(!r.suspense||e.state.status!=="error")&&ec(e,r)}function ec(e,t){return hr(t.enabled,e)!==false&&e.isStaleByTime(zr(t.staleTime,e))}function vf(e,t){return !Ca(e.getCurrentResult(),t)}function tc(e){return {onFetch:(t,r)=>{let o=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[],a={pages:[],pageParams:[]},l=0,d=async()=>{let c=false,g=y=>{au(y,()=>t.signal,()=>c=true);},w=wa(t.options,t.fetchOptions),f=async(y,b,m)=>{if(c)return Promise.reject();if(b==null&&y.pages.length)return Promise.resolve(y);let h=(()=>{let _={client:t.client,queryKey:t.queryKey,pageParam:b,direction:m?"backward":"forward",meta:t.options.meta};return g(_),_})(),p=await w(h),{maxPages:T}=t.options,x=m?su:iu;return {pages:x(y.pages,p,T),pageParams:x(y.pageParams,b,T)}};if(n&&i.length){let y=n==="backward",b=y?If:wu,m={pages:i,pageParams:s},S=b(o,m);a=await f(m,S,y);}else {let y=e??i.length;do{let b=l===0?s[0]??o.initialPageParam:wu(o,a);if(l>0&&b==null)break;a=await f(a,b),l++;}while(l<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=d;}}}function wu(e,{pages:t,pageParams:r}){let o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,r[o],r):void 0}function If(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var bs,ro,rr,Hn,oo,Xo,Tu,Su=(Tu=class extends xa{constructor(t){super();Q(this,oo);Q(this,bs);Q(this,ro);Q(this,rr);Q(this,Hn);D(this,bs,t.client),this.mutationId=t.mutationId,D(this,rr,t.mutationCache),D(this,ro,[]),this.state=t.state||Pf(),this.setOptions(t.options),this.scheduleGc();}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime);}get meta(){return this.options.meta}addObserver(t){u(this,ro).includes(t)||(u(this,ro).push(t),this.clearGcTimeout(),u(this,rr).notify({type:"observerAdded",mutation:this,observer:t}));}removeObserver(t){D(this,ro,u(this,ro).filter(r=>r!==t)),this.scheduleGc(),u(this,rr).notify({type:"observerRemoved",mutation:this,observer:t});}optionalRemove(){u(this,ro).length||(this.state.status==="pending"?this.scheduleGc():u(this,rr).remove(this));}continue(){return u(this,Hn)?.continue()??this.execute(this.state.variables)}async execute(t){let r=()=>{be(this,oo,Xo).call(this,{type:"continue"});},o={client:u(this,bs),meta:this.options.meta,mutationKey:this.options.mutationKey};D(this,Hn,ka({fn:()=>this.options.mutationFn?this.options.mutationFn(t,o):Promise.reject(new Error("No mutationFn found")),onFail:(s,a)=>{be(this,oo,Xo).call(this,{type:"failed",failureCount:s,error:a});},onPause:()=>{be(this,oo,Xo).call(this,{type:"pause"});},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>u(this,rr).canRun(this)}));let n=this.state.status==="pending",i=!u(this,Hn).canStart();try{if(n)r();else {be(this,oo,Xo).call(this,{type:"pending",variables:t,isPaused:i}),u(this,rr).config.onMutate&&await u(this,rr).config.onMutate(t,this,o);let a=await this.options.onMutate?.(t,o);a!==this.state.context&&be(this,oo,Xo).call(this,{type:"pending",context:a,variables:t,isPaused:i});}let s=await u(this,Hn).start();return await u(this,rr).config.onSuccess?.(s,t,this.state.context,this,o),await this.options.onSuccess?.(s,t,this.state.context,o),await u(this,rr).config.onSettled?.(s,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(s,null,t,this.state.context,o),be(this,oo,Xo).call(this,{type:"success",data:s}),s}catch(s){try{await u(this,rr).config.onError?.(s,t,this.state.context,this,o);}catch(a){Promise.reject(a);}try{await this.options.onError?.(s,t,this.state.context,o);}catch(a){Promise.reject(a);}try{await u(this,rr).config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,o);}catch(a){Promise.reject(a);}try{await this.options.onSettled?.(void 0,s,t,this.state.context,o);}catch(a){Promise.reject(a);}throw be(this,oo,Xo).call(this,{type:"error",error:s}),s}finally{u(this,rr).runNext(this);}}},bs=new WeakMap,ro=new WeakMap,rr=new WeakMap,Hn=new WeakMap,oo=new WeakSet,Xo=function(t){let r=o=>{switch(t.type){case "failed":return {...o,failureCount:t.failureCount,failureReason:t.error};case "pause":return {...o,isPaused:true};case "continue":return {...o,isPaused:false};case "pending":return {...o,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case "success":return {...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:false};case "error":return {...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:false,status:"error"}}};this.state=r(this.state),ut.batch(()=>{u(this,ro).forEach(o=>{o.onMutationUpdate(t);}),u(this,rr).notify({mutation:this,type:"updated",action:t});});},Tu);function Pf(){return {context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:false,status:"idle",variables:void 0,submittedAt:0}}var ko,Ur,Cs,ku,xu=(ku=class extends Zr{constructor(t={}){super();Q(this,ko);Q(this,Ur);Q(this,Cs);this.config=t,D(this,ko,new Set),D(this,Ur,new Map),D(this,Cs,0);}build(t,r,o){let n=new Su({client:t,mutationCache:this,mutationId:++qi(this,Cs)._,options:t.defaultMutationOptions(r),state:o});return this.add(n),n}add(t){u(this,ko).add(t);let r=_a(t);if(typeof r=="string"){let o=u(this,Ur).get(r);o?o.push(t):u(this,Ur).set(r,[t]);}this.notify({type:"added",mutation:t});}remove(t){if(u(this,ko).delete(t)){let r=_a(t);if(typeof r=="string"){let o=u(this,Ur).get(r);if(o)if(o.length>1){let n=o.indexOf(t);n!==-1&&o.splice(n,1);}else o[0]===t&&u(this,Ur).delete(r);}}this.notify({type:"removed",mutation:t});}canRun(t){let r=_a(t);if(typeof r=="string"){let n=u(this,Ur).get(r)?.find(i=>i.state.status==="pending");return !n||n===t}else return true}runNext(t){let r=_a(t);return typeof r=="string"?u(this,Ur).get(r)?.find(n=>n!==t&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ut.batch(()=>{u(this,ko).forEach(t=>{this.notify({type:"removed",mutation:t});}),u(this,ko).clear(),u(this,Ur).clear();});}getAll(){return Array.from(u(this,ko))}find(t){let r={exact:true,...t};return this.getAll().find(o=>ba(r,o))}findAll(t={}){return this.getAll().filter(r=>ba(t,r))}notify(t){ut.batch(()=>{this.listeners.forEach(r=>{r(t);});});}resumePausedMutations(){let t=this.getAll().filter(r=>r.state.isPaused);return ut.batch(()=>Promise.all(t.map(r=>r.continue().catch(At))))}},ko=new WeakMap,Ur=new WeakMap,Cs=new WeakMap,ku);function _a(e){return e.options.scope?.id}var no,_u,Ru=(_u=class extends Zr{constructor(t={}){super();Q(this,no);this.config=t,D(this,no,new Map);}build(t,r,o){let n=r.queryKey,i=r.queryHash??us(n,r),s=this.get(i);return s||(s=new fu({client:t,queryKey:n,queryHash:i,options:t.defaultQueryOptions(r),state:o,defaultOptions:t.getQueryDefaults(n)}),this.add(s)),s}add(t){u(this,no).has(t.queryHash)||(u(this,no).set(t.queryHash,t),this.notify({type:"added",query:t}));}remove(t){let r=u(this,no).get(t.queryHash);r&&(t.destroy(),r===t&&u(this,no).delete(t.queryHash),this.notify({type:"removed",query:t}));}clear(){ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t);});});}get(t){return u(this,no).get(t)}getAll(){return [...u(this,no).values()]}find(t){let r={exact:true,...t};return this.getAll().find(o=>ya(r,o))}findAll(t={}){let r=this.getAll();return Object.keys(t).length>0?r.filter(o=>ya(t,o)):r}notify(t){ut.batch(()=>{this.listeners.forEach(r=>{r(t);});});}onFocus(){ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus();});});}onOnline(){ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline();});});}},no=new WeakMap,_u);var xt,en,tn,Ri,vi,rn,Ii,Pi,vu,rc=(vu=class{constructor(e={}){Q(this,xt);Q(this,en);Q(this,tn);Q(this,Ri);Q(this,vi);Q(this,rn);Q(this,Ii);Q(this,Pi);D(this,xt,e.queryCache||new Ru),D(this,en,e.mutationCache||new xu),D(this,tn,e.defaultOptions||{}),D(this,Ri,new Map),D(this,vi,new Map),D(this,rn,0);}mount(){qi(this,rn)._++,u(this,rn)===1&&(D(this,Ii,yi.subscribe(async e=>{e&&(await this.resumePausedMutations(),u(this,xt).onFocus());})),D(this,Pi,wi.subscribe(async e=>{e&&(await this.resumePausedMutations(),u(this,xt).onOnline());})));}unmount(){var e,t;qi(this,rn)._--,u(this,rn)===0&&((e=u(this,Ii))==null||e.call(this),D(this,Ii,void 0),(t=u(this,Pi))==null||t.call(this),D(this,Pi,void 0));}isFetching(e){return u(this,xt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return u(this,en).findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return u(this,xt).get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=u(this,xt).build(this,t),o=r.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(zr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return u(this,xt).findAll(e).map(({queryKey:t,state:r})=>{let o=r.data;return [t,o]})}setQueryData(e,t,r){let o=this.defaultQueryOptions({queryKey:e}),i=u(this,xt).get(o.queryHash)?.state.data,s=ou(t,i);if(s!==void 0)return u(this,xt).build(this,o).setData(s,{...r,manual:true})}setQueriesData(e,t,r){return ut.batch(()=>u(this,xt).findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return u(this,xt).get(t.queryHash)?.state}removeQueries(e){let t=u(this,xt);ut.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r);});});}resetQueries(e,t){let r=u(this,xt);return ut.batch(()=>(r.findAll(e).forEach(o=>{o.reset();}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:true,...t},o=ut.batch(()=>u(this,xt).findAll(e).map(n=>n.cancel(r)));return Promise.all(o).then(At).catch(At)}invalidateQueries(e,t={}){return ut.batch(()=>(u(this,xt).findAll(e).forEach(r=>{r.invalidate();}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??true},o=ut.batch(()=>u(this,xt).findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let i=n.fetch(void 0,r);return r.throwOnError||(i=i.catch(At)),n.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(o).then(At)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=false);let r=u(this,xt).build(this,t);return r.isStaleByTime(zr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(At).catch(At)}fetchInfiniteQuery(e){return e.behavior=tc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(At).catch(At)}ensureInfiniteQueryData(e){return e.behavior=tc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return wi.isOnline()?u(this,en).resumePausedMutations():Promise.resolve()}getQueryCache(){return u(this,xt)}getMutationCache(){return u(this,en)}getDefaultOptions(){return u(this,tn)}setDefaultOptions(e){D(this,tn,e);}setQueryDefaults(e,t){u(this,Ri).set(Fn(e),{queryKey:e,defaultOptions:t});}getQueryDefaults(e){let t=[...u(this,Ri).values()],r={};return t.forEach(o=>{Ln(e,o.queryKey)&&Object.assign(r,o.defaultOptions);}),r}setMutationDefaults(e,t){u(this,vi).set(Fn(e),{mutationKey:e,defaultOptions:t});}getMutationDefaults(e){let t=[...u(this,vi).values()],r={};return t.forEach(o=>{Ln(e,o.mutationKey)&&Object.assign(r,o.defaultOptions);}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...u(this,tn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:true};return t.queryHash||(t.queryHash=us(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Vn&&(t.enabled=false),t}defaultMutationOptions(e){return e?._defaulted?e:{...u(this,tn).mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:true}}clear(){u(this,xt).clear(),u(this,en).clear();}},xt=new WeakMap,en=new WeakMap,tn=new WeakMap,Ri=new WeakMap,vi=new WeakMap,rn=new WeakMap,Ii=new WeakMap,Pi=new WeakMap,vu);var oc=on__namespace.createContext(void 0),nc=e=>{let t=on__namespace.useContext(oc);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ic=({client:e,children:t})=>(on__namespace.useEffect(()=>(e.mount(),()=>{e.unmount();}),[e]),jsxRuntime.jsx(oc.Provider,{value:e,children:t}));var Iu=on__namespace.createContext(false),Pu=()=>on__namespace.useContext(Iu);Iu.Provider;function Df(){let e=false;return {clearReset:()=>{e=false;},reset:()=>{e=true;},isReset:()=>e}}var Ff=on__namespace.createContext(Df()),Ou=()=>on__namespace.useContext(Ff);var Fu=(e,t,r)=>{let o=r?.state.error&&typeof e.throwOnError=="function"?Ta(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||o)&&(t.isReset()||(e.retryOnMount=false));},Vu=e=>{on__namespace.useEffect(()=>{e.clearReset();},[e]);},Lu=({result:e,errorResetBoundary:t,throwOnError:r,query:o,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(n&&e.data===void 0||Ta(r,[e.error,o]));var Bu=e=>{if(e.suspense){let r=n=>n==="static"?n:Math.max(n??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...n)=>r(o(...n)):r(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3));}},Wu=(e,t)=>e.isLoading&&e.isFetching&&!t,Au=(e,t)=>e?.suspense&&t.isPending,sc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset();});function Eu(e,t,r){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');let o=Pu(),n=Ou(),i=nc(),s=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let a=i.getQueryCache().get(s.queryHash);process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",Bu(s),Fu(s,n,a),Vu(n);let l=!i.getQueryCache().get(s.queryHash),[d]=on__namespace.useState(()=>new t(i,s)),c=d.getOptimisticResult(s),g=!o&&e.subscribed!==false;if(on__namespace.useSyncExternalStore(on__namespace.useCallback(w=>{let f=g?d.subscribe(ut.batchCalls(w)):At;return d.updateResult(),f},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),on__namespace.useEffect(()=>{d.setOptions(s);},[s,d]),Au(s,c))throw sc(s,d,n);if(Lu({result:c,errorResetBoundary:n,throwOnError:s.throwOnError,query:a,suspense:s.suspense}))throw c.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(s,c),s.experimental_prefetchInRender&&!to.isServer()&&Wu(c,o)&&(l?sc(s,d,n):a?.promise)?.catch(At).finally(()=>{d.updateResult();}),s.notifyOnChangeProps?c:d.trackResult(c)}function xo(e,t){return Eu(e,Xl)}function Di({children:e,mode:t="auto",accentColor:r,theme:o,fontFamily:n,fonts:i,components:s}){let a=reactNative.useColorScheme(),l=on.useMemo(()=>t==="auto"?a==="dark"?"dark":"light":t,[t,a]),d=on.useMemo(()=>{let f=o?.[l];return bl(l,f,r)},[l,o,r]),c=on.useMemo(()=>Qi(d,s,l),[d,s,l]),g=on.useMemo(()=>i?{regular:i.regular||n,medium:i.medium||n,semibold:i.semibold||n,bold:i.bold||n}:n?{regular:n,medium:n,semibold:n,bold:n}:{regular:void 0,medium:void 0,semibold:void 0,bold:void 0},[n,i]),w=on.useMemo(()=>({mode:l,colors:d,fonts:g,components:c,isDark:l==="dark"}),[l,d,g,c]);return jsxRuntime.jsx(Cl.Provider,{value:w,children:e})}function Qe({visible:e,onClose:t,children:r,closeOnBackdropPress:o=true,showHandle:n=true,heightPercent:i,noPadding:s=false,borderTopLeftRadius:a=24,borderTopRightRadius:l=24}){let{colors:d,components:c}=O(),{height:g}=reactNative.useWindowDimensions(),w=on.useRef(g);w.current=g;let f=on.useRef(new reactNative.Animated.Value(g)).current,y=on.useRef(new reactNative.Animated.Value(0)).current,b=i!=null&&i>=1;on.useEffect(()=>{let S=w.current;e?(f.setValue(S),y.setValue(0),reactNative.Animated.parallel([reactNative.Animated.spring(f,{toValue:0,useNativeDriver:true,tension:65,friction:11}),reactNative.Animated.timing(y,{toValue:.5,duration:200,useNativeDriver:true})]).start()):reactNative.Animated.parallel([reactNative.Animated.spring(f,{toValue:S,useNativeDriver:true,tension:65,friction:11}),reactNative.Animated.timing(y,{toValue:0,duration:200,useNativeDriver:true})]).start();},[e,f,y]);let m=()=>{o&&t();};return jsxRuntime.jsx(reactNative.Modal,{visible:e,transparent:true,animationType:"none",statusBarTranslucent:true,onRequestClose:t,children:jsxRuntime.jsxs(reactNativeGestureHandler.GestureHandlerRootView,{style:[nn.container,reactNative.Platform.OS==="android"&&{paddingTop:reactNative.StatusBar.currentHeight}],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[nn.backdrop,{backgroundColor:"#000000",opacity:y}],pointerEvents:"none"}),!b&&jsxRuntime.jsx(reactNative.TouchableWithoutFeedback,{onPress:m,children:jsxRuntime.jsx(reactNative.View,{style:nn.backdropTouchArea})}),jsxRuntime.jsxs(reactNative.Animated.View,{style:[nn.sheet,{maxHeight:g*.9,backgroundColor:d.background,borderTopLeftRadius:a,borderTopRightRadius:l,overflow:"hidden",transform:[{translateY:f}],shadowColor:c.sheet.shadowColor,shadowOffset:c.sheet.shadowOffset,shadowOpacity:c.sheet.shadowOpacity,shadowRadius:c.sheet.shadowRadius,elevation:c.sheet.elevation,...i&&{height:g*i,maxHeight:g*i},...b&&{paddingBottom:0},...s&&{paddingBottom:0}}],children:[n&&jsxRuntime.jsx(reactNative.View,{style:nn.handleContainer,children:jsxRuntime.jsx(reactNative.View,{style:[nn.handle,{backgroundColor:d.border}]})}),jsxRuntime.jsx(reactNative.View,{style:[nn.content,i&&nn.contentFlex],children:r})]})]})})}var nn=reactNative.StyleSheet.create({container:{flex:1},backdrop:{...reactNative.StyleSheet.absoluteFillObject},backdropTouchArea:{flex:1},sheet:{paddingBottom:reactNative.Platform.OS==="ios"?34:24},handleContainer:{alignItems:"center",paddingTop:12,paddingBottom:4},handle:{width:36,height:4,borderRadius:2},content:{},contentFlex:{flex:1}});var Vi=new Map;function Hu({width:e,height:t,borderRadius:r,color:o}){let n=on.useRef(new reactNative.Animated.Value(.3)).current;return on.useEffect(()=>{let i=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(n,{toValue:.7,duration:800,useNativeDriver:true}),reactNative.Animated.timing(n,{toValue:.3,duration:800,useNativeDriver:true})]));return i.start(),()=>i.stop()},[n]),jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",width:e,height:t,borderRadius:r,backgroundColor:o,opacity:n}})}function an({uri:e,width:t,height:r,borderRadius:o=0,borderWidth:n=0,borderColor:i="transparent",backgroundColor:s="transparent",style:a}){let{colors:l}=O(),[d,c]=on.useState(false),[g,w]=on.useState(false),[f,y]=on.useState(()=>{if(!e||!e.toLowerCase().endsWith(".svg"))return null;let x=Vi.get(e);return x?{uri:e,xml:x}:null}),b=e?.toLowerCase().endsWith(".svg"),m=b&&e&&f?.uri===e?f.xml:null;on.useEffect(()=>{c(false),w(false);},[e]),on.useEffect(()=>{if(!b||!e)return;if(Vi.has(e)){y({uri:e,xml:Vi.get(e)});return}let x=false;return fetch(e).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.text()}).then(_=>{x||(Vi.set(e,_),y({uri:e,xml:_}));}).catch(()=>{x||c(true);}),()=>{x=true;}},[e,b]);let S=l.card;if(!e)return jsxRuntime.jsx(reactNative.View,{style:[{width:t,height:r,borderRadius:o,backgroundColor:S},a]});let h={width:t,height:r,borderRadius:o,borderWidth:n,borderColor:i,backgroundColor:s,overflow:"hidden",alignItems:"center",justifyContent:"center",...a},p=t-n*2,T=r-n*2;return d?jsxRuntime.jsx(reactNative.View,{style:[h,{backgroundColor:s||S}]}):b?jsxRuntime.jsxs(reactNative.View,{style:h,children:[!!!m&&jsxRuntime.jsx(Hu,{width:p,height:T,borderRadius:o,color:S}),m?jsxRuntime.jsx(St.SvgXml,{xml:m,width:p,height:T,onError:()=>c(true)}):jsxRuntime.jsx(St.SvgUri,{uri:e,width:p,height:T,onError:()=>c(true)})]}):jsxRuntime.jsxs(reactNative.View,{style:h,children:[!g&&jsxRuntime.jsx(Hu,{width:p,height:T,borderRadius:o,color:S}),jsxRuntime.jsx(reactNative.Image,{source:{uri:e,cache:"force-cache"},style:{width:p,height:T},resizeMode:"contain",onLoad:()=>w(true),onError:()=>c(true)})]})}function dc(e){let t=[];for(let r of e)if(r)if(r.toLowerCase().endsWith(".svg")){if(Vi.has(r))continue;t.push(fetch(r).then(o=>{if(!o.ok)throw new Error(`HTTP ${o.status}`);return o.text()}).then(o=>{Vi.set(r,o);}).catch(()=>{}));}else t.push(reactNative.Image.prefetch(r).then(()=>{}).catch(()=>{}));return Promise.all(t).then(()=>{})}function cr({title:e,subtitle:t,showBack:r=false,showClose:o=true,onBack:n,onClose:i,badge:s,showBalance:a=false,balanceAddress:l,balanceChainType:d,balanceChainId:c,balanceTokenAddress:g,publishableKey:w,projectName:f,leftIcon:y,onLeftAction:b}){let{colors:m,fonts:S,components:h}=O(),[p,T]=on.useState(null),[x,_]=on.useState(false),F=on.useState(()=>new reactNative.Animated.Value(0))[0];on.useEffect(()=>{if(!x)return;let C=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(F,{toValue:1,duration:700,useNativeDriver:true}),reactNative.Animated.timing(F,{toValue:0,duration:700,useNativeDriver:true})]));return C.start(),()=>C.stop()},[x,F]),on.useEffect(()=>{if(!a||!l||!d||!c||!g||!w){T(null),_(false);return}let C=false;return _(true),ia(l,d,c,g,w).then(B=>{if(C)return;let E=B.balance,L=null;E&&(E.amount_usd!=null&&E.amount_usd!==""?L=`$${E.amount_usd}`:L="$0.00"),T(L);}).catch(()=>{C||T(null);}).finally(()=>{C||_(false);}),()=>{C=true;}},[a,l,d,c,g,w]);let k=F.interpolate({inputRange:[0,1],outputRange:[.4,1]});return jsxRuntime.jsxs(reactNative.View,{style:or.header,children:[jsxRuntime.jsx(reactNative.View,{style:or.leftContainer,children:r&&n?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:n,style:[or.iconButton,{backgroundColor:"transparent"}],hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(Ki,{size:20,color:h.header.buttonColor,strokeWidth:2})}):y&&b?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:b,style:[or.iconButton,{backgroundColor:"transparent"}],hitSlop:{top:10,bottom:10,left:10,right:10},children:y}):jsxRuntime.jsx(reactNative.View,{style:or.spacer})}),jsxRuntime.jsxs(reactNative.View,{style:or.titleContainer,children:[jsxRuntime.jsxs(reactNative.View,{style:or.titleRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[or.title,{color:h.header.titleColor,fontFamily:S.medium}],children:e}),s&&s.count>0&&jsxRuntime.jsx(reactNative.View,{style:[or.titleBadge,{backgroundColor:m.card}],children:jsxRuntime.jsx(reactNative.Text,{style:[or.titleBadgeText,{color:m.foregroundMuted,fontFamily:S.regular}],children:s.count})})]}),t?jsxRuntime.jsx(reactNative.Text,{style:[or.balanceText,{color:m.foregroundMuted,fontFamily:S.regular}],children:t}):null,a&&(x?jsxRuntime.jsx(reactNative.Animated.View,{style:[or.balanceSkeleton,{backgroundColor:m.cardHover,opacity:k}]}):p!=null?jsxRuntime.jsxs(reactNative.Text,{style:[or.balanceText,{color:m.foregroundMuted,fontFamily:S.regular}],children:[f?`${f} `:"","Balance: ",p]}):null)]}),jsxRuntime.jsx(reactNative.View,{style:or.rightContainer,children:o?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:i,style:[or.iconButton,{backgroundColor:"transparent"}],hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(tt,{size:20,color:h.header.buttonColor,strokeWidth:2})}):jsxRuntime.jsx(reactNative.View,{style:or.spacer})})]})}var or=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},leftContainer:{width:40,alignItems:"flex-start"},rightContainer:{width:40,alignItems:"flex-end"},titleContainer:{flex:1,alignItems:"center"},titleRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},title:{fontSize:16,textAlign:"center"},titleBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:12},titleBadgeText:{fontSize:10,fontWeight:"400"},balanceSkeleton:{height:10,width:120,borderRadius:5,marginTop:4},balanceText:{fontSize:14,marginTop:3,textAlign:"center"},iconButton:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},spacer:{width:28,height:28}});function Et({children:e,style:t,contentStyle:r,onPress:o,activeOpacity:n=.7,cardTokens:i}){let{components:s}=O(),a=i??s.card,l=a.backShadowColor!=="transparent",d={backgroundColor:a.backgroundColor,borderRadius:a.borderRadius,borderWidth:a.borderWidth,borderColor:a.borderColor},c=[qu.wrapper,t,l&&{marginBottom:a.backShadowSpacing}],g=[d,r];return jsxRuntime.jsxs(reactNative.View,{style:c,children:[l&&jsxRuntime.jsx(reactNative.View,{style:[qu.backShadow,{top:a.backShadowOffset.top,left:a.backShadowOffset.left,right:a.backShadowOffset.right,bottom:a.backShadowOffset.bottom,backgroundColor:a.backShadowColor,borderRadius:a.borderRadius}]}),o!=null?jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:o,activeOpacity:n,style:g,children:e}):jsxRuntime.jsx(reactNative.View,{style:g,children:e})]})}var qu=reactNative.StyleSheet.create({wrapper:{position:"relative"},backShadow:{position:"absolute"}});function Ss({onPress:e,title:t,subtitle:r,featuredTokens:o}){let{fonts:n,components:i}=O(),s=i.depositMenu.card,a=o?[...o].sort((l,d)=>l.position-d.position):[];return jsxRuntime.jsxs(Et,{cardTokens:s,onPress:e,style:so.wrapper,contentStyle:so.container,children:[jsxRuntime.jsxs(reactNative.View,{style:so.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[so.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:jsxRuntime.jsx(Tl,{size:20,color:s.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:so.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[so.title,{color:s.titleColor,fontFamily:n.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[so.subtitle,{color:s.subtitleColor,fontFamily:n.regular}],children:r})]})]}),jsxRuntime.jsx(reactNative.View,{style:so.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:so.networkIcons,children:a.map((l,d)=>{let c=l.icon_urls.find(g=>g.format==="png")?.url||l.icon_urls.find(g=>g.format==="svg")?.url;return jsxRuntime.jsx(reactNative.View,{style:[so.networkIconWrapper,{marginLeft:d===0?0:-6,zIndex:a.length-d}],children:jsxRuntime.jsx(an,{uri:K(c),width:20,height:20})},l.name)})})})]})}var so=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},networkIcons:{flexDirection:"row",alignItems:"center"},networkIconWrapper:{}});function xs({onPress:e,title:t,subtitle:r,paymentNetworks:o}){let{fonts:n,components:i}=O(),s=i.depositMenu.card;return jsxRuntime.jsxs(Et,{cardTokens:s,onPress:e,style:_o.wrapper,contentStyle:_o.container,children:[jsxRuntime.jsxs(reactNative.View,{style:_o.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[_o.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:jsxRuntime.jsx(Sl,{size:20,color:s.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:_o.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[_o.title,{color:s.titleColor,fontFamily:n.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[_o.subtitle,{color:s.subtitleColor,fontFamily:n.regular}],children:r})]})]}),jsxRuntime.jsx(reactNative.View,{style:_o.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:_o.paymentIcons,children:o?.map(a=>{let l=a.icon_urls.find(d=>d.format==="png")?.url||a.icon_urls.find(d=>d.format==="svg")?.url;return jsxRuntime.jsx(an,{uri:K(l),width:32,height:20,borderRadius:4},a.name)})})})]})}var _o=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},paymentIcons:{flexDirection:"row",alignItems:"center",gap:6}});function _s({onPress:e,title:t,subtitle:r,badge:o}){let{fonts:n,components:i}=O(),s=i.depositMenu.card;return jsxRuntime.jsx(Et,{cardTokens:s,onPress:e,style:Ro.wrapper,contentStyle:Ro.container,children:jsxRuntime.jsxs(reactNative.View,{style:Ro.leftContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[Ro.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:[jsxRuntime.jsx(jr,{size:20,color:s.iconColor,strokeWidth:2}),o!==void 0&&o>0&&jsxRuntime.jsx(reactNative.View,{style:[Ro.badge,{backgroundColor:s.iconColor,borderRadius:i.badge.borderRadius}],children:jsxRuntime.jsx(reactNative.Text,{style:[Ro.badgeText,{fontFamily:n.semibold}],children:o>99?"99+":o})})]}),jsxRuntime.jsxs(reactNative.View,{style:Ro.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ro.title,{color:s.titleColor,fontFamily:n.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[Ro.subtitle,{color:s.subtitleColor,fontFamily:n.regular}],children:r})]})]})})}var Ro=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center",position:"relative"},badge:{position:"absolute",top:-4,right:-4,minWidth:18,height:18,alignItems:"center",justifyContent:"center",paddingHorizontal:4},badgeText:{color:"#FFFFFF",fontSize:10,fontWeight:"600"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"}});function vs({onPress:e,title:t,subtitle:r}){let{fonts:o,components:n}=O(),i=n.depositMenu.card;return jsxRuntime.jsxs(Et,{cardTokens:i,onPress:e,style:ao.wrapper,contentStyle:ao.container,children:[jsxRuntime.jsxs(reactNative.View,{style:ao.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[ao.iconContainer,{borderRadius:i.iconContainerBorderRadius}],children:jsxRuntime.jsx(Hs,{size:20,color:i.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:ao.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[ao.title,{color:i.titleColor,fontFamily:o.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[ao.subtitle,{color:i.subtitleColor,fontFamily:o.regular}],children:r})]})]}),jsxRuntime.jsx(reactNative.View,{style:ao.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:ao.badge,children:jsxRuntime.jsx(reactNative.Text,{style:[ao.badgeText,{fontFamily:o.regular}],children:"Stripe"})})})]})}var ao=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},badge:{paddingHorizontal:10,paddingVertical:4,borderRadius:6,backgroundColor:"#635BFF"},badgeText:{fontSize:12,fontWeight:"600",color:"#FFFFFF"}});var Yu=1e4,Ju=2500,Zu=3e3,Xu=6e4;function Is(e){let{depositConfirmationMode:t,depositAddress:r,chain:o,externalUserId:n,publishableKey:i,modalOpenedAt:s,depositWalletId:a,depositExecutions:l,trackedExecutions:d,setDepositExecutions:c,setTrackedExecutions:g,setLatestExecution:w,setShowStatusSheet:f,onDepositSuccess:y,onExecutionsChange:b,onDepositError:m}=e,[S,h]=on.useState(false),[p,T]=on.useState(false);return on.useEffect(()=>{if(t!=="auto_ui"&&t!=="auto_silent"||!r)return;h(false),t==="auto_ui"&&T(false);let _=setTimeout(()=>{h(true),t==="auto_ui"&&T(true);},Yu);return ()=>clearTimeout(_)},[t,r,o]),on.useEffect(()=>{if(!n||!s)return;let _=new Date(s.getTime()-Xu),F=setInterval(async()=>{try{let B=[...(await Co(n,i)).data??[]].sort((L,R)=>{let H=L.created_at?new Date(L.created_at).getTime():0;return (R.created_at?new Date(R.created_at).getTime():0)-H}),E=null;for(let L of B){let R=L.created_at?new Date(L.created_at):null;if(!R||R<=_)continue;let H=d.get(L.id);if(!H){E=L;break}if(["pending","waiting","delayed"].includes(H)&&L.status==="succeeded"){E=L;break}}if(E){let L=E;c(R=>{let H=R.findIndex(V=>V.id===L.id);if(H>=0){let V=[...R];return V[H]=L,V}return [...R,L]}),g(R=>{let H=new Map(R);return H.set(L.id,L.status),H}),w(L),f(!0),L.status==="succeeded"&&y?.({message:"Deposit completed successfully",executionId:L.id}),b?.([...l,L]);}}catch(k){m?.({message:"Failed to check deposit status",error:k});}},Ju);return ()=>clearInterval(F)},[n,i,s,d,l,b,y,m]),on.useEffect(()=>{if(!S||!a)return;let _=async()=>{try{await ta(a,i);}catch{}};_();let F=setInterval(_,Zu);return ()=>clearInterval(F)},[S,a,i]),{pollingEnabled:S,showWaitingUi:p,handleIveDeposited:()=>{h(true),T(true);}}}function Ai({value:e,size:t=180,logoUri:r,logoSize:o=40,logoBackgroundColor:n}){let{colors:i,isDark:s}=O(),a=s?"#1a1a1a":"#ffffff",l=s?"#ffffff":"#000000",d=n||a;return jsxRuntime.jsxs(reactNative.View,{style:[tp.container,{width:t,height:t}],children:[jsxRuntime.jsx(Xf__default.default,{value:e||"placeholder",size:t,backgroundColor:a,color:l,ecl:"H",quietZone:4}),r&&jsxRuntime.jsx(reactNative.View,{style:[tp.logoContainer,{width:o+12,height:o+12,backgroundColor:d,borderRadius:(o+12)/2}],children:jsxRuntime.jsx(an,{uri:r,width:o,height:o,borderRadius:o/2})})]})}var tp=reactNative.StyleSheet.create({container:{alignItems:"center",justifyContent:"center",position:"relative"},logoContainer:{position:"absolute",alignItems:"center",justifyContent:"center"}});function np(e){let t=e.split("/"),r=t[t.length-1];return r&&r.length>10?`${r.slice(0,6)}...${r.slice(-3)}`:r||""}function oh(e){let r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],o=e.getDate(),n=e.getFullYear(),i=e.getHours(),s=e.getMinutes(),a=i>=12?"pm":"am";i=i%12,i=i||12;let l=s<10?`0${s}`:s;return `${r} ${o}, ${n} at ${i}:${l}${a}`}function Ei({visible:e,status:t,tokenIconUrl:r,explorerUrl:o,completionExplorerUrl:n,date:i,amountUsd:s,onClose:a,borderTopLeftRadius:l,borderTopRightRadius:d}){let{colors:c,fonts:g,components:w}=O(),[f,y]=on.useState(false),b=t==="pending"||t==="waiting"||t==="delayed",m=t==="succeeded",S=()=>{o&&reactNative.Linking.openURL(o);},h=()=>{n&&reactNative.Linking.openURL(n);};return jsxRuntime.jsx(Qe,{visible:e,onClose:a,closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:l,borderTopRightRadius:d,children:jsxRuntime.jsxs(reactNative.View,{style:bt.container,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:bt.closeButton,onPress:a,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(tt,{size:20,color:w.header.buttonColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.View,{style:bt.iconContainer,children:b?jsxRuntime.jsx(it,{size:80,strokeWidth:4,iconSize:68,children:r?jsxRuntime.jsx(reactNative.Image,{source:{uri:K(r)},style:bt.tokenIconFill}):jsxRuntime.jsx(reactNative.View,{style:[bt.tokenIconFill,{backgroundColor:c.cardHover}]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r?jsxRuntime.jsx(reactNative.Image,{source:{uri:K(r)},style:bt.tokenIconLarge}):jsxRuntime.jsx(reactNative.View,{style:[bt.tokenIconLarge,{backgroundColor:c.cardHover}]}),jsxRuntime.jsx(reactNative.View,{style:[bt.statusBadge,{backgroundColor:w.container.iconBackgroundColor}],children:jsxRuntime.jsx(Ae,{size:16,color:w.container.iconColor,strokeWidth:3})})]})}),jsxRuntime.jsx(reactNative.Text,{style:[bt.title,{color:w.container.titleColor,fontFamily:g.semibold}],children:b?"Deposit Processing":"Deposit Complete"}),s!==void 0&&jsxRuntime.jsxs(reactNative.Text,{style:[bt.amount,{color:w.container.titleColor,fontFamily:g.bold}],children:["$",s.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),i&&jsxRuntime.jsx(reactNative.Text,{style:[bt.date,{color:w.container.subtitleColor,fontFamily:g.regular}],children:oh(i)}),jsxRuntime.jsx(reactNative.Text,{style:[bt.subtitle,{color:w.container.subtitleColor,fontFamily:g.regular}],children:b?"This usually takes less than a minute.":"Your account has been credited successfully!"}),m&&(o||n)&&jsxRuntime.jsxs(reactNative.View,{style:bt.detailsSection,children:[jsxRuntime.jsx(reactNative.View,{style:[bt.divider,{backgroundColor:c.border}]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:bt.detailsToggle,onPress:()=>y(!f),children:[jsxRuntime.jsx(reactNative.Text,{style:[bt.detailsToggleText,{color:w.container.actionTitle,fontFamily:g.medium}],children:f?"See less":"See more details"}),f?jsxRuntime.jsx(qr,{size:18,color:w.container.actionColor,strokeWidth:2}):jsxRuntime.jsx(yt,{size:18,color:w.container.actionColor,strokeWidth:2})]}),f&&jsxRuntime.jsxs(reactNative.View,{style:bt.txButtonsContainer,children:[o&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[bt.txButton,{backgroundColor:w.card.backgroundColor,borderColor:c.border}],onPress:S,children:[jsxRuntime.jsx(reactNative.Text,{style:[bt.txLabel,{color:w.card.titleColor,fontFamily:g.medium}],children:"Deposit tx"}),jsxRuntime.jsx(reactNative.Text,{style:[bt.txHash,{color:w.card.subtitleColor,fontFamily:g.regular}],children:np(o)}),jsxRuntime.jsx($r,{size:16,color:w.card.actionColor,strokeWidth:2})]}),n&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[bt.txButton,{backgroundColor:w.card.backgroundColor,borderColor:c.border}],onPress:h,children:[jsxRuntime.jsx(reactNative.Text,{style:[bt.txLabel,{color:w.card.titleColor,fontFamily:g.medium}],children:"Completion tx"}),jsxRuntime.jsx(reactNative.Text,{style:[bt.txHash,{color:w.card.subtitleColor,fontFamily:g.regular}],children:np(n)}),jsxRuntime.jsx($r,{size:16,color:w.card.actionColor,strokeWidth:2})]})]})]})]})})}var bt=reactNative.StyleSheet.create({container:{alignItems:"center",paddingHorizontal:24,paddingTop:40},closeButton:{position:"absolute",top:16,right:16,padding:4,zIndex:1},iconContainer:{position:"relative",marginBottom:16},tokenIcon:{width:64,height:64,borderRadius:32},tokenIconLarge:{width:68,height:68,borderRadius:34},tokenIconFill:{width:"100%",height:"100%",borderRadius:34},statusBadge:{position:"absolute",bottom:-2,right:-2,width:28,height:28,borderRadius:14,alignItems:"center",justifyContent:"center"},title:{fontSize:18,fontWeight:"600",marginBottom:4,textAlign:"center"},amount:{fontSize:28,fontWeight:"700",marginBottom:4,textAlign:"center"},date:{fontSize:13,textAlign:"center",marginBottom:12},detailsSection:{width:"100%",marginTop:16,paddingHorizontal:16},divider:{height:1,width:"100%",opacity:.15},detailsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",paddingVertical:12},detailsToggleText:{fontSize:14,fontWeight:"500"},txButtonsContainer:{width:"100%",gap:10,marginTop:10},txButton:{flexDirection:"row",alignItems:"center",width:"100%",paddingVertical:12,paddingHorizontal:14,borderRadius:10,borderWidth:1,gap:8},txLabel:{fontSize:14,fontWeight:"500"},txHash:{fontSize:14,flex:1,textAlign:"right"},subtitle:{fontSize:14,textAlign:"center",lineHeight:20,paddingTop:8},buttonRow:{flexDirection:"row",gap:10,width:"100%"},button:{paddingVertical:14,paddingHorizontal:20,borderRadius:10,alignItems:"center",justifyContent:"center"},halfButton:{flex:1},successButton:{backgroundColor:"#22C55E"},buttonText:{color:"#fff",fontSize:14,fontWeight:"600"},hint:{fontSize:12,marginTop:12,textAlign:"center"}});function Va({depositConfirmationMode:e,depositAddress:t,showWaitingUi:r,latestExecution:o,onIveDeposited:n}){let{colors:i,fonts:s,components:a}=O();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e==="manual"&&t&&!r&&jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:n,activeOpacity:.8,style:[qn.iveDepositedButton,{backgroundColor:i.primary,borderRadius:a.button.borderRadius,borderWidth:a.button.borderWidth,borderColor:a.button.borderColor}],children:jsxRuntime.jsx(reactNative.Text,{style:[qn.iveDepositedButtonText,{color:i.primaryForeground??"#FFF",fontFamily:s.semibold}],children:"I've made the deposit"})}),r&&!o&&jsxRuntime.jsxs(reactNative.View,{style:[qn.processingCard,{backgroundColor:a.card.backgroundColor,borderRadius:a.card.borderRadius,borderWidth:a.card.borderWidth,borderColor:a.card.borderColor,shadowColor:a.card.shadowOpacity>0?a.card.shadowColor:void 0,shadowOffset:a.card.shadowOpacity>0?a.card.shadowOffset:void 0,shadowOpacity:a.card.shadowOpacity,shadowRadius:a.card.shadowRadius,elevation:a.card.elevation}],children:[jsxRuntime.jsx(reactNative.View,{style:[qn.detailIcon,{backgroundColor:a.card.iconBackgroundColor,borderRadius:a.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(kl,{size:14,color:a.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:qn.processingCardText,children:[jsxRuntime.jsx(reactNative.Text,{style:[qn.processingCardTitle,{color:a.card.titleColor,fontFamily:s.semibold}],children:"Processing deposit transactions."}),jsxRuntime.jsx(reactNative.Text,{style:[qn.processingCardSubtitle,{color:a.card.subtitleColor,fontFamily:s.regular}],children:"We're checking if your deposit has landed."})]})]})]})}var qn=reactNative.StyleSheet.create({iveDepositedButton:{paddingVertical:14,alignItems:"center",justifyContent:"center",marginBottom:12},iveDepositedButtonText:{fontSize:16},processingCard:{flexDirection:"row",alignItems:"center",padding:12,marginBottom:12,gap:12},processingCardText:{flex:1,gap:4},processingCardTitle:{fontSize:14},processingCardSubtitle:{fontSize:12,lineHeight:18},detailIcon:{width:24,height:24,alignItems:"center",justifyContent:"center"}});var Ps=(e,t)=>`${t}:${e}`,ph=e=>{let[t,r]=e.split(":");return {chainType:t,chainId:r}};function Ba({externalUserId:e,publishableKey:t,recipientAddress:r,destinationChainType:o,destinationChainId:n,destinationTokenAddress:i,destinationTokenSymbol:s,defaultChainType:a,defaultChainId:l,defaultTokenAddress:d,depositConfirmationMode:c="auto_ui",onExecutionsChange:g,onDepositSuccess:w,onDepositError:f,borderTopLeftRadius:y,borderTopRightRadius:b,sheetBorderRadius:m}){let{colors:S,fonts:h,components:p}=O(),T=a&&l?`${a}:${l}`:"solana:mainnet",[x,_]=on.useState("USDC"),[F,k]=on.useState(T),[C,B]=on.useState([]),[E,L]=on.useState(true),[R,H]=on.useState([]),[V,we]=on.useState(true),[We,Xe]=on.useState(false),[ee,ye]=on.useState(false),[ze,Fe]=on.useState(false),[Ue,ie]=on.useState(false),[Ge,Ve]=on.useState([]),[Ye,dt]=on.useState(new Map),[at]=on.useState(()=>new Date),[ht,He]=on.useState(null),[Lt,J]=on.useState(false),[q,Te]=on.useState(null),[wt,he]=on.useState(false),_e=new Map;R.forEach(U=>{U.chains.forEach(Z=>{let pe=`${Z.chain_type}:${Z.chain_id}`;_e.has(pe)||_e.set(pe,Z);});});let Je=Array.from(_e.values()),mt=ph(F),et=Je.find(U=>U.chain_type===mt.chainType&&U.chain_id===mt.chainId)?.chain_type||"ethereum",Ht=bo(C,et),lt=Ht?.address||"",Re=on.useRef(false);on.useEffect(()=>{async function U(){try{we(!0),He(null);let pe=await kn(t,i&&n&&o?{destination_token_address:i,destination_chain_id:n,destination_chain_type:o}:void 0);if(H(pe.data),pe.data.length>0&&!Re.current){Re.current=!0;let oe,X;if(a&&l)if(d)for(let ce of pe.data){let nt=ce.chains.find(Xt=>Xt.chain_type===a&&Xt.chain_id===l&&Xt.token_address.toLowerCase()===d.toLowerCase());if(nt){oe=ce,X=nt;break}}else for(let ce of pe.data){let nt=ce.chains.find(Xt=>Xt.chain_type===a&&Xt.chain_id===l);if(nt){oe=ce,X=nt;break}}if(!oe&&i)for(let ce of pe.data){let nt=ce.chains.find(Xt=>Xt.token_address.toLowerCase()===i.toLowerCase());if(nt){oe=ce,X=nt;break}}oe||(oe=pe.data.find(ce=>ce.symbol==="USDC"),oe&&oe.chains.length>0&&(X=oe.chains[0])),oe||(oe=pe.data.find(ce=>ce.symbol==="USDT"),oe&&oe.chains.length>0&&(X=oe.chains[0])),oe||(oe=pe.data[0],oe.chains.length>0&&(X=oe.chains[0])),oe&&_(oe.symbol),X&&k(Ps(X.chain_id,X.chain_type));}}catch(Z){console.error("Error fetching supported tokens:",Z),He("Failed to load supported tokens"),f?.({message:"Failed to load supported tokens",error:Z});}finally{we(false);}}U();},[t,f,a,l,d,i,n,o]),on.useEffect(()=>{async function U(){try{L(!0),He(null);let Z=await yo({external_user_id:e,recipient_address:r,destination_chain_type:o,destination_chain_id:n,destination_token_address:i},t);B(Z.data);}catch(Z){console.error("Error fetching wallets:",Z),He("Failed to load wallets"),f?.({message:"Failed to load wallets",error:Z});}finally{L(false);}}U();},[e,r,o,n,i,t,f]);let Nt=Ht?.id??"",{showWaitingUi:Bt,handleIveDeposited:Cr}=Is({depositConfirmationMode:c,depositAddress:lt,chain:F,externalUserId:e,publishableKey:t,modalOpenedAt:at,depositWalletId:Nt,depositExecutions:Ge,trackedExecutions:Ye,setDepositExecutions:Ve,setTrackedExecutions:dt,setLatestExecution:Te,setShowStatusSheet:J,onDepositSuccess:w,onExecutionsChange:g,onDepositError:f});on.useEffect(()=>{if(!R.length)return;let U=R.find(pe=>pe.symbol===x);if(!U||U.chains.length===0)return;if(!U.chains.some(pe=>Ps(pe.chain_id,pe.chain_type)===F)){let pe=U.chains[0];k(Ps(pe.chain_id,pe.chain_type));}},[x,R,F]);let xe=R.find(U=>U.symbol===x),je=xe?.chains||[],$e=je.find(U=>Ps(U.chain_id,U.chain_type)===F),ur=async()=>{if(lt)try{reactNative.Clipboard.setString(lt),Xe(!0),setTimeout(()=>Xe(!1),2e3);}catch(U){console.error("Failed to copy:",U);}},N=$e?.estimated_price_impact_percent??0,re=$e?.max_slippage_percent??.25,ue=$e?.minimum_deposit_amount_usd??3;if(V)return jsxRuntime.jsxs(reactNative.View,{style:I.loadingContainer,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:S.primary}),jsxRuntime.jsx(reactNative.Text,{style:[I.loadingText,{color:S.foregroundMuted,fontFamily:h.regular}],children:"Loading currencies..."})]});if(ht&&R.length===0)return jsxRuntime.jsxs(reactNative.View,{style:I.errorContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[I.errorText,{color:S.error,fontFamily:h.regular}],children:ht}),jsxRuntime.jsx(reactNative.Text,{style:[I.errorHint,{color:S.foregroundMuted,fontFamily:h.regular}],children:"Please check your network connection and try again."})]});let le=()=>jsxRuntime.jsxs(Qe,{visible:ze,onClose:()=>Fe(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:m?.tokenSelector?.borderTopLeftRadius??y,borderTopRightRadius:m?.tokenSelector?.borderTopRightRadius??b,children:[jsxRuntime.jsxs(reactNative.View,{style:[I.sheetHeader,{borderBottomColor:S.border}],children:[jsxRuntime.jsx(reactNative.View,{style:I.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[I.sheetTitle,{color:p.header.titleColor,fontFamily:h.medium}],children:"Select Token"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Fe(false),style:I.sheetCloseButton,children:jsxRuntime.jsx(tt,{size:20,color:p.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.ScrollView,{style:I.sheetList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:R.map(U=>jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>{_(U.symbol),Fe(false);},activeOpacity:.7,style:[I.sheetItem,{backgroundColor:x===U.symbol?p.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(U,"png"))},style:I.sheetItemIcon}),jsxRuntime.jsxs(reactNative.View,{style:I.sheetItemText,children:[jsxRuntime.jsx(reactNative.Text,{style:[I.sheetItemTitle,{color:p.card.titleColor,fontFamily:h.medium}],children:U.symbol}),jsxRuntime.jsxs(reactNative.Text,{style:[I.sheetItemSubtitle,{color:p.card.subtitleColor,fontFamily:h.regular}],children:[U.chains.length," network",U.chains.length!==1?"s":""," available"]})]}),x===U.symbol&&jsxRuntime.jsx(Ae,{size:20,color:S.primary,strokeWidth:2})]},U.symbol))})]}),Le=()=>jsxRuntime.jsxs(Qe,{visible:Ue,onClose:()=>ie(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:m?.chainSelector?.borderTopLeftRadius??y,borderTopRightRadius:m?.chainSelector?.borderTopRightRadius??b,children:[jsxRuntime.jsxs(reactNative.View,{style:[I.sheetHeader,{borderBottomColor:S.border}],children:[jsxRuntime.jsx(reactNative.View,{style:I.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[I.sheetTitle,{color:p.header.titleColor,fontFamily:h.medium}],children:"Select Network"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>ie(false),style:I.sheetCloseButton,children:jsxRuntime.jsx(tt,{size:20,color:p.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.ScrollView,{style:I.sheetList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:je.map(U=>{let Z=Ps(U.chain_id,U.chain_type),pe=F===Z;return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>{k(Z),ie(false);},activeOpacity:.7,style:[I.sheetItem,{backgroundColor:pe?p.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(U,"png"))},style:I.sheetItemIcon}),jsxRuntime.jsxs(reactNative.View,{style:I.sheetItemText,children:[jsxRuntime.jsx(reactNative.Text,{style:[I.sheetItemTitle,{color:p.card.titleColor,fontFamily:h.medium}],children:U.chain_name}),jsxRuntime.jsxs(reactNative.Text,{style:[I.sheetItemSubtitle,{color:p.card.subtitleColor,fontFamily:h.regular}],children:["Min deposit: $",U.minimum_deposit_amount_usd]})]}),pe&&jsxRuntime.jsx(Ae,{size:20,color:S.primary,strokeWidth:2})]},Z)})})]});return jsxRuntime.jsxs(reactNative.View,{style:I.container,children:[jsxRuntime.jsxs(reactNative.View,{style:I.selectorSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[I.selectorLabel,{color:p.card.labelColor,fontFamily:h.regular}],children:"Token"}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Fe(true),style:[I.selector,{backgroundColor:p.card.backgroundColor,borderRadius:p.card.borderRadius,borderWidth:p.card.borderWidth,borderColor:p.card.borderColor}],children:[xe&&jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(xe,"png"))},style:I.selectorIcon}),jsxRuntime.jsx(reactNative.Text,{style:[I.selectorText,{color:p.card.titleColor,fontFamily:h.medium}],children:x}),jsxRuntime.jsx(yt,{size:16,color:p.card.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsxs(reactNative.View,{style:I.selectorSection,children:[jsxRuntime.jsxs(reactNative.Text,{style:[I.selectorLabel,{color:p.card.labelColor,fontFamily:h.regular}],children:["Network"," ",jsxRuntime.jsxs(reactNative.Text,{style:[I.minDeposit,{fontFamily:h.regular}],children:["($",ue," min)"]})]}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>ie(true),style:[I.selector,{backgroundColor:p.card.backgroundColor,borderRadius:p.card.borderRadius,borderWidth:p.card.borderWidth,borderColor:p.card.borderColor}],children:[$e&&jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae($e,"png"))},style:I.selectorIcon}),jsxRuntime.jsx(reactNative.Text,{style:[I.selectorText,{color:p.card.titleColor,fontFamily:h.medium}],numberOfLines:1,children:$e?.chain_name||"Select network"}),jsxRuntime.jsx(yt,{size:16,color:p.card.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsx(reactNative.View,{style:I.qrContainer,children:jsxRuntime.jsx(reactNative.View,{style:[I.qrWrapper,{backgroundColor:S.background,borderRadius:p.card.borderRadius,borderWidth:p.card.borderWidth>0?p.card.borderWidth:1,borderColor:p.card.borderColor}],children:E?jsxRuntime.jsxs(reactNative.View,{style:I.qrLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:S.primary}),jsxRuntime.jsx(reactNative.Text,{style:[I.loadingText,{color:S.foregroundMuted,fontFamily:h.regular}],children:"Loading..."})]}):lt?jsxRuntime.jsx(Ai,{value:lt,size:160,logoUri:K(ae($e,"png")||Mt("/icons/networks/png/ethereum.png")),logoSize:40}):jsxRuntime.jsx(reactNative.View,{style:I.qrLoading,children:jsxRuntime.jsx(reactNative.Text,{style:[I.errorText,{color:S.error,fontFamily:h.regular}],children:"No address available"})})})}),jsxRuntime.jsxs(reactNative.View,{style:I.addressSection,children:[jsxRuntime.jsxs(reactNative.View,{style:I.addressHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[I.addressLabel,{color:p.card.labelColor,fontFamily:h.medium}],children:"Deposit Address"}),We&&jsxRuntime.jsxs(reactNative.View,{style:I.copiedIndicator,children:[jsxRuntime.jsx(Ae,{size:14,color:S.success,strokeWidth:2}),jsxRuntime.jsx(reactNative.Text,{style:[I.copiedText,{color:S.success,fontFamily:h.regular}],children:"Copied"})]})]}),jsxRuntime.jsxs(Et,{cardTokens:p.transferCrypto.depositAddress.card,onPress:!E&<?ur:void 0,contentStyle:I.addressBox,children:[jsxRuntime.jsx(reactNative.Text,{style:[I.addressText,{color:p.card.titleColor,fontFamily:h.regular}],numberOfLines:2,children:E?"Loading...":lt||"No address available"}),jsxRuntime.jsx(reactNative.View,{style:I.addressCopyIcon,children:jsxRuntime.jsx(Cn,{size:16,color:p.card.actionColor,strokeWidth:1})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:[I.detailsCard,{backgroundColor:p.card.backgroundColor,borderRadius:p.card.borderRadius,borderWidth:p.card.borderWidth,borderColor:p.card.borderColor}],children:[jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>ye(!ee),style:I.detailsHeader,children:[jsxRuntime.jsxs(reactNative.View,{style:I.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[I.detailIcon,{backgroundColor:p.card.iconBackgroundColor,borderRadius:p.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(jr,{size:12,color:p.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[I.detailsLabel,{color:p.card.titleColor,fontFamily:h.regular}],children:"Processing time: < 1 min"})]}),jsxRuntime.jsx(reactNative.View,{style:I.chevronContainer,children:ee?jsxRuntime.jsx(qr,{size:16,color:p.card.actionColor,strokeWidth:2}):jsxRuntime.jsx(yt,{size:16,color:p.card.actionColor,strokeWidth:2})})]}),ee&&jsxRuntime.jsxs(reactNative.View,{style:I.detailsContent,children:[jsxRuntime.jsxs(reactNative.View,{style:I.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[I.detailIcon,{backgroundColor:p.card.iconBackgroundColor,borderRadius:p.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Ho,{size:12,color:p.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[I.detailsLabel,{color:p.card.titleColor,fontFamily:h.regular}],children:["Price impact: ",N.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>he(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(ri,{size:14,color:p.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:I.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[I.detailIcon,{backgroundColor:p.card.iconBackgroundColor,borderRadius:p.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(No,{size:12,color:p.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[I.detailsLabel,{color:p.card.titleColor,fontFamily:h.regular}],children:["Slippage: Auto \u2022 ",re.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>he(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(ri,{size:14,color:p.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:I.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[I.detailIcon,{backgroundColor:p.card.iconBackgroundColor,borderRadius:p.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(zs,{size:12,color:p.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[I.detailsLabel,{color:p.card.titleColor,fontFamily:h.regular}],children:["Need help?"," ",jsxRuntime.jsx(reactNative.Text,{style:{textDecorationLine:"underline"},children:"Contact support"})]})]})]})]}),jsxRuntime.jsx(Va,{depositConfirmationMode:c,depositAddress:lt,showWaitingUi:Bt,latestExecution:q,onIveDeposited:Cr}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{style:I.termsContainer,onPress:()=>reactNative.Linking.openURL("https://unifold.io/terms"),children:jsxRuntime.jsx(reactNative.Text,{style:[I.termsText,{color:S.primary,fontFamily:h.regular}],children:"Terms apply"})}),le(),Le(),jsxRuntime.jsxs(Qe,{visible:wt,onClose:()=>he(false),closeOnBackdropPress:true,showHandle:true,borderTopLeftRadius:m?.infoSheet?.borderTopLeftRadius??y,borderTopRightRadius:m?.infoSheet?.borderTopRightRadius??b,children:[jsxRuntime.jsxs(reactNative.View,{style:[I.sheetHeader,{borderBottomColor:S.border}],children:[jsxRuntime.jsx(reactNative.View,{style:I.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[I.sheetTitle,{color:p.header.titleColor,fontFamily:h.medium}],children:"Price Impact & Slippage"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>he(false),style:I.sheetCloseButton,children:jsxRuntime.jsx(tt,{size:20,color:p.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:I.infoSheetContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[I.infoCard,{backgroundColor:p.card.backgroundColor,borderRadius:p.card.borderRadius,borderWidth:p.card.borderWidth,borderColor:p.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:I.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[I.infoCardIcon,{backgroundColor:p.card.iconBackgroundColor,borderRadius:p.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Ho,{size:16,color:p.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[I.infoCardTitle,{color:p.card.titleColor,fontFamily:h.medium}],children:"Price Impact"}),jsxRuntime.jsxs(reactNative.Text,{style:[I.infoCardValue,{color:p.card.titleColor,fontFamily:h.medium}],children:[N.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[I.infoCardDescription,{color:p.card.descriptionColor,fontFamily:h.regular}],children:"Price impact is the difference between the current market price and the price you'll receive for your swap. This occurs due to liquidity pool mechanics and trade size."})]}),jsxRuntime.jsxs(reactNative.View,{style:[I.infoCard,{backgroundColor:p.card.backgroundColor,borderRadius:p.card.borderRadius,borderWidth:p.card.borderWidth,borderColor:p.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:I.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[I.infoCardIcon,{backgroundColor:p.card.iconBackgroundColor,borderRadius:p.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(No,{size:16,color:p.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[I.infoCardTitle,{color:p.card.titleColor,fontFamily:h.medium}],children:"Max Slippage"}),jsxRuntime.jsxs(reactNative.Text,{style:[I.infoCardValue,{color:p.card.titleColor,fontFamily:h.medium}],children:[re.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[I.infoCardDescription,{color:p.card.descriptionColor,fontFamily:h.regular}],children:"Max slippage is the maximum price difference you're willing to accept between when you submit a transaction and when it executes. Your transaction will revert if the price moves beyond this threshold."})]})]})]}),q&&jsxRuntime.jsx(Ei,{visible:Lt,status:q.status,tokenIconUrl:q.destination_token_metadata?.icon_urls?.find(U=>U.format==="png")?.url||q.destination_token_metadata?.icon_url||ae(xe,"png"),explorerUrl:q.explorer_url,completionExplorerUrl:q.destination_explorer_url,date:q.created_at?new Date(q.created_at):void 0,amountUsd:q.source_amount_usd?parseFloat(q.source_amount_usd):void 0,onClose:()=>J(false),borderTopLeftRadius:m?.depositStatus?.borderTopLeftRadius??y,borderTopRightRadius:m?.depositStatus?.borderTopRightRadius??b})]})}var I=reactNative.StyleSheet.create({container:{flex:1,padding:16},loadingContainer:{padding:40,alignItems:"center",gap:12},loadingText:{fontSize:14},errorContainer:{padding:40,alignItems:"center",gap:8},errorText:{fontSize:14,textAlign:"center"},errorHint:{fontSize:12,textAlign:"center"},selectorSection:{marginBottom:12},selectorLabel:{fontSize:13,marginBottom:8},minDeposit:{fontSize:10},selector:{flexDirection:"row",alignItems:"center",gap:10,padding:12,borderRadius:12},selectorIcon:{width:24,height:24,borderRadius:12},selectorText:{flex:1,fontSize:14,fontWeight:"500"},qrContainer:{alignItems:"center",marginVertical:16},qrWrapper:{padding:16},qrLoading:{width:160,height:160,alignItems:"center",justifyContent:"center"},addressSection:{marginBottom:16},addressHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},addressLabel:{fontSize:13},copiedIndicator:{flexDirection:"row",alignItems:"center",gap:4},copiedText:{fontSize:12,fontWeight:"500"},addressBox:{position:"relative",paddingHorizontal:12,paddingVertical:16},addressText:{fontSize:12,fontFamily:"monospace"},addressCopyIcon:{position:"absolute",right:12,top:0,bottom:0,justifyContent:"center"},detailsCard:{borderRadius:8,padding:4,marginBottom:16},detailsHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,paddingLeft:8,paddingRight:8},detailsContent:{paddingRight:12,paddingLeft:8,paddingBottom:12,gap:10},detailsRow:{flexDirection:"row",alignItems:"center",gap:8},detailIcon:{width:24,height:24,borderRadius:12,alignItems:"center",justifyContent:"center"},detailsLabel:{fontSize:13},chevronContainer:{},spacer:{flex:1},termsContainer:{alignItems:"center"},termsText:{fontSize:12,textDecorationLine:"underline"},sheetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},sheetHeaderSpacer:{width:28},sheetTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},sheetCloseButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},sheetList:{maxHeight:400,paddingTop:8},sheetItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,marginHorizontal:8,borderRadius:12,gap:12},sheetItemIcon:{width:40,height:40,borderRadius:20},sheetItemText:{flex:1},sheetItemTitle:{fontSize:16,fontWeight:"500"},sheetItemSubtitle:{fontSize:12,marginTop:2},infoSheetContent:{paddingHorizontal:16,paddingBottom:32,gap:16},infoCard:{borderRadius:12,padding:16,gap:12},infoCardHeader:{flexDirection:"row",alignItems:"center",gap:10},infoCardIcon:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center"},infoCardTitle:{fontSize:15,fontWeight:"600",flex:1},infoCardValue:{fontSize:15,fontWeight:"600"},infoCardDescription:{fontSize:13,lineHeight:20}});function Wa({currency:e,isSelected:t,onSelect:r}){let{colors:o,fonts:n,components:i}=O();return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>r(e.currency_code),activeOpacity:.7,style:[Qn.container,{backgroundColor:i.card.backgroundColor,borderRadius:i.list.rowBorderRadius,borderWidth:i.card.borderWidth,borderColor:i.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:Qn.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[Qn.iconContainer,{backgroundColor:o.background}],children:jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(e,"png"))},style:Qn.icon})}),jsxRuntime.jsxs(reactNative.View,{style:Qn.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Qn.name,{color:i.card.titleColor,fontFamily:n.medium}],children:e.name}),jsxRuntime.jsx(reactNative.Text,{style:[Qn.code,{color:i.card.subtitleColor,fontFamily:n.regular}],children:e.currency_code.toUpperCase()})]})]}),t&&jsxRuntime.jsx(Ae,{size:16,color:o.primary,strokeWidth:2})]})}var Qn=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,marginHorizontal:8,marginVertical:4},leftContent:{flexDirection:"row",alignItems:"center",gap:12},iconContainer:{width:40,height:40,borderRadius:20,overflow:"hidden",alignItems:"center",justifyContent:"center"},icon:{width:40,height:40,borderRadius:20},textContainer:{gap:2},name:{fontSize:14,fontWeight:"400"},code:{fontSize:12,fontWeight:"300"}});function Ds({title:e,currencies:t,selectedCurrency:r,onSelect:o}){let{fonts:n,components:i}=O();return t.length===0?null:jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.View,{style:cp.headerContainer,children:jsxRuntime.jsx(reactNative.Text,{style:[cp.title,{color:i.list.titleSectionColor,fontFamily:n.medium}],children:e})}),t.map(s=>jsxRuntime.jsx(Wa,{currency:s,isSelected:r.toLowerCase()===s.currency_code.toLowerCase(),onSelect:o},s.currency_code))]})}var cp=reactNative.StyleSheet.create({headerContainer:{paddingHorizontal:12,paddingBottom:8,paddingTop:4},title:{fontSize:14,fontWeight:"500"}});function Ea({open:e,onOpenChange:t,currencies:r,preferredCurrencyCodes:o,selectedCurrency:n,onSelectCurrency:i,borderTopLeftRadius:s,borderTopRightRadius:a}){let{colors:l,fonts:d,components:c}=O(),[g,w]=on.useState(""),f=o.map(T=>r.find(x=>x.currency_code.toLowerCase()===T.toLowerCase())).filter(T=>T!==void 0),y=r.filter(T=>!o.includes(T.currency_code.toLowerCase())),b=T=>{if(!g)return T;let x=g.toLowerCase();return T.filter(_=>_.name.toLowerCase().includes(x)||_.currency_code.toLowerCase().includes(x))},m=b(f),S=b(y),h=T=>{i(T),t(false),w("");},p=()=>{t(false),w("");};return jsxRuntime.jsxs(Qe,{visible:e,onClose:p,closeOnBackdropPress:true,showHandle:false,heightPercent:.9,borderTopLeftRadius:s,borderTopRightRadius:a,children:[jsxRuntime.jsx(cr,{title:"Currency",showBack:false,onClose:p}),jsxRuntime.jsx(reactNative.View,{style:Kn.searchContainer,children:jsxRuntime.jsx(reactNative.TextInput,{style:[Kn.searchInput,{backgroundColor:c.search.backgroundColor,color:c.search.inputColor,fontFamily:d.regular,borderRadius:c.input.borderRadius,borderWidth:c.input.borderWidth,borderColor:c.input.borderColor}],value:g,onChangeText:w,placeholder:"Search",placeholderTextColor:c.search.placeholderColor})}),jsxRuntime.jsx(reactNative.ScrollView,{style:Kn.listContainer,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:jsxRuntime.jsxs(reactNative.View,{style:Kn.listContent,children:[jsxRuntime.jsx(Ds,{title:"Popular currencies",currencies:m,selectedCurrency:n,onSelect:h}),m.length>0&&S.length>0&&jsxRuntime.jsx(reactNative.View,{style:Kn.sectionSpacer}),jsxRuntime.jsx(Ds,{title:"All currencies",currencies:S,selectedCurrency:n,onSelect:h}),m.length===0&&S.length===0&&jsxRuntime.jsx(reactNative.View,{style:Kn.noResultsContainer,children:jsxRuntime.jsx(reactNative.Text,{style:[Kn.noResultsText,{color:c.container.subtitleColor,fontFamily:d.regular}],children:"No currencies found"})})]})})]})}var Kn=reactNative.StyleSheet.create({searchContainer:{marginTop:8,paddingHorizontal:18,paddingBottom:12},searchInput:{padding:16,fontSize:14},listContainer:{flex:1,paddingHorizontal:12},listContent:{paddingBottom:24},sectionSpacer:{height:8},noResultsContainer:{paddingVertical:32,alignItems:"center"},noResultsText:{fontSize:14}});function Dc(e){try{return new Intl.NumberFormat("en",{style:"currency",currency:e.toUpperCase(),minimumFractionDigits:0,maximumFractionDigits:0}).format(0).replace(/\d/g,"").trim()}catch{return e.toUpperCase()}}function Ua({externalUserId:e,publishableKey:t,view:r,onViewChange:o,destinationTokenSymbol:n,recipientAddress:i,destinationChainType:s,destinationChainId:a,destinationTokenAddress:l,onDepositSuccess:d,onDepositError:c,borderTopLeftRadius:g,borderTopRightRadius:w,sheetBorderRadius:f}){let{colors:y,fonts:b,components:m}=O(),[S,h]=on.useState(""),[p,T]=on.useState("usd"),[x,_]=on.useState(false),[F,k]=on.useState(false),[C,B]=on.useState([]),[E,L]=on.useState(false),[R,H]=on.useState(null),[V,we]=on.useState(null),[We,Xe]=on.useState("amount"),[ee,ye]=on.useState(null),[ze,Fe]=on.useState(true),[Ue,ie]=on.useState(null),[Ge,Ve]=on.useState(false),Ye=on.useRef(null),dt=on.useRef(false);on.useEffect(()=>{Ye.current=ee;},[ee]),on.useEffect(()=>{dt.current=Ge;},[Ge]);let[at,ht]=on.useState([]),[He,Lt]=on.useState(true),[J,q]=on.useState(60),[Te,wt]=on.useState([]),[he,_e]=on.useState([]),[Je,mt]=on.useState(null),[Se,et]=on.useState(null),[Ht,lt]=on.useState(true),[Re,Nt]=on.useState(null),[Bt,Cr]=on.useState(false),[xe,je]=on.useState(null),[$e,ur]=on.useState(false),[N,re]=on.useState(false),[ue,le]=on.useState(false),[Le,U]=on.useState(null),Z=r??We,pe=on.useRef(null),oe=Te.find(v=>v.currency_code.toLowerCase()===p.toLowerCase()),X=on.useCallback(v=>{Xe(v),v==="quotes"?o?.(v,C.length):o?.(v);},[C.length,o]);on.useEffect(()=>{async function v(){try{let M=await rs();et(M);}catch(M){console.error("Error fetching user IP:",M);}finally{lt(false);}}v();},[]),on.useEffect(()=>{async function v(){try{let M=await yo({external_user_id:e,recipient_address:i,destination_chain_type:s,destination_chain_id:a,destination_token_address:l},t);ht(M.data);}catch(M){console.error("Error fetching wallets:",M),H("Failed to load wallet addresses");}finally{Lt(false);}}v();},[e,i,s,a,l,t]);let ce=n||Je?.symbol.toUpperCase()||"USDC",nt=ci(Je?.icon_urls,"png")||Je?.icon_url,Xt=ci(Je?.chain_icon_urls,"png")||Je?.chain_icon_url;on.useEffect(()=>{async function v(){try{let M=await Wl(t);wt(M.data),_e(M.preferred||[]);}catch(M){console.error("Error fetching fiat currencies:",M);}}v();},[t]),on.useEffect(()=>{if(x||Te.length===0||!Se?.alpha2)return;let v=Se.alpha2.toUpperCase(),M=Te.find(ke=>ke.country_codes.includes(v));if(M)T(M.currency_code.toLowerCase()),!S&&!F&&h(String(M.default_amount??100));else if(!S&&!F){let ke=Te.find(gt=>gt.currency_code.toLowerCase()==="usd");ke&&h(String(ke.default_amount??100));}},[Te,Se,x,S,F]),on.useEffect(()=>{if(Te.length!==0){if(pe.current!==null&&pe.current!==p){let v=Te.find(M=>M.currency_code.toLowerCase()===p.toLowerCase());v&&h(String(v.default_amount??100));}pe.current=p;}},[p,Te]),on.useEffect(()=>{async function v(){try{let M=await Fl({chain_type:s||"",chain_id:a||"",token_address:l||""},t);mt(M);}catch(M){console.error("Error fetching supported tokens:",M);}}v();},[s,a,l,t]),on.useEffect(()=>{async function v(){if(!(!l||!a||!s)&&!Ht){Cr(true);try{let M=await Bl({country_code:Se?.alpha2?.toUpperCase()||"US",subdivision_code:Se?.state||void 0,token_address:l,chain_id:a,chain_type:s},t);Nt(M);}catch(M){console.error("Error fetching default onramp token:",M);}finally{Cr(false);}}}v();},[l,a,s,Se,Ht,t]),on.useEffect(()=>{let v=parseFloat(S);if(isNaN(v)||v<=0){B([]),we(null);return}if(!Re||Bt){B([]),ye(null);return}let M=Te.find(gt=>gt.currency_code.toLowerCase()===p.toLowerCase());if(M){if(v<M.minimum_amount){B([]),ye(null),we(`Minimum amount is ${Dc(p)}${M.minimum_amount.toLocaleString()}`);return}if(v>M.maximum_amount){B([]),ye(null),we(`Maximum amount is ${Dc(p)}${M.maximum_amount.toLocaleString()}`);return}}we(null);let ke=setTimeout(()=>{bn(v);},500);return ()=>clearTimeout(ke)},[S,p,t,Re,Bt,Te]);let bn=async v=>{if(!Re){H("Loading token information...");return}L(true),H(null);try{let M={country_code:Se?.alpha2?.toUpperCase()||"US",source_amount:v.toString(),source_currency:p.toLowerCase(),destination_currency:Re.destination_currency,destination_network:Re.destination_network,subdivision_code:Se?.state||void 0},ke=await Vl(M,t);B(ke.data);let gt=dt.current,zo=Ye.current;if(gt&&zo){let wr=ke.data.find(ir=>ir.service_provider===zo.service_provider);if(wr){if(ye(wr),ke.data.length>0){let ir=ke.data.reduce((Tt,Uo)=>Uo.destination_amount>Tt.destination_amount?Uo:Tt);Ue||ie(ir.service_provider),Fe(wr.service_provider===Ue);}}else if(ke.data.length>0){let ir=ke.data.reduce((Tt,Uo)=>Uo.destination_amount>Tt.destination_amount?Uo:Tt);ye(ir),ie(ir.service_provider),Fe(!0),Ve(!1);}}else if(ke.data.length>0){let wr=ke.data.reduce((ir,Tt)=>Tt.destination_amount>ir.destination_amount?Tt:ir);ye(wr),ie(wr.service_provider),Fe(!0);}q(60);}catch(M){console.error("Failed to fetch quotes:",M),H("Failed to fetch quotes. Please try again."),B([]);}finally{L(false);}};on.useEffect(()=>{if(C.length===0)return;let v=setInterval(()=>{q(M=>{if(M<=1){let ke=parseFloat(S);return !isNaN(ke)&&ke>0&&bn(ke),60}return M-1});},1e3);return ()=>clearInterval(v)},[C.length,S]);let ul=v=>{(/^\d*\.?\d{0,2}$/.test(v)||v==="")&&(h(v),k(true));},pl=v=>{h(v.toString()),k(true);},ml=async()=>{if(ee&&Re)try{let v=Re.destination_token_metadata.chain_type,M=bo(at,v);if(!M?.address){H("Wallet address not available");return}let ke={service_provider:ee.service_provider,country_code:ee.country_code?.toUpperCase()||Se?.alpha2?.toUpperCase()||"US",source_currency:ee.source_currency,source_amount:S,destination_currency:ee.destination_currency,destination_network:ee.destination_network,wallet_address:M.address,subdivision_code:Se?.state||void 0},gt=await Ll(ke,t);je({provider:ee,sourceCurrency:p,sourceAmount:S,sessionUrl:gt.url}),U(gt.url),le(!0);}catch(v){console.error("Failed to create session:",v),H("Failed to start payment flow"),c?.({message:"Failed to start payment flow",error:v});}},P=Dc(p),Y=()=>{le(false),X("onramp"),d?.({message:"Payment flow completed"});},ne=()=>jsxRuntime.jsx(vh,{visible:ue,onClose:Y,url:Le,providerName:ee?.service_provider_display_name||"Complete Payment",colors:y,fonts:b,borderTopLeftRadius:f?.webView?.borderTopLeftRadius??g,borderTopRightRadius:f?.webView?.borderTopRightRadius??w});return Z==="amount"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:z.amountViewContainer,children:[jsxRuntime.jsxs(reactNative.ScrollView,{style:z.scrollContainer,contentContainerStyle:z.scrollContent,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",bounces:false,children:[jsxRuntime.jsx(reactNative.View,{style:z.currencySelector,children:jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>ur(true),style:[z.currencyButton,{backgroundColor:m.card.backgroundColor,borderRadius:m.input.borderRadius,borderWidth:m.input.borderWidth,borderColor:m.input.borderColor}],children:[oe&&jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(oe,"png"))},style:z.currencyIcon}),jsxRuntime.jsx(reactNative.Text,{style:[z.currencyText,{color:m.card.titleColor,fontFamily:b.medium}],children:p.toUpperCase()}),jsxRuntime.jsx(yt,{size:16,color:m.card.actionColor,strokeWidth:2})]})}),jsxRuntime.jsx(Ea,{open:$e,onOpenChange:ur,currencies:Te,preferredCurrencyCodes:he,selectedCurrency:p,onSelectCurrency:v=>{T(v.toLowerCase()),_(true);},borderTopLeftRadius:f?.currencyModal?.borderTopLeftRadius??g,borderTopRightRadius:f?.currencyModal?.borderTopRightRadius??w}),jsxRuntime.jsx(reactNative.View,{style:z.amountContainer,children:jsxRuntime.jsxs(reactNative.View,{style:z.amountInputRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[z.currencySymbol,{color:m.container.titleColor,fontFamily:b.medium}],children:P}),jsxRuntime.jsx(reactNative.TextInput,{style:[z.amountInput,{color:m.container.titleColor,fontFamily:b.medium}],value:S,onChangeText:ul,keyboardType:"decimal-pad",placeholder:"0",placeholderTextColor:y.foregroundMuted})]})}),oe?.suggested_amounts&&oe.suggested_amounts.length>0&&jsxRuntime.jsx(reactNative.View,{style:z.quickAmounts,children:oe.suggested_amounts.map(v=>jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>pl(v),style:[z.quickAmountButton,{backgroundColor:m.card.backgroundColor,borderRadius:m.button.borderRadius,borderWidth:parseFloat(S)===v?2:m.button.borderWidth,borderColor:parseFloat(S)===v?y.primary:m.button.borderColor}],children:jsxRuntime.jsxs(reactNative.Text,{style:[z.quickAmountText,{color:m.card.titleColor,fontFamily:b.medium}],children:[P,v.toLocaleString()]})},v))}),V&&jsxRuntime.jsx(reactNative.Text,{style:[z.validationError,{color:y.error,fontFamily:b.regular}],children:V}),jsxRuntime.jsxs(reactNative.View,{style:z.providerSection,children:[jsxRuntime.jsxs(reactNative.View,{style:z.providerHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[z.providerLabel,{color:m.card.labelColor,fontFamily:b.medium}],children:"Provider"}),C.length>0&&!E&&jsxRuntime.jsxs(reactNative.Text,{style:[z.refreshText,{color:m.card.labelRightColor,fontFamily:b.regular}],children:["Refreshing in ",J,"s"]})]}),jsxRuntime.jsx(Et,{cardTokens:m.depositCard.quoteProvider.card,onPress:E||C.length===0?void 0:()=>re(true),contentStyle:reactNative.StyleSheet.flatten([z.providerButton,(E||C.length===0)&&z.disabled]),children:E?jsxRuntime.jsxs(reactNative.View,{style:z.providerLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:m.container.subtitleColor}),jsxRuntime.jsx(reactNative.Text,{style:[z.loadingText,{color:m.container.subtitleColor,fontFamily:b.regular}],children:"Finding best rates..."})]}):ee?jsxRuntime.jsxs(reactNative.View,{style:z.providerContent,children:[jsxRuntime.jsxs(reactNative.View,{style:z.providerInfo,children:[ze&&jsxRuntime.jsx(reactNative.Text,{style:[z.autoPickedText,{color:m.container.subtitleColor,fontFamily:b.regular}],children:"Auto-picked for you"}),jsxRuntime.jsxs(reactNative.View,{style:z.providerRow,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ra(ee.icon_urls,"png",ee.icon_url))},style:z.providerIconImage},`provider-${ee.service_provider}`),jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.Text,{style:[z.providerName,{color:m.card.titleColor,fontFamily:b.medium}],children:ee.service_provider_display_name}),jsxRuntime.jsxs(reactNative.Text,{style:[z.bestPriceText,{color:y.success,fontFamily:b.regular}],children:["Best price \u2022 ",ee.destination_amount.toFixed(2)," ","USDC"]})]})]})]}),jsxRuntime.jsx(Br,{size:20,color:m.card.actionColor,strokeWidth:2})]}):jsxRuntime.jsx(reactNative.Text,{style:[z.noProviderText,{color:m.container.subtitleColor,fontFamily:b.regular}],children:parseFloat(S)>0?"No providers available":"Enter an amount to see providers"})}),R&&jsxRuntime.jsx(reactNative.Text,{style:[z.errorText,{color:y.error,fontFamily:b.regular}],children:R})]}),jsxRuntime.jsxs(Qe,{visible:N,onClose:()=>re(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:f?.providerModal?.borderTopLeftRadius??g,borderTopRightRadius:f?.providerModal?.borderTopRightRadius??w,children:[jsxRuntime.jsx(cr,{title:"Select Provider",showBack:false,onClose:()=>re(false)}),jsxRuntime.jsx(reactNative.ScrollView,{style:z.providerModalList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:jsxRuntime.jsx(reactNative.View,{style:z.quotesList,children:[...C].sort((v,M)=>M.destination_amount-v.destination_amount).map((v,M)=>{let ke=ee?.service_provider===v.service_provider,gt=M===0;return jsxRuntime.jsxs(Et,{cardTokens:m.depositCard.quoteProvider.card,onPress:()=>{ye(v),Ve(true),Fe(v.service_provider===Ue),re(false);},contentStyle:reactNative.StyleSheet.flatten([z.quoteItem,ke&&{borderWidth:2,borderColor:y.primary}]),children:[jsxRuntime.jsxs(reactNative.View,{style:z.quoteLeft,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ra(v.icon_urls,"png",v.icon_url))},style:z.providerIconImage}),jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.Text,{style:[z.quoteName,{color:m.card.titleColor,fontFamily:b.medium}],children:v.service_provider_display_name}),gt&&jsxRuntime.jsx(reactNative.Text,{style:[z.bestPriceLabel,{color:y.success,fontFamily:b.regular}],children:"\u2713 Best price"})]})]}),jsxRuntime.jsxs(reactNative.View,{style:z.quoteRight,children:[jsxRuntime.jsxs(reactNative.Text,{style:[z.quoteAmount,{color:m.card.textRightColor,fontFamily:b.medium}],children:[v.destination_amount.toFixed(2)," USDC"]}),jsxRuntime.jsxs(reactNative.Text,{style:[z.quoteSource,{color:m.card.subtextRightColor,fontFamily:b.regular}],children:["Fee: ",P,v.total_fee.toFixed(2)]})]})]},v.service_provider)})})})]})]}),jsxRuntime.jsx(reactNative.View,{style:[z.continueButtonContainer,{backgroundColor:y.background}],children:jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:ml,disabled:E||He||!ee||parseFloat(S)<=0,style:[z.continueButton,{backgroundColor:m.container.buttonColor,borderRadius:m.button.borderRadius,borderWidth:m.button.borderWidth,borderColor:m.button.borderColor},(E||He||!ee)&&z.disabledButton],children:jsxRuntime.jsx(reactNative.Text,{style:[z.continueButtonText,{color:m.container.buttonTitleColor,fontFamily:b.medium}],children:He?"Loading...":"Continue"})})})]}),ne()]}):Z==="onramp"&&xe?jsxRuntime.jsxs(reactNative.View,{style:z.onrampContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ra(xe.provider.icon_urls,"png",xe.provider.icon_url))},style:z.onrampProviderIcon}),jsxRuntime.jsxs(reactNative.Text,{style:[z.onrampTitle,{color:m.container.titleColor,fontFamily:b.medium}],children:["Complete transaction with ",xe.provider.service_provider_display_name]}),jsxRuntime.jsx(reactNative.Text,{style:[z.onrampSubtitle,{color:m.container.subtitleColor,fontFamily:b.regular}],children:"You can close this modal."}),jsxRuntime.jsxs(reactNative.View,{style:[z.flowDiagram,{backgroundColor:m.card.backgroundColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:z.flowStep,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:Mt(`/icons/currencies/png/${xe.sourceCurrency.toLowerCase()}.png`)},style:z.flowIconImage}),jsxRuntime.jsx(reactNative.Text,{style:[z.flowLabel,{color:m.card.subtitleColor,fontFamily:b.regular}],children:"You use"}),jsxRuntime.jsx(reactNative.Text,{style:[z.flowValue,{color:m.card.titleColor,fontFamily:b.medium}],children:xe.sourceCurrency.toUpperCase()})]}),jsxRuntime.jsx(Br,{size:16,color:m.card.actionColor,strokeWidth:2}),jsxRuntime.jsxs(reactNative.View,{style:z.flowStep,children:[jsxRuntime.jsxs(reactNative.View,{style:z.flowIconWithBadge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:ci(Re?.destination_token_metadata?.icon_urls,"png")||Re?.destination_token_metadata?.icon_url||Mt("/icons/tokens/png/usdc.png")},style:z.flowIconImageNoBadge}),jsxRuntime.jsx(reactNative.Image,{source:{uri:ci(Re?.destination_token_metadata?.chain?.icon_urls,"png")||Re?.destination_token_metadata?.chain?.icon_url||Mt("/icons/networks/png/polygon.png")},style:[z.flowNetworkBadge,{borderColor:y.background,borderRadius:m.badge.borderRadius}]})]}),jsxRuntime.jsx(reactNative.Text,{style:[z.flowLabel,{color:m.card.subtitleColor,fontFamily:b.regular}],children:"You buy"}),jsxRuntime.jsx(reactNative.Text,{style:[z.flowValue,{color:m.card.titleColor,fontFamily:b.medium}],children:"USDC"})]}),jsxRuntime.jsx(Br,{size:16,color:m.card.actionColor,strokeWidth:2}),jsxRuntime.jsxs(reactNative.View,{style:z.flowStep,children:[jsxRuntime.jsxs(reactNative.View,{style:z.flowIconWithBadge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:nt||Mt("/icons/tokens/png/usdc.png")},style:z.flowIconImageNoBadge}),jsxRuntime.jsx(reactNative.Image,{source:{uri:Xt||Mt("/icons/networks/png/polygon.png")},style:[z.flowNetworkBadge,{borderColor:y.background,borderRadius:m.badge.borderRadius}]})]}),jsxRuntime.jsx(reactNative.Text,{style:[z.flowLabel,{color:m.card.subtitleColor,fontFamily:b.regular}],children:"You receive"}),jsxRuntime.jsx(reactNative.Text,{style:[z.flowValue,{color:m.card.titleColor,fontFamily:b.medium}],children:ce})]})]}),jsxRuntime.jsx(reactNative.View,{style:[z.onrampInfoBox,{backgroundColor:m.card.backgroundColor,borderRadius:m.card.borderRadius,borderWidth:m.card.borderWidth,borderColor:m.card.borderColor}],children:jsxRuntime.jsx(reactNative.Text,{style:[z.onrampInfoText,{color:m.card.descriptionColor,fontFamily:b.regular}],children:"The wallet address displayed in the payment provider is a temporary deposit address. Your funds will be automatically converted and deposited into your account."})})]}):null}function vh({visible:e,onClose:t,url:r,providerName:o,colors:n,fonts:i,borderTopLeftRadius:s,borderTopRightRadius:a}){return jsxRuntime.jsxs(Qe,{visible:e,onClose:t,closeOnBackdropPress:false,showHandle:false,heightPercent:.92,noPadding:true,borderTopLeftRadius:s,borderTopRightRadius:a,children:[jsxRuntime.jsxs(reactNative.View,{style:Gn.header,children:[jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:t,style:Gn.headerButton,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(Ae,{size:20,color:n.foregroundMuted,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[Gn.headerTitle,{color:n.foreground,fontFamily:i.medium}],children:o}),jsxRuntime.jsx(reactNative.View,{style:Gn.headerSpacer})]}),r&&jsxRuntime.jsx(reactNative.View,{style:Gn.container,children:jsxRuntime.jsx(reactNativeWebview.WebView,{source:{uri:r},style:Gn.webView,startInLoadingState:true,renderLoading:()=>jsxRuntime.jsx(reactNative.View,{style:Gn.loading,children:jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:n.primary})})})})]})}var Gn=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},headerButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},headerTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},headerSpacer:{width:28,height:28},container:{flex:1},webView:{flex:1},loading:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"}}),z=reactNative.StyleSheet.create({amountViewContainer:{flex:1},scrollContainer:{flex:1},scrollContent:{padding:16,paddingBottom:16},currencySelector:{alignItems:"center",marginBottom:16},currencyButton:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:8},currencyText:{fontSize:14,fontWeight:"500"},currencyIcon:{width:24,height:24,borderRadius:12},amountContainer:{alignItems:"center",marginBottom:24},amountInputRow:{flexDirection:"row",alignItems:"center",marginBottom:8},currencySymbol:{fontSize:48,fontWeight:"300"},amountInput:{fontSize:48,fontWeight:"300",minWidth:50},usdcPreview:{fontSize:14},quickAmounts:{flexDirection:"row",justifyContent:"center",gap:12,marginBottom:24},quickAmountButton:{paddingHorizontal:20,paddingVertical:10},quickAmountText:{fontSize:14,fontWeight:"500"},validationError:{fontSize:12,textAlign:"center",marginTop:12,paddingHorizontal:16},providerSection:{marginBottom:24},providerHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},providerLabel:{fontSize:12,fontWeight:"500"},refreshText:{fontSize:10},providerButton:{padding:16},disabled:{opacity:.5},providerLoading:{flexDirection:"row",alignItems:"center",gap:12},loadingText:{fontSize:14},providerContent:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},providerInfo:{flex:1},autoPickedText:{fontSize:12,marginBottom:6},providerRow:{flexDirection:"row",alignItems:"center",gap:12},providerIcon:{width:32,height:32,borderRadius:16},providerIconPlaceholder:{width:32,height:32,borderRadius:8},providerIconImage:{width:32,height:32,borderRadius:8},providerName:{fontSize:14,fontWeight:"500"},bestPriceText:{fontSize:11,marginTop:2},noProviderText:{fontSize:14,textAlign:"center"},errorText:{fontSize:12,marginTop:8},continueButtonContainer:{padding:16,paddingBottom:24},continueButton:{paddingVertical:16,alignItems:"center"},disabledButton:{opacity:.5},continueButtonText:{fontSize:16,fontWeight:"600"},webViewHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},webViewHeaderButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},webViewHeaderTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},webViewHeaderSpacer:{width:28,height:28},webViewContainer:{flex:1},webView:{flex:1},webViewLoading:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"},providerModalList:{height:468,paddingHorizontal:12,marginTop:8},quotesList:{gap:8,paddingBottom:24,minHeight:468},quoteItem:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:12},quoteLeft:{flexDirection:"row",alignItems:"center",gap:12},quoteIcon:{width:40,height:40,borderRadius:20},quoteName:{fontSize:14,fontWeight:"500"},bestPriceLabel:{fontSize:11,marginTop:2},quoteRight:{alignItems:"flex-end"},quoteAmount:{fontSize:14,fontWeight:"500"},quoteSource:{fontSize:12},onrampContainer:{flex:1,padding:16,alignItems:"center",paddingTop:24},onrampProviderIcon:{width:64,height:64,borderRadius:16},onrampTitle:{fontSize:18,fontWeight:"600",textAlign:"center",marginTop:20,marginBottom:8,paddingHorizontal:16},onrampSubtitle:{fontSize:14,textAlign:"center",marginBottom:24},flowDiagram:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:20,paddingHorizontal:24,borderRadius:12,width:"100%"},flowIconWithBadge:{position:"relative",width:24,height:24,marginBottom:4},flowIconImageNoBadge:{width:24,height:24,borderRadius:12},flowNetworkBadge:{position:"absolute",bottom:-4,right:-6,width:14,height:14,borderWidth:2},onrampInfoBox:{marginTop:16,padding:16,width:"100%"},onrampInfoText:{fontSize:13,lineHeight:20},flowStep:{alignItems:"center"},flowIcon:{width:28,height:28,borderRadius:14,marginBottom:4},flowIconImage:{width:24,height:24,borderRadius:12,marginBottom:4},flowLabel:{fontSize:10},flowValue:{fontSize:14,fontWeight:"500"}});function Dh(e){try{let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" at "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e}}function Fh(e){return e?`$${parseFloat(e).toFixed(2)}`:"$0.00"}function ja({execution:e,onPress:t}){let {colors:r,fonts:o,components:n}=O(),i=n.depositTracker.executionRow.card,s=e.status==="pending"||e.status==="waiting"||e.status==="delayed";e.status==="succeeded";let l=K(ae(e.destination_token_metadata,"png")||Mt("/icons/tokens/png/usdc.png")),d=s?"Deposit Processing":"Deposit Completed",c=Dh(e.created_at||new Date().toISOString()),g=Fh(e.source_amount_usd);return jsxRuntime.jsxs(Et,{cardTokens:i,onPress:t,contentStyle:Oo.container,children:[jsxRuntime.jsxs(reactNative.View,{style:Oo.iconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:l},style:Oo.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[Oo.statusBadge,{backgroundColor:s?r.warning:r.success,borderColor:i.backgroundColor}],children:s?jsxRuntime.jsx(Us,{size:12,color:"#FFFFFF",strokeWidth:2.5}):jsxRuntime.jsx(Ae,{size:12,color:"#FFFFFF",strokeWidth:3})})]}),jsxRuntime.jsxs(reactNative.View,{style:Oo.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Oo.title,{color:i.titleColor,fontFamily:o.medium}],children:d}),jsxRuntime.jsx(reactNative.Text,{style:[Oo.dateTime,{color:i.subtitleColor,fontFamily:o.regular}],children:c})]}),jsxRuntime.jsxs(reactNative.View,{style:Oo.rightContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Oo.amount,{color:i.textRightColor,fontFamily:o.medium}],children:g}),jsxRuntime.jsx(Br,{size:20,color:i.actionColor,strokeWidth:2})]})]})}var Oo=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",paddingHorizontal:16,paddingVertical:12},iconContainer:{position:"relative",marginRight:12},tokenIcon:{width:40,height:40,borderRadius:20},statusBadge:{position:"absolute",bottom:-4,right:-4,width:22,height:22,borderRadius:11,alignItems:"center",justifyContent:"center",borderWidth:2},textContainer:{flex:1,gap:2},title:{fontSize:16,fontWeight:"500"},dateTime:{fontSize:13},rightContainer:{flexDirection:"row",alignItems:"center",gap:8},amount:{fontSize:16,fontWeight:"500"}});function hp(e,t){let r={solana:"Solana",ethereum:"Ethereum",bitcoin:"Bitcoin"};return e==="ethereum"?{1:"Ethereum",137:"Polygon",8453:"Base",42161:"Arbitrum",10:"Optimism"}[t]||r[e]||e:r[e]||e}function gp(e,t=6){if(!e)return "\u2014";try{let r=Number(e)/Math.pow(10,t);return r===0?"0.00":r>=1?r.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):r.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:8,minimumSignificantDigits:2,maximumSignificantDigits:6})}catch{return "0.00"}}function Ah(e){return e?`$${parseFloat(e).toFixed(2)}`:"$0.00"}var yp=e=>!e||e.length<12?e:`${e.slice(0,12)}...${e.slice(-4)}`;function bp(e){if(!e)return "";let t=e.indexOf(".");return t===-1?e.toUpperCase():e.slice(0,t).toUpperCase()+e.slice(t)}function Eh(e){try{let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" at "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e}}function qa({visible:e,onClose:t,executions:r,externalUserId:o,publishableKey:n,borderTopLeftRadius:i,borderTopRightRadius:s}){let{height:a}=reactNative.useWindowDimensions(),{colors:l,fonts:d,components:c}=O(),[g,w]=on.useState(r),[f,y]=on.useState(false),[b,m]=on.useState(null),[S,h]=on.useState(false),p=on.useRef(null);on.useEffect(()=>{if(!e||!o)return;let C=async()=>{y(true);try{let L=[...(await Co(o,n)).data].sort((R,H)=>{let V=R.created_at?new Date(R.created_at).getTime():0;return (H.created_at?new Date(H.created_at).getTime():0)-V});w(L);}catch(E){console.error("Failed to fetch executions:",E),w(r);}finally{y(false);}};C();let B=setInterval(C,1e4);return ()=>clearInterval(B)},[e,o,n,r]),on.useEffect(()=>{r.length>0&&w(C=>{let B=new Set(C.map(L=>L.id)),E=r.filter(L=>!B.has(L.id));return E.length>0?[...E,...C]:C});},[r]),on.useEffect(()=>{e||m(null);},[e]);let T=C=>{m(C);},x=()=>{m(null),h(false);},_=()=>{m(null),t();};return jsxRuntime.jsxs(Qe,{visible:e,onClose:_,closeOnBackdropPress:true,showHandle:false,heightPercent:.6,borderTopLeftRadius:i,borderTopRightRadius:s,children:[jsxRuntime.jsx(cr,{title:b?"Deposit Details":"Deposit Tracker",onClose:_,showClose:!b,showBack:!!b,onBack:x}),b?(()=>{if(!b)return null;let C=b,B=C.status==="pending"||C.status==="waiting"||C.status==="delayed",E=C.status==="succeeded",L=K(ae(C.destination_token_metadata,"png")||Mt("/icons/tokens/png/usdc.png")),R=C.provider_metadata?.details,H=R?.currencyIn,V=R?.currencyOut;H?.currency?.symbol||"USDC";V?.currency?.symbol||"USDC";let Xe=gp(C.source_amount_base_unit,C.source_token_metadata?.decimals),ee=gp(C.destination_amount_base_unit,C.destination_token_metadata?.decimals),ye=Ah(C.source_amount_usd),ze=hp(C.source_chain_type,C.source_chain_id),Fe=hp(C.destination_chain_type,C.destination_chain_id),Ue=()=>{C.explorer_url&&reactNative.Linking.openURL(C.explorer_url);},ie=()=>{C.destination_explorer_url&&reactNative.Linking.openURL(C.destination_explorer_url);};return jsxRuntime.jsxs(reactNative.ScrollView,{ref:p,style:[te.scrollContainer,{maxHeight:a*.7}],contentContainerStyle:te.detailsContent,showsVerticalScrollIndicator:false,children:[jsxRuntime.jsxs(reactNative.View,{style:te.iconSection,children:[jsxRuntime.jsxs(reactNative.View,{style:te.iconWrapper,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:L},style:te.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[te.statusBadge,{backgroundColor:B?l.warning:l.success,borderColor:l.background}],children:B?jsxRuntime.jsx(yt,{size:14,color:"#FFFFFF",strokeWidth:2}):jsxRuntime.jsx(Ae,{size:14,color:"#FFFFFF",strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:te.statusRow,children:[jsxRuntime.jsx(reactNative.View,{style:[te.statusDot,{backgroundColor:B?l.warning:l.success}]}),jsxRuntime.jsx(reactNative.Text,{style:[te.statusText,{color:c.container.titleColor,fontFamily:d.semibold}],children:B?"Processing":"Completed"})]}),jsxRuntime.jsx(reactNative.Text,{style:[te.dateText,{color:c.container.subtitleColor,fontFamily:d.regular}],children:Eh(C.created_at||new Date().toISOString())})]}),jsxRuntime.jsxs(reactNative.View,{style:[te.card,{backgroundColor:c.card.backgroundColor,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth,borderColor:c.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:te.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.cardLabel,{color:c.card.rowLeftLabel,fontFamily:d.regular}],children:"Amount Sent"}),jsxRuntime.jsxs(reactNative.Text,{style:[te.cardValue,{color:c.card.rowRightLabel,fontFamily:d.medium}],children:[Xe," ",bp(C.source_currency)]})]}),jsxRuntime.jsx(reactNative.View,{style:[te.cardDivider,{backgroundColor:l.border}]}),jsxRuntime.jsxs(reactNative.View,{style:te.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.cardLabel,{color:c.card.rowLeftLabel,fontFamily:d.regular}],children:"Amount Received"}),jsxRuntime.jsxs(reactNative.Text,{style:[te.cardValue,{color:c.card.rowRightLabel,fontFamily:d.medium}],children:[ee," ",bp(C.destination_currency)]})]}),jsxRuntime.jsx(reactNative.View,{style:[te.cardDivider,{backgroundColor:l.border}]}),jsxRuntime.jsxs(reactNative.View,{style:te.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.cardLabel,{color:c.card.rowLeftLabel,fontFamily:d.regular}],children:"USD Value"}),jsxRuntime.jsx(reactNative.Text,{style:[te.cardValue,{color:c.card.rowRightLabel,fontFamily:d.medium}],children:ye})]}),jsxRuntime.jsx(reactNative.View,{style:[te.cardDivider,{backgroundColor:l.border}]}),jsxRuntime.jsxs(reactNative.View,{style:te.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.cardLabel,{color:c.card.rowLeftLabel,fontFamily:d.regular}],children:"Source Network"}),jsxRuntime.jsx(reactNative.Text,{style:[te.cardValue,{color:c.card.rowRightLabel,fontFamily:d.medium}],children:ze})]}),jsxRuntime.jsx(reactNative.View,{style:[te.cardDivider,{backgroundColor:l.border}]}),jsxRuntime.jsxs(reactNative.View,{style:te.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.cardLabel,{color:c.card.rowLeftLabel,fontFamily:d.regular}],children:"Destination Network"}),jsxRuntime.jsx(reactNative.Text,{style:[te.cardValue,{color:c.card.rowRightLabel,fontFamily:d.medium}],children:Fe})]})]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:()=>{let Ge=!S;h(Ge),Ge?setTimeout(()=>{p.current?.scrollToEnd({animated:true});},100):p.current?.scrollTo({y:0,animated:true});},style:te.toggleButton,activeOpacity:.7,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.toggleText,{color:c.container.actionTitle,fontFamily:d.regular}],children:S?"See less":"See more details"}),S?jsxRuntime.jsx(qr,{size:14,color:c.container.actionColor,strokeWidth:2}):jsxRuntime.jsx(yt,{size:14,color:c.container.actionColor,strokeWidth:2})]}),S&&jsxRuntime.jsxs(reactNative.View,{style:[te.card,{backgroundColor:c.card.backgroundColor,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth,borderColor:c.card.borderColor}],children:[C.explorer_url&&jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:Ue,style:te.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.cardLabel,{color:c.card.rowLeftLabel,fontFamily:d.regular}],children:"Deposit Tx"}),jsxRuntime.jsxs(reactNative.View,{style:te.cardRowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.cardValue,{color:c.card.rowRightLabel,fontFamily:d.medium}],children:yp(C.transaction_hash)}),jsxRuntime.jsx($r,{size:14,color:c.card.actionIcon,strokeWidth:2})]})]}),jsxRuntime.jsx(reactNative.View,{style:[te.cardDivider,{backgroundColor:l.border}]})]}),C.destination_explorer_url&&E&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:ie,style:te.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.cardLabel,{color:c.card.rowLeftLabel,fontFamily:d.regular}],children:"Completion Tx"}),jsxRuntime.jsxs(reactNative.View,{style:te.cardRowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.cardValue,{color:c.card.rowRightLabel,fontFamily:d.medium}],children:yp(C.destination_transaction_hashes[0])}),jsxRuntime.jsx($r,{size:14,color:c.card.actionIcon,strokeWidth:2})]})]})]})]})})():jsxRuntime.jsx(reactNative.ScrollView,{style:[te.scrollContainer,{maxHeight:a*.7}],contentContainerStyle:te.scrollContent,showsVerticalScrollIndicator:false,children:g.length===0?jsxRuntime.jsxs(reactNative.View,{style:te.emptyContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[te.emptyText,{color:c.container.titleColor,fontFamily:d.medium}],children:"No deposits yet"}),jsxRuntime.jsx(reactNative.Text,{style:[te.emptySubtext,{color:c.container.subtitleColor,fontFamily:d.regular}],children:"Your deposit history will appear here"})]}):jsxRuntime.jsx(reactNative.View,{style:te.executionsList,children:g.map(C=>jsxRuntime.jsx(ja,{execution:C,onPress:()=>T(C)},C.id))})})]})}var te=reactNative.StyleSheet.create({scrollContainer:{paddingTop:16},scrollContent:{paddingHorizontal:16,paddingBottom:16},emptyContainer:{paddingVertical:40,paddingHorizontal:16,alignItems:"center"},emptyText:{fontSize:14,marginBottom:4},emptySubtext:{fontSize:12},executionsList:{paddingTop:8,gap:12},detailsContent:{paddingHorizontal:16,paddingBottom:32},iconSection:{alignItems:"center",marginBottom:24},iconWrapper:{position:"relative",marginBottom:12},tokenIcon:{width:72,height:72,borderRadius:36},statusBadge:{position:"absolute",bottom:0,right:0,width:28,height:28,borderRadius:14,alignItems:"center",justifyContent:"center",borderWidth:3},statusRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},statusDot:{width:8,height:8,borderRadius:4},statusText:{fontSize:16,fontWeight:"600"},dateText:{fontSize:14},card:{borderRadius:12,marginBottom:12,overflow:"hidden"},cardRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:14,paddingHorizontal:16},cardRowRight:{flexDirection:"row",alignItems:"center",gap:8},cardDivider:{height:1,marginHorizontal:16},cardLabel:{fontSize:14},cardValue:{fontSize:14,fontWeight:"500"},toggleButton:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:12,paddingHorizontal:4},toggleText:{fontSize:14},buttonSection:{marginTop:12,gap:10},actionButton:{flexDirection:"row",alignItems:"center",paddingVertical:16,paddingHorizontal:16,borderRadius:12},buttonIconLeft:{marginRight:12},buttonIconRight:{marginLeft:12},buttonText:{color:"#FFFFFF",fontSize:14,fontWeight:"600",flex:1,textAlign:"left"},hintText:{fontSize:12,textAlign:"center",marginTop:8}});function Fs(e,t=true){let[r,o]=on.useState(null),[n,i]=on.useState(null),[s,a]=on.useState(false),[l,d]=on.useState(false),[c,g]=on.useState(null),[w,f]=on.useState(null);on.useEffect(()=>{!t||r||(a(true),rs().then(S=>{o(S),g(null);}).catch(S=>{g(S instanceof Error?S:new Error(String(S)));}).finally(()=>{a(false);}));},[t,r]),on.useEffect(()=>{!t||!e||n||(d(true),ts(e).then(S=>{i(S),f(null);}).catch(S=>{f(S instanceof Error?S:new Error(String(S)));}).finally(()=>{d(false);}));},[t,e,n]);let y=s||l,b=c||w||null,m=null;if(r&&n){let S=n.blocked_country_codes||[],h=r.alpha2.toUpperCase();m=!S.some(p=>p.toUpperCase()===h);}return {isAllowed:m,alpha2:r?.alpha2?.toLowerCase()??null,country:r?.country??null,isLoading:y,error:b}}var Ac="unifold_recent_tokens",Uh=5,kp=[{symbol:"ETH",chainType:"ethereum",chainId:"1"},{symbol:"SOL",chainType:"solana",chainId:"mainnet"},{symbol:"USDC",chainType:"solana",chainId:"mainnet"},{symbol:"POL",chainType:"ethereum",chainId:"137"},{symbol:"BNB",chainType:"ethereum",chainId:"56"},{symbol:"BTC",chainType:"bitcoin",chainId:"mainnet"}];async function Ga(){try{let e=await Wc__default.default.getItem(Ac);return e?JSON.parse(e):[]}catch{return []}}async function Hh(e){try{let r=(await Ga()).filter(n=>!(n.symbol===e.symbol&&n.chainType===e.chainType&&n.chainId===e.chainId));r.unshift(e);let o=r.slice(0,Uh);await Wc__default.default.setItem(Ac,JSON.stringify(o));}catch{}}async function Nh(e){try{let r=(await Ga()).filter(o=>!(o.symbol===e.symbol&&o.chainType===e.chainType&&o.chainId===e.chainId));return await Wc__default.default.setItem(Ac,JSON.stringify(r)),r}catch{return []}}function Ec({visible:e,onClose:t,tokens:r,selectedToken:o,selectedChainKey:n,onSelect:i,borderTopLeftRadius:s,borderTopRightRadius:a}){let{colors:l,fonts:d,components:c}=O(),[g,w]=on.useState(""),[f,y]=on.useState([]);on.useEffect(()=>{e&&Ga().then(y);},[e]),on.useEffect(()=>{e||w("");},[e]);let b=on.useMemo(()=>{let x=[];return r.forEach(_=>{_.chains.forEach(F=>{x.push({token:_,chain:F});});}),x},[r]),m=on.useMemo(()=>{let x=[],_=new Set,F=(k,C,B,E)=>{let L=`${k}-${C}:${B}`;if(_.has(L))return;let R=r.find(V=>V.symbol===k);if(!R)return;let H=R.chains.find(V=>V.chain_type===C&&V.chain_id===B);H&&(_.add(L),x.push({token:R,chain:H,isRecent:E}));};return f.forEach(k=>{F(k.symbol,k.chainType,k.chainId,true);}),kp.forEach(k=>{F(k.symbol,k.chainType,k.chainId,false);}),x},[r,f]),S=on.useMemo(()=>{if(!g.trim())return b;let x=g.toLowerCase();return b.filter(({token:_,chain:F})=>_.symbol.toLowerCase().includes(x)||_.name.toLowerCase().includes(x)||F.chain_name.toLowerCase().includes(x))},[b,g]),h=(x,_,F)=>kp.some(k=>k.symbol===x&&k.chainType===_&&k.chainId===F),p=async(x,_)=>{let F=`${_.chain_type}:${_.chain_id}`;if(!h(x.symbol,_.chain_type,_.chain_id)){await Hh({symbol:x.symbol,chainType:_.chain_type,chainId:_.chain_id});let k=await Ga();y(k);}w(""),i(x.symbol,F),t();},T=async(x,_)=>{let F=await Nh({symbol:x.symbol,chainType:_.chain_type,chainId:_.chain_id});y(F);};return jsxRuntime.jsxs(Qe,{visible:e,onClose:t,closeOnBackdropPress:true,showHandle:false,heightPercent:.9,borderTopLeftRadius:s,borderTopRightRadius:a,children:[jsxRuntime.jsxs(reactNative.View,{style:Ke.header,children:[jsxRuntime.jsx(reactNative.View,{style:Ke.headerSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[Ke.headerTitle,{color:c.header.titleColor,fontFamily:d.medium}],children:"Select token to deposit"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:t,style:Ke.closeButton,children:jsxRuntime.jsx(tt,{size:20,color:c.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.View,{style:Ke.searchContainer,children:jsxRuntime.jsx(reactNative.TextInput,{style:[Ke.searchInput,{backgroundColor:c.search.backgroundColor,color:c.search.inputColor,fontFamily:d.regular,borderRadius:c.input.borderRadius,borderWidth:c.input.borderWidth,borderColor:c.input.borderColor}],placeholder:"Search",placeholderTextColor:c.search.placeholderColor,value:g,onChangeText:w,autoCapitalize:"none",autoCorrect:false})}),m.length>0&&!g&&jsxRuntime.jsxs(reactNative.View,{style:Ke.quickSelectSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ke.sectionLabel,{color:c.list.titleSectionColor,fontFamily:d.regular}],children:"Quick select"}),jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,keyboardShouldPersistTaps:"handled",contentContainerStyle:Ke.quickSelectScroll,children:m.map(({token:x,chain:_,isRecent:F})=>{let k=`${_.chain_type}:${_.chain_id}`;x.symbol===o&&k===n;return jsxRuntime.jsxs(reactNative.View,{children:[F&&jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>T(x,_),style:Ke.removeButton,children:jsxRuntime.jsx(tt,{size:12,color:l.foregroundMuted,strokeWidth:2})}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>p(x,_),activeOpacity:.7,style:[Ke.quickSelectItem,{backgroundColor:c.card.backgroundColor,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth,borderColor:c.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:Ke.tokenIconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(x,"png"))},style:Ke.quickSelectIcon}),jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(_,"png"))},style:[Ke.quickSelectChainBadge,{borderColor:c.card.backgroundColor,borderRadius:c.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:Ke.quickSelectText,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ke.quickSelectSymbol,{color:c.card.titleColor,fontFamily:d.medium}],children:x.symbol}),jsxRuntime.jsx(reactNative.Text,{style:[Ke.quickSelectChain,{color:c.card.subtitleColor,fontFamily:d.regular}],children:_.chain_name})]})]})]},`quick-${x.symbol}-${k}`)})})]}),jsxRuntime.jsx(reactNative.Text,{style:[Ke.sectionLabel,{color:c.list.titleSectionColor,fontFamily:d.regular}],children:"All supported tokens"}),jsxRuntime.jsx(reactNative.ScrollView,{style:Ke.tokenList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",contentContainerStyle:Ke.tokenListContent,children:S.length===0?jsxRuntime.jsx(reactNative.View,{style:Ke.emptyState,children:jsxRuntime.jsx(reactNative.Text,{style:[Ke.emptyText,{color:l.foregroundMuted,fontFamily:d.regular}],children:"No tokens found"})}):S.map(({token:x,chain:_})=>{let F=`${_.chain_type}:${_.chain_id}`,k=x.symbol===o&&F===n;return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>p(x,_),activeOpacity:.7,style:[Ke.tokenItem,{backgroundColor:k?c.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsxs(reactNative.View,{style:Ke.tokenIconContainerLarge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(x,"png"))},style:Ke.tokenIcon}),jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(_,"png"))},style:[Ke.tokenChainBadge,{borderColor:c.card.backgroundColor,borderRadius:c.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:Ke.tokenInfo,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ke.tokenSymbol,{color:c.card.titleColor,fontFamily:d.medium}],children:x.symbol}),jsxRuntime.jsx(reactNative.Text,{style:[Ke.tokenChainName,{color:c.card.subtitleColor,fontFamily:d.regular}],children:_.chain_name})]}),jsxRuntime.jsxs(reactNative.Text,{style:[Ke.minDeposit,{color:c.card.labelColor,fontFamily:d.regular}],children:["Minimum:"," ",jsxRuntime.jsxs(reactNative.Text,{style:{color:c.card.labelHighlightRightColor,fontFamily:d.regular},children:["$",_.minimum_deposit_amount_usd]})]})]},`${x.symbol}-${F}`)})})]})}var Ke=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},closeButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},headerTitle:{fontSize:16,fontWeight:"500",textAlign:"center",flex:1},headerSpacer:{width:28},searchContainer:{paddingHorizontal:16,paddingBottom:12},searchInput:{height:40,paddingHorizontal:16,fontSize:14},quickSelectSection:{marginBottom:12},sectionLabel:{fontSize:12,paddingHorizontal:16,marginBottom:8},quickSelectScroll:{paddingHorizontal:16,gap:8},quickSelectItem:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12},removeButton:{position:"absolute",top:-2,right:-6,zIndex:1,padding:2},tokenIconContainer:{position:"relative"},quickSelectIcon:{width:28,height:28,borderRadius:14},quickSelectChainBadge:{position:"absolute",bottom:-2,right:-2,width:14,height:14,borderRadius:7,borderWidth:2},quickSelectText:{alignItems:"flex-start"},quickSelectSymbol:{fontSize:12,fontWeight:"500"},quickSelectChain:{fontSize:10},tokenList:{flex:1},tokenListContent:{paddingHorizontal:16,paddingBottom:24,gap:4},emptyState:{padding:32,alignItems:"center"},emptyText:{fontSize:14},tokenItem:{flexDirection:"row",alignItems:"center",gap:12,padding:12,borderRadius:12},tokenIconContainerLarge:{position:"relative"},tokenIcon:{width:40,height:40,borderRadius:20},tokenChainBadge:{position:"absolute",bottom:-4,right:-4,width:20,height:20,borderRadius:10,borderWidth:2},tokenInfo:{flex:1},tokenSymbol:{fontSize:14,fontWeight:"500"},tokenChainName:{fontSize:12},minDeposit:{fontSize:12}});var Ja=(e,t)=>`${t}:${e}`,Kh=e=>{let[t,r]=e.split(":");return {chainType:t,chainId:r}};function Mc({externalUserId:e,publishableKey:t,recipientAddress:r,destinationChainType:o,destinationChainId:n,destinationTokenAddress:i,destinationTokenSymbol:s,defaultChainType:a,defaultChainId:l,defaultTokenAddress:d,depositConfirmationMode:c="auto_ui",onExecutionsChange:g,onDepositSuccess:w,onDepositError:f,wallets:y,borderTopLeftRadius:b,borderTopRightRadius:m,sheetBorderRadius:S}){let{colors:h,fonts:p,components:T}=O(),x=a&&l?`${a}:${l}`:"solana:mainnet",[_,F]=on.useState("USDC"),[k,C]=on.useState(x),[B,E]=on.useState([]),[L,R]=on.useState(!y?.length),H=y?.length?y:B,[V,we]=on.useState([]),[We,Xe]=on.useState(true),[ee,ye]=on.useState(false),[ze,Fe]=on.useState(false),[Ue,ie]=on.useState(false),[Ge,Ve]=on.useState([]),[Ye,dt]=on.useState(new Map),[at]=on.useState(()=>new Date),[ht,He]=on.useState(null),[Lt,J]=on.useState(false),[q,Te]=on.useState(null),[wt,he]=on.useState(false),_e=new Map;V.forEach(le=>{le.chains.forEach(Le=>{let U=`${Le.chain_type}:${Le.chain_id}`;_e.has(U)||_e.set(U,Le);});});let Je=Array.from(_e.values()),mt=Kh(k),Se=Je.find(le=>le.chain_type===mt.chainType&&le.chain_id===mt.chainId),et=Se?.chain_type||"ethereum",Ht=bo(H,et),lt=Ht?.address||"",Re=on.useRef(false);on.useEffect(()=>{async function le(){try{Xe(!0),He(null);let U=await kn(t,i&&n&&o?{destination_token_address:i,destination_chain_id:n,destination_chain_type:o}:void 0);if(we(U.data),U.data.length>0&&!Re.current){Re.current=!0;let Z,pe;if(a&&l)if(d)for(let oe of U.data){let X=oe.chains.find(ce=>ce.chain_type===a&&ce.chain_id===l&&ce.token_address.toLowerCase()===d.toLowerCase());if(X){Z=oe,pe=X;break}}else for(let oe of U.data){let X=oe.chains.find(ce=>ce.chain_type===a&&ce.chain_id===l);if(X){Z=oe,pe=X;break}}if(!Z&&i)for(let oe of U.data){let X=oe.chains.find(ce=>ce.token_address.toLowerCase()===i.toLowerCase());if(X){Z=oe,pe=X;break}}Z||(Z=U.data.find(oe=>oe.symbol==="USDC"),Z&&Z.chains.length>0&&(pe=Z.chains[0])),Z||(Z=U.data.find(oe=>oe.symbol==="USDT"),Z&&Z.chains.length>0&&(pe=Z.chains[0])),Z||(Z=U.data[0],Z.chains.length>0&&(pe=Z.chains[0])),Z&&F(Z.symbol),pe&&C(Ja(pe.chain_id,pe.chain_type));}}catch(Le){console.error("Error fetching supported tokens:",Le),He("Failed to load supported tokens"),f?.({message:"Failed to load supported tokens",error:Le});}finally{Xe(false);}}le();},[t,i,n,o,a,l,d,f]),on.useEffect(()=>{g&&g(Ge);},[Ge,g]),on.useEffect(()=>{if(y?.length){R(false);return}if(B.length>0){R(false);return}let le=null,Le=false,U=async()=>{if(!Le){R(true);try{let Z=await yo({external_user_id:e,recipient_address:r,destination_chain_type:o,destination_chain_id:n,destination_token_address:i},t);Le||(E(Z.data),He(null),R(!1));}catch(Z){console.error("Error fetching wallets, retrying in 5s:",Z),Le||(He(Z instanceof Error?Z.message:"Failed to load wallets"),R(false),le=setTimeout(U,5e3));}}};return U(),()=>{Le=true,le&&clearTimeout(le);}},[e,r,o,n,i,t,y,B.length]);let Nt=Ht?.id??"",{showWaitingUi:Bt,handleIveDeposited:Cr}=Is({depositConfirmationMode:c,depositAddress:lt,chain:k,externalUserId:e,publishableKey:t,modalOpenedAt:at,depositWalletId:Nt,depositExecutions:Ge,trackedExecutions:Ye,setDepositExecutions:Ve,setTrackedExecutions:dt,setLatestExecution:Te,setShowStatusSheet:J,onDepositSuccess:w,onExecutionsChange:g,onDepositError:f});on.useEffect(()=>{if(!V.length)return;let le=V.find(U=>U.symbol===_);if(!le||le.chains.length===0)return;if(!le.chains.some(U=>Ja(U.chain_id,U.chain_type)===k)){let U=le.chains[0];C(Ja(U.chain_id,U.chain_type));}},[_,V,k]);let xe=V.find(le=>le.symbol===_),$e=(xe?.chains||[]).find(le=>Ja(le.chain_id,le.chain_type)===k),ur=async()=>{if(lt)try{reactNative.Clipboard.setString(lt),ye(!0),setTimeout(()=>ye(!1),2e3);}catch(le){console.error("Failed to copy:",le);}},N=$e?.estimated_price_impact_percent??0,re=$e?.max_slippage_percent??.25,ue=$e?.minimum_deposit_amount_usd??3;return We?jsxRuntime.jsxs(reactNative.View,{style:A.loadingContainer,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:h.primary}),jsxRuntime.jsx(reactNative.Text,{style:[A.loadingText,{color:h.foregroundMuted,fontFamily:p.regular}],children:"Loading currencies..."})]}):ht&&V.length===0?jsxRuntime.jsxs(reactNative.View,{style:A.errorContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[A.errorText,{color:h.error,fontFamily:p.regular}],children:ht}),jsxRuntime.jsx(reactNative.Text,{style:[A.errorHint,{color:h.foregroundMuted,fontFamily:p.regular}],children:"Please check your network connection and try again."})]}):jsxRuntime.jsxs(reactNative.View,{style:A.container,children:[jsxRuntime.jsxs(reactNative.View,{style:A.selectorSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[A.selectorLabel,{color:T.card.labelColor,fontFamily:p.medium}],children:"Select token to deposit"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>ie(true),disabled:We||V.length===0,style:[A.tokenSelectorButton,{backgroundColor:T.card.backgroundColor,borderRadius:T.card.borderRadius,borderWidth:T.card.borderWidth,borderColor:T.card.borderColor}],activeOpacity:.7,children:We?jsxRuntime.jsxs(reactNative.View,{style:A.tokenSelectorLoading,children:[jsxRuntime.jsx(reactNative.View,{style:[A.loadingIcon,{backgroundColor:h.cardHover}]}),jsxRuntime.jsxs(reactNative.View,{style:A.loadingTextContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[A.loadingLine,{backgroundColor:h.cardHover,width:60}]}),jsxRuntime.jsx(reactNative.View,{style:[A.loadingLine,{backgroundColor:h.cardHover,width:100,marginTop:4}]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:A.tokenIconWrapper,children:[xe&&jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(xe,"png"))},style:A.tokenMainIcon}),($e||Se)&&jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae($e||Se,"png"))},style:[A.tokenChainBadge,{borderColor:T.card.backgroundColor,borderRadius:T.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:A.tokenSelectorInfo,children:[jsxRuntime.jsx(reactNative.Text,{style:[A.tokenSelectorSymbol,{color:T.card.titleColor,fontFamily:p.semibold}],children:xe?.symbol||_}),jsxRuntime.jsx(reactNative.Text,{style:[A.tokenSelectorNetwork,{color:T.card.subtitleColor,fontFamily:p.regular}],numberOfLines:1,children:$e?.chain_name||Se?.chain_name||"Select network"})]}),jsxRuntime.jsxs(reactNative.View,{style:A.tokenSelectorRight,children:[jsxRuntime.jsxs(reactNative.Text,{style:[A.minDepositText,{color:T.card.labelHighlightRightColor,fontFamily:p.medium}],children:["$",ue," min"]}),jsxRuntime.jsx(Br,{size:16,color:T.card.actionColor,strokeWidth:2})]})]})})]}),jsxRuntime.jsx(Ec,{visible:Ue,onClose:()=>ie(false),tokens:V,selectedToken:_,selectedChainKey:k,onSelect:(le,Le)=>{F(le),C(Le);},borderTopLeftRadius:S?.tokenSelector?.borderTopLeftRadius??b,borderTopRightRadius:S?.tokenSelector?.borderTopRightRadius??m}),jsxRuntime.jsx(reactNative.View,{style:A.qrContainer,children:jsxRuntime.jsx(reactNative.View,{style:[A.qrWrapper,{backgroundColor:h.background,borderRadius:T.card.borderRadius,borderWidth:T.card.borderWidth>0?T.card.borderWidth:1,borderColor:T.card.borderColor}],children:L?jsxRuntime.jsxs(reactNative.View,{style:A.qrLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:h.primary}),jsxRuntime.jsx(reactNative.Text,{style:[A.loadingText,{color:h.foregroundMuted,fontFamily:p.regular}],children:"Loading..."})]}):lt?jsxRuntime.jsx(Ai,{value:lt,size:180,logoUri:K(ae($e,"png")||Mt("/icons/networks/png/ethereum.png")),logoSize:45}):jsxRuntime.jsx(reactNative.View,{style:A.qrLoading,children:jsxRuntime.jsx(reactNative.Text,{style:[A.errorText,{color:h.error,fontFamily:p.regular}],children:"No address available"})})})}),jsxRuntime.jsxs(reactNative.View,{style:A.addressSection,children:[jsxRuntime.jsxs(reactNative.View,{style:A.addressHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[A.addressLabel,{color:T.card.labelColor,fontFamily:p.medium}],children:"Deposit Address"}),ee&&jsxRuntime.jsxs(reactNative.View,{style:A.copiedIndicator,children:[jsxRuntime.jsx(Ae,{size:14,color:h.success,strokeWidth:2}),jsxRuntime.jsx(reactNative.Text,{style:[A.copiedText,{color:h.success,fontFamily:p.regular}],children:"Copied"})]})]}),jsxRuntime.jsxs(Et,{cardTokens:T.transferCrypto.depositAddress.card,onPress:!L&<?ur:void 0,contentStyle:A.addressBox,children:[jsxRuntime.jsx(reactNative.Text,{style:[A.addressText,{color:T.card.titleColor,fontFamily:p.regular}],numberOfLines:2,children:L?"Loading...":lt||"No address available"}),jsxRuntime.jsx(reactNative.View,{style:A.addressCopyIcon,children:jsxRuntime.jsx(Cn,{size:16,color:T.card.actionColor,strokeWidth:1})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:[A.detailsCard,{backgroundColor:T.card.backgroundColor,borderRadius:T.card.borderRadius,borderWidth:T.card.borderWidth,borderColor:T.card.borderColor}],children:[jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Fe(!ze),style:A.detailsHeader,children:[jsxRuntime.jsxs(reactNative.View,{style:A.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[A.detailIcon,{backgroundColor:T.card.iconBackgroundColor,borderRadius:T.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(jr,{size:12,color:T.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[A.detailsLabel,{color:T.card.titleColor,fontFamily:p.regular}],children:"Processing time: < 1 min"})]}),jsxRuntime.jsx(reactNative.View,{style:A.chevronContainer,children:ze?jsxRuntime.jsx(qr,{size:16,color:T.card.actionColor,strokeWidth:2}):jsxRuntime.jsx(yt,{size:16,color:T.card.actionColor,strokeWidth:2})})]}),ze&&jsxRuntime.jsxs(reactNative.View,{style:A.detailsContent,children:[jsxRuntime.jsxs(reactNative.View,{style:A.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[A.detailIcon,{backgroundColor:T.card.iconBackgroundColor,borderRadius:T.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Ho,{size:12,color:T.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[A.detailsLabel,{color:T.card.titleColor,fontFamily:p.regular}],children:["Price impact: ",N.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>he(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(ri,{size:14,color:T.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:A.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[A.detailIcon,{backgroundColor:T.card.iconBackgroundColor,borderRadius:T.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(No,{size:12,color:T.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[A.detailsLabel,{color:T.card.titleColor,fontFamily:p.regular}],children:["Slippage: Auto \u2022 ",re.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>he(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(ri,{size:14,color:T.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:A.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[A.detailIcon,{backgroundColor:T.card.iconBackgroundColor,borderRadius:T.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(zs,{size:12,color:T.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[A.detailsLabel,{color:T.card.titleColor,fontFamily:p.regular}],children:["Need help?"," ",jsxRuntime.jsx(reactNative.Text,{style:{textDecorationLine:"underline"},children:"Contact support"})]})]})]})]}),jsxRuntime.jsx(Va,{depositConfirmationMode:c,depositAddress:lt,showWaitingUi:Bt,latestExecution:q,onIveDeposited:Cr}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{style:A.termsContainer,onPress:()=>reactNative.Linking.openURL("https://unifold.io/terms"),children:jsxRuntime.jsx(reactNative.Text,{style:[A.termsText,{color:h.primary,fontFamily:p.regular}],children:"Terms apply"})}),jsxRuntime.jsxs(Qe,{visible:wt,onClose:()=>he(false),closeOnBackdropPress:true,showHandle:true,borderTopLeftRadius:S?.infoSheet?.borderTopLeftRadius??b,borderTopRightRadius:S?.infoSheet?.borderTopRightRadius??m,children:[jsxRuntime.jsxs(reactNative.View,{style:[A.sheetHeader,{borderBottomColor:h.border}],children:[jsxRuntime.jsx(reactNative.View,{style:A.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[A.sheetTitle,{color:T.header.titleColor,fontFamily:p.medium}],children:"Price Impact & Slippage"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>he(false),style:A.sheetCloseButton,children:jsxRuntime.jsx(tt,{size:20,color:T.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:A.infoSheetContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[A.infoCard,{backgroundColor:T.card.backgroundColor,borderRadius:T.card.borderRadius,borderWidth:T.card.borderWidth,borderColor:T.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:A.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[A.infoCardIcon,{backgroundColor:T.card.iconBackgroundColor,borderRadius:T.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Ho,{size:16,color:T.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[A.infoCardTitle,{color:T.card.titleColor,fontFamily:p.medium}],children:"Price Impact"}),jsxRuntime.jsxs(reactNative.Text,{style:[A.infoCardValue,{color:T.card.titleColor,fontFamily:p.medium}],children:[N.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[A.infoCardDescription,{color:T.card.descriptionColor,fontFamily:p.regular}],children:"Price impact is the difference between the current market price and the price you'll receive for your swap. This occurs due to liquidity pool mechanics and trade size."})]}),jsxRuntime.jsxs(reactNative.View,{style:[A.infoCard,{backgroundColor:T.card.backgroundColor,borderRadius:T.card.borderRadius,borderWidth:T.card.borderWidth,borderColor:T.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:A.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[A.infoCardIcon,{backgroundColor:T.card.iconBackgroundColor,borderRadius:T.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(No,{size:16,color:T.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[A.infoCardTitle,{color:T.card.titleColor,fontFamily:p.medium}],children:"Max Slippage"}),jsxRuntime.jsxs(reactNative.Text,{style:[A.infoCardValue,{color:T.card.titleColor,fontFamily:p.medium}],children:[re.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[A.infoCardDescription,{color:T.card.descriptionColor,fontFamily:p.regular}],children:"Max slippage is the maximum price difference you're willing to accept between when you submit a transaction and when it executes. Your transaction will revert if the price moves beyond this threshold."})]})]})]}),q&&jsxRuntime.jsx(Ei,{visible:Lt,status:q.status,tokenIconUrl:q.destination_token_metadata?.icon_urls?.find(le=>le.format==="png")?.url||q.destination_token_metadata?.icon_url||ae(xe,"png"),explorerUrl:q.explorer_url,completionExplorerUrl:q.destination_explorer_url,date:q.created_at?new Date(q.created_at):void 0,amountUsd:q.source_amount_usd?parseFloat(q.source_amount_usd):void 0,onClose:()=>J(false),borderTopLeftRadius:S?.depositStatus?.borderTopLeftRadius??b,borderTopRightRadius:S?.depositStatus?.borderTopRightRadius??m})]})}var A=reactNative.StyleSheet.create({container:{flex:1,paddingHorizontal:16},loadingContainer:{padding:40,alignItems:"center",gap:12},loadingText:{fontSize:14},errorContainer:{padding:40,alignItems:"center",gap:8},errorText:{fontSize:14,textAlign:"center"},errorHint:{fontSize:12,textAlign:"center"},selectorSection:{marginBottom:12},selectorLabel:{fontSize:12,marginBottom:8},tokenSelectorButton:{flexDirection:"row",alignItems:"center",gap:12,padding:12},tokenSelectorLoading:{flexDirection:"row",alignItems:"center",gap:12,flex:1},loadingIcon:{width:40,height:40,borderRadius:20},loadingTextContainer:{flex:1},loadingLine:{height:12,borderRadius:6},tokenIconWrapper:{position:"relative"},tokenMainIcon:{width:40,height:40,borderRadius:20},tokenChainBadge:{position:"absolute",bottom:-4,right:-4,width:20,height:20,borderRadius:10,borderWidth:2},tokenSelectorInfo:{flex:1},tokenSelectorSymbol:{fontSize:14,fontWeight:"500"},tokenSelectorNetwork:{fontSize:12,marginTop:2},tokenSelectorRight:{flexDirection:"row",alignItems:"center",gap:8},minDepositText:{fontSize:12,fontWeight:"500"},qrContainer:{alignItems:"center",marginVertical:8},qrWrapper:{padding:16},qrLoading:{width:160,height:160,alignItems:"center",justifyContent:"center"},addressSection:{marginBottom:16},addressHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},addressLabel:{fontSize:12},copiedIndicator:{flexDirection:"row",alignItems:"center",gap:4},copiedText:{fontSize:12,fontWeight:"500"},addressBox:{position:"relative",paddingHorizontal:12,paddingVertical:16},addressText:{fontSize:12,fontFamily:"monospace"},addressCopyIcon:{position:"absolute",right:12,top:0,bottom:0,justifyContent:"center"},detailsCard:{borderRadius:8,padding:4,marginBottom:16},detailsHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,paddingLeft:8,paddingRight:8},detailsContent:{paddingRight:12,paddingLeft:8,paddingBottom:12,gap:10},detailsRow:{flexDirection:"row",alignItems:"center",gap:8},detailIcon:{width:24,height:24,borderRadius:12,alignItems:"center",justifyContent:"center"},detailsLabel:{fontSize:13},chevronContainer:{},termsContainer:{alignItems:"center",paddingVertical:8},termsText:{fontSize:12,textDecorationLine:"underline"},sheetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},sheetHeaderSpacer:{width:28},sheetTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},sheetCloseButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},infoSheetContent:{paddingHorizontal:16,paddingBottom:32,gap:16},infoCard:{borderRadius:12,padding:16,gap:12},infoCardHeader:{flexDirection:"row",alignItems:"center",gap:10},infoCardIcon:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center"},infoCardTitle:{fontSize:15,fontWeight:"600",flex:1},infoCardValue:{fontSize:15,fontWeight:"600"},infoCardDescription:{fontSize:13,lineHeight:20}});var Fo={transferCrypto:{title:"Transfer Crypto",subtitle:"No limit \u2022 Instant"},depositWithCard:{title:"Deposit with Card",subtitle:"$50,000 limit \u2022 2 min"},stripeLinkPay:{title:"Pay with Stripe Link",subtitle:"Apple Pay or Card"},depositTracker:{title:"Deposit Tracker",subtitle:"Track your deposit progress"}};function Zh(){let{colors:e,components:t}=O(),r=on.useRef(new reactNative.Animated.Value(.5)).current,o=t.depositMenu.card.backgroundColor,n=e.cardHover;on.useEffect(()=>{let s=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(r,{toValue:1,duration:800,useNativeDriver:true}),reactNative.Animated.timing(r,{toValue:.5,duration:800,useNativeDriver:true})]));return s.start(),()=>s.stop()},[r]);let i=({rightIcons:s=2})=>jsxRuntime.jsxs(reactNative.View,{style:[fn.card,{backgroundColor:o,borderRadius:t.depositMenu.card.borderRadius}],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[fn.leftIcon,{backgroundColor:n,opacity:r,borderRadius:t.depositMenu.card.iconContainerBorderRadius}]}),jsxRuntime.jsxs(reactNative.View,{style:fn.textBlock,children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[fn.titleBar,{backgroundColor:n,opacity:r}]}),jsxRuntime.jsx(reactNative.Animated.View,{style:[fn.subtitleBar,{backgroundColor:n,opacity:r}]})]}),jsxRuntime.jsx(reactNative.View,{style:fn.rightIcons,children:Array.from({length:s}).map((a,l)=>jsxRuntime.jsx(reactNative.Animated.View,{style:[fn.rightIcon,{backgroundColor:n,opacity:r}]},l))})]});return jsxRuntime.jsxs(reactNative.View,{style:fn.container,children:[jsxRuntime.jsx(i,{rightIcons:3}),jsxRuntime.jsx(i,{rightIcons:2}),jsxRuntime.jsx(i,{rightIcons:0})]})}var fn=reactNative.StyleSheet.create({container:{paddingTop:8,paddingBottom:24,gap:8},card:{marginHorizontal:16,flexDirection:"row",alignItems:"center",paddingVertical:16,paddingHorizontal:12,gap:12},leftIcon:{width:36,height:36},textBlock:{flex:1,gap:6},titleBar:{height:12,width:"70%",borderRadius:6},subtitleBar:{height:10,width:"50%",borderRadius:5},rightIcons:{flexDirection:"row",alignItems:"center",gap:4},rightIcon:{width:20,height:20,borderRadius:10}});function Xh({visible:e,onClose:t,externalUserId:r,publishableKey:o,modalTitle:n="Deposit",destinationTokenSymbol:i,recipientAddress:s,destinationChainType:a,destinationChainId:l,destinationTokenAddress:d,defaultChainType:c,defaultChainId:g,defaultTokenAddress:w,showBalance:f=false,hideDepositTracker:y=false,enableStripeLinkPay:b=false,StripeOnrampComponent:m,stripeOnrampEmail:S,stripeOnrampPhone:h,stripeMerchantIdentifier:p,stripeTheme:T,depositConfirmationMode:x="auto_ui",transferInputVariant:_="double_input",onDepositSuccess:F,onDepositError:k,sheetBorderRadius:C}){let B=C?.globalBorderTopLeftRadius,E=C?.globalBorderTopRightRadius,{colors:L,fonts:R}=O(),[H,V]=on.useState([]),[we,We]=on.useState(false),[Xe,ee]=on.useState(false),[ye,ze]=on.useState(false),[Fe,Ue]=on.useState(false),[ie,Ge]=on.useState(null),[Ve,Ye]=on.useState("amount"),{isAllowed:dt,isLoading:at}=Fs(o,e);on.useEffect(()=>{if(!e||ie)return;let he=false;return ts(o).then(async _e=>{if(he)return;let Je=[];for(let mt of _e?.transfer_crypto?.networks??[]){let Se=mt.icon_urls.find(et=>et.format==="png")?.url||mt.icon_urls.find(et=>et.format==="svg")?.url;Se&&Je.push(K(Se));}for(let mt of _e?.payment_networks?.networks??[]){let Se=mt.icon_urls.find(et=>et.format==="png")?.url||mt.icon_urls.find(et=>et.format==="svg")?.url;Se&&Je.push(K(Se));}Je.length>0&&await dc(Je),he||Ge(_e);}).catch(console.error),()=>{he=true;}},[e,ie,o]);let ht=()=>{t();},He=H.filter(he=>he.status==="pending"||he.status==="waiting").length,J=!!(s&&a&&l&&d&&o)&&f!==false&&!!ie,q=at||e&&!ie,Te=dt===false,wt=null;if(Fe&&m){let he=jsxRuntime.jsx(m,{publishableKey:o,email:S,phone:h,externalUserId:r,recipientAddress:s??"",destinationChainType:a,destinationChainId:l,destinationTokenAddress:d,merchantIdentifier:p,onClose:()=>Ue(false)});wt=T?jsxRuntime.jsx(Di,{...T,children:he}):he;}return jsxRuntime.jsxs(Qe,{visible:e,onClose:ht,closeOnBackdropPress:false,showHandle:false,borderTopLeftRadius:C?.main?.borderTopLeftRadius??B,borderTopRightRadius:C?.main?.borderTopRightRadius??E,children:[jsxRuntime.jsx(cr,{title:n,showBack:false,onClose:ht,showBalance:J,balanceAddress:s,balanceChainType:a,balanceChainId:l,balanceTokenAddress:d,publishableKey:o,projectName:ie?.project_name}),q&&jsxRuntime.jsx(Zh,{}),!q&&Te&&jsxRuntime.jsxs(reactNative.View,{style:Vo.centeredContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[Vo.iconContainer,{backgroundColor:L.cardHover}],children:jsxRuntime.jsx(Ns,{size:32,color:L.foreground,strokeWidth:1.5})}),jsxRuntime.jsx(reactNative.Text,{style:[Vo.blockedTitle,{color:L.foreground,fontFamily:R.semibold}],children:"No Tokens Available"}),jsxRuntime.jsx(reactNative.Text,{style:[Vo.blockedDescription,{color:L.foreground,opacity:.7,fontFamily:R.regular}],children:"There are no supported tokens available from your current location."})]}),!q&&!Te&&jsxRuntime.jsxs(reactNative.View,{style:Vo.optionsContainer,children:[jsxRuntime.jsx(Ss,{onPress:()=>ee(true),title:Fo.transferCrypto.title,subtitle:Fo.transferCrypto.subtitle,featuredTokens:ie?.transfer_crypto?.networks}),jsxRuntime.jsx(xs,{onPress:()=>ze(true),title:Fo.depositWithCard.title,subtitle:Fo.depositWithCard.subtitle,paymentNetworks:ie?.payment_networks?.networks}),b&&m&&jsxRuntime.jsx(vs,{onPress:()=>Ue(true),title:Fo.stripeLinkPay.title,subtitle:Fo.stripeLinkPay.subtitle}),!y&&jsxRuntime.jsx(_s,{onPress:()=>We(true),title:Fo.depositTracker.title,subtitle:Fo.depositTracker.subtitle,badge:He>0?He:void 0})]}),jsxRuntime.jsx(qa,{visible:we,onClose:()=>We(false),executions:H,externalUserId:r,publishableKey:o,borderTopLeftRadius:C?.depositsTracker?.borderTopLeftRadius??B,borderTopRightRadius:C?.depositsTracker?.borderTopRightRadius??E}),jsxRuntime.jsxs(Qe,{visible:Xe,onClose:()=>ee(false),closeOnBackdropPress:false,showHandle:false,heightPercent:.9,borderTopLeftRadius:C?.transferCrypto?.borderTopLeftRadius??B,borderTopRightRadius:C?.transferCrypto?.borderTopRightRadius??E,children:[jsxRuntime.jsx(cr,{title:Fo.transferCrypto.title,showBack:false,onClose:()=>ee(false),showBalance:J,balanceAddress:s,balanceChainType:a,balanceChainId:l,balanceTokenAddress:d,publishableKey:o,projectName:ie?.project_name}),jsxRuntime.jsx(reactNative.ScrollView,{style:Vo.transferScrollContainer,contentContainerStyle:Vo.scrollContent,showsVerticalScrollIndicator:false,children:_==="single_input"?jsxRuntime.jsx(Mc,{externalUserId:r,publishableKey:o,recipientAddress:s,destinationChainType:a,destinationChainId:l,destinationTokenAddress:d,destinationTokenSymbol:i,defaultChainType:c,defaultChainId:g,defaultTokenAddress:w,depositConfirmationMode:x,onExecutionsChange:V,onDepositSuccess:F,onDepositError:k,borderTopLeftRadius:B,borderTopRightRadius:E,sheetBorderRadius:{tokenSelector:C?.tokenSelector,infoSheet:C?.infoSheet,depositStatus:C?.depositStatus}}):jsxRuntime.jsx(Ba,{externalUserId:r,publishableKey:o,recipientAddress:s,destinationChainType:a,destinationChainId:l,destinationTokenAddress:d,destinationTokenSymbol:i,defaultChainType:c,defaultChainId:g,defaultTokenAddress:w,depositConfirmationMode:x,onExecutionsChange:V,onDepositSuccess:F,onDepositError:k,borderTopLeftRadius:B,borderTopRightRadius:E,sheetBorderRadius:{tokenSelector:C?.tokenSelector,chainSelector:C?.chainSelector,infoSheet:C?.infoSheet,depositStatus:C?.depositStatus}})})]}),jsxRuntime.jsxs(Qe,{visible:ye,onClose:()=>{ze(false),Ye("amount");},closeOnBackdropPress:false,showHandle:false,heightPercent:.9,borderTopLeftRadius:C?.buyWithCard?.borderTopLeftRadius??B,borderTopRightRadius:C?.buyWithCard?.borderTopRightRadius??E,children:[jsxRuntime.jsx(cr,{title:`Deposit ${i||"USDC"}`,showBack:Ve==="onramp",onBack:()=>Ye("amount"),onClose:()=>{ze(false),Ye("amount");},showBalance:J,balanceAddress:s,balanceChainType:a,balanceChainId:l,balanceTokenAddress:d,publishableKey:o,projectName:ie?.project_name}),jsxRuntime.jsx(reactNative.View,{style:Vo.buyWithCardContainer,children:jsxRuntime.jsx(Ua,{externalUserId:r,publishableKey:o,destinationTokenSymbol:i,recipientAddress:s,destinationChainType:a,destinationChainId:l,destinationTokenAddress:d,onDepositSuccess:F,onDepositError:k,view:Ve,onViewChange:he=>Ye(he),borderTopLeftRadius:B,borderTopRightRadius:E,sheetBorderRadius:{providerModal:C?.providerModal,webView:C?.webView,currencyModal:C?.currencyModal}})})]}),b&&m&&jsxRuntime.jsx(Qe,{visible:Fe,onClose:()=>Ue(false),closeOnBackdropPress:false,showHandle:false,heightPercent:1,borderTopLeftRadius:0,borderTopRightRadius:0,children:jsxRuntime.jsx(reactNative.View,{style:Vo.stripeLinkPayContainer,children:wt})})]})}function Za({theme:e="auto",...t}){return jsxRuntime.jsx(Xh,{...t})}var Vo=reactNative.StyleSheet.create({optionsContainer:{paddingTop:8,paddingBottom:24,gap:8},transferScrollContainer:{flex:1},scrollContent:{paddingBottom:24},buyWithCardContainer:{flex:1},stripeLinkPayContainer:{flex:1},centeredContainer:{alignItems:"center",justifyContent:"center",paddingVertical:48,paddingHorizontal:16,minHeight:200},iconContainer:{width:64,height:64,borderRadius:32,alignItems:"center",justifyContent:"center",marginBottom:16},blockedTitle:{fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},blockedDescription:{fontSize:14,textAlign:"center",maxWidth:280,lineHeight:20}});function Xa(e,t=true){return xo({queryKey:["unifold","supportedDestinationTokens",e],queryFn:()=>na(e),staleTime:1e3*60*5,gcTime:1e3*60*30,refetchOnMount:false,enabled:t})}function zc(e){let{sourceChainType:t,sourceChainId:r,sourceTokenAddress:o,sourceTokenSymbol:n,publishableKey:i,enabled:s=true}=e;return xo({queryKey:["unifold","sourceTokenValidation",t??null,r??null,o??null,i],queryFn:async()=>{let l=await kn(i),d=null,c=null,g=null,w=null,f,y,b,m=l.data.some(S=>S.chains.some(h=>{let p=h.chain_type===t&&h.chain_id===r&&h.token_address.toLowerCase()===o.toLowerCase();return p&&(d=h.minimum_deposit_amount_usd,c=h.estimated_processing_time,g=h.max_slippage_percent,w=h.estimated_price_impact_percent,b=h.chain_name,y=S),p}));if(y){let S=ae(y,"png");S&&(f=K(S));}return {isSupported:m,minimumAmountUsd:d,estimatedProcessingTime:c,maxSlippagePercent:g,priceImpactPercent:w,errorMessage:m?null:`${n||"Source token"} is not a supported withdrawal token. Supported tokens include USDC, USDT, and other stablecoins.`,iconUrl:f,chainName:b}},enabled:s&&(!!t&&!!r&&!!o),staleTime:1e3*60*5,gcTime:1e3*60*30,refetchOnMount:false})}function Uc(e){let{address:t,chainType:r,chainId:o,tokenAddress:n,publishableKey:i,enabled:s=true}=e;return xo({queryKey:["unifold","addressBalance",t??null,r??null,o??null,n??null,i],queryFn:async()=>{let l=await ia(t,r,o,n,i);if(l.balance){let d=l.balance.token?.decimals??6,c=l.balance.token?.symbol??"",g=l.balance.amount,w=BigInt(g),f=BigInt(10**d),y=w/f,m=(w%f).toString().padStart(d,"0").replace(/0+$/,""),S=m?`${y}.${m}`:y.toString();return {balanceBaseUnit:g,balanceHuman:S,balanceUsd:l.balance.amount_usd,exchangeRate:l.balance.exchange_rate,decimals:d,symbol:c}}return {balanceBaseUnit:"0",balanceHuman:"0",balanceUsd:"0",exchangeRate:null,decimals:6,symbol:""}},enabled:s&&(!!t&&!!r&&!!o&&!!n),staleTime:1e3*30,gcTime:1e3*60*5,refetchInterval:1e3*30,refetchOnMount:"always"})}var eg=2500,tg=3e3,rg=6e4;function Hc({userId:e,publishableKey:t,depositWalletId:r,enabled:o=false,onWithdrawSuccess:n,onWithdrawError:i}){let[s,a]=on.useState([]),[l,d]=on.useState(false),c=on.useRef(new Date),g=on.useRef(new Map),w=on.useRef(false),f=on.useRef(n),y=on.useRef(i);return on.useEffect(()=>{f.current=n;},[n]),on.useEffect(()=>{y.current=i;},[i]),on.useEffect(()=>{o&&!w.current&&(c.current=new Date,g.current.clear()),o||g.current.clear(),w.current=o;},[o]),on.useEffect(()=>{if(!e||!o)return;let b=c.current,m=async()=>{try{let h=await Co(e,t,"withdraw"),p=new Date(b.getTime()-rg),T=[...h.data].sort((k,C)=>{let B=k.created_at?new Date(k.created_at).getTime():0;return (C.created_at?new Date(C.created_at).getTime():0)-B}),x=["pending","waiting","delayed"],_=["succeeded","failed"],F=null;for(let k of T){let C=k.created_at?new Date(k.created_at):null;if(!C||C<p)continue;let B=g.current.get(k.id);if(!B){F=k;break}if(x.includes(B)&&_.includes(k.status)){F=k;break}}if(F){let k=F,C=k.created_at?new Date(k.created_at):null;if(!C||C<c.current)return;let B=g.current.get(k.id);g.current.set(k.id,k.status),a(E=>{let L=E.findIndex(R=>R.id===k.id);if(L>=0){let R=[...E];return R[L]=k,R}return [...E,k]}),k.status==="succeeded"&&(!B||x.includes(B))?f.current?.({message:"Withdrawal completed successfully",transaction:k}):k.status==="failed"&&B!=="failed"&&y.current?.({message:"Withdrawal failed",code:"WITHDRAW_FAILED",error:k});}}catch(h){console.error("Failed to fetch withdraw executions:",h),y.current?.({message:"Failed to fetch withdrawal status",code:"POLLING_ERROR",error:h});}};m();let S=setInterval(m,eg);return d(true),()=>{clearInterval(S),d(false);}},[e,t,o]),on.useEffect(()=>{if(!o||!r)return;let b=async()=>{try{await Ml({deposit_wallet_id:r},t);}catch{}};b();let m=setInterval(b,tg);return ()=>clearInterval(m)},[o,r,t]),{executions:s,isPolling:l}}var Nc=(e,t)=>`${t}:${e}`;function Bs({tokens:e,selectedTokenSymbol:t,selectedChainKey:r,onTokenChange:o,onChainChange:n,isLoading:i=false,tokenLabel:s="Receive token",chainLabel:a="Receive chain",tokenPickerBorderTopLeftRadius:l,tokenPickerBorderTopRightRadius:d,chainPickerBorderTopLeftRadius:c,chainPickerBorderTopRightRadius:g}){let{colors:w,fonts:f,components:y}=O(),[b,m]=on.useState(false),[S,h]=on.useState(false),p=y.card,T=t?e.find(k=>k.symbol===t):void 0,x=T?.chains||[],_=r?x.find(k=>Nc(k.chain_id,k.chain_type)===r):void 0,F={backgroundColor:p.backgroundColor,borderRadius:p.borderRadius,borderWidth:p.borderWidth||1,borderColor:p.borderColor};return jsxRuntime.jsxs(reactNative.View,{style:De.row,children:[jsxRuntime.jsxs(reactNative.View,{style:De.col,children:[jsxRuntime.jsx(reactNative.Text,{style:[De.label,{color:p.labelColor,fontFamily:f.medium}],children:s}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[De.selectButton,F],onPress:()=>!i&&e.length>0&&m(true),activeOpacity:.7,disabled:i||e.length===0,children:[i?jsxRuntime.jsx(reactNative.Text,{style:[De.placeholder,{color:p.subtitleColor,fontFamily:f.regular}],children:"Loading..."}):T?jsxRuntime.jsxs(reactNative.View,{style:De.selectedItem,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(T,"png"))},style:De.icon}),jsxRuntime.jsx(reactNative.Text,{style:[De.selectedText,{color:p.titleColor,fontFamily:f.medium}],numberOfLines:1,children:T.symbol})]}):jsxRuntime.jsx(reactNative.Text,{style:[De.placeholder,{color:p.subtitleColor,fontFamily:f.regular}],children:"Select receive token"}),jsxRuntime.jsx(yt,{size:16,color:p.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsxs(reactNative.View,{style:De.col,children:[jsxRuntime.jsx(reactNative.Text,{style:[De.label,{color:p.labelColor,fontFamily:f.medium}],children:a}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[De.selectButton,F,(!T||x.length===0)&&De.disabled],onPress:()=>!i&&T&&x.length>0&&h(true),activeOpacity:.7,disabled:i||!T||x.length===0,children:[_?jsxRuntime.jsxs(reactNative.View,{style:De.selectedItem,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(_,"png"))},style:De.icon}),jsxRuntime.jsx(reactNative.Text,{style:[De.selectedText,{color:p.titleColor,fontFamily:f.medium}],numberOfLines:1,children:_.chain_name})]}):jsxRuntime.jsx(reactNative.Text,{style:[De.placeholder,{color:p.subtitleColor,fontFamily:f.regular}],children:"Chain"}),jsxRuntime.jsx(yt,{size:16,color:p.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsxs(Qe,{visible:b,onClose:()=>m(false),closeOnBackdropPress:true,showHandle:false,heightPercent:.6,borderTopLeftRadius:l,borderTopRightRadius:d,children:[jsxRuntime.jsxs(reactNative.View,{style:De.pickerHeader,children:[jsxRuntime.jsx(reactNative.View,{style:De.pickerHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[De.pickerTitle,{color:w.foreground,fontFamily:f.medium}],children:"Select Token"}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:De.pickerHeaderClose,onPress:()=>m(false),hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(tt,{size:20,color:w.foregroundMuted,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.FlatList,{data:e,keyExtractor:k=>k.symbol,contentContainerStyle:De.listContent,renderItem:({item:k})=>jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[De.pickerItem,{backgroundColor:k.symbol===t?w.cardHover:"transparent"}],onPress:()=>{o(k.symbol),m(false);},activeOpacity:.7,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(k,"png"))},style:De.pickerIcon}),jsxRuntime.jsx(reactNative.Text,{style:[De.pickerItemText,{color:w.foreground,fontFamily:f.medium}],children:k.symbol}),jsxRuntime.jsx(reactNative.Text,{style:[De.pickerItemSub,{color:w.foregroundMuted,fontFamily:f.regular}],children:k.name}),k.symbol===t&&jsxRuntime.jsx(Ae,{size:18,color:w.primary,strokeWidth:2.5})]})})]}),jsxRuntime.jsxs(Qe,{visible:S,onClose:()=>h(false),closeOnBackdropPress:true,showHandle:false,heightPercent:.6,borderTopLeftRadius:c,borderTopRightRadius:g,children:[jsxRuntime.jsxs(reactNative.View,{style:De.pickerHeader,children:[jsxRuntime.jsx(reactNative.View,{style:De.pickerHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[De.pickerTitle,{color:w.foreground,fontFamily:f.medium}],children:"Select Chain"}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:De.pickerHeaderClose,onPress:()=>h(false),hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(tt,{size:20,color:w.foregroundMuted,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.FlatList,{data:x,keyExtractor:k=>Nc(k.chain_id,k.chain_type),contentContainerStyle:De.listContent,renderItem:({item:k})=>{let C=Nc(k.chain_id,k.chain_type);return jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[De.pickerItem,{backgroundColor:C===r?w.cardHover:"transparent"}],onPress:()=>{n(C),h(false);},activeOpacity:.7,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:K(ae(k,"png"))},style:De.pickerIcon}),jsxRuntime.jsx(reactNative.Text,{style:[De.pickerItemText,{color:w.foreground,fontFamily:f.medium}],children:k.chain_name}),C===r&&jsxRuntime.jsx(Ae,{size:18,color:w.primary,strokeWidth:2.5})]})}})]})]})}var De=reactNative.StyleSheet.create({row:{flexDirection:"column",gap:10},col:{},label:{fontSize:12,marginBottom:6},selectButton:{flexDirection:"row",alignItems:"center",paddingHorizontal:12,paddingVertical:12,gap:6,minHeight:48},selectedItem:{flex:1,flexDirection:"row",alignItems:"center",gap:6},icon:{width:20,height:20,borderRadius:10},selectedText:{fontSize:13,flexShrink:1},placeholder:{flex:1,fontSize:13},disabled:{opacity:.4},pickerHeader:{flexDirection:"row",alignItems:"center",paddingHorizontal:16,paddingTop:16,paddingBottom:12},pickerHeaderSpacer:{width:28},pickerHeaderClose:{width:28,alignItems:"flex-end"},pickerTitle:{flex:1,fontSize:16,textAlign:"center"},listContent:{paddingHorizontal:16,paddingVertical:8},pickerItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:12,borderRadius:10,gap:10},pickerIcon:{width:32,height:32,borderRadius:16},pickerItemText:{fontSize:15,flex:1},pickerItemSub:{fontSize:13}});function jc(e){let{chainType:t,chainId:r,tokenAddress:o,recipientAddress:n,publishableKey:i,enabled:s=true}=e,a=n?.trim()||"",l=!!t&&!!r&&!!o&&a.length>0;return xo({queryKey:["unifold","verifyRecipientAddress",t??null,r??null,o??null,a,i],queryFn:()=>El({chain_type:t,chain_id:r,token_address:o,recipient_address:a},i),enabled:s&&l,staleTime:1e3*60*5,gcTime:1e3*60*30,retry:1,refetchOnMount:false})}function sg(e){if(e===null)return "< 1 min";let t=Math.ceil(e/60);return t<60?`< ${t} min`:`< ${Math.ceil(t/60)} hr`}function ag(e,t){if(e<=0)return "0";if(t===0)return BigInt(Math.round(e)).toString();let r=e.toFixed(t),[o,n=""]=r.split("."),i=n.padEnd(t,"0").slice(0,t);return (BigInt(o)*BigInt(10**t)+BigInt(i)).toString()}function lg(e,t){return e===0?"0":e.toFixed(t).replace(/\.?0+$/,"")}function rl({publishableKey:e,sourceChainType:t,sourceChainId:r,sourceTokenAddress:o,sourceTokenSymbol:n,sourceChainName:i,sourceTokenIconUrl:s,recipientAddressProp:a,selectedToken:l,selectedChain:d,balanceData:c,isLoadingBalance:g,minimumWithdrawAmountUsd:w,estimatedProcessingTime:f,maxSlippagePercent:y,priceImpactPercent:b,canWithdraw:m,onDepositWalletCreation:S,onWithdraw:h,onWithdrawError:p,onWithdrawSubmitted:T,onViewTracker:x}){let _="https://unifold.io/terms",F="https://unifold.io/support",{colors:k,fonts:C,components:B}=O(),[E,L]=on.useState(a||""),[R,H]=on.useState(""),[V,we]=on.useState("crypto"),[We,Xe]=on.useState(false),[ee,ye]=on.useState(null),[ze,Fe]=on.useState(false),[Ue,ie]=on.useState(""),Ge=on.useRef(null);on.useEffect(()=>{L(a||""),H(""),we("crypto"),ye(null);},[a]);let Ve=E.trim();on.useEffect(()=>{let re=setTimeout(()=>ie(Ve),500);return ()=>clearTimeout(re)},[Ve]);let {data:Ye,isLoading:dt,error:at}=jc({chainType:d?.chain_type,chainId:d?.chain_id,tokenAddress:d?.token_address,recipientAddress:Ue,publishableKey:e,enabled:Ue.length>5&&!!d}),ht=Ve!==Ue,He=on.useMemo(()=>!Ve||Ve.length<=5||ht||dt?null:at?"Invalid address":Ye&&!Ye.valid?Ye.failure_code==="account_not_found"?`Account not found on ${d?.chain_name}`:Ye.failure_code==="not_opted_in"?`Recipient hasn't opted in to ${l?.symbol} on ${d?.chain_name}`:"Invalid address":null,[Ve,ht,dt,at,Ye,d,l]),Lt=!ht&&!!Ye?.valid&&!He,J=on.useMemo(()=>c?.exchangeRate?parseFloat(c.exchangeRate):0,[c]),q=on.useMemo(()=>c?.balanceHuman?parseFloat(c.balanceHuman):0,[c]),Te=on.useMemo(()=>c?.balanceUsd?parseFloat(c.balanceUsd):0,[c]),wt=n||c?.symbol||"TOKEN",he=c?.decimals??6,_e=on.useMemo(()=>{let re=parseFloat(R);return !re||re<=0?0:V==="crypto"?re:J>0?re/J:0},[R,V,J]),Je=on.useMemo(()=>{let re=parseFloat(R);return !re||re<=0?0:V==="fiat"?re:re*J},[R,V,J]);on.useMemo(()=>!R||parseFloat(R)<=0?null:V==="crypto"?`$${Je.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:`${_e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:6})} ${wt}`,[R,V,Je,_e,wt]);on.useMemo(()=>g||!c?null:V==="crypto"?`${q.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:6})} ${wt}`:`$${Te.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`,[g,c,V,q,Te,wt]);let et=on.useCallback(async()=>{try{let ue=await Gp("expo-clipboard").getStringAsync();ue&&(L(ue.trim()),ye(null));}catch{}},[]),Ht=on.useCallback(()=>{let re=parseFloat(R);if(!re||re<=0||J<=0){we(ue=>ue==="crypto"?"fiat":"crypto"),H("");return}V==="crypto"?(H((re*J).toFixed(2)),we("fiat")):(H((re/J).toFixed(he>6?6:he)),we("crypto"));},[R,V,J,he]),lt=on.useCallback(()=>{if(V==="crypto"){if(q<=0)return;H(c?.balanceHuman??"0");}else {if(Te<=0)return;H((Math.floor(Te*100)/100).toFixed(2));}},[V,q,Te,c]),Re=w!==null&&Je>0&&Je<w,Nt=V==="crypto"?_e>0&&q>0&&_e>q:Je>0&&Te>0&&Je>Te,Bt=Ve.length>0&&R.trim().length>0&&_e>0&&Lt&&!Re&&!Nt&&!!c,Cr=on.useCallback(async()=>{if(!(!l||!d||!Bt||!m)){Xe(true),ye(null);try{let re=await S({destinationChainType:d.chain_type,destinationChainId:d.chain_id,destinationTokenAddress:d.token_address,recipientAddress:Ve}),ue=ag(_e,he),le=lg(_e,he),Le={sourceChainType:t,sourceChainId:r,sourceTokenAddress:o,sourceTokenSymbol:wt,sourceTokenIconUrl:s,destinationChainType:d.chain_type,destinationChainId:d.chain_id,destinationTokenAddress:d.token_address,destinationTokenSymbol:l.symbol,destinationChainName:d.chain_name,destinationTokenIconUrl:l?K(ae(l,"png")):void 0,amount:le,amountBaseUnit:ue,submittedAt:new Date,withdrawIntentAddress:re.address,recipientAddress:Ve};await h(Le),T(Le);}catch(re){let ue=re instanceof Error?re.message:"Withdrawal failed. Please try again.",le=ue.length>120?"Withdrawal failed. Please try again.":ue;ye(le),p?.({message:ue,error:re,code:"WITHDRAW_FAILED"});}finally{Xe(false);}}},[l,d,Bt,m,Ve,t,r,o,wt,s,R,V,q,Te,c,_e,he,Je,S,h,p,T]),xe=B.input,je=B.card,$e=B.button,ur=He?k.error:xe.borderColor,N=on.useMemo(()=>We?"Processing...":Nt?"Insufficient balance":Re?`Minimum $${w?.toFixed(2)}`:ee?"Withdrawal failed \u2014 try again":"Withdraw",[We,Nt,Re,w,ee]);return jsxRuntime.jsxs(reactNative.View,{style:Oe.container,children:[jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsxs(reactNative.View,{style:Oe.labelRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[Oe.label,{color:je.labelColor,fontFamily:C.medium}],children:"Recipient address"}),(ht||dt)&&Ve.length>5?jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:k.foregroundMuted}):jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:et,activeOpacity:.6,hitSlop:{top:8,bottom:8,left:8,right:8},children:jsxRuntime.jsx(ed,{size:16,color:k.foregroundMuted,strokeWidth:1.75})})]}),jsxRuntime.jsx(reactNative.View,{style:[Oe.inputRow,{backgroundColor:xe.backgroundColor,borderRadius:xe.borderRadius,borderWidth:xe.borderWidth,borderColor:ur}],children:jsxRuntime.jsx(reactNative.TextInput,{style:[Oe.textInput,{color:xe.textColor,fontFamily:C.regular}],placeholder:"Enter wallet address",placeholderTextColor:xe.placeholderColor,value:E,onChangeText:re=>{L(re),ye(null);},autoCapitalize:"none",autoCorrect:false,returnKeyType:"done",onSubmitEditing:()=>Ge.current?.focus()})}),He?jsxRuntime.jsx(reactNative.Text,{style:[Oe.errorText,{color:k.error,fontFamily:C.regular}],children:He}):null]}),jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsxs(reactNative.Text,{style:[Oe.label,{color:je.labelColor,fontFamily:C.medium,paddingBottom:8}],children:["Amount",w!=null&&w>0&&jsxRuntime.jsx(reactNative.Text,{style:{color:k.warning,fontFamily:C.regular},children:` ($${w.toFixed(2)} min)`})]}),jsxRuntime.jsxs(reactNative.View,{style:[Oe.amountRow,{backgroundColor:xe.backgroundColor,borderRadius:xe.borderRadius,borderWidth:xe.borderWidth,borderColor:xe.borderColor}],children:[jsxRuntime.jsx(reactNative.TextInput,{ref:Ge,style:[Oe.amountInput,{color:xe.textColor,fontFamily:C.regular}],placeholder:"0.00",placeholderTextColor:xe.placeholderColor,value:R,onChangeText:re=>{(re===""||/^\d*\.?\d*$/.test(re))&&(H(re),ye(null));},keyboardType:"decimal-pad",returnKeyType:"done"}),jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:J>0?Ht:void 0,activeOpacity:.7,children:jsxRuntime.jsx(reactNative.Text,{style:[Oe.unitLabel,{color:k.foregroundMuted,fontFamily:C.medium}],children:V==="crypto"?wt:"USD"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[Oe.maxButton,{backgroundColor:`${k.primary}20`}],onPress:lt,activeOpacity:.7,children:jsxRuntime.jsx(reactNative.Text,{style:[Oe.maxText,{color:k.primary,fontFamily:C.medium}],children:"Max"})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:[Oe.detailsCard,{marginTop:24,backgroundColor:je.backgroundColor,borderRadius:je.borderRadius,borderWidth:je.borderWidth||1,borderColor:je.borderColor}],children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Oe.detailsToggle,onPress:()=>Fe(!ze),activeOpacity:.7,children:jsxRuntime.jsxs(reactNative.View,{style:Oe.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[Oe.detailIcon,{backgroundColor:je.iconBackgroundColor,borderRadius:je.iconContainerBorderRadius}],children:jsxRuntime.jsx(jr,{size:12,color:je.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[Oe.detailsLabel,{color:je.titleColor,fontFamily:C.regular}],children:["Processing time:"," ",jsxRuntime.jsx(reactNative.Text,{style:{fontFamily:C.medium},children:sg(f)})]}),jsxRuntime.jsx(reactNative.View,{style:{transform:[{rotate:ze?"180deg":"0deg"}]},children:jsxRuntime.jsx(yt,{size:16,color:je.actionColor,strokeWidth:2})})]})}),ze&&jsxRuntime.jsxs(reactNative.View,{style:Oe.detailsExpanded,children:[jsxRuntime.jsxs(reactNative.View,{style:Oe.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[Oe.detailIcon,{backgroundColor:je.iconBackgroundColor,borderRadius:je.iconContainerBorderRadius}],children:jsxRuntime.jsx(No,{size:12,color:je.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[Oe.detailsLabel,{color:je.titleColor,fontFamily:C.regular}],children:["Slippage:"," ",jsxRuntime.jsxs(reactNative.Text,{style:{fontFamily:C.medium},children:["Auto \u2022 ",(y??.25).toFixed(2),"%"]})]})]}),jsxRuntime.jsxs(reactNative.View,{style:Oe.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[Oe.detailIcon,{backgroundColor:je.iconBackgroundColor,borderRadius:je.iconContainerBorderRadius}],children:jsxRuntime.jsx(Ho,{size:12,color:je.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[Oe.detailsLabel,{color:je.titleColor,fontFamily:C.regular}],children:["Price impact:"," ",jsxRuntime.jsxs(reactNative.Text,{style:{fontFamily:C.medium},children:[(b??0).toFixed(2),"%"]})]})]})]})]}),ee&&jsxRuntime.jsx(reactNative.Text,{style:[Oe.errorText,{color:k.error,fontFamily:C.regular,textAlign:"center"}],children:ee}),jsxRuntime.jsxs(reactNative.View,{style:Oe.withdrawRow,children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[Oe.withdrawButton,{backgroundColor:$e.primaryBackground,borderRadius:$e.borderRadius,borderWidth:$e.borderWidth,borderColor:$e.borderColor,opacity:!Bt||!m||We?.5:1}],onPress:Cr,disabled:!Bt||!m||We,activeOpacity:.8,children:[We&&jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:$e.primaryText}),jsxRuntime.jsx(reactNative.Text,{style:[Oe.withdrawButtonText,{color:$e.primaryText,fontFamily:C.medium}],children:N})]}),jsxRuntime.jsxs(reactNative.View,{style:Oe.footerRow,children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:Oe.historyLink,onPress:x,activeOpacity:.7,children:[jsxRuntime.jsx(jr,{size:14,color:k.foregroundMuted,strokeWidth:2}),jsxRuntime.jsx(reactNative.Text,{style:[Oe.historyText,{color:k.foregroundMuted,fontFamily:C.regular}],children:"Withdrawal history"})]}),jsxRuntime.jsxs(reactNative.View,{style:Oe.legalLinks,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:()=>reactNative.Linking.openURL(_),activeOpacity:.7,children:jsxRuntime.jsx(reactNative.Text,{style:[Oe.legalText,{color:k.foregroundMuted,fontFamily:C.regular}],children:"Terms"})}),jsxRuntime.jsx(reactNative.Text,{style:[Oe.legalSeparator,{color:k.foregroundMuted,fontFamily:C.regular}],children:"|"}),jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:()=>reactNative.Linking.openURL(F),activeOpacity:.7,children:jsxRuntime.jsx(reactNative.Text,{style:[Oe.legalText,{color:k.foregroundMuted,fontFamily:C.regular}],children:"Help"})})]})]})]})]})}var Oe=reactNative.StyleSheet.create({container:{gap:12,paddingHorizontal:16,paddingBottom:16},label:{fontSize:12},labelRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:6},inputRow:{flexDirection:"row",alignItems:"center",paddingHorizontal:12,paddingVertical:4,minHeight:48},textInput:{flex:1,fontSize:14,paddingVertical:8},errorText:{fontSize:12,marginTop:4},amountRow:{flexDirection:"row",alignItems:"center",paddingHorizontal:12,paddingVertical:4,minHeight:48,gap:8},amountInput:{flex:1,fontSize:14,paddingVertical:8},unitLabel:{fontSize:14,flexShrink:0},maxButton:{paddingHorizontal:8,paddingVertical:4,borderRadius:6},maxText:{fontSize:12,fontWeight:"600"},balanceRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:6,paddingHorizontal:4},convertedText:{fontSize:12},balanceText:{fontSize:12},withdrawRow:{gap:12},footerRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},historyLink:{flexDirection:"row",alignItems:"center",gap:6},historyText:{fontSize:13},legalLinks:{flexDirection:"row",alignItems:"center",gap:6},legalText:{fontSize:13},legalSeparator:{fontSize:13},detailsCard:{paddingHorizontal:12,overflow:"hidden"},detailsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:12},detailsRow:{flexDirection:"row",alignItems:"center",gap:8},detailIcon:{width:24,height:24,alignItems:"center",justifyContent:"center"},detailsLabel:{fontSize:13,flex:1},detailsExpanded:{gap:10,paddingBottom:12},withdrawButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:15,gap:8},withdrawButtonText:{fontSize:16,fontWeight:"600"}});function ug(e){try{let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" at "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e}}function pg(e){return e?`$${parseFloat(e).toFixed(2)}`:"$0.00"}function il({execution:e,onPress:t}){let{colors:r,fonts:o,components:n}=O(),i=n.depositTracker.executionRow.card,s=e.status==="pending"||e.status==="waiting"||e.status==="delayed",a=e.status==="failed"||e.status==="refunded",l=a?r.error:s?r.warning:r.success,d=K(ae(e.destination_token_metadata,"png")||Mt("/icons/tokens/png/usdc.png")),c=a?"Withdrawal Failed":s?"Withdrawal Processing":"Withdrawal Completed",g=ug(e.created_at||new Date().toISOString()),w=pg(e.source_amount_usd);return jsxRuntime.jsxs(Et,{cardTokens:i,onPress:t,contentStyle:Ao.container,children:[jsxRuntime.jsxs(reactNative.View,{style:Ao.iconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:d},style:Ao.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[Ao.statusBadge,{backgroundColor:l,borderColor:i.backgroundColor}],children:a?jsxRuntime.jsx(Gi,{size:12,color:"#FFFFFF",strokeWidth:2.5}):s?jsxRuntime.jsx(Us,{size:12,color:"#FFFFFF",strokeWidth:2.5}):jsxRuntime.jsx(Ae,{size:12,color:"#FFFFFF",strokeWidth:3})})]}),jsxRuntime.jsxs(reactNative.View,{style:Ao.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ao.title,{color:i.titleColor,fontFamily:o.medium}],children:c}),jsxRuntime.jsx(reactNative.Text,{style:[Ao.dateTime,{color:i.subtitleColor,fontFamily:o.regular}],children:g})]}),jsxRuntime.jsxs(reactNative.View,{style:Ao.rightContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ao.amount,{color:i.textRightColor,fontFamily:o.medium}],children:w}),jsxRuntime.jsx(Br,{size:20,color:i.actionColor,strokeWidth:2})]})]})}var Ao=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",paddingHorizontal:16,paddingVertical:12},iconContainer:{position:"relative",marginRight:12},tokenIcon:{width:40,height:40,borderRadius:20},statusBadge:{position:"absolute",bottom:-4,right:-4,width:22,height:22,borderRadius:11,alignItems:"center",justifyContent:"center",borderWidth:2},textContainer:{flex:1,gap:2},title:{fontSize:16},dateTime:{fontSize:13},rightContainer:{flexDirection:"row",alignItems:"center",gap:8},amount:{fontSize:16}});function qc(e){try{let t=new Date(e),o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],n=t.getDate(),i=t.getFullYear(),s=t.getHours(),a=t.getMinutes(),l=s>=12?"PM":"AM";s=s%12||12;let d=a<10?`0${a}`:`${a}`;return `${o} ${n}, ${i} at ${s}:${d} ${l}`}catch{return e}}function Up(e,t=6){if(!e)return "\u2014";try{let r=Number(e)/Math.pow(10,t);return r===0?"0.00":r>=1?r.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):r.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:8,minimumSignificantDigits:2,maximumSignificantDigits:6})}catch{return "0.00"}}function hg(e,t){if(e)try{return `$${Number(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}catch{}if(t)try{return `$${(Number(t)/1e6).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}catch{}return "$0.00"}function Hp(e){if(!e)return "";let t=e.indexOf(".");return t===-1?e.toUpperCase():e.slice(0,t).toUpperCase()+e.slice(t)}function Np(e){return !e||e.length<12?e:`${e.slice(0,12)}...${e.slice(-4)}`}function Ws({label:e,value:t,isLast:r}){let{fonts:o,components:n}=O(),i=n.card;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:Ce.detailRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ce.detailLabel,{color:i.subtitleColor,fontFamily:o.regular}],children:e}),jsxRuntime.jsx(reactNative.Text,{style:[Ce.detailValue,{color:i.titleColor,fontFamily:o.regular}],children:t})]}),!r&&jsxRuntime.jsx(reactNative.View,{style:[Ce.divider,{backgroundColor:i.borderColor}]})]})}function Kc({execution:e,txInfo:t,onClose:r,onViewHistory:o,onBack:n,onHeaderClose:i}){let{colors:s,fonts:a,components:l}=O(),[d,c]=on.useState([]),[g,w]=on.useState(!!n),f=l.card,y=l.button,b=l.header,m=l.container;on.useEffect(()=>{Al().then(we=>c(we.data)).catch(()=>{});},[]),on.useEffect(()=>{w(!!n);},[e?.id]);let S=e?e.status==="pending"||e.status==="waiting"||e.status==="delayed":false,h=e?e.status==="failed"||e.status==="refunded":false,p=h?s.error:S?s.warning:s.success,T=h?"Failed":S?"Processing":"Completed",x=e?.destination_token_metadata?K(ae(e.destination_token_metadata,"png")):t.destinationTokenIconUrl?K(t.destinationTokenIconUrl):K(Mt("/icons/tokens/png/usdc.png")),_=e?.created_at?qc(e.created_at):t.submittedAt?qc(t.submittedAt.toISOString()):qc(new Date().toISOString()),F=e?`${Up(e.source_amount_base_unit,e.source_token_metadata?.decimals)} ${Hp(e.source_currency)}`:`${t.amount} ${t.sourceTokenSymbol}`,k=e?`${Up(e.destination_amount_base_unit,e.destination_token_metadata?.decimals)} ${Hp(e.destination_currency)}`:`${t.amount} ${t.destinationTokenSymbol}`,C=e?hg(e.source_amount_usd,e.source_amount_base_unit):"$0.00",B=e?oa(d,e.source_chain_type,e.source_chain_id):t.sourceChainId,E=e?oa(d,e.destination_chain_type,e.destination_chain_id):t.destinationChainName??t.destinationChainId,L=e?.transaction_hash,R=e?.explorer_url,H=e?.destination_transaction_hashes?.[0],V=e?.destination_explorer_url;return jsxRuntime.jsxs(reactNative.ScrollView,{style:Ce.scroll,contentContainerStyle:Ce.container,showsVerticalScrollIndicator:false,children:[jsxRuntime.jsxs(reactNative.View,{style:Ce.headerRow,children:[n?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:n,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(Xc,{size:22,color:b.buttonColor,strokeWidth:2})}):jsxRuntime.jsx(reactNative.View,{style:Ce.headerSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[Ce.headerTitle,{color:b.titleColor,fontFamily:a.medium}],children:"Withdrawal Details"}),n?jsxRuntime.jsx(reactNative.View,{style:Ce.headerSpacer}):jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:i??r,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(tt,{size:20,color:b.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:Ce.iconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:x},style:Ce.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[Ce.statusBadge,{backgroundColor:p}],children:h?jsxRuntime.jsx(Gi,{size:10,color:"#FFFFFF",strokeWidth:3}):S?jsxRuntime.jsx(reactNative.View,{style:Ce.spinnerDot}):jsxRuntime.jsx(Ae,{size:10,color:"#FFFFFF",strokeWidth:3})})]}),jsxRuntime.jsxs(reactNative.View,{style:Ce.statusRow,children:[jsxRuntime.jsx(reactNative.View,{style:[Ce.statusDot,{backgroundColor:p}]}),jsxRuntime.jsx(reactNative.Text,{style:[Ce.statusText,{color:p,fontFamily:a.medium}],children:T})]}),jsxRuntime.jsx(reactNative.Text,{style:[Ce.dateText,{color:m.subtitleColor,fontFamily:a.regular}],children:_}),jsxRuntime.jsxs(reactNative.View,{style:[Ce.detailsCard,{backgroundColor:f.backgroundColor,borderRadius:f.borderRadius,borderWidth:f.borderWidth??1,borderColor:f.borderColor}],children:[jsxRuntime.jsx(Ws,{label:"Amount Sent",value:F}),jsxRuntime.jsx(Ws,{label:"Amount Received",value:k}),jsxRuntime.jsx(Ws,{label:"USD Value",value:C}),jsxRuntime.jsx(Ws,{label:"Source Network",value:B}),jsxRuntime.jsx(Ws,{label:"Destination Network",value:E,isLast:true})]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:Ce.moreDetailsRow,onPress:()=>w(we=>!we),activeOpacity:.7,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ce.moreDetailsText,{color:m.actionTitle,fontFamily:a.regular}],children:g?"See less":n?"See more":"See more details"}),g?jsxRuntime.jsx(qr,{size:16,color:m.actionColor,strokeWidth:2}):jsxRuntime.jsx(yt,{size:16,color:m.actionColor,strokeWidth:2})]}),g&&jsxRuntime.jsx(reactNative.View,{style:[Ce.detailsCard,{backgroundColor:f.backgroundColor,borderRadius:f.borderRadius,borderWidth:f.borderWidth??1,borderColor:f.borderColor}],children:L&&R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:Ce.txRow,onPress:()=>reactNative.Linking.openURL(R),activeOpacity:.7,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ce.txLabel,{color:f.subtitleColor,fontFamily:a.regular}],children:"Withdrawal Tx"}),jsxRuntime.jsx(reactNative.Text,{style:[Ce.txHash,{color:f.titleColor,fontFamily:a.regular}],children:Np(L)}),jsxRuntime.jsx($r,{size:14,color:f.actionColor,strokeWidth:2})]}),!S&&H&&V&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:[Ce.divider,{backgroundColor:f.borderColor}]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:Ce.txRow,onPress:()=>reactNative.Linking.openURL(V),activeOpacity:.7,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ce.txLabel,{color:f.subtitleColor,fontFamily:a.regular}],children:"Completion Tx"}),jsxRuntime.jsx(reactNative.Text,{style:[Ce.txHash,{color:f.titleColor,fontFamily:a.regular}],children:Np(H)}),jsxRuntime.jsx($r,{size:14,color:f.actionColor,strokeWidth:2})]})]})]}):jsxRuntime.jsx(reactNative.View,{style:Ce.detailRow,children:jsxRuntime.jsx(reactNative.Text,{style:[Ce.detailLabel,{color:f.subtitleColor,fontFamily:a.regular}],children:"Transaction details not yet available"})})}),!n&&jsxRuntime.jsxs(reactNative.View,{style:Ce.buttonRow,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[Ce.button,Ce.halfButton,{backgroundColor:y.secondaryBackground,borderRadius:y.borderRadius,borderWidth:y.borderWidth,borderColor:y.borderColor}],onPress:o,activeOpacity:.8,children:jsxRuntime.jsx(reactNative.Text,{style:[Ce.buttonText,{color:y.secondaryText,fontFamily:a.medium}],children:"Withdrawal History"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[Ce.button,Ce.halfButton,{backgroundColor:y.primaryBackground,borderRadius:y.borderRadius,borderWidth:y.borderWidth,borderColor:y.borderColor}],onPress:r,activeOpacity:.8,children:jsxRuntime.jsx(reactNative.Text,{style:[Ce.buttonText,{color:y.primaryText,fontFamily:a.medium}],children:"Close"})})]})]})}var Ce=reactNative.StyleSheet.create({scroll:{flex:1},container:{alignItems:"center",paddingHorizontal:20,paddingTop:8,paddingBottom:32,gap:12},headerRow:{flexDirection:"row",alignItems:"center",width:"100%",paddingTop:16,marginBottom:4},headerSpacer:{width:28},headerTitle:{flex:1,fontSize:16,textAlign:"center"},iconContainer:{position:"relative",marginTop:8},tokenIcon:{width:64,height:64,borderRadius:32},statusBadge:{position:"absolute",bottom:-2,right:-2,width:22,height:22,borderRadius:11,alignItems:"center",justifyContent:"center"},spinnerDot:{width:10,height:10,borderRadius:5,borderWidth:2,borderColor:"#FFFFFF",borderTopColor:"transparent"},statusRow:{flexDirection:"row",alignItems:"center",gap:6},statusDot:{width:8,height:8,borderRadius:4},statusText:{fontSize:15},dateText:{fontSize:13,marginTop:-4},detailsCard:{width:"100%",paddingHorizontal:16,overflow:"hidden"},detailRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:12},detailLabel:{fontSize:13,flex:1},detailValue:{fontSize:13,flexShrink:0,maxWidth:"55%",textAlign:"right"},divider:{height:reactNative.StyleSheet.hairlineWidth,opacity:.5},moreDetailsRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",paddingHorizontal:4},moreDetailsText:{fontSize:14},txRow:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:12},txLabel:{fontSize:13},txHash:{fontSize:13,flex:1,textAlign:"right"},buttonRow:{flexDirection:"row",gap:10,width:"100%",marginTop:4},button:{paddingVertical:14,alignItems:"center",justifyContent:"center"},halfButton:{flex:1},fullButton:{width:"100%"},buttonText:{fontSize:14}});function jp(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function sl({txInfo:e,executions:t,onClose:r,onViewTracker:o}){let{colors:n,fonts:i,components:s}=O(),a=t.length>0?t[t.length-1]:null,l=a?.status==="succeeded",d=a?.status==="failed",c={borderRadius:s.button.borderRadius,borderWidth:s.button.borderWidth,borderColor:s.button.borderColor};return l?jsxRuntime.jsxs(reactNative.View,{style:ct.container,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:ct.closeButton,onPress:r,children:jsxRuntime.jsx(tt,{size:20,color:s.header.buttonColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.View,{style:[ct.iconRing,{backgroundColor:n.successBackground}],children:jsxRuntime.jsx(Ae,{size:32,color:n.success,strokeWidth:2.5})}),jsxRuntime.jsx(reactNative.Text,{style:[ct.title,{color:n.foreground,fontFamily:i.medium}],children:"Withdrawal Sent"}),jsxRuntime.jsxs(reactNative.Text,{style:[ct.subtitle,{color:n.foregroundMuted,fontFamily:i.regular}],children:[e.amount," ",e.sourceTokenSymbol," to"," ",jp(e.recipientAddress)]}),jsxRuntime.jsxs(reactNative.View,{style:ct.buttonRow,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[ct.button,ct.halfButton,c,{backgroundColor:s.button.secondaryBackground}],onPress:o,activeOpacity:.8,children:jsxRuntime.jsx(reactNative.Text,{style:[ct.buttonText,{color:s.button.secondaryText,fontFamily:i.medium}],children:"History"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[ct.button,ct.halfButton,c,{backgroundColor:s.button.primaryBackground}],onPress:r,activeOpacity:.8,children:jsxRuntime.jsx(reactNative.Text,{style:[ct.buttonText,{color:s.button.primaryText,fontFamily:i.medium}],children:"Close"})})]})]}):d?jsxRuntime.jsxs(reactNative.View,{style:ct.container,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:ct.closeButton,onPress:r,children:jsxRuntime.jsx(tt,{size:20,color:s.header.buttonColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.View,{style:[ct.iconRing,{backgroundColor:n.errorBackground}],children:jsxRuntime.jsx(tt,{size:32,color:n.error,strokeWidth:2.5})}),jsxRuntime.jsx(reactNative.Text,{style:[ct.title,{color:n.foreground,fontFamily:i.medium}],children:"Withdrawal Failed"}),jsxRuntime.jsx(reactNative.Text,{style:[ct.subtitle,{color:n.foregroundMuted,fontFamily:i.regular}],children:"Something went wrong. Please try again."}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[ct.button,ct.fullButton,c,{backgroundColor:s.button.primaryBackground}],onPress:r,activeOpacity:.8,children:jsxRuntime.jsx(reactNative.Text,{style:[ct.buttonText,{color:s.button.primaryText,fontFamily:i.medium}],children:"Close"})})]}):jsxRuntime.jsxs(reactNative.View,{style:ct.container,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:ct.closeButton,onPress:r,children:jsxRuntime.jsx(tt,{size:20,color:s.header.buttonColor,strokeWidth:2})}),jsxRuntime.jsx(it,{size:80,strokeWidth:4,iconSize:68,children:e.sourceTokenIconUrl?jsxRuntime.jsx(reactNative.Image,{source:{uri:K(e.sourceTokenIconUrl)},style:ct.tokenIconFill}):jsxRuntime.jsx(reactNative.View,{style:[ct.tokenIconFill,{backgroundColor:n.cardHover}]})}),jsxRuntime.jsx(reactNative.Text,{style:[ct.title,{color:n.foreground,fontFamily:i.medium,paddingTop:16}],children:"Checking Withdrawal"}),jsxRuntime.jsxs(reactNative.Text,{style:[ct.subtitle,{color:n.foregroundMuted,fontFamily:i.regular}],children:[e.amount," ",e.sourceTokenSymbol," to"," ",jp(e.recipientAddress)]})]})}var ct=reactNative.StyleSheet.create({container:{alignItems:"center",paddingHorizontal:24,paddingTop:48,paddingBottom:24},closeButton:{position:"absolute",top:16,right:16,padding:4,zIndex:1},iconRing:{width:80,height:80,borderRadius:40,alignItems:"center",justifyContent:"center",marginBottom:20},tokenIconFill:{width:"100%",height:"100%",borderRadius:34},title:{fontSize:20,marginBottom:8,textAlign:"center"},subtitle:{fontSize:14,textAlign:"center",lineHeight:20,marginBottom:24},buttonRow:{flexDirection:"row",gap:10,width:"100%"},button:{paddingVertical:14,alignItems:"center",justifyContent:"center",borderRadius:12},halfButton:{flex:1},fullButton:{width:"100%"},buttonText:{fontSize:15}});function kg(e){let t=e.source_token_metadata?.decimals??6,r=e.source_amount_base_unit??"0",o=Number(r)/Math.pow(10,t),n=o>=1?o.toFixed(2):o.toPrecision(4).replace(/\.?0+$/,"");return {sourceChainType:e.source_chain_type,sourceChainId:e.source_chain_id,sourceTokenAddress:e.source_token_address,sourceTokenSymbol:e.source_currency?.toUpperCase()??"",sourceTokenIconUrl:K(ae(e.source_token_metadata,"png")),destinationChainType:e.destination_chain_type,destinationChainId:e.destination_chain_id,destinationTokenAddress:e.destination_token_address,destinationTokenSymbol:e.destination_currency?.toUpperCase()??"",destinationTokenIconUrl:K(ae(e.destination_token_metadata,"png")),amount:n,amountBaseUnit:r,submittedAt:e.created_at?new Date(e.created_at):void 0,withdrawIntentAddress:e.deposit_wallet?.address??"",recipientAddress:e.recipient_address??""}}var $p=(e,t)=>`${t}:${e}`;function xg(){let{colors:e}=O(),t=on.useRef(new reactNative.Animated.Value(.5)).current,r=e.cardHover;return on.useEffect(()=>{let o=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(t,{toValue:1,duration:800,useNativeDriver:true}),reactNative.Animated.timing(t,{toValue:.5,duration:800,useNativeDriver:true})]));return o.start(),()=>o.stop()},[t]),jsxRuntime.jsx(reactNative.View,{style:{gap:12,paddingHorizontal:16},children:[1,2,3].map(o=>jsxRuntime.jsx(reactNative.Animated.View,{style:{height:48,borderRadius:12,backgroundColor:r,opacity:t}},o))})}function cl({visible:e,onClose:t,publishableKey:r,externalUserId:o,senderAddress:n,recipientAddress:i,modalTitle:s="Withdraw Crypto",onWithdraw:a,onWithdrawSuccess:l,onWithdrawError:d,heightPercent:c=.92,sheetBorderRadius:g,sourceChainType:w,sourceChainId:f,sourceTokenAddress:y,sourceTokenSymbol:b,sourceChainName:m,sourceTokenIconUrl:S}){let{colors:h,fonts:p}=O(),[T,x]=on.useState("form"),[_,F]=on.useState(w),[k,C]=on.useState(f),[B,E]=on.useState(y),[L,R]=on.useState(b),[H,V]=on.useState(m),[we,We]=on.useState(S),[Xe,ee]=on.useState(null),[ye,ze]=on.useState(null),[Fe,Ue]=on.useState(null),[ie,Ge]=on.useState(),[Ve,Ye]=on.useState([]),[dt,at]=on.useState(null),[ht,He]=on.useState("form"),Lt=on.useRef(new reactNative.Animated.Value(reactNative.Dimensions.get("window").width)).current,J=on.useRef(null),q=!!_&&!!k&&!!B,{data:Te,isLoading:wt}=Xa(r,e&&T==="form"),he=Te?.data??[],{data:_e,isLoading:Je}=zc({sourceChainType:_,sourceChainId:k,sourceTokenAddress:B,sourceTokenSymbol:L,publishableKey:r,enabled:e&&q&&T==="form"}),{data:mt,isLoading:Se}=Uc({address:n,chainType:_,chainId:k,tokenAddress:B,publishableKey:r,enabled:e&&q}),{executions:et}=Hc({userId:o,publishableKey:r,depositWalletId:ie,enabled:!!ie&&e,onWithdrawSuccess:l,onWithdrawError:d});on.useEffect(()=>{if(!e||T!=="tracker")return;let X=false;return Co(o,r,"withdraw").then(ce=>{X||Ye(ce.data);}).catch(console.error),()=>{X=true;}},[e,T,o,r]),on.useEffect(()=>{e&&(J.current&&(clearTimeout(J.current),J.current=null),x("form"),F(w),C(f),E(y),R(b),V(m),We(S),ee(null),ze(null),Ue(null),Ge(void 0),Ye([]),at(null),He("form"),Lt.setValue(reactNative.Dimensions.get("window").width));},[e]),on.useEffect(()=>()=>{J.current&&clearTimeout(J.current);},[]),on.useEffect(()=>{we||_e?.iconUrl&&We(_e.iconUrl);},[_e?.iconUrl,we]),on.useEffect(()=>{H||_e?.chainName&&V(_e.chainName);},[_e?.chainName,H]),on.useEffect(()=>{T==="confirming"&&et.length>0&&x("details");},[T,et]);let Ht=on.useCallback(()=>{t(),J.current=setTimeout(()=>{x("form"),F(w),C(f),E(y),R(b),V(m),We(S),ee(null),ze(null),Ue(null),Ge(void 0),Ye([]),at(null),He("form"),J.current=null;},300);},[t,w,f,y,b,m,S]),lt=on.useCallback(X=>{let ce=he.find(nt=>nt.symbol===X);ce&&(ee(ce),ce.chains.length>0&&ze(ce.chains[0]));},[he]),Re=on.useCallback(X=>{if(!Xe)return;let ce=Xe.chains.find(nt=>$p(nt.chain_id,nt.chain_type)===X);ce&&ze(ce);},[Xe]),Nt=on.useCallback(async X=>{let ce=await yo({external_user_id:o,destination_chain_type:X.destinationChainType,destination_chain_id:X.destinationChainId,destination_token_address:X.destinationTokenAddress,recipient_address:X.recipientAddress,action_type:"withdraw"},r),nt=bo(ce.data,_??"");if(!nt)throw new Error(`No deposit wallet found for chain type: ${_}`);return Ge(nt.id),{id:nt.id,address:nt.address}},[o,r,_]),Bt=on.useCallback(X=>{Ue(X),x("confirming");},[]),Cr=on.useCallback(X=>{at(X),Lt.setValue(reactNative.Dimensions.get("window").width),reactNative.Animated.timing(Lt,{toValue:0,duration:280,useNativeDriver:true}).start();},[Lt]),xe=on.useCallback(()=>{reactNative.Animated.timing(Lt,{toValue:reactNative.Dimensions.get("window").width,duration:250,useNativeDriver:true}).start(()=>at(null));},[Lt]),je=wt||Je,$e=_e?.isSupported??null,ur=T==="confirming"?"Withdrawal Status":s,N=g?.globalBorderTopLeftRadius,re=g?.globalBorderTopRightRadius,ue=g?.main?.borderTopLeftRadius??N,le=g?.main?.borderTopRightRadius??re,Le=g?.tokenSelector?.borderTopLeftRadius??N,U=g?.tokenSelector?.borderTopRightRadius??re,Z=g?.chainSelector?.borderTopLeftRadius??N,pe=g?.chainSelector?.borderTopRightRadius??re,oe=(()=>{if(T!=="form"||!q||Se||!mt)return;let X=L||mt.symbol,ce=mt.balanceUsd;if(ce!=null){let bn=`$${parseFloat(ce).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`;return X?`Balance: ${bn} ${X}`:`Balance: ${bn}`}let nt=mt.balanceHuman;if(!(!nt||nt==="0"))return X?`Balance: ${nt} ${X}`:`Balance: ${nt}`})();return jsxRuntime.jsx(Qe,{visible:e,onClose:Ht,closeOnBackdropPress:false,showHandle:false,heightPercent:T==="confirming"?.3:T==="details"?.7:c,borderTopLeftRadius:ue,borderTopRightRadius:le,children:T==="confirming"&&Fe?jsxRuntime.jsx(sl,{txInfo:Fe,executions:et,onClose:Ht,onViewTracker:()=>{He("confirming"),x("tracker");}}):T==="details"&&Fe?jsxRuntime.jsx(Kc,{execution:et.length>0?et[et.length-1]:null,txInfo:Fe,onClose:Ht,onViewHistory:()=>{He("details"),x("tracker");},onHeaderClose:()=>x("form")}):T==="tracker"?jsxRuntime.jsxs(reactNative.View,{style:uo.trackerContainer,children:[jsxRuntime.jsx(cr,{title:"Withdrawal History",onClose:()=>x(ht)}),Ve.length===0?jsxRuntime.jsx(reactNative.View,{style:uo.emptyState,children:jsxRuntime.jsx(reactNative.Text,{style:[uo.emptyText,{color:h.foregroundMuted,fontFamily:p.regular}],children:"No withdrawals to track yet"})}):jsxRuntime.jsx(reactNative.FlatList,{data:Ve,keyExtractor:X=>X.id,contentContainerStyle:uo.listContent,renderItem:({item:X})=>jsxRuntime.jsx(il,{execution:X,onPress:()=>Cr(X)})}),dt&&jsxRuntime.jsx(reactNative.Animated.View,{style:[uo.historyDetailOverlay,{backgroundColor:h.background,transform:[{translateX:Lt}]}],children:jsxRuntime.jsx(Kc,{execution:dt,txInfo:kg(dt),onClose:Ht,onBack:xe,onViewHistory:xe})})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(cr,{title:ur,subtitle:oe,onClose:Ht}),je?jsxRuntime.jsx(xg,{}):$e===false?jsxRuntime.jsxs(reactNative.View,{style:uo.unsupportedContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[uo.unsupportedTitle,{color:h.foreground,fontFamily:p.medium}],children:"Unsupported Token"}),jsxRuntime.jsx(reactNative.Text,{style:[uo.unsupportedMessage,{color:h.foregroundMuted,fontFamily:p.regular}],children:_e?.errorMessage})]}):jsxRuntime.jsx(_g,{publishableKey:r,sourceChainType:_??"",sourceChainId:k??"",sourceTokenAddress:B??"",sourceTokenSymbol:L,sourceChainName:H,sourceTokenIconUrl:we,recipientAddressProp:i,destinationTokens:he,selectedToken:Xe,selectedChain:ye,selectedChainKey:ye?$p(ye.chain_id,ye.chain_type):null,onTokenChange:lt,onChainChange:Re,tokensLoading:wt,balanceData:mt??null,isLoadingBalance:Se,sourceValidation:_e??null,onDepositWalletCreation:Nt,onWithdraw:a,onWithdrawError:d,onWithdrawSubmitted:Bt,onViewTracker:()=>{He("form"),x("tracker");},tokenSelectorLeft:Le,tokenSelectorRight:U,chainSelectorLeft:Z,chainSelectorRight:pe})]})})}function _g({publishableKey:e,sourceChainType:t,sourceChainId:r,sourceTokenAddress:o,sourceTokenSymbol:n,sourceChainName:i,sourceTokenIconUrl:s,recipientAddressProp:a,destinationTokens:l,selectedToken:d,selectedChain:c,selectedChainKey:g,onTokenChange:w,onChainChange:f,tokensLoading:y,balanceData:b,isLoadingBalance:m,sourceValidation:S,onDepositWalletCreation:h,onWithdraw:p,onWithdrawError:T,onWithdrawSubmitted:x,onViewTracker:_,tokenSelectorLeft:F,tokenSelectorRight:k,chainSelectorLeft:C,chainSelectorRight:B}){return jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{behavior:reactNative.Platform.OS==="ios"?"padding":void 0,style:{flex:1},children:jsxRuntime.jsxs(reactNative.ScrollView,{style:{flex:1,paddingTop:16},contentContainerStyle:uo.scrollContent,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:false,children:[jsxRuntime.jsx(reactNative.View,{style:uo.doubleInputWrapper,children:jsxRuntime.jsx(Bs,{tokens:l,selectedTokenSymbol:d?.symbol??null,selectedChainKey:g,onTokenChange:w,onChainChange:f,isLoading:y,tokenPickerBorderTopLeftRadius:F,tokenPickerBorderTopRightRadius:k,chainPickerBorderTopLeftRadius:C,chainPickerBorderTopRightRadius:B})}),jsxRuntime.jsx(rl,{publishableKey:e,sourceChainType:t,sourceChainId:r,sourceTokenAddress:o,sourceTokenSymbol:n,sourceChainName:i,sourceTokenIconUrl:s,recipientAddressProp:a,selectedToken:d,selectedChain:c,balanceData:b,isLoadingBalance:m,minimumWithdrawAmountUsd:S?.minimumAmountUsd??null,estimatedProcessingTime:S?.estimatedProcessingTime??null,maxSlippagePercent:S?.maxSlippagePercent??null,priceImpactPercent:S?.priceImpactPercent??null,canWithdraw:true,onDepositWalletCreation:h,onWithdraw:p,onWithdrawError:T,onWithdrawSubmitted:x,onViewTracker:_})]})})}var uo=reactNative.StyleSheet.create({scrollContent:{paddingBottom:32},doubleInputWrapper:{paddingHorizontal:16,paddingBottom:12,paddingTop:4},listContent:{paddingHorizontal:16,paddingBottom:32,gap:8},trackerContainer:{flex:1,overflow:"hidden"},historyDetailOverlay:{position:"absolute",top:0,left:0,right:0,bottom:0},emptyState:{flex:1,alignItems:"center",justifyContent:"center",paddingVertical:48},emptyText:{fontSize:14},unsupportedContainer:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:24,paddingVertical:48},unsupportedTitle:{fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},unsupportedMessage:{fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280}});reactNative.StyleSheet.create({container:{paddingHorizontal:16,paddingTop:16,paddingBottom:24,gap:16},fieldGroup:{gap:8},fieldLabel:{fontSize:12},walletCard:{paddingHorizontal:12,paddingVertical:12,minHeight:48,justifyContent:"center"},walletAddress:{fontSize:13},primaryButton:{paddingVertical:14,alignItems:"center",justifyContent:"center",marginTop:4},primaryButtonText:{fontSize:16},secondaryButton:{paddingVertical:14,alignItems:"center",justifyContent:"center"},secondaryButtonText:{fontSize:16}});reactNative.StyleSheet.create({base:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},text:{fontWeight:"600",textAlign:"center"},fullWidth:{width:"100%"},disabled:{opacity:.5}});reactNative.StyleSheet.create({icon:{backgroundColor:"transparent"}});var Kp=on.createContext(null);function Bg({children:e,publishableKey:t,config:r}){let[o]=on.useState(()=>new rc({defaultOptions:{queries:{retry:1,staleTime:3e5}}})),[n,i]=on.useState(false),[s,a]=on.useState(null),[l,d]=on.useState(false),[c,g]=on.useState(null),w=reactNative.useColorScheme(),f=on.useRef(false);f.current||(Xs({publishableKey:t}),f.current=true);let y=on.useMemo(()=>{let R=r?.appearance||"dark";return R==="auto"?w==="dark"?"dark":"light":R},[r?.appearance,w]);on.useEffect(()=>{if(!t||t.trim()===""){console.error("Unifold: publishableKey is required. Please provide a valid publishable key.");return}!t.startsWith("pk_test_")&&!t.startsWith("pk_live_")&&console.warn('Unifold: publishableKey should start with "pk_test_" or "pk_live_". Please ensure you are using a valid publishable key.'),Xs({publishableKey:t});},[t]),on.useEffect(()=>()=>{m.current&&clearTimeout(m.current),_.current&&clearTimeout(_.current);},[]);let b=on.useRef(null),m=on.useRef(null),S=on.useCallback(R=>{m.current&&(clearTimeout(m.current),m.current=null),b.current&&(console.warn("[UnifoldProvider] A deposit is already in progress. Cancelling previous deposit."),b.current.reject({message:"Deposit cancelled - new deposit started",code:"DEPOSIT_SUPERSEDED"}),b.current=null);let H=new Promise((V,we)=>{b.current={resolve:V,reject:we};});return a(R),i(true),H},[]),h=on.useCallback(()=>{b.current&&(b.current.reject({message:"Deposit cancelled by user",code:"DEPOSIT_CANCELLED"}),b.current=null),i(false),m.current=setTimeout(()=>{a(null),m.current=null;},200);},[]),p=on.useCallback(R=>{s?.onSuccess&&s.onSuccess(R),b.current&&(b.current.resolve(R),b.current=null);},[s]),T=on.useCallback(R=>{console.error("[UnifoldProvider] Deposit error:",R),s?.onError&&s.onError(R),b.current&&(b.current.reject(R),b.current=null);},[s]),x=on.useRef(null),_=on.useRef(null),F=on.useRef(void 0),k=on.useCallback(R=>{_.current&&(clearTimeout(_.current),_.current=null),x.current&&(console.warn("[UnifoldProvider] A withdrawal is already in progress. Cancelling previous withdrawal."),x.current.reject({message:"Withdrawal cancelled - new withdrawal started",code:"WITHDRAW_SUPERSEDED"}),x.current=null);let H=new Promise((V,we)=>{x.current={resolve:V,reject:we};});return F.current=R.onClose,g(R),d(true),H},[]),C=on.useCallback(()=>{x.current&&(x.current.reject({message:"Withdrawal cancelled by user",code:"WITHDRAW_CANCELLED"}),x.current=null),F.current?.(),F.current=void 0,d(false),_.current=setTimeout(()=>{g(null),_.current=null;},200);},[]),B=on.useCallback(R=>{c?.onSuccess&&c.onSuccess(R),x.current&&(x.current.resolve(R),x.current=null);},[c]),E=on.useCallback(R=>{console.error("[UnifoldProvider] Withdraw error:",R),c?.onError&&c.onError(R),x.current&&(x.current.reject(R),x.current=null);},[c]),L=on.useMemo(()=>({publishableKey:t,beginDeposit:S,closeDeposit:h,beginWithdraw:k,closeWithdraw:C}),[t,S,h,k,C]);return jsxRuntime.jsx(ic,{client:o,children:jsxRuntime.jsx(Kp.Provider,{value:L,children:jsxRuntime.jsxs(Di,{mode:y,accentColor:r?.accentColor,theme:r?.theme,fontFamily:r?.fontFamily,fonts:r?.fonts,components:r?.components,children:[e,s&&jsxRuntime.jsx(Za,{visible:n,onClose:h,publishableKey:t,modalTitle:r?.modalTitle,externalUserId:s.externalUserId,destinationChainType:s.destinationChainType,destinationChainId:s.destinationChainId,destinationTokenSymbol:s.destinationTokenSymbol,recipientAddress:s.recipientAddress,destinationTokenAddress:s.destinationTokenAddress,defaultChainType:s.defaultChainType,defaultChainId:s.defaultChainId,defaultTokenAddress:s.defaultTokenAddress,showBalance:s.showBalance,stripeOnrampEmail:s.stripeOnrampEmail,stripeOnrampPhone:s.stripeOnrampPhone,stripeTheme:{mode:y,accentColor:r?.accentColor,theme:r?.theme,fontFamily:r?.fontFamily,fonts:r?.fonts,components:r?.components},depositConfirmationMode:s.depositConfirmationMode??"auto_ui",hideDepositTracker:r?.hideDepositTracker,transferInputVariant:r?.transferInputVariant,enableStripeLinkPay:r?.enableStripeLinkPay,stripeMerchantIdentifier:r?.stripeMerchantIdentifier,StripeOnrampComponent:r?.enableStripeLinkPay?Jd():void 0,onDepositSuccess:p,onDepositError:T,theme:y,sheetBorderRadius:r?.sheetBorderRadius}),c&&jsxRuntime.jsx(cl,{visible:l,onClose:C,publishableKey:t,externalUserId:c.externalUserId,senderAddress:c.senderAddress,recipientAddress:c.recipientAddress,sourceChainType:c.sourceChainType,sourceChainId:c.sourceChainId,sourceTokenAddress:c.sourceTokenAddress,sourceTokenSymbol:c.sourceTokenSymbol,onWithdraw:c.withdraw,onWithdrawSuccess:B,onWithdrawError:E,sheetBorderRadius:r?.sheetBorderRadius?{globalBorderTopLeftRadius:r.sheetBorderRadius.globalBorderTopLeftRadius,globalBorderTopRightRadius:r.sheetBorderRadius.globalBorderTopRightRadius,tokenSelector:r.sheetBorderRadius.tokenSelector,chainSelector:r.sheetBorderRadius.chainSelector}:void 0})]})})})}function Wg(){let e=on.useContext(Kp);if(!e)throw new Error("useUnifold must be used within UnifoldProvider");return e}
|
|
3
|
+
exports.AmountScreen=Gs;exports.BottomSheet=Qe;exports.KYCWizardScreen=Js;exports.OnrampScreen=pa;exports.StripeOnramp=ma;exports.StripeOnrampPreconfigure=Gd;exports.UnifoldProvider=Bg;exports.getPreferredIcon=ae;exports.getStripePublishableKey=la;exports.getSupportedDestinationTokens=na;exports.normalizeIconUrl=K;exports.registerStripeOnramp=fa;exports.setDevApiUrl=Cd;exports.setStripeOnrampApiUrl=aa;exports.setStripeOnrampPublishableKey=sa;exports.useAllowedCountry=Fs;exports.useStripeOnramp=ca;exports.useTheme=O;exports.useUnifold=Wg;
|