(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[9807],{734910(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{e:()=>f,uY:()=>w});var t=__webpack_require__(860012);var e=__webpack_require__(48084);var l=__webpack_require__(60746);__webpack_require__.n(l);var n=__webpack_require__(619489);var r=__webpack_require__(456895);__webpack_require__.n(r);var u=__webpack_require__(738012);var a=__webpack_require__(768466);var i=__webpack_require__(895175);var s=__webpack_require__(127565);var o=__webpack_require__(79222);var c=__webpack_require__(962331);var d=__webpack_require__(589628);var v=__webpack_require__(950887);var h=__webpack_require__(86111);"use no memo";let f=({quote:l,fromAddress:n,fromAddressAccount:u,chainId:a})=>{let s=(0,e.wA)();let[d,f]=(0,t.useState)(!1);let[w,S]=(0,t.useState)(null);let[k,m]=(0,t.useState)(!1);let[p,I]=(0,t.useState)(!1);let b=(0,i.Z)(l?.requestId);let[g,A]=(0,t.useState)(null);let y=(0,e.d4)(v.Sc);let T=(0,e.d4)(v.R6);let{accounts:q}=(0,h.G)();let $=(0,t.useRef)(new Map);let[C,E]=(0,t.useState)(null);let G=(0,t.useCallback)((0,r.debounce)(async(t,e)=>{S(null),m(!1),f(!1),I(!1)},750),[s]);let M=(0,t.useCallback)(async t=>{if(!!1||!t||!n||!a||!y){S(null),m(!1),A(null),f(!1),I(!1);return}f(!0),I(!1);let e=null;try{if(!await s((0,o.ggM)(q))){S(null),m(!1),A(null),I(!1),f(!1);return}if(!(e=(0,c.B)(n,a))){S(null),I(!1),m(!1),A(null),f(!1);return}let l=await s((0,o.NSN)(e));A(l);let r=l;if(!l&&u&&(r=await s((0,o.J$j)({account:u}))),m(r),S(null),I(!1),!r||!l){f(!1);return}await G(t,e)}catch{f(!1),m(!1),S(null),A(null),I(!1)}},[n,a,y,s,u,G]);return(0,t.useEffect)(()=>{b!==l?.requestId&&M(l)},[M,l?.requestId,l,b]),(0,t.useEffect)(()=>{n&&T!==null?($.current.set(n,T),E(T)):n?E($.current.get(n)??null):E(null)},[T,n]),(0,t.useEffect)(()=>{C!==null&&g===!1&&M(l)},[C,g,M,l]),{shouldShowRewardsRow:k,isLoading:d,estimatedPoints:w,hasError:p,accountOptedIn:g,rewardsAccountScope:l&&k?u:null}};let w=({activeQuote:t})=>{let l=(0,e.d4)(u.G8);let r=(0,e.d4)(u.dJ);let i=(0,e.d4)(u.WZ);let o=(0,s.t)(a.aN);let c=o?(0,n.Kr)(o.toString()):null;let v=(0,e.d4)(t=>c?(0,d.zH)(t,c):null);return f({quote:l&&r&&i?.srcTokenAmount&&v?.address?t:null,fromAddress:v?.address,fromAddressAccount:v,chainId:o?.toString()})}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},837844(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{Y5:()=>r,eh:()=>n});var t=__webpack_require__(477322);var e=__webpack_require__(242317);var l=__webpack_require__(280501);let n=n=>{if(!n)return"unknown";let{type:r,metadata:u}=n;let a=u?.keyring?.type;let i=u?.snap?.id;return a&&[l.rI.ledger,l.rI.trezor,l.rI.oneKey,l.rI.lattice,l.rI.qr].includes(a)?"hardware":(0,a===l.rI.simple)?"private-key":(0,a===l.rI.snap&&i==="npm:@metamask/institutional-wallet-snap")?"institutional-evm":(0,(0,e.a)(r))?"evm":(0,r===t.Ux.DataAccount)?"solana":(0,Object.values(t.fi).includes(r))?"bitcoin":(0,r===t.mA.Eoa)?"tron":(0,"unknown")};let r=t=>{return n(t)==="hardware"}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);