forked from bombastictranz/Coinbase-Exchange
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepositmodal-b40621d8b91ed28d.js
2 lines (2 loc) · 91 KB
/
depositmodal-b40621d8b91ed28d.js
1
2
"use strict";(("undefined"!=typeof self?self:this).webpackChunk_cb_app=("undefined"!=typeof self?self:this).webpackChunk_cb_app||[]).push([[12],{2287:(e,n,a)=>{a.r(n)},1473:(e,n,a)=>{a.r(n),a.d(n,{DepositModal:()=>pe,default:()=>ge});const l={fragment:{argumentDefinitions:[t={defaultValue:null,kind:"LocalArgument",name:"accountUuid"},i={defaultValue:null,kind:"LocalArgument",name:"address"},s={defaultValue:null,kind:"LocalArgument",name:"assetSlug"},r={defaultValue:null,kind:"LocalArgument",name:"assetUuid"},o={defaultValue:null,kind:"LocalArgument",name:"forceRegeneration"},c={defaultValue:null,kind:"LocalArgument",name:"nativeCurrency"},u={defaultValue:null,kind:"LocalArgument",name:"network"},d={defaultValue:null,kind:"LocalArgument",name:"receiveUseDefaultAccount"},m={defaultValue:null,kind:"LocalArgument",name:"receiveUuid"},p={defaultValue:null,kind:"LocalArgument",name:"skipAssetSlug"},g={defaultValue:null,kind:"LocalArgument",name:"skipAssetUuid"},y={defaultValue:null,kind:"LocalArgument",name:"skipReceiveUseAccountByUuid"}],kind:"Fragment",metadata:null,name:"DepositModalQuery",selections:[{args:null,kind:"FragmentSpread",name:"SendReceiveRedesignReceiveSoloQueryFragment"},{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{kind:"RequiredField",field:{alias:null,args:k=[{kind:"Variable",name:"uuid",variableName:"accountUuid"}],concreteType:"Account",kind:"LinkedField",name:"accountByUuidV2",plural:!1,selections:[f={alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},F={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[S={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},h={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null}],type:"TiersCurrency",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Asset",kind:"LinkedField",name:"asset",plural:!1,selections:[b={alias:null,args:null,kind:"ScalarField",name:"platformName",storageKey:null}],storageKey:null}],type:"ViewerAsset",abstractKey:null}],storageKey:null}],storageKey:null},action:"THROW",path:"viewer.accountByUuidV2"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[t,i,d,m,y,u,o,s,p,r,g,c],kind:"Operation",name:"DepositModalQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:"receiveAccounts",args:T=[{kind:"Literal",name:"flow",value:"RECEIVE"}],concreteType:"Account",kind:"LinkedField",name:"accountsForFlow",plural:!0,selections:[f,F,A={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"availableBalance",plural:!1,selections:x=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"availableBalanceInNativeCurrency",plural:!1,selections:x,storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[S,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Asset",kind:"LinkedField",name:"asset",plural:!1,selections:[f,A,K={alias:null,args:null,kind:"ScalarField",name:"displaySymbol",storageKey:null},b,C={alias:null,args:null,kind:"ScalarField",name:"slug",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"exponent",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"imageUrl",storageKey:null},{alias:null,args:null,concreteType:"DestinationTag",kind:"LinkedField",name:"destinationTag",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"regex",storageKey:null}],storageKey:null},v={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{name:"isStablecoin",args:null,fragment:{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"AssetCategory",kind:"LinkedField",name:"categories",plural:!0,selections:[C,v],storageKey:null}],type:"Asset",abstractKey:null},kind:"RelayResolver",storageKey:null,isOutputType:!0},{alias:null,args:D=[{kind:"Variable",name:"quoteCurrency",variableName:"nativeCurrency"}],kind:"ScalarField",name:"unitPriceScaleV2",storageKey:null},{alias:null,args:D,concreteType:"CurrencyQuote",kind:"LinkedField",name:"latestQuoteV2",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},{alias:null,args:null,concreteType:"PercentChanges",kind:"LinkedField",name:"percentChanges",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"day",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"AssetBalanceBreakdown",kind:"LinkedField",name:"assetBalanceBreakdown",plural:!1,selections:[{alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"availableToSendBalanceFiat",plural:!1,selections:x,storageKey:null},{alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"availableToSendBalance",plural:!1,selections:x,storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"RewardApy",kind:"LinkedField",name:"rewardApy",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"formattedValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null}],storageKey:null},{alias:null,args:[{kind:"Literal",name:"action",value:"SEND"},w={kind:"Literal",name:"applicationContext",value:"CONSUMER"}],concreteType:"SendReceiveSupportedNetworks",kind:"LinkedField",name:"supportedNetworks",plural:!1,selections:[{alias:null,args:null,concreteType:"SendReceiveSupportedNetwork",kind:"LinkedField",name:"supportedNetworks",plural:!0,selections:[M={alias:null,args:null,kind:"ScalarField",name:"networkSlug",storageKey:null}],storageKey:null}],storageKey:'supportedNetworks(action:"SEND",applicationContext:"CONSUMER")'}],type:"ViewerAsset",abstractKey:null},_={kind:"InlineFragment",selections:[v],type:"Node",abstractKey:"__isNode"}],storageKey:null},v],storageKey:'accountsForFlow(flow:"RECEIVE")'},{condition:"receiveUseDefaultAccount",kind:"Condition",passingValue:!0,selections:[{alias:"receiveDefaultAccount",args:T,concreteType:"Account",kind:"LinkedField",name:"defaultAccountForFlow",plural:!1,selections:E=[V={alias:null,args:[{kind:"Variable",name:"forceRegeneration",variableName:"forceRegeneration"},{kind:"Variable",name:"network",variableName:"network"}],concreteType:"Address",kind:"LinkedField",name:"address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"depositUri",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"qrCodeImageUrl",storageKey:null},v,{alias:null,args:null,concreteType:"AddressInfo",kind:"LinkedField",name:"addressInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"address",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"destinationTag",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"FullScreenWarning",kind:"LinkedField",name:"fullScreenWarning",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"illustrationName",storageKey:null},I={alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},L={alias:null,args:null,kind:"ScalarField",name:"subtitle",storageKey:null},{alias:null,args:null,concreteType:"Link",kind:"LinkedField",name:"hyperlink",plural:!1,selections:j=[P={alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},B={alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"Link",kind:"LinkedField",name:"cta",plural:!1,selections:j,storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isRegenerable",storageKey:null},{alias:null,args:null,concreteType:"InlineWarning",kind:"LinkedField",name:"inlineWarning",plural:!1,selections:[B,{alias:null,args:null,concreteType:"ToolTip",kind:"LinkedField",name:"tooltip",plural:!1,selections:[I,L],storageKey:null}],storageKey:null}],storageKey:null},U={alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[S,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Asset",kind:"LinkedField",name:"asset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"color",storageKey:null},v,A,K,{alias:null,args:null,concreteType:"DestinationTag",kind:"LinkedField",name:"destinationTag",plural:!1,selections:[A],storageKey:null}],storageKey:null},{alias:null,args:[{kind:"Literal",name:"action",value:"RECEIVE"},{kind:"Variable",name:"address",variableName:"address"},w],concreteType:"SendReceiveSupportedNetworks",kind:"LinkedField",name:"supportedNetworks",plural:!1,selections:[{alias:null,args:null,concreteType:"SendReceiveSupportedNetwork",kind:"LinkedField",name:"supportedNetworks",plural:!0,selections:[M,{alias:null,args:null,kind:"ScalarField",name:"isEnabled",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isDefault",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"networkName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"assetImageUrl",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isFreeGasEnabled",storageKey:null}],storageKey:null}],storageKey:null}],type:"ViewerAsset",abstractKey:null},_],storageKey:null},f,A,F,v],storageKey:'defaultAccountForFlow(flow:"RECEIVE")'}]},{condition:"skipAssetUuid",kind:"Condition",passingValue:!1,selections:[{alias:"receiveAssetByUuid",args:[{kind:"Variable",name:"uuid",variableName:"assetUuid"}],concreteType:"ViewerAsset",kind:"LinkedField",name:"assetByUuid",plural:!1,selections:R=[{alias:null,args:null,concreteType:"Account",kind:"LinkedField",name:"accounts",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"primary",storageKey:null},V,U,f,A,F,v],storageKey:null},v],storageKey:null}]},{condition:"skipReceiveUseAccountByUuid",kind:"Condition",passingValue:!1,selections:[{alias:"receiveAccountByUuidV2",args:[{kind:"Literal",name:"createIfNotExist",value:!0},{kind:"Variable",name:"uuid",variableName:"receiveUuid"}],concreteType:"Account",kind:"LinkedField",name:"accountByUuidV2",plural:!1,selections:E,storageKey:null}]},{alias:"receivePolicyRestrictions",args:[{kind:"Literal",name:"action",value:"receives"}],concreteType:"PolicyRestriction",kind:"LinkedField",name:"policyRestrictions",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"restrictionName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,concreteType:"Link",kind:"LinkedField",name:"link",plural:!1,selections:[B,P],storageKey:null},v],storageKey:'policyRestrictions(action:"receives")'},{condition:"skipAssetSlug",kind:"Condition",passingValue:!1,selections:[{alias:"receiveAssetBySlug",args:[{kind:"Variable",name:"slug",variableName:"assetSlug"}],concreteType:"ViewerAsset",kind:"LinkedField",name:"assetBySlug",plural:!1,selections:R,storageKey:null}]},v,{alias:null,args:k,concreteType:"Account",kind:"LinkedField",name:"accountByUuidV2",plural:!1,selections:[f,F,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[S,h,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Asset",kind:"LinkedField",name:"asset",plural:!1,selections:[b,v],storageKey:null}],type:"ViewerAsset",abstractKey:null},_],storageKey:null},v],storageKey:null}],storageKey:null}]},params:{id:"62c6bf0674fb67ff7f6e6199c16f93fac54ad034942ff611f3c687f12bfeab4a",metadata:{},name:"DepositModalQuery",operationKind:"query",text:null}};var t,i,s,r,o,c,u,d,m,p,g,y,k,f,F,S,h,b,T,A,x,K,C,v,D,w,M,_,I,L,P,B,j,V,U,E,R;l.hash="93e702b9cd27ed401710efa1be90fb12";const N=l;var O=a(0),Z=a(32),q=a(266),W=a(4),z=a(3),Q=a(84),H=a(3589),G=a(1414),X=a(927),$=a(3583),Y=a(4053),J=a(65),ee=a(8488),ne=a(8481),ae=a(1445),le=a(105),te=a(360),ie=a(505),se=a(853),re=a(2);const oe=(0,O.lazy)((()=>Promise.all([a.e(0),a.e(1),a.e(3),a.e(13),a.e(12),a.e(14),a.e(2),a.e(4),a.e(5),a.e(8),a.e(9),a.e(10),a.e(16),a.e(25),a.e(31),a.e(34),a.e(2141),a.e(6),a.e(7),a.e(11),a.e(15),a.e(17),a.e(18),a.e(19),a.e(20),a.e(21),a.e(43),a.e(60),a.e(103),a.e(125),a.e(3022)]).then(a.bind(a,2304))));function ce(e){return(0,re.jsx)(z.zq,{instrumentationId:"LazyVaultDepositModal",fallback:null,"data-element":"InstrumentedSuspense","data-component":"LazyVaultDepositModal",children:(0,re.jsx)(oe,{...e,"data-element":"LazyVaultDepositModalContent"})})}const ue=(0,O.lazy)((()=>Promise.all([a.e(0),a.e(1),a.e(3),a.e(13),a.e(12),a.e(14),a.e(27),a.e(28),a.e(30),a.e(2),a.e(4),a.e(5),a.e(8),a.e(9),a.e(10),a.e(16),a.e(22),a.e(24),a.e(25),a.e(26),a.e(29),a.e(32),a.e(31),a.e(47),a.e(46),a.e(54),a.e(96),a.e(2722),a.e(6),a.e(7),a.e(15),a.e(17),a.e(18),a.e(19),a.e(20),a.e(60),a.e(70),a.e(76),a.e(92),a.e(2970)]).then(a.bind(a,3674)))),de=["USD","EUR","GBP","JPY","AUD","SGD","BRL","CAD"];function me({accountId:e,close:n,allowRedirect:a=!0,allowCryptoReceive:l,suggestedAmount:t,onSuccess:i,entryPoint:s}){const r=(0,ae.a)(),{id:o}=(0,Z.UO)(),c=(0,le.Z)(),u=(0,z.pp)(N,{accountUuid:e??o??"",address:"",receiveUseDefaultAccount:!1,receiveUuid:e??o??"",skipReceiveUseAccountByUuid:!1,network:"",assetSlug:"",assetUuid:"",skipAssetUuid:!0,skipAssetSlug:!0,nativeCurrency:c}),{viewer:d}=u,m=(0,Z.k6)(),p=(0,te.Z)().get("type");(0,ne.H)();const g=d.accountByUuidV2,y="ViewerAsset"===g.assetOrFiatCurrency?.__typename?g.assetOrFiatCurrency.asset.platformName||"":"TiersCurrency"===g.assetOrFiatCurrency?.__typename?g.assetOrFiatCurrency.code:"",k=(0,O.useMemo)((()=>["VAULT","MULTISIG_VAULT","MULTISIG"].includes(g.type)),[g.type]),f="FIAT"!==g.type,F=(0,q.Z)((()=>o||e||"")),S=(0,J._x)(),h=(0,O.useCallback)((()=>{n&&n(),a?m.replace((0,ie.Kc)(F||"")):S()}),[m,n,a,S,F]);return k?(0,re.jsx)(ce,{accountUuid:g.uuid,close:h}):f&&l?(0,re.jsx)(J.ZP,{close:h,children:(0,re.jsx)(ue,{queryRef:u})}):f?(0,re.jsx)(Z.l_,{to:(0,ie.Kc)(F)}):"open_banking"===p?(0,re.jsx)(J.ZP,{close:h,children:(0,re.jsx)(ee.Z,{entryPoint:"deep_link"})}):"interac"===p||"CAD"===y?(0,re.jsx)($.Z,{entryPoint:"deposit"}):de.includes(y)?r?(0,re.jsx)(H.Z,{accountId:g.uuid,entryPoint:s,enabledTransferTypes:[G.Z.DEPOSIT],close:n,onSuccess:i}):(0,re.jsx)(se.v,{accountUuid:g.uuid,accountCurrencyCode:y,close:h,suggestedAmount:t,onSuccess:i,entryPoint:s}):null}function pe(e){return(0,re.jsx)(Q.Z,{owner:"payment",context:"deposit_modal",name:"DepositModal",fallback:(0,re.jsx)(J.ZP,{children:(0,re.jsx)(W.VStack,{alignContent:"center",alignItems:"center",spacing:3,children:(0,re.jsx)(Y.Z,{})})}),errorFallback:e=>(0,re.jsx)(J.ZP,{children:(0,re.jsx)(W.VStack,{alignContent:"center",alignItems:"center",spacing:3,children:(0,re.jsx)(X.Z,{...e})})}),"data-element":"Boundary","data-component":"DepositModal",children:(0,re.jsx)(me,{...e,"data-element":"DepositModalContent"})})}const ge=(0,O.memo)(pe)},953:(e,n,a)=>{a.r(n),a.d(n,{DepositFiatModalContent:()=>ia,default:()=>oa});var l=a(10);const t={fragment:{argumentDefinitions:i=[{defaultValue:null,kind:"LocalArgument",name:"accountId"},{defaultValue:null,kind:"LocalArgument",name:"skipBrazilPaymentStatus"}],kind:"Fragment",metadata:null,name:"DepositFiatModalQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:s=[{kind:"Literal",name:"action",value:"deposits"}],concreteType:"PolicyRestriction",kind:"LinkedField",name:"policyRestrictions",plural:!0,selections:[r={alias:null,args:null,kind:"ScalarField",name:"restrictionName",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},u={alias:null,args:null,concreteType:"Link",kind:"LinkedField",name:"link",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null}],storageKey:null}],storageKey:'policyRestrictions(action:"deposits")'},{alias:null,args:d=[{kind:"Variable",name:"uuid",variableName:"accountId"}],concreteType:"Account",kind:"LinkedField",name:"accountByUuidV2",plural:!1,selections:[p={alias:null,args:null,concreteType:"AccountDepositInformation",kind:"LinkedField",name:"depositInformation",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"isDepositAllowed",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"depositCurrency",storageKey:null},{alias:null,args:null,concreteType:"AccountDepositMethod",kind:"LinkedField",name:"availableDepositMethods",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"isActive",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},{alias:null,args:null,concreteType:"AccountDepositMethodInformation",kind:"LinkedField",name:"depositInformation",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},c,{alias:null,args:null,kind:"ScalarField",name:"isHighlighted",storageKey:null}],storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,concreteType:"AccountDepositNextRequirement",kind:"LinkedField",name:"nextRequirement",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"requirementId",storageKey:null},o,u],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"supportedPaymentMethods",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"bankBlacklist",storageKey:null}],storageKey:null}],storageKey:null},{args:null,kind:"FragmentSpread",name:"DepositMethodAccountFragment"}],storageKey:null}],storageKey:null},{args:[{kind:"Variable",name:"skipBrazilPaymentStatus",variableName:"skipBrazilPaymentStatus"}],kind:"FragmentSpread",name:"DepositMethodFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:i,kind:"Operation",name:"DepositFiatModalQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:s,concreteType:"PolicyRestriction",kind:"LinkedField",name:"policyRestrictions",plural:!0,selections:[r,o,c,u,g={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:'policyRestrictions(action:"deposits")'},{alias:null,args:d,concreteType:"Account",kind:"LinkedField",name:"accountByUuidV2",plural:!1,selections:[p,{alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[y={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"InlineFragment",selections:[k={alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null},m],type:"TiersCurrency",abstractKey:null},{kind:"InlineFragment",selections:[g],type:"Node",abstractKey:"__isNode"},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Asset",kind:"LinkedField",name:"asset",plural:!1,selections:[m,g],storageKey:null}],type:"ViewerAsset",abstractKey:null}],storageKey:null},g],storageKey:null},g,{alias:null,args:null,concreteType:"UserProperties",kind:"LinkedField",name:"userProperties",plural:!1,selections:[{alias:null,args:null,concreteType:"SecondFactor",kind:"LinkedField",name:"secondFactor",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"twoFactorMethod",storageKey:null}],storageKey:null},g],storageKey:null}],storageKey:null},{condition:"skipBrazilPaymentStatus",kind:"Condition",passingValue:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"brazilVirtualAccountStatus",plural:!1,selections:[y,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"accountStatus",storageKey:null}],type:"BrazilVirtualAccountStatusSuccess",abstractKey:null},{kind:"InlineFragment",selections:[k,o],type:"BrazilVirtualAccountStatusError",abstractKey:null}],storageKey:null}]}]},params:{id:"33551e1f639ae7cbfb2f91d88e63e6da0d1f3f37224edae0117bcafb72efb4b3",metadata:{},name:"DepositFiatModalQuery",operationKind:"query",text:null}};var i,s,r,o,c,u,d,m,p,g,y,k;t.hash="f47740cd007ae2e5878fa0a0d233a3ab";const f=t;var F=a(0),S=a(33),h=a(11),b=a(9),T=a(495),A=a(4),x=a(52),K=a(7),C=a(3),v=a(1420),D=a(3691),w=a(4027),M=a(271),_=a(3588),I=a(1414),L=a(65),P=a(565),B=a(355),j=a(799),V=a(1552),U=a(3658),E=a(1445),R=a(3633),N=a(9007),O=a(7060),Z=a(23),q=a(123),W=a(4028);const z={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"DepositMethodAccountFragment",selections:[{args:null,kind:"FragmentSpread",name:"OnlineDepositFormAccountFragment"},{args:null,kind:"FragmentSpread",name:"FedWireStepsAccountFragment"}],type:"Account",abstractKey:null,hash:"7fd5fae3b291c90f62cdf171377b15b0"},Q=z,H={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"skipBrazilPaymentStatus"}],kind:"Fragment",metadata:null,name:"DepositMethodFragment",selections:[{args:null,kind:"FragmentSpread",name:"OnlineDepositFormFragment"},{args:[{kind:"Variable",name:"skip",variableName:"skipBrazilPaymentStatus"}],kind:"FragmentSpread",name:"PixDepositFragment"}],type:"Query",abstractKey:null,hash:"9edadd3f7f1ca12f570b60b2c1f4936a"},G=H;var X=a(8),$=a.n(X),Y=a(15),J=a(3693),ee=a(3902),ne=a(3903),ae=a(3904),le=a(3905),te=a(3659),ie=a(1551),se=a(3660),re=a(3661),oe=a(1458),ce=a(73),ue=a(3634),de=a(504),me=a(82),pe=a(3606),ge=a(3906),ye=a(3596),ke=a(510),fe=a(2);const Fe=(0,h.vU)({continue:{id:"WireTransferInstructions.ReferenceStep.continue",defaultMessage:"Continue"},referenceCheckboxLabel:{id:"WireTransferInstructions.ReferenceStep.referenceCheckboxLabel",defaultMessage:"I've copied or written down my Reference Number"},referenceLabel:{id:"WireTransferInstructions.ReferenceStep.referenceLabel",defaultMessage:"Reference Number"},referenceWarningSubtitle:{id:"WireTransferInstructions.ReferenceStep.referenceWarningSubtitle",defaultMessage:"Without this code, we cannot add these funds into your Coinbase account."},referenceWarning:{id:"WireTransferInstructions.ReferenceStep.referenceWarning",defaultMessage:"Please include this reference code in your transfer"}}),Se=l.ZP.div.withConfig({displayName:"ReferenceStep__Section",componentId:"wowjq7-0"})(["margin-bottom:",";"],ke.dp.huge);function he({onNextLegacy:e,nextStep:n,depositInformation:a,stepName:l}){const{formatMessage:t}=(0,b.Z)(),[i,s]=(0,F.useState)(!1),r=(0,ce.p5)(n||""),o=(a?.find((e=>"reference"===e?.key))||{}).value;return(0,fe.jsxs)(x.VStack,{"data-element":"VStack","data-component":"ReferenceStep",children:[(0,fe.jsx)(Se,{"data-element":"Section",children:(0,fe.jsx)(ue.Z,{type:"warning",title:t(Fe.referenceWarning),subtitle:t(Fe.referenceWarningSubtitle),"data-element":"InlineAlert"})}),(0,fe.jsxs)(Se,{"data-element":"Section",children:[(0,fe.jsx)(ye.Z,{"data-element":"FormLabel",children:(0,fe.jsx)(de.Z,{weight:"demiBold","data-element":"Text",children:t(Fe.referenceLabel)})}),(0,fe.jsx)(ge.Z,{value:o,"data-element":"CopyOnlyInput"})]}),(0,fe.jsx)(Se,{"data-element":"Section",children:(0,fe.jsx)(pe.Z,{puppeteerHandle:"reference-checkbox",checked:i,label:(0,fe.jsx)(de.Z,{children:t(Fe.referenceCheckboxLabel)}),labelPosition:"right",onCheckToggle:()=>s(!0),"data-element":"Checkbox"})}),(0,fe.jsx)(me.Button,{block:!0,disabled:!i,onPress:()=>{e&&n?e(n):n&&r()},"data-element":"Button",children:t(Fe.continue)})]})}const be=(0,F.memo)(he);function Te({requirement:e,depositInformation:n,close:a}){const l=e?"requirement":"reference";return(0,fe.jsxs)(ce.ZP,{defaultStep:l,"data-element":"Stepper","data-component":"SwiftDeposit",children:[(0,fe.jsx)(oe.Z,{stepName:"requirement",requirement:e,nextStep:"reference","data-element":"RequirementsStep"}),(0,fe.jsx)(be,{stepName:"reference",nextStep:"info",depositInformation:n,"data-element":"ReferenceStep"}),(0,fe.jsx)(re.Z,{stepName:"info",type:"swift",nextStep:"confirmation","data-element":"DepositInfoStep"}),(0,fe.jsx)(se.Z,{stepName:"confirmation",onClick:a,"data-element":"DepositConfirmation"})]})}const Ae=(0,F.memo)(Te);var xe=a(1439);function Ke({depositInformation:e,bankDepositMethod:n}){return(0,fe.jsx)(xe.Z,{bankType:{type:"uk",bankDepositMethod:n},depositInformation:e,"data-element":"DepositInformation","data-component":"UKDeposit"})}const Ce=(0,F.memo)(Ke),ve={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"OnlineDepositFormAccountFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},{args:null,kind:"FragmentSpread",name:"useOnlineDepositFormStateFragment"},{args:null,kind:"FragmentSpread",name:"TransferConfirmFragment"},{args:null,kind:"FragmentSpread",name:"WBLDepositConfirmFragment"}],type:"Account",abstractKey:null,hash:"653eb9687fdf84f144571902838df6b2"},De=ve,we={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"OnlineDepositFormFragment",selections:[{args:null,kind:"FragmentSpread",name:"TransferFormFragment"},{args:null,kind:"FragmentSpread",name:"PayPalTransferFragment"}],type:"Query",abstractKey:null,hash:"13497bac4527006819ce8a400fd6d5c2"},Me=we;var _e=a(352),Ie=a(1402),Le=a(1446),Pe=a(3907),Be=a(278),je=a(3908),Ve=a(3909),Ue=a(3910),Ee=a(1504),Re=a(1523),Ne=a(3911),Oe=a(3912),Ze=a(798),qe=a(3582),We=a(124);const ze="web-retail-deposit",Qe="2YDwbhLiFx24ROGn7QL0gPiHQFh",He={mode:Ze.Fw.Allow,types:[Ze.QA.No2FA,Ze.QA.SMS,Ze.QA.TOTP,Ze.QA.U2F,Ze.QA.Passkey]};function Ge({store:e}){const{showErrorToast:n,showInfoToast:a}=(0,We.Z)(),l=(0,F.useCallback)((e=>{e.type!==Ze.k.Error?a(e.message):n(e.message)}),[n,a]),t=(0,F.useCallback)((async n=>{e.confirm(n)}),[e]);return(0,fe.jsx)(qe.Z,{action:ze,projectId:Qe,onToast:l,onCancel:e.cancel,onSuccess:t,constraints:He,"data-element":"ConfirmTwoFactor","data-component":"DepositTwoFactorAuth"})}const Xe={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"PayPalTransferFragment",selections:[{args:null,kind:"FragmentSpread",name:"TransferFormFragment"}],type:"Query",abstractKey:null,hash:"8be72f7032c6cc8699a2b1f1b2b53585"},$e=Xe;var Ye=a(840),Je=a(1547);function en({queryRef:e,store:n}){const a=(0,C.Jc)($e,e),{logSardineAnalyticsEvent:l}=(0,Ye.g)(),t=(0,F.useCallback)((async e=>{l("add_cash"),await n.submitForm({paypal_correlation_id:e})}),[n,l]),i=(0,Je.l)({payPalPaymentMethod:{uuid:n.activePaymentMethod.id,payoutOnly:n.activePaymentMethod.pickerData&&"payOutOnly"in n.activePaymentMethod.pickerData&&"boolean"==typeof n.activePaymentMethod.pickerData.payOutOnly?n.activePaymentMethod.pickerData.payOutOnly:void 0},onSubmit:t,onSignInComplete:n.createAndSetPaymentMethod,onError:n.showServerError});return(0,fe.jsx)(Ee.Z,{queryRef:a,store:n,onSubmit:i,"data-element":"TransferForm","data-component":"PayPalTransfer"})}const nn=(0,h.vU)({dismissErrorBanner:{id:"AchDepositForm.dismissErrorBanner",defaultMessage:"Dismiss"}});let an=function(e){return e.Form="form",e.PlaidRelink="plaidRelink",e.Confirm="confirm",e.Success="success",e.Failed="failed",e.WBL="wbl",e.TwoFactorAuth="twoFactorAuth",e}({});const ln=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],n=[{kind:"Variable",name:"input",variableName:"input"}],a={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"instant",storageKey:null},i=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null}],s={alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"amount",plural:!1,selections:i,storageKey:null},r={alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"subtotal",plural:!1,selections:i,storageKey:null},o={alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"fee",plural:!1,selections:i,storageKey:null},c={alias:null,args:null,concreteType:"InstantAchData",kind:"LinkedField",name:"instantAch",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"isTotalInstant",storageKey:null},{alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"instantAchAmount",plural:!1,selections:i,storageKey:null}],storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"holdDays",storageKey:null},d={alias:null,args:null,concreteType:"TransferWblUxData",kind:"LinkedField",name:"wblUxData",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null}],storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"payoutAt",storageKey:null},p=[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null}],g={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"GenericError",kind:"LinkedField",name:"error",plural:!1,selections:p,storageKey:null}],type:"CommitDepositPartialError",abstractKey:null},y={kind:"InlineFragment",selections:p,type:"GenericError",abstractKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"useOnlineDepositFormStateCommitDepositMutation",selections:[{alias:null,args:n,concreteType:null,kind:"LinkedField",name:"commitDeposit",plural:!1,selections:[a,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"TransferDeposit",kind:"LinkedField",name:"transferDeposit",plural:!1,selections:[l,t,s,r,o,c,u,d,m],storageKey:null}],type:"CommitDepositSuccess",abstractKey:null},g,y],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"useOnlineDepositFormStateCommitDepositMutation",selections:[{alias:null,args:n,concreteType:null,kind:"LinkedField",name:"commitDeposit",plural:!1,selections:[a,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"TransferDeposit",kind:"LinkedField",name:"transferDeposit",plural:!1,selections:[l,t,s,r,o,c,u,d,m,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],type:"CommitDepositSuccess",abstractKey:null},g,y],storageKey:null}]},params:{id:"7cd1c2d07fc2a521dbae466202502b3c3669ec799440310d59d50381bc758c34",metadata:{},name:"useOnlineDepositFormStateCommitDepositMutation",operationKind:"mutation",text:null}}}();ln.hash="8f535539219cd17465911826d1bc6737";const tn=ln,sn=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],n=[{kind:"Variable",name:"input",variableName:"input"}],a={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"instant",storageKey:null},i=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null}],s={alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"amount",plural:!1,selections:i,storageKey:null},r={alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"subtotal",plural:!1,selections:i,storageKey:null},o={alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"fee",plural:!1,selections:i,storageKey:null},c={alias:null,args:null,concreteType:"InstantAchData",kind:"LinkedField",name:"instantAch",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"isTotalInstant",storageKey:null},{alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"instantAchAmount",plural:!1,selections:i,storageKey:null}],storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"holdDays",storageKey:null},d={alias:null,args:null,concreteType:"TransferWblUxData",kind:"LinkedField",name:"wblUxData",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null}],storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"payoutAt",storageKey:null},p=[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null}],g={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"GenericError",kind:"LinkedField",name:"error",plural:!1,selections:p,storageKey:null}],type:"CreateDepositPartialError",abstractKey:null},y={kind:"InlineFragment",selections:p,type:"GenericError",abstractKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"useOnlineDepositFormStateCreateDepositMutation",selections:[{alias:null,args:n,concreteType:null,kind:"LinkedField",name:"createDeposit",plural:!1,selections:[a,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"TransferDeposit",kind:"LinkedField",name:"transferDeposit",plural:!1,selections:[l,t,s,r,o,c,u,d,m],storageKey:null}],type:"CreateDepositSuccess",abstractKey:null},g,y],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"useOnlineDepositFormStateCreateDepositMutation",selections:[{alias:null,args:n,concreteType:null,kind:"LinkedField",name:"createDeposit",plural:!1,selections:[a,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"TransferDeposit",kind:"LinkedField",name:"transferDeposit",plural:!1,selections:[l,t,s,r,o,c,u,d,m,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],type:"CreateDepositSuccess",abstractKey:null},g,y],storageKey:null}]},params:{id:"0a35f04a69e9abd33b02db757f6236647d46368eabf06a6d520ef592504c8368",metadata:{},name:"useOnlineDepositFormStateCreateDepositMutation",operationKind:"mutation",text:null}}}();sn.hash="02af718292ef34e0f40f12c5f96f70df";const rn=sn,on={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"useOnlineDepositFormStateFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null}],type:"TiersCurrency",abstractKey:null}],storageKey:null}],type:"Account",abstractKey:null,hash:"a0048a79bbada8572a2a8d4c0cbf9e85"},cn=on;var un=a(156),dn=a(3637),mn=a(276),pn=a(217),gn=a(1438),yn=a(1550),kn=a(4026);const fn=(0,h.vU)({transferUnavailable:{id:"useOnlineDepositFormState.transferUnavailable",defaultMessage:"Deposit details currently unavailable. Please try again later."}});const Fn=function({accountRef:e,paymentMethods:n,closeModal:a,suggestedAmount:l,onSuccess:t,entryPoint:i}){const{formatMessage:s}=(0,b.Z)(),r=(0,kn.t)(),o=(0,C.Jc)(cn,e),[c]=(0,C.Db)(rn),[u]=(0,C.Db)(tn),d=o.assetOrFiatCurrency?.code||"",m=d,p="deposit",{isInUS:g}=(0,Z.Z)(),y=(0,mn.Z)(),k=(0,gn.Z)(),[f,S]=(0,F.useState)({error:void 0,serverError:void 0,serverErrorId:void 0,loading:!1,submitEnabled:void 0!==l,step:"form",amount:void 0===l?"":String(l),activePaymentMethodId:"",transfer:void 0}),{error:h,serverError:T,serverErrorId:A,loading:x,submitEnabled:K,step:v,amount:D,activePaymentMethodId:w,transfer:_}=f,I=(0,pn.Z)(),L=(0,F.useMemo)((()=>{const e=["ach_bank_account"];return g&&e.push("paypal_account"),e}),[g]),P=(0,F.useMemo)((()=>n.filter((e=>L.includes(e.type)&&e.verified))),[n,L]),B=(0,F.useMemo)((()=>n.filter((e=>L.includes(e.type)))),[n,L]),j=(0,F.useCallback)((async()=>{await y()}),[y]),V=(0,F.useCallback)((()=>{S((e=>({...e,submitEnabled:!0})))}),[]),U=(0,F.useCallback)((()=>{S((e=>({...e,submitEnabled:!1})))}),[]),E=(0,F.useCallback)((e=>{S((n=>({...n,serverErrorId:e.id,serverError:e.message})))}),[]),R=(0,F.useCallback)((()=>{S((e=>({...e,serverErrorId:void 0,serverError:void 0})))}),[]),N=(0,F.useCallback)((()=>{S((e=>({...e,step:"form"})))}),[]),O=(0,F.useMemo)((()=>{if(r&&!w){const e=(0,yn.Tu)("deposit",P);return(0,yn.Wf)("deposit",e)[0]??e[0]??P[0]}return P.find((e=>e.id===w))??P[0]}),[w,r,P]),q=(0,F.useCallback)((e=>{R(),S((n=>({...n,activePaymentMethodId:e})))}),[R]),W=(0,F.useCallback)((async e=>{await I({transferType:p,accountUuid:o.uuid}),e&&q(e.id)}),[o.uuid,I,q]),z=O?.limits?.deposit?.[0]?.remaining?.currency||"",Q=O?.limits?.deposit?.[0]?.remaining?.amount||"0",H=(0,F.useCallback)((()=>{Boolean(_?.wblUxData?.title&&_?.wblUxData?.description)?S((e=>({...e,step:an.WBL}))):a()}),[a,_?.wblUxData?.description,_?.wblUxData?.title]),G=(0,F.useCallback)((()=>new Promise(((e,n)=>{c({variables:{input:{accountUuid:o.uuid,amount:{value:D,currency:d},paymentMethodUuid:O?.id,commit:!1}},onCompleted:({response:a})=>{(0,C.V4)(a.createDeposit).when("CreateDepositSuccess",(({transferDeposit:n})=>{e(n)})).when("CreateDepositPartialError",(e=>{n(e.error)})).when("GenericError",(e=>{n(e)})).otherwise((e=>{(0,un.cB)(new Error(`useOnlineDepositFormState createDepositMutation failed with following error | Error: ${e}`),{owner:"payment",context:"useOnlineDepositFormState"}),n({message:s(dn.N.genericErrorMessage),code:"UnknownResponseType"})}))},onError:({alreadyReportedError:e})=>{n({code:e.name,message:s(dn.N.genericErrorMessage)})}})}))),[c,o.uuid,D,d,O?.id,s]);(0,F.useEffect)((()=>{if("limitOrderAddCash"!==i){if(R(),!K||!O||!d)return;S((e=>({...e,loading:!0})));const{promise:e,cancel:n}=(0,Y.HO)(G());return e.then((e=>{R(),S((n=>({...n,transfer:e,loading:!1})))})).catch((e=>{const n=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:s(dn.N.genericErrorMessage),a=e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:"";E({id:a,message:n}),S((e=>({...e,loading:!1})))})),()=>{S((e=>({...e,loading:!1}))),n()}}}),[D,K]);const X=(0,F.useCallback)((e=>{S((n=>({...n,amount:e})))}),[]),J=(0,F.useCallback)((e=>{S((n=>({...n,loading:e})))}),[]),ee=(0,F.useCallback)((async e=>{R();try{S((e=>({...e,loading:!0})));const n=await k({graphqlParams:{type:"PAYPAL_ACCOUNT",paypalDetails:{paypalPayInDetails:{paymentMethodNonce:e.payment_method_nonce,payerId:e.payer_id,postalCode:e.postal_code,country:e.country,line1:e.line_1,ownerName:e.owner_name,email:e.email,state:e.state,city:e.city}}},resthookParams:e});n&&q(n.id)}catch(e){return E(e),Promise.reject(e)}finally{S((e=>({...e,loading:!1})))}}),[R,k,q,E]),ne=(0,F.useCallback)((async e=>{if(!O||!d)return;R(),S((e=>({...e,loading:!0})));await new Promise(((n,a)=>{c({variables:{input:{accountUuid:o.uuid,amount:{value:D,currency:d},paymentMethodUuid:O.id,commit:!1,paypalCorrelationId:e?.paypal_correlation_id}},onCompleted:({response:e})=>{(0,C.V4)(e.createDeposit).when("CreateDepositSuccess",(({transferDeposit:e})=>{S((n=>({...n,transfer:e,step:O?.isRevoked?an.PlaidRelink:an.Confirm,loading:!1}))),n(e)})).when("CreateDepositPartialError",(e=>{const{message:n,code:l}=e.error;E({id:l,message:n}),S((e=>({...e,loading:!1}))),a({code:l,message:n})})).when("GenericError",(e=>{const{message:n,code:l}=e;E({id:l,message:n}),S((e=>({...e,loading:!1}))),a({code:l,message:n})})).otherwise((e=>{(0,un.cB)(new Error(`useOnlineDepositFormState createDepositMutation failed with following error | Error: ${e}`),{owner:"payment",context:"useOnlineDepositFormState"}),a(e)}))},onError:({alreadyReportedError:e})=>{E({id:e.name,message:e.message}),S((e=>({...e,loading:!1}))),a({code:e.name,message:e.message})}})}))}),[O,d,R,c,o.uuid,D,E]),ae=(0,F.useCallback)((async e=>{R(),_?(S((e=>({...e,loading:!0}))),(0,M.ev)({transferType:"deposit",transferUuid:_.uuid}),u({variables:{input:{accountUuid:o.uuid,transferDepositUuid:_.uuid,twoFactorToken:e}},onCompleted:({response:e})=>{(0,C.V4)(e.commitDeposit).when("CommitDepositSuccess",(({transferDeposit:e})=>{setTimeout(j,2e3),S((n=>({...n,transfer:e,step:an.Success,loading:!1}))),t?.()})).when("CommitDepositPartialError",(e=>{const{message:n,code:a}=e.error;S("two_factor_required"===a?e=>({...e,step:an.TwoFactorAuth,loading:!1}):e=>({...e,error:{id:a,message:n},step:an.Failed,loading:!1}))})).when("GenericError",(e=>{const{message:n,code:a}=e;S("two_factor_required"===a?e=>({...e,step:an.TwoFactorAuth,loading:!1}):e=>({...e,error:{id:a,message:n},step:an.Failed,loading:!1}))})).otherwise((e=>{(0,un.cB)(new Error(`useOnlineDepositFormState commitDepositMutation failed with following error | Error: ${e}`),{owner:"payment",context:"useOnlineDepositFormState"})}))},onError:({alreadyReportedError:e})=>{const{name:n,message:a}=e;S((e=>({...e,error:{id:n,message:a},step:an.Failed,loading:!1}))),(0,un.cB)((0,un.Xv)(e),{owner:"payment",context:"useOnlineDepositFormState"})}})):S((e=>({...e,error:{id:"transferUnavaiable",message:s(fn.transferUnavailable)},step:an.Failed})))}),[R,_,u,o.uuid,s,j,t]),le=(0,F.useCallback)((async e=>{if(O&&o.assetOrFiatCurrency?.code){S((e=>({...e,loading:!0})));try{let n=f.transfer;if(!n){const a=n=>new Promise(((a,l)=>{c({variables:{input:{accountUuid:o.uuid,amount:{value:D,currency:n},paymentMethodUuid:O?.id,commit:!1,paypalCorrelationId:e?.paypal_correlation_id}},onCompleted:({response:e})=>{(0,C.V4)(e.createDeposit).when("CreateDepositSuccess",(({transferDeposit:e})=>{a(e)})).when("CreateDepositPartialError",(e=>{const{message:n,code:a}=e.error;l({code:a,message:n})})).when("GenericError",(e=>{const{message:n,code:a}=e;l({code:a,message:n})})).otherwise((e=>{(0,un.cB)(new Error(`useOnlineDepositFormState createDepositMutation failed with following error | Error: ${e}`),{owner:"payment",context:"useOnlineDepositFormState"})}))},onError:({alreadyReportedError:e})=>{l({code:e.name,message:e.message})}})}));n=await a(o.assetOrFiatCurrency?.code),S((e=>({...e,transfer:n})))}if(O?.isRevoked)return void S((e=>({...e,transfer:n,step:an.PlaidRelink})));$()(n,"OnlineDepositFormStore will not be null in confirm"),u({variables:{input:{accountUuid:o.uuid,transferDepositUuid:n.uuid}},onCompleted:({response:e})=>{(0,C.V4)(e.commitDeposit).when("CommitDepositSuccess",(({transferDeposit:e})=>{S((n=>({...n,transfer:e}))),t?.()})).when("CommitDepositPartialError",(e=>{const{message:n,code:a}=e.error;S("two_factor_required"===a?e=>({...e,step:an.TwoFactorAuth,loading:!1}):e=>({...e,error:{id:a,message:n},step:an.Failed,loading:!1}))})).when("GenericError",(e=>{const{message:n,code:a}=e;S("two_factor_required"===a?e=>({...e,step:an.TwoFactorAuth,loading:!1}):e=>({...e,error:{id:a,message:n},step:an.Failed,loading:!1}))})).otherwise((e=>{(0,un.cB)(new Error(`useOnlineDepositFormState commitDepositMutation failed with following error | Error: ${e}`),{owner:"payment",context:"useOnlineDepositFormState"})}))},onError:({alreadyReportedError:e})=>{const{name:n,message:a}=e;S((e=>({...e,error:{id:n,message:a},step:an.Failed,loading:!1}))),(0,un.cB)((0,un.Xv)(e),{owner:"payment",context:"useOnlineDepositFormState"})}})}catch(e){const n="two_factor_required"===e.code;S(n?e=>({...e,step:an.TwoFactorAuth}):n=>({...n,error:e,step:an.Failed}))}S((e=>({...e,loading:!1})))}}),[o.assetOrFiatCurrency?.code,o.uuid,O,D,u,c,t,f.transfer]);return(0,F.useMemo)((()=>({mode:p,error:h,serverError:T,serverErrorId:A,loading:x,step:v,amount:D,activePaymentMethod:O,transfer:_,availablePendingPaymentMethods:B,submitEnabled:K,paymentMethods:P,markValid:V,markInvalid:U,setAmount:X,setLoading:J,showServerError:E,clearServerError:R,cancel:N,setActivePaymentMethodWithId:q,refreshPaymentMethods:W,limitCurrency:z,maxAmount:Q,closeTransferSuccess:H,createAndSetPaymentMethod:ee,submitForm:ne,confirm:ae,setState:S,accountName:m,accountCurrencyCode:d,createAndCommitDeposit:le})),[h,T,A,x,v,D,O,_,B,K,P,V,U,X,J,E,R,N,q,W,z,Q,H,ee,ne,ae,m,d,le])};function Sn({queryRef:e,accountRef:n,close:a=S.noop,suggestedAmount:l,onSuccess:t,entryPoint:i}){const s=(0,C.Jc)(Me,e),r=(0,C.Jc)(De,n),{isInUS:o}=(0,Z.Z)(),c=(0,Be.Z)({transferType:"deposit",accountId:r.uuid}),u=Fn({accountRef:r,paymentMethods:c,closeModal:a,suggestedAmount:l,onSuccess:t,entryPoint:i}),{formatMessage:d}=(0,b.Z)(),{activePaymentMethod:m,availablePendingPaymentMethods:p,step:g,closeTransferSuccess:y,error:k,mode:f,transfer:h,serverError:T,serverErrorId:A,clearServerError:x}=u,K=m?.type,v=(0,F.useCallback)((()=>{[an.Success,an.Failed,an.WBL].includes(g)||(0,_e.F2)("Deposit Abandoned")}),[g]);(0,L.vy)(v);const D=(0,F.useMemo)((()=>"paypal_account"===K?(0,fe.jsx)(Ie.ZP,{paymentMethodType:"paypal_account",entryPoint:"deposit",paymentMethodId:m?.id,children:(0,fe.jsx)(en,{queryRef:s,store:u})}):(0,fe.jsx)(Ee.Z,{queryRef:s,entryPoint:i,store:u})),[K,m?.id,u,s,i]),w=(0,F.useMemo)((()=>{switch(g){case an.Form:return D;case an.PlaidRelink:return(0,fe.jsx)(je.Z,{store:u});case an.Confirm:return o?(0,fe.jsx)(Ne.Z,{accountRef:r,store:u}):(0,fe.jsx)(Ve.Z,{accountRef:r,store:u});case an.Success:return(0,fe.jsx)(Re.Z,{handleClose:y});case an.Failed:return(0,fe.jsx)(Ue.Z,{closeModal:a,error:k,mode:f});case an.WBL:return(0,fe.jsx)(Oe.Z,{transfer:h,closeModal:a});case an.TwoFactorAuth:return(0,fe.jsx)(Ge,{store:u});default:throw new Error("Step should be in [form, confirm, success]")}}),[D,u,o,g,y,a,k,f,h,r]);return p.length>0&&!m?(0,fe.jsx)(Pe.Z,{action:"deposits",pendingPaymentMethod:p[0]}):m?(0,fe.jsxs)("div",{"data-testid":"online-deposit-form","data-component":"OnlineDepositForm",children:[!!T&&"limit_error_increase_eligible"!==A&&(0,fe.jsx)(hn,{inline:!0,subtitle:T,type:"error",onClickPrimary:x,primaryLabel:d(nn.dismissErrorBanner),testID:"online-deposit-alert"}),w]}):(0,fe.jsx)(Pe.Z,{action:"deposits"})}const hn=(0,l.ZP)(Le.Z).withConfig({displayName:"OnlineDepositForm__StyledAlert",componentId:"sc-1rajouk-0"})(["width:auto;margin:-24px -24px 24px;"]),bn=(0,F.memo)(Sn),Tn={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"skip"}],kind:"Fragment",metadata:null,name:"PixDepositFragment",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"brazilVirtualAccountStatus",plural:!1,selections:[{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"accountStatus",storageKey:null}],type:"BrazilVirtualAccountStatusSuccess",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null}],type:"BrazilVirtualAccountStatusError",abstractKey:null}],storageKey:null}]}],type:"Query",abstractKey:null,hash:"a8be7ef688dd6c949c481d262d83e286"},An=Tn;var xn=a(182),Kn=a(35),Cn=a(61),vn=a(14),Dn=a(3622);const wn=(0,F.memo)((function({children:e}){const n=(0,xn.Z)("phone");return(0,fe.jsx)(A.VStack,{spacingBottom:n?5:3,spacingHorizontal:n?3:5,alignItems:"center",children:e})})),Mn=(0,F.memo)((function({children:e}){const n=(0,xn.Z)("phone");return(0,fe.jsx)(A.VStack,{spacingHorizontal:n?3:5,spacingTop:3,alignItems:"center",width:"100%",justifyContent:n?"center":void 0,flexGrow:n?1:void 0,children:e})})),_n=(0,ce.vj)({steps:["depositInstructions","completePayment","paymentPending"],defaultStep:"depositInstructions"}),In=(0,h.vU)({paymentPendingModalTitle:{id:"ActiveAccountPaymentPendingStep3.paymentPendingModalTitle",defaultMessage:"Processing your payment"},paymentPendingTitle:{id:"ActiveAccountPaymentPendingStep3.paymentPendingTitle",defaultMessage:"We will notify you when the deposit is successful"},paymentPendingDescription:{id:"ActiveAccountPaymentPendingStep3.paymentPendingDescription",defaultMessage:"Once you make the payment, it usually takes under <strong>30 seconds</strong> to reflect on coinbase account but can take up to 30 minutes, depending on your bank. You will be notified by email once we’ve received your funds."},doneBtn:{id:"ActiveAccountPaymentPendingStep3.doneBtn",defaultMessage:"Done"}});function Ln(){const{formatMessage:e}=(0,b.Z)(),n=(0,L._x)(),{goBack:a}=(0,ce.tC)(_n),l=(0,xn.Z)("phone"),t=(0,F.useCallback)((()=>{n()}),[n]),i=(0,F.useCallback)((()=>{a()}),[a]);return(0,K.bH)("pix_deposit_payment_will_be_done_view",{componentType:K.re.modal,action:K.Us.render}),(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(L.xB,{center:!0,title:(0,fe.jsx)(vn.TextHeadline,{as:"span",children:e(In.paymentPendingModalTitle)}),onBack:i,onClose:t,noBorder:!0}),(0,fe.jsxs)(Mn,{children:[(0,fe.jsx)(Cn.HeroSquare,{name:"readyToTrade"}),(0,fe.jsx)(A.Box,{maxWidth:l?void 0:328,children:(0,fe.jsx)(vn.TextTitle3,{as:"h3",spacingVertical:2,align:"center",children:e(In.paymentPendingTitle)})}),(0,fe.jsx)(A.Box,{maxWidth:328,children:(0,fe.jsx)(vn.TextBody,{as:"div",spacingBottom:2,align:"center",color:"foregroundMuted",children:e(In.paymentPendingDescription,{strong:e=>[(0,fe.jsx)("strong",{children:e})]})})})]}),l?(0,fe.jsx)(A.Box,{testID:"safe-alert-container",alignSelf:"center",justifyContent:"center",spacingHorizontal:3,spacingBottom:3,children:(0,fe.jsx)(Dn.F,{})}):null,(0,fe.jsx)(wn,{children:(0,fe.jsx)(A.Box,{width:"100%",maxWidth:l?void 0:328,children:(0,fe.jsx)(Kn.Button,{variant:"primary",block:!0,onPress:t,children:e(In.doneBtn)})})})]})}const Pn=(0,F.memo)(Ln),Bn=(0,h.vU)({completePaymentModalTitle:{id:"ActivePixAccountCompletePaymentStep2.completePaymentModalTitle",defaultMessage:"Complete the payment"},completePaymentTitle:{id:"ActivePixAccountCompletePaymentStep2.completePaymentTitle",defaultMessage:"Complete the payment on your bank app"},completePaymentDescription:{id:"ActivePixAccountCompletePaymentStep2.completePaymentDescription",defaultMessage:"After making the transaction please come back here."},paymentDoneBtn:{id:"ActivePixAccountCompletePaymentStep2.paymentDoneBtn",defaultMessage:"I have made the payment"},cancelBtn:{id:"ActivePixAccountCompletePaymentStep2.cancelBtn",defaultMessage:"Cancel"}});function jn(){const{formatMessage:e}=(0,b.Z)(),n=(0,L._x)(),{goBack:a,goToStep:l}=(0,ce.tC)(_n),t=(0,xn.Z)("phone"),i=(0,F.useCallback)((()=>{n()}),[n]),s=(0,F.useCallback)((()=>{a()}),[a]),r=(0,F.useCallback)((()=>{l("paymentPending")}),[l]);return(0,K.bH)("pix_deposit_complete_payment_view",{componentType:K.re.modal,action:K.Us.render}),(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(L.xB,{center:!0,title:(0,fe.jsx)(vn.TextHeadline,{as:"span",children:e(Bn.completePaymentModalTitle)}),onBack:s,onClose:i,noBorder:!0}),(0,fe.jsxs)(Mn,{children:[(0,fe.jsx)(Cn.SpotRectangle,{name:"uob"}),(0,fe.jsx)(A.Box,{maxWidth:t?void 0:328,children:(0,fe.jsx)(vn.TextTitle3,{as:"h3",spacingBottom:2,spacingTop:t?7:3,align:"center",children:e(Bn.completePaymentTitle)})}),(0,fe.jsx)(A.Box,{maxWidth:t?void 0:328,minHeight:141,spacingBottom:4,children:(0,fe.jsx)(vn.TextBody,{as:"div",spacingBottom:2,align:"center",color:"foregroundMuted",children:e(Bn.completePaymentDescription,{strong:e=>[(0,fe.jsx)("strong",{children:e})]})})})]}),(0,fe.jsxs)(wn,{children:[(0,fe.jsx)(A.Box,{width:"100%",maxWidth:t?void 0:328,spacingBottom:2,children:(0,fe.jsx)(Kn.Button,{variant:"primary",block:!0,onPress:r,children:e(Bn.paymentDoneBtn)})}),(0,fe.jsx)(Kn.Button,{variant:"primary",block:!0,transparent:!0,onPress:i,children:e(Bn.cancelBtn)})]})]})}const Vn=(0,F.memo)(jn);var Un=a(3584),En=a(64),Rn=a(3692);const Nn=(0,h.vU)({depositFormTitle:{id:"ActivePixAccount.depositFormTitle",defaultMessage:"Add cash"},pixMinimumDepositAmount:{id:"ActivePixAccount.pixMinimumDepositAmount",defaultMessage:"You must deposit at least <strong>R$ 1</strong>"},cancelBtn:{id:"ActivePixAccount.cancelBtn",defaultMessage:"Cancel"},confirmPaymentBtn:{id:"ActivePixAccount.confirmPaymentBtn",defaultMessage:"I have made the payment"},copyAndconfirmPaymentBtn:{id:"ActivePixAccount.copyAndconfirmPaymentBtn",defaultMessage:"Copy Pix code & continue"},pixCopiedClipboardToastMessage:{id:"ActivePixAccount.pixCopiedClipboardToastMessage",defaultMessage:"Pix code copied to clipboard"}});function On({depositInformation:e}){const{formatMessage:n}=(0,b.Z)(),a=(0,xn.Z)("phone"),l=(0,L._x)(),{goToStep:t}=(0,ce.tC)(_n),{showSuccessToast:i}=(0,We.Z)(),s=(0,Rn.M)(e),r=(0,F.useCallback)((()=>{l()}),[l]),o=(0,F.useCallback)((()=>{a&&(i(n(Nn.pixCopiedClipboardToastMessage)),(0,Un.Z)(s??null)),t(a?"completePayment":"paymentPending")}),[a,s,t,n,i]),c=(0,F.useCallback)((()=>{setTimeout((()=>{t("completePayment")}),1e3)}),[t]);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(L.xB,{center:!0,title:(0,fe.jsx)(vn.TextHeadline,{as:"span",children:n(Nn.depositFormTitle)}),onBack:r,onClose:r,noBorder:!0}),(0,fe.jsx)(xe.Z,{depositInformation:e,bankType:{type:w.B},onNext:c}),(0,fe.jsxs)(A.VStack,{borderColor:"line",borderedBottom:!1,borderedStart:!1,borderedEnd:!1,spacingTop:a?1:2,spacingHorizontal:3,children:[(0,fe.jsxs)(A.HStack,{justifyContent:"center",alignItems:"center",children:[(0,fe.jsx)(vn.TextLabel2,{as:"span",color:"foregroundMuted",spacingEnd:.5,children:n(Nn.pixMinimumDepositAmount,{strong:e=>[(0,fe.jsx)("strong",{children:e})]})}),(0,fe.jsx)(En.Icon,{name:"info",size:"xs",color:"foregroundMuted"})]}),(0,fe.jsxs)(A.Box,{flexDirection:a?"column-reverse":"row",justifyContent:"space-between",spacingTop:a?1:2,spacingBottom:2,children:[(0,fe.jsx)(A.Box,{flexGrow:1,flexShrink:1,flexBasis:a?"auto":"0%",spacingTop:a?2:0,spacingEnd:a?0:2,children:(0,fe.jsx)(Kn.Button,{onPress:r,variant:"secondary",block:!0,children:n(Nn.cancelBtn)})}),(0,fe.jsx)(A.Box,{flexGrow:1,flexShrink:1,flexBasis:a?"auto":"0%",dangerouslySetClassName:Zn,children:(0,fe.jsx)(Kn.Button,{onPress:o,block:!0,children:n(a?Nn.copyAndconfirmPaymentBtn:Nn.confirmPaymentBtn)})})]})]})]})}const Zn="c14i80zp",qn=(0,F.memo)(On);function Wn({children:e}){const n=(0,xn.Z)("phone");return(0,fe.jsx)(A.VStack,{testID:"active-pix-step",minHeight:n?void 0:"50%",height:n?"100%":void 0,alignSelf:n?"flex-start":void 0,"data-element":"VStack","data-component":"ActivePixStepContainer",children:e})}function zn({depositInformation:e}){return(0,fe.jsx)(_n.Provider,{"data-element":"unknown","data-component":"ActivePixAccount",children:(0,fe.jsxs)(_n.Steps,{"data-element":"unknown",children:[(0,fe.jsx)(_n.Step,{"data-element":"unknown",children:(0,fe.jsx)(Wn,{"data-element":"ActivePixStepContainer",children:(0,fe.jsx)(qn,{depositInformation:e,"data-element":"ActivePixAccountDIStep1"})})},"depositInstructions"),(0,fe.jsx)(_n.Step,{"data-element":"unknown",children:(0,fe.jsx)(Wn,{"data-element":"ActivePixStepContainer",children:(0,fe.jsx)(Vn,{"data-element":"ActivePixAccountCompletePaymentStep2"})})},"completePayment"),(0,fe.jsx)(_n.Step,{"data-element":"unknown",children:(0,fe.jsx)(Wn,{"data-element":"ActivePixStepContainer",children:(0,fe.jsx)(Pn,{"data-element":"ActiveAccountPaymentPendingStep3"})})},"paymentPending")]})})}a(2287);const Qn=(0,F.memo)(zn),Hn=(0,h.vU)({title:{id:"BlockedPixAccount.title",defaultMessage:"We couldn't verify your info"},body:{id:"BlockedPixAccount.bodyTitle",defaultMessage:"Here are a few common mistakes:"},bodyItem1:{id:"BlockedPixAccount.bodyItem1",defaultMessage:"You must use your full, legal name as it appears on government-issued identification."},bodyItem2:{id:"BlockedPixAccount.bodyItem2",defaultMessage:"You can't use a PO box or business address."},bodyItem3:{id:"BlockedPixAccount.bodyItem3",defaultMessage:"Double-check your CPF number to ensure it is entered correctly."},homeButton:{id:"BlockedPixAccount.homeButton",defaultMessage:"Go to home"},helpButton:{id:"BlockedPixAccount.helpButton",defaultMessage:"Contact Support"}});function Gn({close:e}){const n=(0,xn.Z)("phone"),{formatMessage:a}=(0,b.Z)();return(0,K.bH)("pix_blocked_account_deposit_view",{componentType:K.re.modal}),(0,fe.jsxs)(A.VStack,{spacing:2,"data-element":"VStack","data-component":"BlockedPixAccount",children:[(0,fe.jsx)(A.HStack,{spacingBottom:1,justifyContent:"center","data-element":"HStack",children:(0,fe.jsx)(Cn.HeroSquare,{name:"idIssue","data-element":"HeroSquare"})}),(0,fe.jsxs)(A.VStack,{spacingVertical:2,"data-element":"VStack",children:[(0,fe.jsx)(vn.TextTitle3,{as:"h1","data-element":"TextTitle3",children:a(Hn.title)}),(0,fe.jsx)(vn.TextBody,{as:"p",color:"foregroundMuted","data-element":"TextBody",children:a(Hn.body)}),(0,fe.jsxs)(A.VStack,{as:"ul",spacingHorizontal:2,spacingVertical:1,dangerouslySetStyle:{margin:0},"data-element":"VStack",children:[(0,fe.jsx)(vn.TextBody,{as:"li",color:"foregroundMuted","data-element":"TextBody",children:a(Hn.bodyItem1)}),(0,fe.jsx)(vn.TextBody,{as:"li",color:"foregroundMuted","data-element":"TextBody",children:a(Hn.bodyItem2)}),(0,fe.jsx)(vn.TextBody,{as:"li",color:"foregroundMuted","data-element":"TextBody",children:a(Hn.bodyItem3)})]})]}),(0,fe.jsxs)(Kn.ButtonGroup,{block:!0,accessibilityLabel:"Footer buttons",vertical:n,"data-element":"ButtonGroup",children:[(0,fe.jsx)(Kn.Button,{variant:"secondary",onPress:e,"data-element":"Button",children:a(Hn.homeButton)}),(0,fe.jsx)(Kn.Button,{to:"https://help.coinbase.com/contact-us","data-element":"Button",children:a(Hn.helpButton)})]})]})}const Xn=(0,F.memo)(Gn);var $n=a(1421);let Yn=function(e){return e.EBANX_VIRTUAL_ACCOUNT_STATUS_UNSPECIFIED="EBANX_VIRTUAL_ACCOUNT_STATUS_UNSPECIFIED",e.EBANX_VIRTUAL_ACCOUNT_STATUS_CREATED="EBANX_VIRTUAL_ACCOUNT_STATUS_CREATED",e.EBANX_VIRTUAL_ACCOUNT_STATUS_AWAITING_DOCUMENTS="EBANX_VIRTUAL_ACCOUNT_STATUS_AWAITING_DOCUMENTS",e.EBANX_VIRTUAL_ACCOUNT_STATUS_ACTIVE="EBANX_VIRTUAL_ACCOUNT_STATUS_ACTIVE",e.EBANX_VIRTUAL_ACCOUNT_STATUS_VERIFYING="EBANX_VIRTUAL_ACCOUNT_STATUS_VERIFYING",e.EBANX_VIRTUAL_ACCOUNT_STATUS_VERIFIED="EBANX_VIRTUAL_ACCOUNT_STATUS_VERIFIED",e.EBANX_VIRTUAL_ACCOUNT_STATUS_BLOCKED="EBANX_VIRTUAL_ACCOUNT_STATUS_BLOCKED",e.EBANX_VIRTUAL_ACCOUNT_STATUS_INACTIVE="EBANX_VIRTUAL_ACCOUNT_STATUS_INACTIVE",e.EBANX_VIRTUAL_ACCOUNT_STATUS_NOT_FOUND="EBANX_VIRTUAL_ACCOUNT_STATUS_NOT_FOUND",e}({});function Jn({depositInformation:e,close:n,queryRef:a,refreshDepositMethod:l}){const{brazilVirtualAccountStatus:t}=(0,C.Jc)(An,a);if(!t?.accountStatus)throw new Error(t?.message??"Error fetching Brazil virtual account status");const i=(0,F.useCallback)((()=>{n&&n(),l()}),[n,l]);switch(t.accountStatus){case Yn.EBANX_VIRTUAL_ACCOUNT_STATUS_ACTIVE:return(0,fe.jsx)(Qn,{depositInformation:e});case Yn.EBANX_VIRTUAL_ACCOUNT_STATUS_CREATED:case Yn.EBANX_VIRTUAL_ACCOUNT_STATUS_AWAITING_DOCUMENTS:case Yn.EBANX_VIRTUAL_ACCOUNT_STATUS_VERIFYING:case Yn.EBANX_VIRTUAL_ACCOUNT_STATUS_VERIFIED:case Yn.EBANX_VIRTUAL_ACCOUNT_STATUS_NOT_FOUND:return(0,fe.jsx)($n.ZP,{close:i});case Yn.EBANX_VIRTUAL_ACCOUNT_STATUS_UNSPECIFIED:case Yn.EBANX_VIRTUAL_ACCOUNT_STATUS_BLOCKED:case Yn.EBANX_VIRTUAL_ACCOUNT_STATUS_INACTIVE:return(0,fe.jsx)(Xn,{close:i});default:throw new Error(t?.message??`Unknown brasil virtual account status ${t.accountStatus}`)}}const ea=(0,F.memo)(Jn);function na({refreshQuery:e,depositMethodType:n,depositMethod:a,suggestedAmount:l,changeTab:t,close:i,onSuccess:s,queryRef:r,accountRef:o,entryPoint:c}){const u=(0,C.Jc)(G,r),d=(0,te.Z)(),m=(0,C.Jc)(Q,o);if(!a.isActive)return(0,fe.jsx)(v.Z,{testID:"deposit-method-inactive",description:a.nextRequirement?.message,transferType:"deposits",onSuccess:e});switch((0,K.Kz)("deposit_modal_viewed",{action:K.Us.render,componentType:K.re.modal,depositMethod:n}),n){case"online_deposit_account":case"ach_bank_account":return $()(m,"Account must exist"),(0,fe.jsx)(bn,{queryRef:u,accountRef:m,close:i,suggestedAmount:l,onSuccess:s,entryPoint:c});case"fedwire":return $()(m,"Account must exist"),(0,fe.jsx)(ie.Z,{accountRef:m,close:i,wireDepositInformation:a.depositInformation});case"sepa":case"sepa_v2":case"uk_bank_account":return(0,fe.jsx)(Ce,{bankDepositMethod:n,depositInformation:a.depositInformation});case"swift_bank_account":return d?(0,fe.jsx)(le.Z,{close:i,depositInformation:a.depositInformation}):(0,fe.jsx)(Ae,{depositInformation:a.depositInformation,close:i});case"sofort":case"ideal_bank_account":return(0,fe.jsx)(J.Z,{onExit:i,changeTab:t,bankType:n,entryPoint:"deposit_method"});case"ZEPTO":case"zepto":return(0,fe.jsx)(ee.Z,{close:i,depositInformation:a.depositInformation});case"sg_fast":return(0,fe.jsx)(ne.Z,{close:i,depositInformation:a.depositInformation});case"sg_paynow":return(0,fe.jsx)(ae.Z,{close:i,depositInformation:a.depositInformation});case w.B:return(0,fe.jsx)(ea,{depositInformation:a.depositInformation,queryRef:u,close:i,refreshDepositMethod:e});default:{const e=new Error(`Unhandled deposit type: ${n}`);return(0,Y.cB)(e,{owner:"payment",isBoundaryError:!1,context:"DepositModal"}),null}}}const aa=(0,F.memo)(na),la=(0,h.vU)({depositFormTitle:{id:"DepositFiatModal.depositFormTitle",defaultMessage:"Add cash"},noDepositMethodsTitle:{id:"DepositFiatModal.noDepositMethodsTitle",defaultMessage:"You can't add cash to this account."},noDepositMethodsMessage:{id:"DepositFiatModal.noDepositMethodsMessage",defaultMessage:"You don't have any methods to add cash enabled."}});var ta=(0,l.ZP)(L.fe).withConfig({displayName:"DepositFiatModal___StyledModalBody",componentId:"sc-1jis4o4-0"})(["",""],(e=>e._css));function ia({accountUuid:e,defaultTab:n,suggestedAmount:a,close:l,onSuccess:t,entryPoint:i,isModal:s=!0,embeddedInModal:r=!1}){const{formatMessage:o}=(0,b.Z)(),[c,u]=(0,F.useState)(n||""),[d,m]=(0,R.W)(),{countryCode:p}=(0,Z.Z)(),g="BR"===p,y=(0,E.a)(),k=(0,C.pp)(f,{accountId:e,skipBrazilPaymentStatus:!g},(0,S.isEmpty)(d)&&g?{fetchKey:0,fetchPolicy:"network-only"}:d),{viewer:h}=k,T=(0,F.useMemo)((()=>(0,q.D)(h.policyRestrictions||[])),[h.policyRestrictions]);(0,M.OF)({entryPoint:i,transferType:"deposit"});const A=h.accountByUuidV2,{isSocialEngineeringRestrictionAfterIDVAndFM:x}=(0,O.Z)(T);(0,N.D)(p,["deposits"]);const[D,B]=(0,F.useState)(T.length>0?T[0]:void 0),j=h.accountByUuidV2?.depositInformation,z=h.accountByUuidV2?.depositInformation?.availableDepositMethods??[];(0,F.useEffect)((()=>{z.length>0&&(0,K.KQ)("loaded_fiat_deposit_information")}),[z]);let Q=c;const H=z?.some((e=>e?.type===c));H||(Q=z?.[0]?.type||"");const G=(0,F.useCallback)((()=>{m()}),[m]),X=(0,F.useCallback)((e=>{const n=T.find((n=>n.restrictionName===e));n&&B(n)}),[T]),$=(0,F.useCallback)((()=>{(0,K.Kz)("fiat_deposit_success",{action:K.Us.change,componentType:K.re.modal,entryPoint:i}),(0,K.KQ)("fiat_deposit_succeeded"),t?.()}),[i,t]),Y=(e,n,t,i)=>A?(0,fe.jsx)(aa,{accountRef:A,entryPoint:i,refreshQuery:m,depositMethodType:t,depositMethod:e,changeTab:u,close:l,suggestedAmount:a,onSuccess:$,queryRef:k,"data-element":"DepositMethod","data-component":"renderDepositMethod"}):null;(0,F.useEffect)((()=>{B(T.length>0?T[0]:void 0)}),[T]);let J=D;return!x()||D?.link?.url||D?.link?.text||(J=T[1]),(0,fe.jsx)(U.Z.Provider,{value:"deposit","data-element":"unknown","data-component":"DepositFiatModalContent",children:J?(0,fe.jsx)(L.fe,{children:(0,fe.jsx)(v.Z,{testID:"deposit-fiat-modal-restriction",title:J?.message,allRestrictions:T,description:J?.description,policyRestriction:J,transferType:"deposits",navigateToPolicyRestriction:X,onSuccess:G,image:ra(J.restrictionName)})}):(()=>{const n="limitOrderAddCash"===i,a=(0,W.Z)(j?.depositCurrency);if(y&&!n)return(0,fe.jsx)(_.TransfersWidget,{accountId:e,entryPoint:i,enabledTransferTypes:[I.Z.DEPOSIT],onSuccess:$,isModal:s,embeddedInModal:r});if(!(j?.isDepositAllowed&&z?.length>0)){if(j?.isDepositAllowed&&g){const e={type:w.B,isActive:!0,bankBlacklist:null,depositInformation:null,name:null,nextRequirement:null,supportedPaymentMethods:null};return Y(e,0,e.type,i)}return(0,fe.jsx)(L.fe,{"data-element":"ModalBody","data-component":"renderDepositInformationBlock",children:(0,fe.jsx)(v.Z,{testID:"deposit-fiat-modal-restriction-no-deposit",title:o(la.noDepositMethodsTitle),description:o(la.noDepositMethodsMessage),"data-element":"BlockingMessage"})})}if(1===z?.length||n){const e=z?.[0];return e?a?Y(e,0,e.type??"",i):(0,fe.jsx)(ta,{"data-testid":"deposit-fiat-modal",_css:n?"padding-top: 0;":"",children:Y(e,0,e.type??"",i)}):null}return(0,fe.jsx)(V.Z,{selectedValue:Q,onChange:u,"data-element":"Tabs","data-component":"renderBody",children:z.reduce(((e,n)=>{const a=(e=>{const n=z?.find((n=>n?.type===e));return n?(0,fe.jsx)(V.O,{value:e,label:n.name??"","data-element":"Tab","data-component":"renderTabForDepositMethod",children:(0,fe.jsx)(P.T,{"data-element":"ModalBodyContainer",children:Y(n,0,e,i)})},e):null})(n?.type??"");return a&&e.push(a),e}),[])})})()})}function sa(e){const{formatMessage:n}=(0,b.Z)(),{accountCurrencyCode:a,showMultiPortfolioDisclaimer:l=!1}=e,t=(0,F.useMemo)((()=>(0,W.Z)(a)),[a]),i=(0,E.a)();return(0,fe.jsxs)(L.u_,{topAligned:!0,close:e.close,"data-element":"Modal","data-component":"DepositFiatModal",children:[(0,fe.jsx)(j.Z,{view:"DEPOSIT",currencies:[a],"data-element":"SystemAlert"}),l&&(0,fe.jsx)(D.Z,{}),(0,fe.jsxs)(x.VStack,{flexGrow:1,flexShrink:1,flexBasis:"auto","data-element":"VStack",children:[!i&&!t&&(0,fe.jsx)(L.xB,{title:(0,fe.jsx)(A.Box,{testID:"deposit-fiat-modal-header",children:n(la.depositFormTitle,{currency:a})})}),(0,fe.jsx)(B.Z,{owner:"payment",boundaryName:"DepositFiatModal",context:"deposit_fiat","data-element":"ModalBoundary",children:(0,fe.jsx)(ia,{...e,"data-element":"DepositFiatModalContent"})})]})]})}const ra=e=>"jumio_face_match"===e?(0,fe.jsx)(T.HeroSquare,{name:"verifyIdDetails"}):"social_engineering_questionnaire"===e?(0,fe.jsx)(T.HeroSquare,{name:"accountUnderReview"}):void T.HeroSquare,oa=(0,F.memo)(sa)},1551:(e,n,a)=>{a.d(n,{Z:()=>Z});const l={fragment:{argumentDefinitions:t=[{defaultValue:null,kind:"LocalArgument",name:"accountId"}],kind:"Fragment",metadata:null,name:"FedWireStepsQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:i=[{kind:"Variable",name:"uuid",variableName:"accountId"}],concreteType:"Account",kind:"LinkedField",name:"accountByUuidV2",plural:!1,selections:[s={alias:null,args:null,concreteType:"AccountDepositInformation",kind:"LinkedField",name:"depositInformation",plural:!1,selections:[{alias:null,args:null,concreteType:"AccountDepositMethod",kind:"LinkedField",name:"availableDepositMethods",plural:!0,selections:[{alias:null,args:null,concreteType:"AccountDepositMethodInformation",kind:"LinkedField",name:"depositInformation",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isHighlighted",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:t,kind:"Operation",name:"FedWireStepsQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:i,concreteType:"Account",kind:"LinkedField",name:"accountByUuidV2",plural:!1,selections:[s,r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null},r],storageKey:null}]},params:{id:"f405cca5ad790f4e7169acdf7c3f9a911065f33a80847e5a2b53fd237a685510",metadata:{},name:"FedWireStepsQuery",operationKind:"query",text:null}};var t,i,s,r;l.hash="660efb998150dafa9bcff7880e9f877a";const o=l,c=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],n=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:null,kind:"LinkedField",name:"createVirtualAccountNumber",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null}],type:"BadRequestError",abstractKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"FedWireStepsMutation",selections:n,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"FedWireStepsMutation",selections:n},params:{id:"3b405df572c92effab08f9ab2319fe9d3466746da01152cc4ba57d7160851fa7",metadata:{},name:"FedWireStepsMutation",operationKind:"mutation",text:null}}}();c.hash="62ba74674db4c4ad44a229d3b4f9a35b";const u=c,d={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"FedWireStepsAccountFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null}],type:"Account",abstractKey:null,hash:"877c1fa87b020be14ad1c72fdb2c41f8"},m=d;var p=a(0),g=a(11),y=a(9),k=a(15),f=a(3601),F=a(4),S=a(156),h=a(3),b=a(139),T=a(157),A=a(1458),x=a(73),K=a(155),C=a(124),v=a(10),D=a(3901),w=a(2);const M=(0,g.vU)({gbpDepositDelayNote:{id:"WireShared.CompletionMessage.gbpDepositDelayNote",defaultMessage:"Once your transfer is received and matched to your account, your account will be credited. This can take up to 3 business days."},gbpCompletionMaskHeading:{id:"WireShared.CompletionMessage.gbpCompletionMaskHeading",defaultMessage:"We're waiting on your transfer"}});function _({hideCompletionMask:e}){const{formatMessage:n}=(0,y.Z)();return(0,w.jsx)(D.Z,{hide:e,title:n(M.gbpCompletionMaskHeading),subtitle:n(M.gbpDepositDelayNote),"data-element":"CompletionMask","data-component":"CompletionMessage"})}const I=(0,p.memo)(_),L=v.ZP.div.withConfig({displayName:"Confirmation__ReviewContainer",componentId:"sc-1mt3009-0"})(["position:relative;"]),P=v.ZP.div.withConfig({displayName:"Confirmation__Spacer",componentId:"sc-1mt3009-1"})(["height:700px;"]);function B({close:e,stepName:n}){return(0,w.jsxs)(L,{"data-element":"ReviewContainer","data-component":"Confirmation",children:[(0,w.jsx)(I,{hideCompletionMask:()=>e&&e(),"data-element":"CompletionMessage"}),(0,w.jsx)(P,{"data-element":"Spacer"})]})}var j=a(7),V=a(1439);function U({depositInformation:e,stepName:n}){return(0,j.bH)("deposit_fedwire_instructions_viewed",{componentType:j.re.page}),(0,w.jsx)(V.Z,{depositInformation:e,bankType:{type:"fedwire"},"data-element":"DepositInformation","data-component":"EnsuringDepositInstructions"})}const E=(0,p.memo)(U),R=(0,g.vU)({error:{id:"FedWireSteps.error",defaultMessage:"There was an error creating a virtual account"}});function N({close:e,accountRef:n,requirement:a,wireDepositInformation:l}){const t=(0,h.Jc)(m,n),{formatMessage:i}=(0,y.Z)(),{showErrorToast:s}=(0,C.Z)(),r=(0,K.Z)(),[c]=(0,h.Db)(u),d=a?"requirement":"info",g=(0,p.useMemo)((()=>l?.find((e=>"account_number"===e?.key&&e.value))),[l]),F=(0,p.useCallback)((async()=>{await r(o,{accountId:t.uuid},{fetchPolicy:"network-only"})}),[r,t.uuid]),v=(0,p.useCallback)((({accountUuid:e,hasAccountNumber:n})=>new Promise(((a,l)=>{n?a(!0):c({variables:{input:{accountUuid:e}},onCompleted:({response:e})=>{(0,h.V4)(e.createVirtualAccountNumber).when("CreateVirtualAccountNumberSuccess",(async()=>{await F(),a(!0)})).when("BadRequestError",(({code:e,message:n})=>{(0,k.cB)(new Error("Error creating VAN or refreshing fedwire deposit information"),{owner:"payment",context:"fedwire_steps",error:`code: ${e} | message: ${n}`}),l(!1)})).otherwise((e=>{(0,k.cB)(new Error("Error creating VAN or refreshing fedwire deposit information"),{owner:"payment",context:"fedwire_steps",error:`${e}`}),l(!1)}))},onError:({alreadyReportedError:e})=>{(0,k.cB)((0,S.Xv)(e),{owner:"payment",context:"fedwire_steps",error:`name: ${e.name} | message: ${e.message} | cause: ${e.cause}`}),l(!1)}})}))),[c,F]);return(0,f.Z)({uniqueKey:"FedWireSteps",fetcher:v,params:{accountUuid:t.uuid,hasAccountNumber:Boolean(g)}}),(0,w.jsx)(b.Z,{owner:"payment",onCatch:()=>{s(i(R.error))},context:"fedwire","data-element":"ErrorBoundary","data-component":"FedWireStepsContent",children:(0,w.jsx)(T.Z,{owner:"payment",boundaryName:"FedWireSteps",onCatch:()=>{s(i(R.error))},context:"fedwire","data-element":"NetworkErrorBoundary",children:(0,w.jsxs)(x.ZP,{defaultStep:d,"data-element":"Stepper",children:[(0,w.jsx)(A.Z,{stepName:"requirement",requirement:a,nextStep:"info","data-element":"RequirementsStep"}),(0,w.jsx)(E,{stepName:"info",depositInformation:l,"data-element":"DepositInstructions"}),(0,w.jsx)(B,{close:e,stepName:"final","data-element":"Confirmation"})]})})})}function O(e){return(0,w.jsx)(h.zq,{instrumentationId:"FedWireSteps",fallback:(0,w.jsxs)(F.VStack,{gap:1,children:[(0,w.jsx)(F.Fallback,{width:150,height:45}),(0,w.jsx)(F.Fallback,{width:65,height:45,percentage:!0})]}),"data-element":"InstrumentedSuspense","data-component":"FedWireSteps",children:(0,w.jsx)(N,{...e,"data-element":"FedWireStepsContent"})})}const Z=(0,p.memo)(O)},1421:(e,n,a)=>{a.d(n,{ZP:()=>g});var l=a(0),t=a(11),i=a(9),s=a(35),r=a(61),o=a(4),c=a(14),u=a(7),d=a(2);const m=(0,t.vU)({title:{id:"PendingPixAccount.title",defaultMessage:"We’re reviewing your info"},body:{id:"PendingPixAccount.body",defaultMessage:"We will contact you once the review is complete, which can take up to 2 days. After your info is verified, you will be able to purchase cryptocurrency"},button:{id:"PendingPixAccount.button",defaultMessage:"Go to home"}});function p({close:e}){const{formatMessage:n}=(0,i.Z)();return(0,u.bH)("pix_pending_account_deposit_view",{componentType:u.re.modal}),(0,d.jsxs)(o.VStack,{spacing:2,gap:4,"data-element":"VStack","data-component":"PendingPixAccount",children:[(0,d.jsxs)(o.VStack,{justifyContent:"center",alignItems:"center",gap:3,"data-element":"VStack",children:[(0,d.jsx)(r.HeroSquare,{name:"pending","data-element":"HeroSquare"}),(0,d.jsxs)(o.VStack,{gap:1,"data-element":"VStack",children:[(0,d.jsx)(c.TextTitle3,{as:"h1","data-element":"TextTitle3",children:n(m.title)}),(0,d.jsx)(c.TextBody,{as:"p",color:"foregroundMuted","data-element":"TextBody",children:n(m.body)})]})]}),(0,d.jsx)(s.ButtonGroup,{block:!0,accessibilityLabel:"Footer buttons","data-element":"ButtonGroup",children:(0,d.jsx)(s.Button,{onPress:e,"data-element":"Button",children:n(m.button)})})]})}const g=(0,l.memo)(p)},853:(e,n,a)=>{a.d(n,{v:()=>r});var l=a(0),t=a(3),i=a(2);const s=(0,l.lazy)((()=>Promise.all([a.e(0),a.e(1),a.e(3),a.e(13),a.e(12),a.e(14),a.e(27),a.e(28),a.e(48),a.e(2),a.e(4),a.e(5),a.e(8),a.e(9),a.e(10),a.e(16),a.e(22),a.e(25),a.e(26),a.e(29),a.e(32),a.e(31),a.e(34),a.e(38),a.e(37),a.e(6),a.e(7),a.e(11),a.e(15),a.e(17),a.e(18),a.e(19),a.e(20),a.e(21),a.e(23),a.e(35),a.e(39),a.e(40),a.e(42),a.e(43),a.e(49),a.e(2886)]).then(a.bind(a,953))));function r(e){return(0,i.jsx)(t.zq,{instrumentationId:"LazyDepositFiatModal",fallback:null,"data-element":"InstrumentedSuspense","data-component":"LazyDepositFiatModal",children:(0,i.jsx)(s,{...e,"data-element":"LazyDepositFiatModalContent"})})}},2296:(e,n,a)=>{a.r(n),a.d(n,{DepositRoute:()=>b});const l={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"DepositRouteQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:"Account",kind:"LinkedField",name:"fiatAccounts",plural:!0,selections:[t={alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"primary",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"allowDeposits",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[r={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null}],type:"TiersCurrency",abstractKey:null}],storageKey:null}],storageKey:null},{alias:null,args:o=[{kind:"Literal",name:"transferType",value:"deposits"},{kind:"Literal",name:"walletApp",value:!1}],concreteType:"AvailablePaymentMethodV2",kind:"LinkedField",name:"availablePaymentMethodsV2",plural:!0,selections:[c={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:'availablePaymentMethodsV2(transferType:"deposits",walletApp:false)'}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"DepositRouteQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:"Account",kind:"LinkedField",name:"fiatAccounts",plural:!0,selections:[t,i,s,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},r,{kind:"InlineFragment",selections:[u={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Node",abstractKey:"__isNode"}],storageKey:null},u],storageKey:null},{alias:null,args:o,concreteType:"AvailablePaymentMethodV2",kind:"LinkedField",name:"availablePaymentMethodsV2",plural:!0,selections:[c,u],storageKey:'availablePaymentMethodsV2(transferType:"deposits",walletApp:false)'},u],storageKey:null}]},params:{id:"db108530563661053b521bd28f0ef2bca5205fd9a4613d06a3b2015978c999d3",metadata:{},name:"DepositRouteQuery",operationKind:"query",text:null}};var t,i,s,r,o,c,u;l.hash="e1629ab48103aa21f864651049ccd326";const d=l;var m=a(0),p=a(32),g=a(3),y=a(1400),k=a(105),f=a(360),F=a(123),S=a(2);function h(){const{viewer:e}=(0,g.pp)(d,{}),n=(0,m.useMemo)((()=>(0,F.D)(e.fiatAccounts||[])),[e.fiatAccounts]),a=(0,k.Z)(),l=(0,f.Z)(),t=(0,m.useMemo)((()=>{const e=n.find((e=>e.primary));if(e)return e;const l=n.find((e=>e.assetOrFiatCurrency?.code===a));return l||n.find((e=>e.allowDeposits))}),[n,a]);if(t&&t.uuid){const n=l.get("type"),a=e?.availablePaymentMethodsV2?.some((e=>e?.type?.toLowerCase()===n)),i=n&&a?`?type=${n}`:"";return(0,S.jsx)(p.l_,{to:`/accounts/${t.uuid}/deposit${i}`})}return(0,S.jsx)(p.l_,{to:"/assets","data-element":"Redirect","data-component":"DepositRouteContent"})}function b(){return(0,S.jsx)(g.zq,{instrumentationId:"DepositRoute",fallback:(0,S.jsx)(y.Z,{}),"data-element":"InstrumentedSuspense","data-component":"DepositRoute",children:(0,S.jsx)(h,{"data-element":"DepositRouteContent"})})}},2304:(e,n,a)=>{a.r(n),a.d(n,{default:()=>E});const l={fragment:{argumentDefinitions:t=[{defaultValue:null,kind:"LocalArgument",name:"input"}],kind:"Fragment",metadata:null,name:"VaultDepositModalMutation",selections:[{alias:null,args:i=[{kind:"Variable",name:"input",variableName:"input"}],concreteType:null,kind:"LinkedField",name:"createAccountAddress",plural:!1,selections:[s={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Address",kind:"LinkedField",name:"address",plural:!1,selections:[r={alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null}],storageKey:null}],type:"CreateAccountAddressSuccess",abstractKey:null},o={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null}],type:"BadRequestError",abstractKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:t,kind:"Operation",name:"VaultDepositModalMutation",selections:[{alias:null,args:i,concreteType:null,kind:"LinkedField",name:"createAccountAddress",plural:!1,selections:[s,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Address",kind:"LinkedField",name:"address",plural:!1,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],type:"CreateAccountAddressSuccess",abstractKey:null},o],storageKey:null}]},params:{id:"b46ec69046576ea108dbee2b60e36bedf219e399e22a74dc274818f9f2e72cdd",metadata:{},name:"VaultDepositModalMutation",operationKind:"mutation",text:null}};var t,i,s,r,o;l.hash="796a00362e8bf2b34ad8a18d7206ffba";const c=l,u=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"accountUuid"}],n=[{kind:"Variable",name:"uuid",variableName:"accountUuid"}],a={alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"allowDeposits",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"platformName",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"exponent",storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"imageUrl",storageKey:null},d=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null}],m={alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"availableBalance",plural:!1,selections:d,storageKey:null},p={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null},c],type:"TiersCurrency",abstractKey:null},g={kind:"InlineFragment",selections:[r],type:"Node",abstractKey:"__isNode"},y={kind:"TypeDiscriminator",abstractKey:"__isAssetOrCurrency"},k={alias:null,args:null,concreteType:"Amount",kind:"LinkedField",name:"availableBalanceInNativeCurrency",plural:!1,selections:d,storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"VaultDepositModalContentQuery",selections:[{args:null,kind:"FragmentSpread",name:"TransferFormFragment"},{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{kind:"RequiredField",field:{alias:null,args:n,concreteType:"Account",kind:"LinkedField",name:"accountByUuidV2",plural:!1,selections:[a,l,t,i,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[s,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Asset",kind:"LinkedField",name:"asset",plural:!1,selections:[i],storageKey:null}],type:"ViewerAsset",abstractKey:null}],storageKey:null},{args:null,kind:"FragmentSpread",name:"useVaultDepositModalStateFragment"}],storageKey:null},action:"THROW",path:"viewer.accountByUuidV2"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"VaultDepositModalContentQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:"UserProperties",kind:"LinkedField",name:"userProperties",plural:!1,selections:[{alias:null,args:null,concreteType:"SecondFactor",kind:"LinkedField",name:"secondFactor",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"twoFactorMethod",storageKey:null}],storageKey:null},r],storageKey:null},r,{alias:null,args:n,concreteType:"Account",kind:"LinkedField",name:"accountByUuidV2",plural:!1,selections:[a,l,t,i,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[s,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Asset",kind:"LinkedField",name:"asset",plural:!1,selections:[i,r,o,{alias:null,args:null,kind:"ScalarField",name:"displaySymbol",storageKey:null},c,u],storageKey:null},{alias:null,args:null,concreteType:"Account",kind:"LinkedField",name:"accounts",plural:!0,selections:[a,l,m,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[s,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Asset",kind:"LinkedField",name:"asset",plural:!1,selections:[o,r,c,u],storageKey:null}],type:"ViewerAsset",abstractKey:null},p,g,y],storageKey:null},i,k,r],storageKey:null}],type:"ViewerAsset",abstractKey:null},g,p,y],storageKey:null},m,k,r],storageKey:null}],storageKey:null}]},params:{id:"c4acef448a2967c52fcdbd6d9643acf46590005840470fc585d8bae1dc3cacc5",metadata:{},name:"VaultDepositModalContentQuery",operationKind:"query",text:null}}}();u.hash="8dc860f4f4fb54a04e0a41a670ea02fe";const d=u;var m=a(0),p=a(11),g=a(9),y=a(10),k=a(48),f=a(15),F=a(156),S=a(3),h=a(1446),b=a(3597),T=a(65),A=a(355),x=a(1552),K=a(1504),C=a(1523),v=a(3673);const D={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"useVaultDepositModalStateFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Asset",kind:"LinkedField",name:"asset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"platformName",storageKey:null}],storageKey:null}],type:"ViewerAsset",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null}],type:"TiersCurrency",abstractKey:null}],storageKey:null},{args:null,kind:"FragmentSpread",name:"useTransferModalStateFragment"}],type:"Account",abstractKey:null,hash:"abd47f28fcb85d846cbb0341926aafa7"},w=D;var M=a(3642),_=a(214);const I=({accountRef:e,closeModal:n})=>{const a=(0,S.Jc)(w,e),l="ViewerAsset"===a.assetOrFiatCurrency?.__typename?a.assetOrFiatCurrency.asset.platformName||"":"TiersCurrency"===a.assetOrFiatCurrency?.__typename?a.assetOrFiatCurrency.code:"",t=(0,M.Z)({accountRef:a,closeModal:n}),{uuid:i}=a,{accounts:s,clearServerError:r,activeAccountUuid:o,amount:c,showServerError:u,setLoading:d,setStep:p}=t,g=(0,m.useMemo)((()=>s.find((e=>e?.uuid===o))),[s,o]),[y,k]=(0,m.useState)("account"),h=g?.availableBalance.value||"0",b=(0,m.useMemo)((()=>s.filter((e=>e.uuid!==i&&"COLLATERAL"!==e.type&&!["VAULT","MULTISIG_VAULT","MULTISIG"].includes(e.type)))),[s,i]),T=(0,m.useCallback)((async()=>{r(),d(!0);try{await _.L.post(`/v2/accounts/${o}/transactions`,{type:"transfer",to:a.uuid,amount:c,currency:l}),p("success")}catch(e){u(e),(0,f.cB)((0,F.Xv)(e),{owner:"payment",context:"deposit_modal"})}d(!1)}),[r,l,o,c,u,d,a.uuid,p]);return{...t,mode:"transferToVault",activeTab:y,changeTab:k,maxAmount:h,availableAccounts:b,submitForm:T}};var L=a(2);const P=(0,p.vU)({headerTitle:{id:"VaultDepositModal.1234567.headerTitle",defaultMessage:"Transfer into {accountName}"},dismissErrorBanner:{id:"VaultDepositModal.1234567.dismissErrorBanner",defaultMessage:"Dismiss"},accountTab:{id:"VaultDepositModal.1234567.accountTab",defaultMessage:"From Account"},addressTab:{id:"VaultDepositModal.1234567.addressTab",defaultMessage:"{currencyName} Address"}});function B(e){return null}function j({accountUuid:e,close:n}){const a=(0,S.pp)(d,{accountUuid:e}),[l]=(0,S.Db)(c),t=a.viewer.accountByUuidV2,i=I({accountRef:t,closeModal:n}),{activeAccountUuid:s,changeTab:r,activeTab:o,serverError:u,clearServerError:p,step:y,closeModal:k}=i;(0,m.useEffect)((()=>{s||r("address")}),[]);const{formatMessage:A}=(0,g.Z)(),[D,w]=(0,m.useState)(void 0),[M,_]=(0,m.useState)(!1),j=!(0,m.useMemo)((()=>["MULTISIG_VAULT","MULTISIG"].includes(t.type)),[t.type])&&t.allowDeposits,V="ViewerAsset"===t.assetOrFiatCurrency?.__typename?t.assetOrFiatCurrency.asset.name:"";return(0,m.useEffect)((()=>{j?l({variables:{input:{accountUuid:e}},onCompleted:({response:e})=>{(0,S.V4)(e.createAccountAddress).when("CreateAccountAddressSuccess",(e=>{w(e.address?.uuid)})).when("BadRequestError",(({code:e,message:n})=>{_(!0),(0,f.cB)(new Error("Error creating or fetching vault deposit address"),{owner:"payment",context:"vault_deposit_modal",error:`code: ${e} | message: ${n}`})})).otherwise((e=>{_(!0),(0,f.cB)(new Error("Error creating or fetching vault deposit address"),{owner:"payment",context:"vault_deposit_modal",error:`${e}`})}))},onError:({alreadyReportedError:e})=>{_(!0),(0,f.cB)((0,F.Xv)(e),{owner:"payment",context:"vault_deposit_modal",error:`name: ${e.name} | message: ${e.message} | cause: ${e.cause}`})}}):n()}),[]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(T.xB,{title:A(P.headerTitle,{accountName:t.name})}),(0,L.jsxs)(x.Z,{selectedValue:o,onChange:r,children:[!!s&&(0,L.jsxs)(x.O,{value:"account",label:A(P.accountTab),children:[!!u&&(0,L.jsx)(h.Z,{inline:!0,subtitle:u,type:"error",onClickPrimary:p,primaryLabel:A(P.dismissErrorBanner)}),(0,L.jsx)(T.fe,{children:"form"===y?(0,L.jsx)(K.Z,{queryRef:a,store:i}):(0,L.jsx)(C.Z,{handleClose:k})})]}),!M&&(0,L.jsx)(x.O,{value:"address",label:A(P.addressTab,{currencyName:V}),children:D?(0,L.jsx)(v.Z,{accountId:t.uuid,entryPoint:"vault"}):(0,L.jsx)(T.fe,{children:(0,L.jsx)(U,{align:"center",justify:"center",children:(0,L.jsx)(b.Z,{})})})})]}),(0,L.jsx)(B,{state:i})]})}function V({accountUuid:e,close:n}){return(0,L.jsx)(T.u_,{close:n,"data-element":"Modal","data-component":"VaultDepositModal",children:(0,L.jsx)(A.Z,{owner:"payment",boundaryName:"AvailableBalance",context:"available_balance","data-element":"ModalBoundary",children:(0,L.jsx)(j,{accountUuid:e,close:n,"data-element":"VaultDepositModalContent"})})})}const U=(0,y.ZP)(k.Z).withConfig({displayName:"VaultDepositModal__DepositAddressLoader",componentId:"lt1cpk-0"})(["min-height:315px;"]),E=(0,m.memo)(V)},2297:(e,n,a)=>{a.r(n),a.d(n,{WithdrawRoute:()=>h});const l={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"WithdrawRouteQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:"Account",kind:"LinkedField",name:"fiatAccounts",plural:!0,selections:[t={alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"primary",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"allowDeposits",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[r={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"code",storageKey:null}],type:"TiersCurrency",abstractKey:null}],storageKey:null}],storageKey:null},{alias:null,args:o=[{kind:"Literal",name:"transferType",value:"deposits"},{kind:"Literal",name:"walletApp",value:!1}],concreteType:"AvailablePaymentMethodV2",kind:"LinkedField",name:"availablePaymentMethodsV2",plural:!0,selections:[c={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:'availablePaymentMethodsV2(transferType:"deposits",walletApp:false)'}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"WithdrawRouteQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:"Account",kind:"LinkedField",name:"fiatAccounts",plural:!0,selections:[t,i,s,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"assetOrFiatCurrency",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},r,{kind:"InlineFragment",selections:[u={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Node",abstractKey:"__isNode"}],storageKey:null},u],storageKey:null},{alias:null,args:o,concreteType:"AvailablePaymentMethodV2",kind:"LinkedField",name:"availablePaymentMethodsV2",plural:!0,selections:[c,u],storageKey:'availablePaymentMethodsV2(transferType:"deposits",walletApp:false)'},u],storageKey:null}]},params:{id:"cc0806e33573c4bd990f13b2ebef3bdc98604d34090b10a465aca18cd2a95903",metadata:{},name:"WithdrawRouteQuery",operationKind:"query",text:null}};var t,i,s,r,o,c,u;l.hash="a7e7bc6877e3ece471d7c444bbc5b177";const d=l;var m=a(0),p=a(32),g=a(3),y=a(1400),k=a(105),f=a(123),F=a(2);function S(){const{viewer:e}=(0,g.pp)(d,{}),n=(0,m.useMemo)((()=>(0,f.D)(e.fiatAccounts||[])),[e.fiatAccounts]),a=(0,k.Z)(),l=(0,m.useMemo)((()=>{const e=n.find((e=>e.primary));if(e)return e;const l=n.find((e=>e.assetOrFiatCurrency?.code===a));return l||n.find((e=>e.allowDeposits))}),[n,a]);return l&&l.uuid?(0,F.jsx)(p.l_,{to:`/accounts/${l.uuid}/withdraw`}):(0,F.jsx)(p.l_,{to:"/assets","data-element":"Redirect","data-component":"WithdrawRouteContent"})}function h(){return(0,F.jsx)(g.zq,{instrumentationId:"WithdrawRoute",fallback:(0,F.jsx)(y.Z,{}),"data-element":"InstrumentedSuspense","data-component":"WithdrawRoute",children:(0,F.jsx)(S,{"data-element":"WithdrawRouteContent"})})}},1432:(e,n,a)=>{a.d(n,{e:()=>r});var l=a(0),t=a(3),i=a(2);const s=(0,l.lazy)((()=>Promise.all([a.e(12),a.e(156)]).then(a.bind(a,1473))));function r(e){return(0,i.jsx)(t.zq,{instrumentationId:"LazyDepositModal",fallback:null,"data-element":"InstrumentedSuspense","data-component":"LazyDepositModal",children:(0,i.jsx)(s,{...e,"data-element":"DepositModal"})})}}}]);
//# sourceMappingURL=depositmodal-b40621d8b91ed28d.js.map