PageSourceSearch

https://assets.debank.com/static/js/3644.337aeb89.chunk.js

js debank.com collected 2026-10-01 10:34:11 UTC 25,716 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkdefi_insight_react=self.webpackChunkdefi_insight_react||[]).push([[3644],{35204:(e,n,t)=>{t.d(n,{p:()=>i});var s=t(12919),l=t(74772),d=t(39615);const i=e=>{const{title:n,isOpen:t,onClose:i,onConfirm:a,type:o,includeOfficialAccount:r}=e;return(0,d.jsxs)(l.W,{on:t,className:"db-add-addressModal",onRequestClose:i,children:[n&&(0,d.jsx)("div",{className:"db-add-addressModal-title",children:n}),(0,d.jsx)("div",{className:"db-add-addressModal-content",children:(0,d.jsx)(s.Z,{isShowRecent:!1,inputClassName:"db-add-addressModal-input",type:o,inParent:!1,isLimitHeight:!0,onSelect:a,includeOfficialAccount:r,panelClassName:"db-add-addressModal-panel"})})]})}},43502:(e,n,t)=>{t.d(n,{V:()=>j});var s=t(25038),l=t(44385),d=t(32856),i=t(55129),a=t(36160),o=t(90500),r=t(27559),u=t(88516),c=t(84667),m=t(32938),_=t(62921),h=t(86564),b=t(51706);const p={bundleBtn:"AccountList_bundleBtn__lzfbt",bundleDropdown:"AccountList_bundleDropdown__7Gh8y",bundleDropdownItem:"AccountList_bundleDropdownItem__IJso9",bundleDropdownNew:"AccountList_bundleDropdownNew__uBCU7",newInput:"AccountList_newInput__goe3s",bundleDropdownDelete:"AccountList_bundleDropdownDelete__gchLy",userInfo:"AccountList_userInfo__v3xzi",netWorth:"AccountList_netWorth__RJSKm",tokenIcon:"AccountList_tokenIcon__Y6Hp9",nftIcon:"AccountList_nftIcon__p+XPH",tagList:"AccountList_tagList__0Css4",tag:"AccountList_tag__xm+Xy",nftTag:"AccountList_nftTag__GanTw",popover:"AccountList_popover__DK4Qb",item:"AccountList_item__IoEef",label:"AccountList_label__Km1No",value:"AccountList_value__GLCBZ",token:"AccountList_token__aYQrL",alignEnd:"AccountList_alignEnd__GY7GB",accountList:"AccountList_accountList__rHgz-",userId:"AccountList_userId__uT5sf"};var v=t(39615);const x=e=>{let{address:n,bundleId:t,bundleLimt:l=5}=e;const{t:d}=(0,o.$G)(),{data:i,showNewInput:r,inputRef:_,handleToggleNew:h,handleNewEnter:b,preventDefault:x,handleVisbileChange:j}=(0,a.zM)(),{mutate:y}=(0,a.xZ)((()=>{})),{mutate:g}=(0,a.ZR)(),L=(0,s.useMemo)((()=>{var e;return[{label:d("AccountList_columns.1jcgjxk"),children:null===i||void 0===i||null===(e=i.filter((e=>e.id!==t)))||void 0===e?void 0:e.map((e=>({label:e.name,onClick:()=>y({bundleId:e.id,address:n})})))}]}),[t,i,y,n,d]),f=(0,s.useCallback)((()=>{g({bundleId:t,addr:n})}),[g,t,n]),k=(0,s.useCallback)((e=>{b(e,[n])}),[b,n]);return i?(0,v.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,v.jsx)(c.L,{overlayClassName:p.bundleDropdown,data:L,onVisibleChange:j,subfix:(0,v.jsxs)("div",{className:p.bundleDropdownAction,children:[(null===i||void 0===i?void 0:i.length)<l&&(0,v.jsx)("div",{className:p.bundleDropdownNew,children:r?(0,v.jsx)(m.II,{className:p.newInput,ref:_,placeholder:d("AccountList_columns.t6233r"),onPressEnter:k,onClick:x,maxLength:128}):(0,v.jsxs)("div",{onClick:h,children:["+ ",d("AccountList_columns.t6233r")]})}),t?(0,v.jsx)("div",{className:p.bundleDropdownDelete,onClick:f,children:d("AccountList_columns.t2ecw3")}):null]}),children:(0,v.jsx)(u.RP,{className:p.bundleBtn,onClick:e=>e.stopPropagation()})})}):null},j=e=>{let{bundleId:n,accountLimit:t=5,bundleLimt:u=5,isOwner:c}=e;const m=(0,d.Fc)(),{data:j,isLoading:y,refetch:g}=(0,a.Vy)(n),L=(0,s.useMemo)((()=>((e,n,t,s)=>e?[{title:(0,v.jsx)(o.Wb,{children:e=>e("AccountList_columns.1kpnv")}),key:"row.desc.id",width:"70%",render:e=>{let{cellData:n,row:t}=e;return(0,v.jsx)(h.Oe,{info:t,disableMemo:!0})},skeleton:(0,v.jsx)("div",{className:p.innerCell,children:(0,v.jsx)(r.Z,{width:104})})},{title:(0,v.jsx)(o.Wb,{children:e=>e("AccountList_columns.q6o2ej")}),width:"30%",key:"desc.usd_value",render:e=>{let{row:n}=e;return(0,v.jsxs)("div",{className:p.netWorth,children:["$",(0,b.ZI)(n.stats.usd_value,0)]})},align:"right",skeleton:(0,v.jsx)(r.Z,{width:104})}]:[{title:(0,v.jsx)("span",{style:{paddingLeft:26},children:(0,v.jsx)(o.Wb,{children:e=>e("AccountList_columns.1kpnv")})}),key:"row.desc.id",width:"189px",render:e=>{let{cellData:n,row:s}=e;return(0,v.jsx)("div",{className:p.userInfo,children:(0,v.jsx)(h.Oe,{info:s,onMemoChange:t})})},skeleton:(0,v.jsx)("div",{className:p.innerCell,children:(0,v.jsx)(r.Z,{width:104})})},{title:(0,v.jsx)(o.Wb,{children:e=>e("AccountList_columns.q6o2ej")}),width:"100px",key:"desc.usd_value",render:e=>{let{row:n}=e;
1return(0,v.jsxs)("div",{className:p.netWorth,children:["$",(0,b.ZI)(n.stats.usd_value,0)]})},skeleton:(0,v.jsx)(r.Z,{width:104})},{title:(0,v.jsx)(o.Wb,{children:e=>e("AccountList_columns.lga8rp")}),width:"268px",key:"top_token",render:e=>{var n,t;let{row:s}=e;return(0,v.jsx)(_.mR,{data:[...(null===s||void 0===s||null===(n=s.stats)||void 0===n?void 0:n.top_coins)||[],...(null===s||void 0===s||null===(t=s.stats)||void 0===t?void 0:t.top_tokens)||[]]})},skeleton:(0,v.jsx)("div",{className:p.innerCell,children:(0,v.jsx)(r.Z,{width:104})})},{key:"",render:e=>{let{row:t}=e;return s?(0,v.jsx)("div",{className:p.alignEnd,children:(0,v.jsx)(x,{address:t.desc.id,bundleId:n.bundleId,bundleLimt:n.bundleLimt})}):null},skeleton:s?(0,v.jsx)("div",{className:p.innerCell,children:(0,v.jsx)(r.Z,{width:104})}):void 0}])(m,{bundleId:n,accountLimit:t,bundleLimt:u},g,c)),[n,t,u,g,c,m]),f=(0,s.useCallback)((e=>{(0,i.xg)("/profile/".concat(e.id),"_blank")}),[]);return(0,v.jsx)(l.rC,{className:p.accountList,columns:L,data:j,loading:y,onRowClick:f})}},43252:(e,n,t)=>{t.d(n,{Vf:()=>G.V,Fv:()=>te,N5:()=>re,eX:()=>V,c3:()=>z,cV:()=>U,UN:()=>B,HD:()=>w,kO:()=>C});var s=t(5550),l=t.n(s),d=t(25038),i=t(90500),a=t(27559),o=t(74687),r=t(12185),u=t(88516),c=t(42543),m=t(62395),_=t(84667),h=t(67812),b=t(58150),p=t(35204),v=t(97319),x=t(13791),j=t(51706),y=t(25523),g=t(36160),L=t(32938);const f="ConfirmModal_deleteModalContent__OlmV2";var k=t(39615);const{confirm:N}=b.Modal,B=e=>{let n="";return N({title:(0,k.jsx)(i.Wb,{children:e=>e("ConfirmModal.mkecll")}),content:(0,k.jsx)(L.II,{placeholder:e,onChange:e=>{n=e},maxLength:128}),confirmBtnText:(0,k.jsx)(i.Wb,{children:e=>e("SnsAddModal.1j2ql")})}).then((()=>Promise.resolve(n)))},I=()=>{const{t:e}=(0,i.$G)();return(0,k.jsxs)("span",{className:f,children:[e("ConfirmModal.1wzbl6k"),"?"]})},C=(e,n)=>{let t=e;return N({title:(0,k.jsx)(i.Wb,{children:e=>e("ConfirmModal.mkecll")}),content:(0,k.jsx)(L.II,{placeholder:n,value:e,onChange:e=>{t=e},maxLength:128}),confirmBtnText:(0,k.jsx)(i.Wb,{children:e=>e("SnsAddModal.1j2ql")})}).then((()=>Promise.resolve(t)))},w=()=>N({title:(0,k.jsx)(i.Wb,{children:e=>e("ConfirmModal.30c7ef")}),content:(0,k.jsx)(I,{})}),A="HeaderInfo_subTitle__7WpO+",D="HeaderInfo_addButton__tsud1",T="HeaderInfo_addBtnIcon__djT72",M="HeaderInfo_desc__0fJxM",E="HeaderInfo_bundleDesc__G9NaD",W="HeaderInfo_bundleName__kK5or",H="HeaderInfo_bundleNameText__-y4c7",S="HeaderInfo_bundleEdit__58OTM",P="HeaderInfo_bundleAccounts__XDnDD",Z="HeaderInfo_bundleAccountsNumber__2fa4P",F="HeaderInfo_bundleAsset__KSevh",q="HeaderInfo_proModalTip__FBzwm",K="HeaderInfo_link__BaqiC",V=e=>{let{seletedBundle:n,netWorth:t,accountLimit:s,updating:L}=e;const{t:f}=(0,i.$G)(),{bundleId:N}=(0,o.UO)(),B=(0,o.k6)(),{userInfo:I,address:V}=(0,v.yI)(),G=(0,x.ub)(),{data:O,isLoading:Y}=(0,g.jQ)(n.id),{mutate:Q}=(0,g.sk)(),{mutate:R}=(0,g.p7)(),{mutate:U}=(0,g.xZ)((()=>{})),[z,$]=(0,d.useState)(!1),J=V===(null===O||void 0===O?void 0:O.owner),X=(0,d.useMemo)((()=>{var e;return O&&(null===(e=O.addrs)||void 0===e?void 0:e.length)>=(s||1)}),[s,O]),ee=(0,d.useMemo)((()=>null!==O&&void 0!==O&&O.create_at?l().unix(O.create_at).format("MMMM DD, YYYY"):""),[O]),ne=(0,d.useCallback)((()=>{C(n.name,f("HeaderInfo.namePlaceholder")).then((e=>{Q({id:n.id,name:e})}))}),[Q,n,f]),te=(0,d.useCallback)((()=>{w().then((()=>{R(n.id,{onSuccess:()=>{B.replace("/bundles")}})}))}),[R,n,B]),se=(0,d.useMemo)((()=>[{label:f("HeaderInfo.14f8jfi"),onClick:ne},{label:f("HeaderInfo.xskn2j"),onClick:te}]),[ne,te,f]),le=(0,d.useCallback)((()=>{I&&(X?b.Modal.confirm({title:f("HeaderInfo.1fkq903"),content:e=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(r.NavLink,{className:K,to:"/settings",onClick:e,children:f("HeaderInfo.5eh9ot")}),f("HeaderInfo.overTipContent",{bundle:g.dw.pro.bundle,account:g.dw.pro.account})]}),onConfirmClick:()=>{G&&y.K.report({category:"Debank Pro",action:"View Pro Features Page",label:"".concat(G,"|Bundles")}),B.push("/settings")},confirmBtnText:f("BundleList.mint-id"),cancelBtnGhost:!1,cancelBtnType:"default",modalClassName:q}):$(!0))}),[B,X,I,G,f]);
1return N?(0,k.jsxs)("div",{className:E,children:[(0,k.jsxs)("div",{children:[(0,k.jsxs)("div",{className:W,children:[(0,k.jsx)("span",{className:H,children:(0,k.jsx)(c.P,{title:n.name,children:n.name})}),J?(0,k.jsx)(_.L,{inParent:!0,placement:"bottomRight",data:se,children:(0,k.jsx)(u.e8,{className:S})}):null]}),(0,k.jsxs)("div",{className:A,children:[(0,k.jsx)("div",{className:P,children:(0,k.jsxs)(i.cC,{i18nKey:"HeaderInfo.bundleAddressCount",count:null===O||void 0===O?void 0:O.addrs.length,children:[(0,k.jsx)("span",{className:Z,children:null===O||void 0===O?void 0:O.addrs.length}),"Address added"]})}),Y||!J?null:(0,k.jsx)(h.y,{title:null!==I&&void 0!==I&&I.web3_id&&X?f("HeaderInfo.overAccount",{account:s}):null,children:(0,k.jsxs)(m.z,{disabled:!(null===I||void 0===I||!I.web3_id)&&X,className:D,type:"text",onClick:le,children:[(0,k.jsx)(u.ac,{className:T}),f("HeaderInfo.1pdryad")]})})]}),(0,k.jsxs)("div",{className:M,children:[f("HeaderInfo.1jmakvr")," ",ee]})]}),(0,k.jsx)("div",{className:F,children:L&&!t?(0,k.jsx)(a.Z,{width:104,highlightColor:"var(--bg-light-color)",baseColor:"var(--bg-default-color)"}):(0,j.eT)(t)}),(0,k.jsx)(p.p,{isOpen:z,title:f("HeaderInfo.vgei0s"),type:"bundle",onClose:()=>{$(!1)},onConfirm:e=>{U({bundleId:N,address:e}),$(!1)}})]}):(B.replace("/bundles/".concat(n.id)),null)};var G=t(43502),O=t(22618);const Y="EmptyHolder_noBundles__VjAVt",Q="EmptyHolder_desc__HgQvV",R="EmptyHolder_addButton__lVbDx",U=()=>{const{t:e}=(0,i.$G)(),n=(0,o.k6)(),{mutate:t}=(0,g.DE)((e=>{let{id:t}=e;n.replace("/bundles/".concat(t))})),s=(0,d.useCallback)((async()=>{B(e("BundleList.namePlaceholder")).then((e=>{t({name:e})}))}),[t,e]);return(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)(O.Z,{className:Y,children:[(0,k.jsx)("div",{className:Q,children:e("EmptyHolder.uq4b5r")}),(0,k.jsx)(m.z,{className:R,type:"primary",shadow:!0,onClick:s,children:e("EmptyHolder.1y2ihy8")})]})})},z=e=>{let{bundleId:n,isOwner:t}=e;const{t:s}=(0,i.$G)(),{mutate:l}=(0,g.xZ)((()=>{})),[a,o]=(0,d.useState)(!1),r=(0,d.useCallback)((()=>{o(!0)}),[]);return(0,k.jsxs)(O.Z,{className:Y,children:[(0,k.jsx)("div",{className:Q,children:s("EmptyHolder.bkcx28")}),t?(0,k.jsx)(m.z,{className:R,type:"primary",shadow:!0,onClick:r,children:s("EmptyHolder.1pdryad")}):null,(0,k.jsx)(p.p,{isOpen:a,title:s("EmptyHolder.vgei0s"),type:"bundle",onClose:()=>{o(!1)},onConfirm:e=>{l({bundleId:n,address:e}),o(!1)}})]})};var $=t(78201),J=t(25867),X=t(26924),ee=t(15210);const ne={container:"AnalysisTab_container__W-1Z4",welcomeTitle:"AnalysisTab_welcomeTitle__iN21I",bannerDesc:"AnalysisTab_bannerDesc__RQEgn",confirmTitleTag:"AnalysisTab_confirmTitleTag__KgYXG",enterBtn:"AnalysisTab_enterBtn__UfG9i"},te=(0,d.memo)((e=>{let{bundleId:n}=e;const{isVerified:t,address:s}=(0,v.yI)(),{data:l,isLoading:d}=(0,$.C7)($.Xq.TIME_MACHINE);return s&&t?l?(0,k.jsx)(de,{bundleId:n}):(0,k.jsx)(le,{isPaidLoading:d}):(0,k.jsx)(se,{current:s})})),se=e=>{let{current:n}=e;const{t:t}=(0,i.$G)(),s=(0,d.useCallback)((async()=>{(0,J.x4)()}),[]);return(0,k.jsx)("div",{className:ne.container,children:(0,k.jsxs)("div",{className:ne.bannerContent,children:[(0,k.jsx)("div",{className:ne.welcomeTitle,children:t("AnalysisTab.j9g0lt")}),(0,k.jsx)("div",{className:ne.bannerDesc,children:t("AnalysisTab.12yw2up")}),(0,k.jsx)(m.Z,{type:"primary",className:ne.enterBtn,onClick:s,children:n?"Verify Account":t("SignLoginModal.connect-wallet")})]})})},le=e=>{let{isPaidLoading:n}=e;const{t:t}=(0,i.$G)(),s=(0,o.k6)(),l=(0,x.ub)();return(0,k.jsx)("div",{className:ne.container,children:(0,k.jsxs)("div",{className:ne.bannerContent,children:[(0,k.jsx)("div",{className:ne.welcomeTitle,children:t("AnalysisTab.j9g0lt")}),(0,k.jsx)("div",{className:ne.confirmTitleTag,children:t("AnalysisTab.5k1i1u")}),n?(0,k.jsx)(a.Z,{width:180}):(0,k.jsx)(m.Z,{type:"primary",className:ne.enterBtn,onClick:()=>{l&&y.K.report({category:"Debank Pro",action:"View Pro Features Page",label:"".concat(l,"|Bundles")}),s.push("/paid")},children:t("AnalysisTab.1velqvu")})]})})},de=e=>{let{bundleId:n}=e;const t=(0,o.k6)(),{data:s,refetch:l,isFetched:i}=(0,X.cu)("bundles",n),{mutateAsync:a}=(0,X._3)("bundles");(0,ee.b3)(i,(null===s||void 0===s?void 0:s.status)||"",l);const r=(0,d.useCallback)((()=>{t.push("/bundle-analysis/".concat(n))}),[t,n]),u=(0,d.useCallback)((async()=>a(n).then((()=>l()))),[n,a,l]);return(0,k.jsx)("div",{className:ne.container,children:(0,k.jsx)(ee.S1,{onClick:r,status:null===s||void 0===s?void 0:s.status,onInit:u,isBundle:!0})})};var ie=t(44385),ae=t(62921);const oe={listHeader:"BundleList_listHeader__jp8yB",desc:"BundleList_desc__oc2vt",proTip:"BundleList_proTip__e5dEr",subTitle:"BundleList_subTitle__KDvZ6",bundleCount:"BundleList_bundleCount__-0zid",addButton:"BundleList_addButton__-Uj0g",addBtnIcon:"BundleList_addBtnIcon__uPjHu",bundleList:"BundleList_bundleList__9ShRj",bundleLink:"BundleList_bundleLink__gB-gy",bundleName:"BundleList_bundleName__QVgR5",bundleAddrsCount:"BundleList_bundleAddrsCount__8HJHF",netWorth:"BundleList_netWorth__o-boR",tokenIcon:"BundleList_tokenIcon__SX4Tw",nftIcon:"BundleList_nftIcon__r4UEx",tagList:"BundleList_tagList__JIdL0",tag:"BundleList_tag__MMgAu",nftTag:"Bu
1ndleList_nftTag__UpCSc",popover:"BundleList_popover__CKiKX",item:"BundleList_item__03bck",label:"BundleList_label__SljeY",value:"BundleList_value__++BC0",token:"BundleList_token__pNa+l",proModalTip:"BundleList_proModalTip__yUmwy"},re=e=>{let{bundleLimt:n,accountLimit:t}=e;const{t:s}=(0,i.$G)(),{data:l,isLoading:r,isError:c,refetch:_}=(0,g.J_)(),p=(0,o.k6)(),L=(0,x.ub)(),{userInfo:f}=(0,v.yI)(),N=(0,d.useMemo)((()=>[{title:(0,k.jsx)(i.Wb,{children:e=>e("BundleList_columns.mkecll")}),key:"id",width:"180px",render:e=>{var n;let{cellData:t,row:s}=e;return(0,k.jsxs)("div",{className:oe.bundleLink,children:[(0,k.jsx)("div",{className:oe.bundleName,children:s.name}),(0,k.jsxs)("div",{className:oe.bundleAddrsCount,children:[null===(n=s.addrs)||void 0===n?void 0:n.length," ",(0,k.jsx)(i.Wb,{children:e=>e("BundleList_columns.8js9uc",{count:s.addrs.length})})]})]})},skeleton:(0,k.jsx)("div",{className:oe.innerCell,children:(0,k.jsx)(a.Z,{width:104})})},{title:(0,k.jsx)(i.Wb,{children:e=>e("BundleList_columns.1b0f4un")}),width:"100px",key:"usd_value",render:e=>{let{row:n}=e;return(0,k.jsxs)("div",{className:oe.netWorth,children:["$",(0,j.ZI)(n.stats.usd_value,0)]})},skeleton:(0,k.jsx)(a.Z,{width:104})},{title:(0,k.jsx)(i.Wb,{children:e=>e("BundleList_columns.lga8rp")}),width:"268px",key:"top_tokens",render:e=>{var n,t;let{row:s}=e;return(0,k.jsx)(ae.mR,{data:[...(null===s||void 0===s||null===(n=s.stats)||void 0===n?void 0:n.top_coins)||[],...(null===s||void 0===s||null===(t=s.stats)||void 0===t?void 0:t.top_tokens)||[]]})},skeleton:(0,k.jsx)("div",{className:oe.innerCell,children:(0,k.jsx)(a.Z,{width:104})})}]),[]),{mutate:I}=(0,g.DE)(),C=(0,d.useMemo)((()=>!n||l&&l.length>=n),[n,l]),w=(0,d.useMemo)((()=>Boolean(null===f||void 0===f?void 0:f.web3_id)),[f]),A=(0,d.useCallback)((async()=>{f&&(C?b.Modal.confirm({title:s("BundleList.1qxi3rh"),content:s("BundleList.overTipContent",{bundle:g.dw.pro.bundle,account:g.dw.pro.account}),onConfirmClick:()=>{L&&y.K.report({category:"Debank Pro",action:"View Pro Features Page",label:"".concat(L,"|Bundles")}),p.push("/settings")},confirmBtnText:s("BundleList.mint-id"),cancelBtnGhost:!1,cancelBtnType:"default",modalClassName:oe.proModalTip}):B(s("BundleList.namePlaceholder")).then((e=>{I({name:e},{onSuccess(e){p.push("/bundles/".concat(e.bundle.id,"/accounts"))}})})))}),[I,p,C,f,L,s]),D=(0,d.useCallback)((e=>{p.push("/bundles/".concat(e.id,"/accounts"))}),[p]);return null!==l&&void 0!==l&&l.length||r?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("div",{className:oe.listHeader,children:[(0,k.jsxs)("div",{className:oe.desc,children:[s("BundleList.desc",{bundleLimt:n,accountLimit:t}),w?null:(0,k.jsx)("span",{className:oe.proTip,children:s("BundleList.1axfp9h")})]}),(0,k.jsxs)("div",{className:oe.subTitle,children:[(0,k.jsxs)(i.cC,{i18nKey:"BundleList.bundleCount",count:(null===l||void 0===l?void 0:l.length)||0,children:[(0,k.jsx)("span",{className:oe.bundleCount,children:l?l.length:"-"}),"bundle created"]}),r?null:(0,k.jsx)(h.y,{title:w&&C?s("BundleList.limitAchived",{bundleLimt:n}):null,children:(0,k.jsxs)(m.z,{disabled:!!w&&C,className:oe.addButton,type:"text",onClick:A,children:[(0,k.jsx)(u.ac,{className:oe.addBtnIcon}),s("BundleList.1lpjmdd")]})})]})]}),(0,k.jsx)("div",{className:oe.bundleList,children:(0,k.jsx)(ie.rC,{columns:N,data:l,loading:r,onRowClick:D,isError:c,reload:_})})]}):(0,k.jsx)("div",{className:oe.bundleList,children:(0,k.jsx)(U,{})})}},36160:(e,n,t)=>{t.d(n,{dw:()=>x,Ju:()=>v,DE:()=>L,p7:()=>N,jQ:()=>I,xZ:()=>A,ZR:()=>D,Vy:()=>w,TD:()=>j,J_:()=>g,YG:()=>k,sk:()=>f,zM:()=>T,O6:()=>M});var s=t(3299),l=t(79970),d=t(76287),i=t(25038),a=t(97319),o=t(32856),r=t(87868),u=t(70117),c=t(28708),m=t(26924),_=t(3066);const h=e=>{u.Eh.invalidateQueries({queryKey:["/bundle/complex_protocol_list",e.toString()]})};var b=t(93982);const p=e=>{u.Eh.invalidateQueries({queryKey:["/bundle/token_list",e.toString()]})},v=()=>{u.Eh.invalidateQueries({queryKey:["/bundle/list"]})},x={pro:{bundle:10,account:50},common:{bundle:5,account:5}},j=()=>{const{userInfo:e}=(0,a.yI)();return(0,i.useMemo)((()=>e?x[null!==e&&void 0!==e&&e.web3_id?"pro":"common"]:null),[e])},y=e=>(e.bundles.sort(((e,n)=>(n.stats.usd_value||0)-(e.stats.usd_value||0))),e.bundles),g=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{address:n,isVerified:t}=(0,a.yI)(),l="/bundle/list";return(0,s.a)({queryKey:[l,n],queryFn:()=>c.WY.get(l),enabled:e&&t,staleTime:3e4,gcTime:3e4,select:y})},L=e=>{const{address:n}=(0,a.yI)();return(0,l.D)({mutationFn:e=>{let{name:n,addrs:t}=e;return t&&({name:n}.addrs=t),c.WY.post("/bundle/create",{name:n,addrs:t})},onSuccess(t){u.Eh.setQueryData(["/bundle/list",n],(e=>
1({bundles:null!==e&&void 0!==e&&e.bundles?e.bundles.concat(t.bundle):[t.bundle]}))),d.Z.success("added"),null===e||void 0===e||e(t)},onError(e){(0,r._N)(e)}})},f=()=>{const{address:e}=(0,a.yI)();return(0,l.D)({mutationFn:e=>{let{id:n,name:t}=e;return c.WY.post("/bundle/update_name",{id:n,new_name:t})},onSuccess(n,t){let{id:s}=t;v(),u.Eh.invalidateQueries({queryKey:["/bundle",e,s.toString()]}),d.Z.success("changed")},onError(e){(0,r._N)(e)}})},k=e=>{const{address:n}=(0,a.yI)();return(0,l.D)({mutationFn:()=>c.WY.post("/bundle/public",{id:e}),onSuccess(t){t.is_success?(v(),u.Eh.invalidateQueries({queryKey:["/bundle",n,null===e||void 0===e?void 0:e.toString()]}),d.Z.success("changed")):d.Z.error("failed")},onError(e){(0,r._N)(e)}})},N=()=>{const{address:e}=(0,a.yI)();return(0,l.D)({mutationFn:e=>c.WY.post("/bundle/delete",{id:e}),onSuccess(n,t){if(n.success)return u.Eh.removeQueries({queryKey:["/bundle",e,t]}),v(),void d.Z.success("deleted");throw new Error(n.error_msg)},onError(e){(0,r._N)(e)}})},B=e=>e.bundle,I=e=>{const n="/bundle",{address:t}=(0,a.yI)(),l=(0,o.Fc)();return(0,s.a)({queryKey:[n,t,null===e||void 0===e?void 0:e.toString()],queryFn:()=>c.WY.get(n,{id:e}),enabled:!!e,select:B,meta:{showError:!l}})},C=e=>(e.items.sort(((e,n)=>(n.stats.usd_value||0)-(e.stats.usd_value||0))),e.items),w=e=>{const n="/bundle/items",{address:t}=(0,a.yI)();return(0,s.a)({queryKey:[n,t,e.toString()],queryFn:()=>c.WY.get(n,{id:e}),select:C})},A=e=>{const{address:n}=(0,a.yI)();return(0,l.D)({mutationFn:e=>{let{bundleId:n,address:t}=e;return c.WY.post("/bundle/add_item",{addr:t,id:Number(n)})},onSuccess(t,s){let{bundleId:l}=s;v(),h(l),p(l),u.Eh.invalidateQueries({queryKey:["/bundle",n,l.toString()]}),u.Eh.invalidateQueries({queryKey:["/bundle/items",n,l.toString()]}),(0,m.vG)(l),d.Z.success("added"),e()},onError(e){(0,r._N)(e)}})},D=()=>{const{address:e}=(0,a.yI)();return(0,l.D)({mutationFn:e=>{let{bundleId:n,addr:t}=e;return c.WY.post("/bundle/delete_item",{id:n,addr:t})},onSuccess(n,t){let{bundleId:s,addr:l}=t;u.Eh.invalidateQueries({queryKey:["/bundle",e,s.toString()]}),u.Eh.invalidateQueries({queryKey:["/bundle/items",e,s.toString()]}),v(),h(s),p(s),(0,m.vG)(s),d.Z.success("deleted")},onError(e){(0,r._N)(e)}})},T=()=>{const e=(0,i.useRef)(null),[n,t]=(0,i.useState)(!1),{isVerified:s}=(0,a.yI)(),{data:l}=g(s),{mutateAsync:d}=L((()=>{t(!1)})),o=(0,i.useCallback)((e=>{null===e||void 0===e||e.stopPropagation(),t(!n)}),[n]);(0,i.useLayoutEffect)((()=>{n&&e.current&&(e.current.focus(),e.current.value="")}
1),[n]);const r=(0,i.useCallback)((async(e,n)=>{const{value:t}=e.currentTarget;return d({name:t,addrs:n})}),[d]),u=(0,i.useCallback)((e=>{e.stopPropagation()}),[]),c=(0,i.useCallback)((e=>{e||t(!1)}),[]);return{data:l,showNewInput:n,inputRef:e,handleToggleNew:o,handleNewEnter:r,preventDefault:u,handleVisbileChange:c,addBundleMutate:d}},M=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const l=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const l="/bundle/token_list",{data:d,isFetching:a}=(0,s.a)({queryKey:[l,e.toString()],queryFn:()=>c.WY.async(l,{id:e},{retry:1,retryDelay:3e3}),enabled:t}),o=(0,i.useMemo)((()=>{if(d){const e=d.reduce(((e,n)=>(e[n.chain]=e[n.chain]||[],e[n.chain].push(n),e)),{});return(0,b.ZP)(_.rn,(n=>(0,_.wi)(n,e)))}}),[d]),r=(0,i.useMemo)((()=>o?(0,_.JC)(o):[]),[o]);return{currentWalletNetWorth:(0,i.useMemo)((()=>{var e;return n?null===o||void 0===o||null===(e=o._portfolioDict[n])||void 0===e?void 0:e.netWorth:null===o||void 0===o?void 0:o.netWorth}),[n,o]),tokens:r,isDone:!a,tokenNetworthOnChain:(0,i.useMemo)((()=>o?o._portfolios.reduce(((e,n)=>(e[n.id]=n.netWorth,e)),{}):{}),[o]),isSnapshotDone:!a,netWorth:(null===o||void 0===o?void 0:o.netWorth)||0,walletProject:o}}(e,n,t),[d,a]=(0,i.useState)(!0),{currentWalletNetWorth:o,isDone:r,tokenNetworthOnChain:u}=l,{projects:m,isDone:v,isSomeFailed:x,portfolioNetWorth:j,updatedAt:y}=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const t="/bundle/complex_protocol_list",{data:l,isFetching:d,isError:a}=(0,s.a)({queryKey:[t,e.toString()],queryFn:()=>c.WY.async(t,{id:e},{retry:1,retryDelay:3e3}),enabled:n});return{isSomeFailed:a,isDone:!d,...(0,i.useMemo)((()=>{if(!l)return{projects:[],updatedAt:Math.ceil(+new Date/1e3),portfolioNetWorth:{}};const e=(0,_.Bo)(l,!0),n=(0,_.nW)(e);return{projects:n.projectsList,portfolioNetWorth:n.portfolioNetWorth,updatedAt:n.projectsUpdateAt}}),[l])}}(e,t),g=(0,i.useMemo)((()=>(0,_.GP)(u,j)),[u,j]),L=(0,i.useMemo)((()=>Object.values(g).reduce(((e,n)=>e+n),0)),[g]),f=(0,i.useMemo)((()=>n?j[n]:L-(o||0)),[L,j,n,o]),k=(0,i.useMemo)((()=>n?m.filter((e=>e.chain===n)):m),[m,n]),N=(0,i.useCallback)((()=>{a(!0),p(e),h(e)}),[e]);return(0,i.useEffect)((()=>{const e=!r||!v;e!==d&&a(e)}),[d,r,v]),{queryTokens:l,projects:k,isSomeFailed:x,allChainAssetsDict:g,allChainUsd:L,isTokenDone:r,isProjectsDone:v,last
1CacheUpdated:y,updateAssets:N,updating:d,currentPortfolioNetWorth:f}}},83644:(e,n,t)=>{t.r(n),t.d(n,{AccountList:()=>y.Vf,BUNDLE_LIMIT:()=>g.dw,BundleAnalysisTab:()=>y.Fv,BundleList:()=>y.N5,HeaderInfo:()=>y.eX,NoAccount:()=>y.c3,NoBundles:()=>y.cV,addBundleModal:()=>y.UN,default:()=>k,deleteBundleModal:()=>y.HD,refetchBundleList:()=>g.Ju,renameBundleModal:()=>y.kO,useBundleAdd:()=>g.DE,useBundleDelete:()=>g.p7,useBundleDetail:()=>g.jQ,useBundleItemAdd:()=>g.xZ,useBundleItemDelete:()=>g.ZR,useBundleItems:()=>g.Vy,useBundleLimit:()=>g.TD,useBundleList:()=>g.J_,useBundlePublicUpdate:()=>g.YG,useBundlePut:()=>g.sk,useBundles:()=>g.zM,useQueryBundleAssets:()=>g.O6});var s=t(25038),l=t(90500),d=t(74687),i=t(32416),a=t(17127),o=t(97319),r=t(32856),u=t(13791),c=t(25523),m=t(29816),_=t(42590),h=t.n(_),b=t(10643),p=t(39615);const v=h()({loader:()=>t.e(9077).then(t.bind(t,39077)),loading:()=>(0,p.jsx)(b.g,{}),delay:500}),x=h()({loader:()=>Promise.all([t.e(8765),t.e(8567)]).then(t.bind(t,30413)),loading:()=>(0,p.jsx)(b.g,{}),delay:500}),j=(0,s.memo)((e=>{const n=(0,r.Fc)()?x:v;return(0,p.jsx)(n,{...e})}));var y=t(43252),g=t(36160);const L="Bundles_pageContainer__8Fhr0",f="Bundles_privateTip__bxjmp",k=(0,s.memo)((()=>{const{bundleId:e}=(0,d.UO)(),n=(0,g.TD)(),{t:t}=(0,l.$G)(),s=(0,r.Fc)();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(i.c,{titlePrefix:"Bundles"}),s?null:(0,p.jsx)(a.k,{title:t(e?"Bundles.titleDetail":"Bundles.titleList"),enableBack:!!e,paddingLeft:!0}),(0,p.jsx)("div",{className:L,children:(0,p.jsx)(N,{bundleLimt:null===n||void 0===n?void 0:n.bundle,accountLimit:null===n||void 0===n?void 0:n.account})})]})})),N=(0,s.memo)((e=>{let{bundleLimt:n,accountLimit:t}=e;const{t:i}=(0,l.$G)(),{bundleId:a}=(0,d.UO)(),_=(0,r.Fc)(),h=(0,u.ub)(),{isVerified:b}=(0,o.yI)(),{data:v,isLoading:x,error:L}=(0,g.jQ)(a);return(0,s.useEffect)((()=>{!a&&h&&c.K.report({category:"View Bundles",action:"Bundles_List_".concat(h)})}),[a,h]),a?x?null:v?(0,p.jsx)(j,{bundle:v,bundleLimt:n,accountLimit:t}):_&&403===(null===L||void 0===L?void 0:L.error_code)?(0,p.jsx)(m.default,{isLandingPage:!0,tip:(0,p.jsxs)("div",{className:f,children:[(0,p.jsx)("div",{children:i("Bundles.15y9zws")}),(0,p.jsx)("div",{children:i("Bundles.17tpjtt")})]})}):(0,p.jsx)(d.l_,{to:_?"/":"/bundles"}):b?(0,p.jsx)(y.N5,{bundleLimt:n,accountLimit:t}):(0,p.jsx)(d.l_,{to:"/"})}))}}]);
2//# sourceMappingURL=3644.337aeb89.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.