(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[1474],{251474(__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__,{H:()=>o});var e=__webpack_require__(303280);__webpack_require__.n(e);var t=__webpack_require__(860012);var l=__webpack_require__(521476);var r=__webpack_require__.n(l);var n=__webpack_require__(48084);var a=__webpack_require__(365337);var u=__webpack_require__(657218);var s=__webpack_require__(880909);var i=__webpack_require__(683683);var c=__webpack_require__(509289);function o(l){let o=(0,e.c)(29);let{tokens:h,address:m,includeFailedTokens:f,hideZeroBalanceTokens:v}=l;let b=f===undefined?!1:f;let g=v===undefined?!1:v;let{chainId:S,rpcUrl:_}=(0,n.d4)(u.Iv);let{address:p}=(0,n.d4)(a._,n.bN);let k=m??p;let T;o[0]!==h?.length?(T=()=>h?.length>=0,o[0]=h?.length,o[1]=T):T=o[1];let[w,y]=(0,t.useState)(T);let $;o[2]===Symbol.for("react.memo_cache_sentinel")?($=[],o[2]=$):$=o[2];let[C,E]=(0,t.useState)($);let[R,A]=(0,t.useState)(null);let L=(0,t.useRef)(null);let B=(0,c.S)(h);let H;o[3]!==g||o[4]!==B?(H=e=>{E((g?e.filter(d):e).map(e=>{let t=B.find(t=>(0,i.y)(t.address,e.address));return{...e,isERC721:t?.isERC721,image:t?.image}})),y(!1),A(null)},o[3]=g,o[4]=B,o[5]=H):H=o[5];let I=H;let M;o[6]===Symbol.for("react.memo_cache_sentinel")?(M=e=>{A(e),y(!1)},o[6]=M):M=o[6];let N=M;let P;o[7]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{L.current&&(L.current.stop(),L.current.removeAllListeners("update"),L.current.removeAllListeners("error"),L.current=null)},o[7]=P):P=o[7];let Z=P;let q;o[8]!==b||o[9]!==I?(q=(e,t)=>{Z(),L.current=new(r())({userAddress:e,provider:globalThis.ethereumProvider,tokens:t,includeFailedTokens:b,pollingInterval:s.Z2*8,balanceDecimals:5}),L.current.on("update",I),L.current.on("error",N),L.current.updateBalances()},o[8]=b,o[9]=I,o[10]=q):q=o[10];let D=q;let F;let G;o[11]===Symbol.for("react.memo_cache_sentinel")?(G=()=>Z,F=[Z],o[11]=F,o[12]=G):(F=o[11],G=o[12]),(0,t.useEffect)(G,F);let j=`${k??""}|${S??""}|${_??""}`;let[x,z]=(0,t.useState)(j);let[J,K]=(0,t.useState)(B);(j!==x||B!==J)&&(z(j),K(B),y(!0),B.length===0&&(E([]),y(!1),A(null)));let O;o[13]!==D||o[14]!==S||o[15]!==B||o[16]!==k?(O=()=>{if(!k||S===undefined||!globalThis.ethereumProvider||B.length===0){Z();return}queueMicrotask(()=>{D(k,B)})},o[13]=D,o[14]=S,o[15]=B,o[16]=k,o[17]=O):O=o[17];let Q;o[18]!==D||o[19]!==S||o[20]!==B||o[21]!==_||o[22]!==I||o[23]!==k?(Q=[k,Z,S,_,B,I,D],o[18]=D,o[19]=S,o[20]=B,o[21]=_,o[22]=I,o[23]=k,o[24]=Q):Q=o[24],(0,t.useEffect)(O,Q);let U;return o[25]!==R||o[26]!==w||o[27]!==C?(U={loading:w,tokensWithBalances:C,error:R},o[25]=R,o[26]=w,o[27]=C,o[28]=U):U=o[28],U}function d(e){return Number(e.balance)>0}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);