(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 r=__webpack_require__(60746);__webpack_require__.n(r);var l=__webpack_require__(619489);var n=__webpack_require__(456895);__webpack_require__.n(n);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:r,fromAddress:l,fromAddressAccount:u,chainId:a})=>{let s=(0,e.wA)();let[d,f]=(0,t.useState)(!1);let[w,S]=(0,t.useState)(null);let[m,p]=(0,t.useState)(!1);let[I,k]=(0,t.useState)(!1);let g=(0,i.Z)(r?.requestId);let[b,A]=(0,t.useState)(null);let T=(0,e.d4)(v.Sc);let y=(0,e.d4)(v.R6);let{accounts:$}=(0,h.G)();let C=(0,t.useRef)(new Map);let[_,q]=(0,t.useState)(null);let E=(0,t.useCallback)((0,n.debounce)(async(t,e)=>{S(null),p(!1),f(!1),k(!1)},750),[s]);let G=(0,t.useCallback)(async t=>{if(!!1||!t||!l||!a||!T){S(null),p(!1),A(null),f(!1),k(!1);return}f(!0),k(!1);let e=null;try{if(!await s((0,o.ggM)($))){S(null),p(!1),A(null),k(!1),f(!1);return}if(!(e=(0,c.B)(l,a))){S(null),k(!1),p(!1),A(null),f(!1);return}let r=await s((0,o.NSN)(e));A(r);let n=r;if(!r&&u&&(n=await s((0,o.J$j)({account:u}))),p(n),S(null),k(!1),!n||!r){f(!1);return}await E(t,e)}catch{f(!1),p(!1),S(null),A(null),k(!1)}},[l,a,T,s,u,E]);return(0,t.useEffect)(()=>{g!==r?.requestId&&G(r)},[G,r?.requestId,r,g]),(0,t.useEffect)(()=>{l&&y!==null?(C.current.set(l,y),q(y)):l?q(C.current.get(l)??null):q(null)},[y,l]),(0,t.useEffect)(()=>{_!==null&&b===!1&&G(r)},[_,b,G,r]),{shouldShowRewardsRow:m,isLoading:d,estimatedPoints:w,hasError:I,accountOptedIn:b,rewardsAccountScope:r&&m?u:null}};let w=({activeQuote:t})=>{let r=(0,e.d4)(u.G8);let n=(0,e.d4)(u.dJ);let i=(0,e.d4)(u.WZ);let o=(0,s.t)(a.aN);let c=o?(0,l.Kr)(o.toString()):null;let v=(0,e.d4)(t=>c?(0,d.zH)(t,c):null);return f({quote:r&&n&&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:()=>n,eh:()=>l});var t=__webpack_require__(477322);var e=__webpack_require__(242317);var r=__webpack_require__(280501);let l=l=>{if(!l)return"unknown";let{type:n,metadata:u}=l;let a=u?.keyring?.type;let i=u?.snap?.id;return a&&[r.rI.ledger,r.rI.trezor,r.rI.oneKey,r.rI.lattice,r.rI.qr].includes(a)?"hardware":(0,a===r.rI.simple)?"private-key":(0,a===r.rI.snap&&i==="npm:@metamask/institutional-wallet-snap")?"institutional-evm":(0,(0,e.a)(n))?"evm":(0,n===t.Ux.DataAccount)?"solana":(0,Object.values(t.fi).includes(n))?"bitcoin":(0,n===t.mA.Eoa)?"tron":(0,"unknown")};let n=t=>{return l(t)==="hardware"}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},962331(__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__,{B:()=>a});var t=__webpack_require__(619489);var e=__webpack_require__(142282);var r=__webpack_require__(760184);var l=__webpack_require__(171097);var n=__webpack_require__.n(l);var u=__webpack_require__(776500);let a=(l,a)=>{try{let n=(0,t.Kr)(a);let{namespace:i,reference:s}=(0,e.rW)(n);let o=(0,r.Cv)(l)?(0,u.sX)(l):l;return(0,e.pI)(i,s,o)}catch(t){return n().error("[rewards-utils] Error formatting account to CAIP-10:",t),null}}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);