!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="49d8570f-3da1-41de-b7f8-e7abaa696cd2",e._sentryDebugIdIdentifier="sentry-dbid-49d8570f-3da1-41de-b7f8-e7abaa696cd2")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8638],{67754:function(e,s,n){var t=n(534);n.o(t,"notFound")&&n.d(s,{notFound:function(){return t.notFound}}),n.o(t,"useParams")&&n.d(s,{useParams:function(){return t.useParams}}),n.o(t,"usePathname")&&n.d(s,{usePathname:function(){return t.usePathname}}),n.o(t,"useRouter")&&n.d(s,{useRouter:function(){return t.useRouter}}),n.o(t,"useSearchParams")&&n.d(s,{useSearchParams:function(){return t.useSearchParams}})},37553:function(e,s,n){n.d(s,{$C:function(){return L},$j:function(){return D},Aw:function(){return U},Ol:function(){return C},Oq:function(){return p},PE:function(){return u},Sj:function(){return A},U9:function(){return P},W1:function(){return G},WN:function(){return B},Yj:function(){return c},fq:function(){return x},kB:function(){return N},oT:function(){return b},u9:function(){return M},vX:function(){return R},yl:function(){return F}});var t=n(27073),a=n(7653),o=n(27573),i=n(60734),r=Object.defineProperty,l=(e,s)=>r(e,"name",{value:s,configurable:!0}),c=l(({children:e})=>{let[s,n]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{n(!0)},[]),s?(0,o.jsx)(o.Fragment,{children:e}):null},"ClientRendered"),d="https://box-v2.api.decent.xyz/chains/unsupportedChain.svg",x=l(({chainId:e,className:s="",chainIconDictOverride:n={}})=>{let a=e?n[e]??(0,t.dH)(e)??d:d;return(0,o.jsx)(c,{children:(0,o.jsx)("img",{className:"box-img-icon "+s,src:a,alt:""})})},"ChainIcon");function u({className:e=""}){return(0,o.jsx)("svg",{className:"box-dropdown-icon "+e,style:{display:"inline"},width:"12px",height:"12px",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})}l(u,"DropDownIcon");var b=l(({srcChainId:e,setSrcChainId:s,chains:n,title:i="From",onSelected:r,anchorToRight:l=!1,chainIconDictOverride:d,customTriggerElement:b,dropdownClassName:h=""})=>{let[m,A]=(0,a.useState)(!1),p=n.map(e=>t.Ub.find(s=>s.id==e)).filter(e=>!!e).map(e=>e);return(0,o.jsx)(c,{children:(0,o.jsxs)("span",{children:[i," ",m&&(0,o.jsx)("div",{className:"box-outside-click-cover",onClick:()=>{A(!1)}}),(0,o.jsxs)("span",{className:"box-chain-selector-outer",children:[(0,o.jsx)("button",{className:"box-btn",onClick:()=>{A(!0)},children:b??(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(x,{chainId:e,chainIconDictOverride:d}),(0,o.jsx)(u,{})]})}),m&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("div",{className:"box-chain-dropdown "+(l?"box-right-0 box-left-auto ":"")+h,children:p.map(({id:e,name:n},t)=>(0,o.jsxs)("button",{className:"box-chain-dropdown-option",onClick:()=>{s(e),A(!1),r?.(e)},children:[(0,o.jsx)(x,{chainId:e,chainIconDictOverride:d}),n]},t))})})]})]})})},"ChainSelector");function h(e){var s,n,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e){if(Array.isArray(e))for(s=0;s<e.length;s++)e[s]&&(n=h(e[s]))&&(t&&(t+=" "),t+=n);else for(s in e)e[s]&&(t&&(t+=" "),t+=s)}return t}function m(){for(var e,s,n=0,t="";n<arguments.length;)(e=arguments[n++])&&(s=h(e))&&(t&&(t+=" "),t+=s);return t}l(h,"r"),l(m,"clsx");var A=l(({token:e,className:s="box-large-icon"})=>{let n=e?.logo,[t,i]=(0,a.useState)(n);return(0,a.useEffect)(()=>{n!=t&&i(n)},[n]),(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("img",{className:s+" "+(t?"":"box-missing-img "),src:t||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mM89h8AApEBx2iaqpQAAAAASUVORK5CYII=",alt:"token",onError:()=>i(void 0)})})},"TokenLogo"),p=l(({isOpen:e,setClosed:s,children:n,headerText:t,className:i,innerClassName:r,closeOnOutsideClick:c=!0,hideCloseIcon:d=!1})=>{let x=(0,a.useRef)(null),u=l(()=>{s(),document.activeElement instanceof HTMLElement&&document.activeElement.blur()},"closeAction");return(0,a.useEffect)(()=>{e&&!x.current?.open?x.current?.showModal():x.current?.open&&(x.current?.setAttribute("closing",""),x.current?.addEventListener("animationend",()=>{x.current?.removeAttribute("closing"),x.current?.close()},{once:!0}))},[e]),(0,o.jsxs)("dialog",{className:m("box-dialog",i),ref:x,onClose:()=>u(),onClick:()=>c&&u(),children:[(0,o.jsxs)("div",{className:m("box-dialog-inner",r),onClick:e=>e.stopPropagation(),children:[t&&(0,o.jsx)("div",{className:"box-dialog-header",children:t}),(0,o.jsx)(o.Fragment,{children:n})]}),!d&&(0,o.jsx)("button",{className:"box-close-btn block",onClick:()=>u(),children:(0,o.jsx)("img",{src:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="%23898597">%0A  <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />%0A</svg>',className:"box-img-icon",alt:""})})]})},"BoxDialog"),f=l(({isOpen:e,setClosed:s,tokens:n,srcToken:t,setSrcToken:a,onSelected:i})=>{let r=l(()=>{s(),document.activeElement instanceof HTMLElement&&document.activeElement.blur()},"closeAction");return n?(0,o.jsx)(p,{isOpen:e,setClosed:s,headerText:"Select Token",className:"box-token-list",children:(0,o.jsx)("div",{className:"box-mt-4 box-flex box-flex-col box-gap-2",children:n.map((e,s)=>(0,o.jsxs)("button",{onClick:()=>{a(e),r(),i?.(e)},className:m(e.address===t?.address&&"box-token-selected","box-token-btn box-btn","box-min-w-[300px] box-cursor-pointer box-px-2","box-flex box-gap-4 box-items-center box-py-2 hover:box-opacity-80"),children:[(0,o.jsx)(A,{token:e}),(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"box-font-[500] box-text-left",children:e.name}),(0,o.jsx)("div",{className:"box-text-sm box-text-gray-400 box-text-left",children:e.symbol})]}),(0,o.jsx)("div",{className:"box-text-right box-ml-auto",children:(0,o.jsxs)("p",{className:"box-my-0",children:[e.balanceFloat.toFixed(4)," ",e.symbol]})})]},s))})}):null},"TokenList");l(({disabled:e,srcToken:s,setSrcToken:n,tokens:t,onSelected:i})=>{let[r,l]=(0,a.useState)(!1);return e=e||t.length<=1,s?(0,o.jsxs)(c,{children:[(0,o.jsx)("button",{className:"box-btn box-token-btn",onClick:()=>l(!0),disabled:e,children:(0,o.jsxs)("div",{className:"box-align-middle",children:[(0,o.jsx)(A,{token:s})," "+s.symbol,!e&&(0,o.jsx)(u,{})]})}),(0,o.jsx)(f,{isOpen:r,setClosed:()=>l(!1),tokens:t,srcToken:s,setSrcToken:n,onSelected:i})]}):(0,o.jsx)("div",{className:"box-load-shine box-h-[30px] box-w-[90px]"})},"SimpleTokenSelector");var g=l(({token:e,onClick:s,className:n=""})=>{let{logo:t}=e;return(0,o.jsxs)("button",{onClick:s,className:"box-popular-chip "+n,children:[(0,o.jsx)("div",{className:"box-mr-[5px]",children:(0,o.jsx)("img",{className:"box-h-[20px] box-w-[20px]",src:t})}),(0,o.jsx)("span",{children:e.symbol.toUpperCase()})]})},"Chip"),w=l(({title:e,className:s=""})=>(0,o.jsx)("div",{className:"box-mt-[24px] box-mb-[14px] box-section-title "+s,children:(0,o.jsx)("span",{className:"box-uppercase box-font-light box-text-[#837D92] box-text-[10px] ",children:e})}),"SectionTitle");function C({chainId:e,tokenAddress:s,balance:n,loadingContent:t,loadingClassName:r="box-load-shine box-w-[24px] box-h-[24px]",className:l="",onUsdFetched:c,loading:d=!1}){let x=(0,a.useRef)(),{data:u,isLoading:b}=(0,i.zJ)({chainId:e,tokenAddress:s,enable:!!n&&n>0});if((0,a.useEffect)(()=>{if(u&&n&&c){let e=Number(u.usdPrice);x.current===e||isNaN(e)||(x.current=e,c(Number(n)*e))}},[u,n,c]),b)return(0,o.jsx)("div",{className:r,children:t});if(0===n)return(0,o.jsx)("div",{className:l,children:"$0.00"});if(!n||!u||isNaN(Number(u.usdPrice)))return(0,o.jsx)("div",{className:l,children:"-"});let h=Number(n)*Number(u.usdPrice);return(0,o.jsxs)("div",{className:l,children:["$",d?"-":h>.01?h.toFixed(2):"<0.01"]})}l(C,"TokenUsdEstimate");var v=l(({tokenInfo:{name:e,symbol:s,logo:n,balanceFloat:t,chainId:a,address:i},showChainIcon:r,showUsdValue:l=!1,price:c,onClick:d})=>(0,o.jsxs)("button",{onClick:d,className:"box-token-row",children:[(0,o.jsxs)("div",{className:"box-flex box-items-center ",children:[(0,o.jsxs)("div",{className:"box-relative box-w-[40px] box-h-[40px] box-mr-[8px] box-shrink-0",children:[(0,o.jsx)(A,{token:{logo:n}}),r&&(0,o.jsx)(x,{chainId:a,className:"box-absolute box-right-0 box-bottom-0"})]}),(0,o.jsxs)("div",{className:"box-flex box-flex-col box-items-start",children:[(0,o.jsx)("span",{className:"box-font-medium box-text-md",children:e}),(0,o.jsx)("span",{className:"box-font-light box-text-xs",children:s})]})]})," ",(0,o.jsxs)("div",{className:"box-flex box-flex-col box-items-end "+(t&&"a")+(!t&&"b"),children:[!!t&&(0,o.jsxs)("div",{className:"box-text-right",children:[(0,o.jsxs)("span",{className:"box-text-md",children:[j(t)," ",s]}),l&&(0,o.jsx)(C,{className:"box-text-subtle2 box-pt-1 box-text-sm",tokenAddress:i,chainId:a,balance:t,loadingClassName:"box-load-shine box-w-[24px] box-h-5 box-ml-auto"})]}),c&&(0,o.jsx)("span",{className:"box-font-light box-text-gray-500 box-text-sm",children:`$${c}`})]})]}),"TokenRow");function j(e){return e>=1e5?e.toFixed(0):e>=1?e.toFixed(2):e>=1e-5?parseFloat(e.toPrecision(5)):e.toPrecision(1)}l(j,"getRoundedValue");var k=l(({setSearchedToken:e,className:s=""})=>(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"box-address-search-box "+s,children:[(0,o.jsx)("span",{children:(0,o.jsx)("img",{src:'data:image/svg+xml,<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">%0A    <path d="M23.9958 22.8036L19.175 17.9828C20.5833 16.3578 21.3958 14.1911 21.3958 11.862C21.3958 6.66198 17.1167 2.38281 11.9167 2.38281C6.71667 2.38281 2.4375 6.71615 2.4375 11.9161C2.4375 17.1161 6.71667 21.3953 11.9167 21.3953C14.2458 21.3953 16.3583 20.5286 18.0375 19.1745L22.8583 23.9953C23.0208 24.1578 23.2375 24.212 23.4542 24.212C23.6708 24.212 23.8875 24.1578 24.05 23.9953C24.2667 23.6703 24.2667 23.1286 23.9958 22.8036ZM11.9167 19.7703C7.58333 19.7703 4.0625 16.2495 4.0625 11.9161C4.0625 7.58281 7.58333 4.06198 11.9167 4.06198C16.25 4.06198 19.7708 7.58281 19.7708 11.9161C19.7708 16.2495 16.25 19.7703 11.9167 19.7703Z" fill="%2371717A"/>%0A</svg>%0A',className:"box-address-search-icon"})}),(0,o.jsx)("input",{onChange:(0,i.Ds)(s=>{e(s.target.value)},100),className:"box-bg-transparent box-outline-none box-flex-1 ",type:"text",placeholder:"Search for any token address"})]})}),"AddressSearchBox"),N=l(({disabled:e,selectedToken:s,popularTokens:n=[],address:r,chainId:d,selectTokens:x,selectChains:b,setSelectedToken:h,selectorOnly:m,hidePopularSection:f=!1,searchBoxClassName:C="",dialogClassName:j="",showUsdValue:N=!1})=>{let[y,I]=(0,a.useState)(!1),S=l(e=>{h(e),I(!1)},"userSelected"),T=l(()=>{try{return(0,t.bv)(d)}catch{return[]}},"getDefaultPopularTokens")(),B=[...n.filter(e=>e.chainId===d),...T],[F,E]=(0,a.useState)(),P=!!F,{data:O,error:D,isLoading:M}=(0,i.qX)({address:r,token:F,chainId:d,enable:P}),{tokens:L=[],isLoading:U}=(0,i.FD)({address:r,chainId:d,selectTokens:x,selectChains:b}),H=F?L.filter(e=>e.name.toLowerCase().includes(F.toLowerCase())||e.symbol.toLowerCase().includes(F.toLowerCase())||e.address.toLowerCase().includes(F.toLowerCase())):[],Q=F&&0===H.length,G=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"box-px-[16px]",children:[(0,o.jsx)(k,{className:C,setSearchedToken:E}),!f&&B.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w,{title:"Popular Tokens"}),(0,o.jsx)("div",{className:"box-popular-token-row",children:B.map((e,s)=>(0,o.jsx)(g,{token:e,onClick:()=>S(e)},s))})]})]}),P?(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"box-px-[16px]",children:(0,o.jsx)(w,{title:"Searched Token"})}),Q&&!O&&(0,o.jsx)("div",{className:"box-py-[36px] box-flex box-items-center box-flex-col",children:(0,o.jsx)("span",{className:"box-mt-8",children:"Did not find a token with that address, name, or symbol"})}),H.map(e=>(0,o.jsx)(v,{showChainIcon:!!b&&b?.length>1,tokenInfo:e,onClick:()=>{S(e)},showUsdValue:N},`${e.address}-${e.chainId}`)),O&&H.every(e=>e.address!=O.address)&&(0,o.jsx)(v,{tokenInfo:O,showChainIcon:!!b&&b?.length>1,onClick:()=>{S(O)},showUsdValue:N})]}):(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"box-px-[16px]",children:(0,o.jsx)(w,{title:r?"My Tokens":"Tokens"})}),U&&(0,o.jsx)("div",{className:"box-py-[24px] box-flex box-items-center box-flex-col box-load-shine"}),!U&&L.map(e=>(0,o.jsx)(v,{showChainIcon:!!b&&b?.length>1,tokenInfo:e,onClick:()=>{S(e)},showUsdValue:N},`${e.address}-${e.chainId}`))]})]});return m?(0,o.jsx)(c,{children:G}):(0,o.jsxs)(c,{children:[(0,o.jsx)("button",{className:"box-btn box-token-btn",onClick:()=>I(!0),disabled:e,children:(0,o.jsxs)("div",{className:"box-align-middle",children:[(0,o.jsx)(A,{token:s})," "+s.symbol,!e&&(0,o.jsx)(u,{})]})}),(0,o.jsx)(p,{isOpen:y,setClosed:()=>I(!1),headerText:"Select Token",className:"box-mt-5 "+j,innerClassName:"box-px-0",children:G})]})},"TokenSelector");function y({children:e,balanceText:s,usdBalanceText:n,tokenInfo:{name:t,symbol:a,logo:i},tokenAmt:r,isSelected:l,onOpen:c}){return(0,o.jsxs)("div",{className:"box-group box-token-group-option",children:[(0,o.jsxs)("button",{onClick:c,className:"box-flex box-items-center box-p-[12px] box-w-full group-hover:box-bg-lighter ",children:[(0,o.jsx)("div",{className:"box-relative box-mr-[8px] box-shrink-0",children:(0,o.jsx)(A,{token:{logo:i},className:"box-w-[40px] box-h-[40px]"})}),(0,o.jsxs)("div",{className:"box-flex box-flex-col box-items-start box-mr-auto box-min-w-0",children:[(0,o.jsx)("span",{className:"box-font-medium box-text-md",children:t}),(0,o.jsx)("span",{className:"box-opacity-50 box-text-sm group-hover:box-opacity-100",children:s})]}),(0,o.jsx)("div",{className:"box-flex box-flex-col box-items-end box-my-auto",children:n}),(0,o.jsxs)("div",{className:"box-w-[48px] box-flex box-items-center box-justify-end",children:[(0,o.jsx)("div",{className:"box-balance-selector-amt",children:r}),(0,o.jsx)("div",{className:"box-ml-[4px] box-opacity-50 group-hover:box-opacity-100 box-transition-transform "+(l?"-box-rotate-90":""),children:(0,o.jsx)(u,{})})]})]}),e]})}function I({disabled:e,openToSide:s,isOpen:n,tokenArr:t,showChainText:i,userSelected:r,onUsdFetched:l}){let c=t.map((n,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(S,{disabled:e,tokenInfo:n,showChainIcon:!0,showChainText:i,className:s?"box-token-option-s":"box-token-option-c",onClick:()=>r(n),onUsdFetched:l?e=>l(n.address,e):void 0}),s&&(0,o.jsx)("hr",{className:"last:box-hidden"})]},`${n.address}-${t}`));return s||(c=(0,o.jsx)("div",{className:"box-min-h-0 box-overflow-hidden",children:c})),(0,o.jsx)("div",{className:(s?"box-token-group-side ":"box-token-group-collapse ")+(n?"box-token-group-open":"box-token-group-closed"),children:c})}function S({disabled:e,tokenInfo:{name:s,symbol:n,logo:a,balanceFloat:i,chainId:r,address:l},showChainIcon:c,showChainText:d=!0,className:u="",onClick:b,onUsdFetched:h}){return(0,o.jsxs)("button",{disabled:e,onClick:b,className:"box-min-w-[320px] box-w-full box-flex box-gap-2 box-py-[12px] hover:box-bg-lighter box-items-center "+u,children:[(0,o.jsxs)("div",{className:"box-relative box-flex box-items-center box-shrink-0",children:[(0,o.jsx)(A,{token:{logo:a},className:"box-w-[40px] box-h-[40px]"}),c&&(0,o.jsx)(x,{chainId:r,className:"box-absolute box-right-0 box-bottom-0"})]}),(0,o.jsxs)("div",{className:"box-flex box-flex-col box-shrink box-items-start box-pr-[4px] box-mr-auto box-min-w-0",children:[(0,o.jsx)("span",{title:s,className:"box-text-left box-font-medium box-text-md box-w-full box-truncate",children:s}),(0,o.jsxs)("span",{className:"box-font-light box-text-xs box-whitespace-nowrap",children:[i?i.toPrecision(4)+" ":"",n," ",d&&(0,o.jsxs)(o.Fragment,{children:["on ",(0,t.qz)(r)]})]})]}),(0,o.jsx)("div",{className:"box-flex box-flex-col box-items-end",children:(0,o.jsx)(C,{chainId:r,tokenAddress:l,balance:i,onUsdFetched:h,className:"box-text-sm"})})]})}l(y,"TokenGroupOption"),l(I,"TokenGroupListing"),l(S,"TokenOption");var T=(0,a.createContext)(null);function B({theme:e,children:s}){let[n,t]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;let s={},n;for(n in e){let t=e[n];null!=t&&(s["--"+E(n)]=t)}t(s)},[e]),(0,o.jsx)(T.Provider,{value:n,children:s})}l(B,"BoxThemeProvider");var F=l(()=>(0,a.useContext)(T),"useBoxThemeContext"),E=l(e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,s)=>(s?"-":"")+e.toLowerCase()),"kebabize");l(({disabled:e,selectedToken:s,setSelectedToken:n,hideZeroBalances:t=!1,openToSide:r=!1,closeOnSelect:d=!0,address:x,chainId:u,selectTokens:b,selectChains:h,className:m=""})=>{let[A,p]=(0,a.useState)(),f=l(e=>{n(e),d&&p(void 0)},"userSelected"),{tokens:g=[],isLoading:w}=(0,i.FD)({address:x,chainId:u,selectTokens:b,selectChains:h}),C=new Map;for(let e of g){if(t&&!e.balance)continue;let s=e.name.replace("(PoS)","").trim(),n=C.get(s)??[];C.set(s,n.concat(e))}let v=F();return(0,o.jsx)(c,{children:(0,o.jsxs)("div",{style:v??void 0,className:"box-balance-selector "+m,children:[w&&(0,o.jsx)("div",{className:"box-balance-selector-loader"}),!w&&[...C.entries()].map(([s,n])=>{let t=n.reduce((e,s)=>e+s.balanceFloat,0)||0;return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(y,{balanceText:t.toPrecision(4)+" "+n[0].symbol,usdBalanceText:t.toPrecision(4),tokenInfo:n[0],tokenAmt:n.length,onOpen:()=>p(A===s?void 0:s),isSelected:A===s,children:(0,o.jsx)(I,{disabled:e??!1,tokenArr:n,isOpen:A===s,openToSide:r,userSelected:f},s+"list")},s)})})]})})},"BalanceSelector");var P=l(({disabled:e,setSelectedToken:s,openToSide:n=!1,closeOnSelect:t=!0,address:i,selectChains:r,className:d=""})=>{let[x,u]=(0,a.useState)(),b=l(n=>{e||(s(n),t&&u(void 0))},"userSelected"),h=F();return(0,o.jsx)(c,{children:(0,o.jsx)("div",{style:h??void 0,className:"box-balance-selector "+d,children:r?.map((s,t)=>o.jsx(O,{disabled:e??!1,onOpen:()=>u(x===s?void 0:s),isSelected:x===s,userSelected:b,openToSide:n,chainId:s,address:i},`${s}-${t}`))})})},"BalanceChainSelector");function O({disabled:e,isSelected:s,openToSide:n,chainId:r,address:c,onOpen:d,userSelected:b}){let{tokens:h=[],isLoading:m}=(0,i.FD)({address:c,chainId:r}),A=h.filter(e=>e.balanceFloat>0),p=A.length,[f,g]=(0,a.useState)({}),[w,C]=(0,a.useState)(!1),v=l((e,s)=>{g(n=>({...n,[e]:s}))},"onUsdFetched");(0,a.useEffect)(()=>{Object.keys(f).length===A.length&&C(!0)},[f,A.length]);let j=(0,a.useMemo)(()=>Object.values(f).reduce((e,s)=>e+s,0),[f]);return(0,o.jsxs)("div",{children:[m&&(0,o.jsx)("div",{className:"box-balance-selector-loader"}),!m&&(0,o.jsxs)("div",{className:"box-group box-token-group-option "+(e?"box-opacity-50":""),children:[(0,o.jsxs)("button",{onClick:d,className:"box-flex box-items-center box-p-[12px] box-w-full group-hover:box-bg-lighter ",children:[(0,o.jsx)("div",{className:"box-relative box-mr-[8px] box-shrink-0",children:(0,o.jsx)(x,{chainId:r,className:"box-w-[30px] box-h-[30px]"})}),(0,o.jsx)("div",{className:"box-flex box-flex-col box-items-start box-mr-auto box-min-w-0",children:(0,o.jsx)("span",{className:"box-font-medium box-text-md",children:(0,t.qz)(r)})}),(0,o.jsx)("div",{className:"box-flex box-items-end box-my-auto",children:(0,o.jsx)("span",{className:"box-opacity-50 box-text-sm group-hover:box-opacity-100",children:w?`$${j.toFixed(2)}`:"Loading..."})}),(0,o.jsxs)("div",{className:"box-w-[48px] box-flex box-items-center box-justify-end",children:[(0,o.jsx)("div",{className:"box-balance-selector-amt",children:p}),(0,o.jsx)("div",{className:"box-ml-[4px] box-opacity-50 group-hover:box-opacity-100 box-transition-transform "+(s?"-box-rotate-90":""),children:(0,o.jsx)(u,{})})]})]}),(0,o.jsx)(I,{disabled:e,tokenArr:A,isOpen:s,openToSide:n,showChainText:!1,userSelected:b,onUsdFetched:v})]})]},`${r}-${c}`)}l(O,"ChainGroupOption");var D=l(e=>(0,o.jsxs)("svg",{...e,className:m("box-animate-spin box-mx-auto box-h-20 box-w-20 box-text-black",e.className),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,o.jsx)("defs",{children:(0,o.jsxs)("linearGradient",{id:"lgrad1",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,o.jsx)("stop",{offset:"0%",stopColor:"#863FF8"}),(0,o.jsx)("stop",{offset:"100%",stopColor:"#863FF899"})]})}),(0,o.jsx)("circle",{className:"",cx:"12",cy:"12",r:"10",stroke:"#00000019",strokeWidth:"2"}),(0,o.jsx)("path",{className:"box-opacity-75",stroke:"url(#lgrad1)",strokeWidth:"2",strokeLinecap:"round",d:"M 22 12 A 10 10 0 0 0 12 2"})]}),"Spinner");function M({className:e=""}){return(0,o.jsx)("svg",{className:"box-swap-arrows-icon "+e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"})})}function L({status:e="loading",className:s=""}){return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"box-status-icon "+s,"data-state":e,viewBox:"0 0 24 24",children:[(0,o.jsx)("circle",{className:"box-circle-loader",cx:"12",cy:"12",r:"10",pathLength:"100"}),(0,o.jsx)("circle",{className:"box-circle-ring",cx:"12",cy:"12",r:"10",pathLength:"100"}),(0,o.jsx)("circle",{className:"box-success-fill",cx:"12",cy:"12",r:"10"}),(0,o.jsx)("polyline",{className:"box-success-check",points:"17,8.5 9.5,15.5 7,13",pathLength:"100"}),(0,o.jsx)("circle",{className:"box-error-fill",cx:"12",cy:"12",r:"10"}),(0,o.jsx)("line",{className:"box-error-bang",x1:"12",y1:"6",x2:"12",y2:"19",pathLength:"100"})]})}function U({className:e="",srcToken:s,receiverAddress:n,onSrcTokenClicked:t,dstToken:i,onSwitchBtnClicked:r,srcInputValue:l,onInputChanged:c,srcConvertedSlot:d,isSpinning:b,onSpinnerClicked:h,srcTokenDisabled:m,feeLines:p,buttonSlot:f,buttonClassName:g,isButtonDisabled:w,onButtonClicked:C,balanceSlot:v,dstAmountSlot:j,dstConvertedSlot:k,appFeeAmtSlot:N,sendInfoTooltip:y,children:I}){let S=F(),[T,B]=(0,a.useState)(!1);return(0,o.jsxs)("div",{style:S??void 0,className:"box-onboarding-outer "+e,children:[(0,o.jsxs)("div",{className:"box-onboarding-top-card",children:[(0,o.jsxs)("div",{className:"box-flex box-items-center box-gap-2",children:[(0,o.jsxs)("button",{disabled:m,onClick:t,className:"box-btn box-relative box-w-8 box-h-8 box-shrink-0",children:[(0,o.jsx)(A,{token:s,className:"box-w-7 box-h-7"}),s?.chainId&&(0,o.jsx)(x,{chainId:s?.chainId,className:"box-absolute box-w-3 box-h-3 box-right-0 box-bottom-0"})]}),(0,o.jsxs)("div",{className:"box-flex-1",children:[(0,o.jsxs)("button",{disabled:m,onClick:t,children:[s?.name??"Select Token",!m&&(0,o.jsx)(u,{className:"box-ml-2"})]}),(0,o.jsx)("div",{className:"box-text-sm box-text-subtle1",children:v&&(0,o.jsxs)(o.Fragment,{children:["Balance: ",v]})})]})]}),(0,o.jsx)("hr",{className:"box-border-t box-my-2"}),(0,o.jsxs)("div",{className:"",children:[(0,o.jsx)("input",{className:"box-onboarding-big-input",value:l,disabled:b,onChange:e=>{Q(e.target.value)&&c?.(e.target.value)}}),(0,o.jsxs)("div",{className:"box-onboarding-src-converted-line",children:[d&&(0,o.jsx)("div",{className:"box-onboarding-equals-circle",children:"="}),d]})]})]}),(0,o.jsx)("div",{className:"box-h-1 box-flex box-justify-center box-items-center",children:(0,o.jsxs)("div",{className:"box-onboarding-middle-circle",children:[b&&(0,o.jsx)("button",{onClick:h,className:"box-onboarding-spinner"}),!b&&(0,o.jsx)(u,{className:"box-w-4 box-h-4 box-text-subtle1"})]})}),(0,o.jsxs)("div",{className:"box-onboarding-middle-card",children:[(0,o.jsxs)("div",{className:"box-relative box-w-8 box-h-8 box-shrink-0",children:[(0,o.jsx)(A,{token:i,className:"box-w-7 box-h-7"}),i?.chainId&&(0,o.jsx)(x,{chainId:i?.chainId,className:"box-absolute box-w-3 box-h-3 box-right-0 box-bottom-0"})]}),(0,o.jsxs)("div",{className:"box-flex box-flex-col box-flex-1",children:[(0,o.jsxs)("div",{className:"box-flex box-justify-between",children:[(0,o.jsx)("div",{className:"box-shrink-0",children:i?.name??"Select Token"}),(0,o.jsx)("div",{children:j})]}),(0,o.jsxs)("div",{className:"box-relative box-flex box-justify-between box-text-sm",children:[n&&(0,o.jsxs)("div",{className:"box-flex box-items-start box-gap-1",children:[y&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{className:"box-btn box-mt-0.5 box-shrink-0",children:(0,o.jsx)("img",{src:'data:image/svg+xml,<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0A  <path fill-rule="evenodd" clip-rule="evenodd"%0A    d="M7.49978 0.876953C3.8421 0.876953 0.876953 3.8421 0.876953 7.49978C0.876953 11.1574 3.8421 14.1226 7.49978 14.1226C11.1574 14.1226 14.1226 11.1574 14.1226 7.49978C14.1226 3.8421 11.1574 0.876953 7.49978 0.876953ZM1.82695 7.49978C1.82695 4.36677 4.36677 1.82695 7.49978 1.82695C10.6328 1.82695 13.1726 4.36677 13.1726 7.49978C13.1726 10.6328 10.6328 13.1726 7.49978 13.1726C4.36677 13.1726 1.82695 10.6328 1.82695 7.49978ZM8.2498 4.50005C8.2498 4.91426 7.91401 5.25005 7.4998 5.25005C7.08558 5.25005 6.7498 4.91426 6.7498 4.50005C6.7498 4.08583 7.08558 3.75005 7.4998 3.75005C7.91401 3.75005 8.2498 4.08583 8.2498 4.50005ZM5.99991 6.00005H6.49991H7.49991C7.77606 6.00005 7.99991 6.2239 7.99991 6.50005V10H8.49991H8.99991V11H8.49991H7.49991H6.49991H5.99991V10H6.49991H6.99991V7.00005H6.49991H5.99991V6.00005Z"%0A    fill="%23A1A1AA" />%0A</svg>',alt:"info"})}),(0,o.jsx)("div",{className:"box-onboarding-popover box-max-w-80",children:y})]}),(0,o.jsxs)("div",{className:"box-receiver-text-line",children:["sending ",i?.name," to"," ",(0,o.jsx)("button",{className:"box-receiver-address-text",children:H(n)}),(0,o.jsx)("div",{className:"box-onboarding-popover box-max-w-80 box-w-fit",children:n})]})]}),(0,o.jsx)("div",{className:"box-text-subtle1",children:k})]})]})]}),(0,o.jsx)("div",{className:"box-onboarding-spacer"}),(0,o.jsxs)("div",{className:"box-onboarding-fee-card",children:[(0,o.jsxs)("div",{className:"box-flex",children:[(0,o.jsx)("div",{className:"box-mr-auto",children:"Application Fee"}),(0,o.jsxs)("div",{className:"box-flex box-gap-1 box-items-center",children:[(0,o.jsx)("div",{className:"box-min-w-8 box-text-right",children:N??"-"}),(0,o.jsx)("button",{onClick:()=>B(!T),className:"ml-[4px] box-opacity-50 group-hover:box-opacity-100 box-transition-transform "+(T?"-box-rotate-90":""),children:(0,o.jsx)(u,{})})]})]}),(0,o.jsx)("div",{className:"box-onboarding-fees-outer "+(T?"box-onboarding-fees-open":"box-onboarding-fees-closed"),children:(0,o.jsxs)("div",{className:"box-min-h-0 box-space-y-1",children:[(0,o.jsx)("div",{className:"box-h-2"}),p?.map(([e,s])=>o.jsxs("div",{className:"box-flex ",children:[o.jsx("div",{className:"box-mr-auto box-text-subtle1",children:e}),o.jsx("div",{className:"box-flex box-gap-1 box-items-center",children:s})]}))]})})]}),(0,o.jsx)("div",{className:"box-onboarding-spacer"}),(0,o.jsx)("button",{className:"box-onboarding-swap-btn "+g,disabled:w,onClick:C,children:f??"Swap"}),I]})}function H(e){return e?`${e.slice(0,5)}\u2026${e.slice(-4)}`:""}function Q(e){if(void 0===e||""===e||"."===e)return!0;if(e.length>10)return!1;let s=Number(e);return 0===s||!(isNaN(s)||s<1e-6)}function G({className:e=""}){return(0,o.jsx)("svg",{className:e,width:"26",height:"26",viewBox:"0 0 26 26",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M23.9958 22.8036L19.175 17.9828C20.5833 16.3578 21.3958 14.1911 21.3958 11.862C21.3958 6.66198 17.1167 2.38281 11.9167 2.38281C6.71667 2.38281 2.4375 6.71615 2.4375 11.9161C2.4375 17.1161 6.71667 21.3953 11.9167 21.3953C14.2458 21.3953 16.3583 20.5286 18.0375 19.1745L22.8583 23.9953C23.0208 24.1578 23.2375 24.212 23.4542 24.212C23.6708 24.212 23.8875 24.1578 24.05 23.9953C24.2667 23.6703 24.2667 23.1286 23.9958 22.8036ZM11.9167 19.7703C7.58333 19.7703 4.0625 16.2495 4.0625 11.9161C4.0625 7.58281 7.58333 4.06198 11.9167 4.06198C16.25 4.06198 19.7708 7.58281 19.7708 11.9161C19.7708 16.2495 16.25 19.7703 11.9167 19.7703Z"})})}function R({feeLines:e=[],totalLabel:s,totalAmtSlot:n,className:t=""}){let[i,r]=(0,a.useState)(!1);return(0,o.jsxs)("div",{className:"box-fee-card "+t,children:[(0,o.jsxs)("div",{className:"box-flex",children:[(0,o.jsx)("div",{className:"box-mr-auto",children:s}),(0,o.jsxs)("div",{className:"box-flex box-gap-1 box-items-center",children:[(0,o.jsx)("div",{className:"box-min-w-8 box-text-right",children:n??"-"}),(0,o.jsx)("button",{onClick:()=>r(!i),className:"ml-[4px] box-opacity-50 group-hover:box-opacity-100 box-transition-transform "+(i?"-box-rotate-90":""),children:(0,o.jsx)(u,{})})]})]}),(0,o.jsx)("div",{className:"box-fees-outer "+(i?"box-fees-open":"box-fees-closed"),children:(0,o.jsxs)("div",{className:"box-min-h-0 box-space-y-1",children:[(0,o.jsx)("div",{className:"box-h-1"}),e?.filter(([e,s])=>null!=e&&null!=s)?.map(([e,s])=>o.jsxs("div",{className:"box-flex ",children:[o.jsx("div",{className:"box-mr-auto box-text-subtle1",children:e}),o.jsx("div",{className:"box-flex box-gap-1 box-items-center",children:s})]},e?.toString()))]})})]})}l(M,"SwapArrowsIcon"),l(L,"StatusCircle"),l(U,"OnboardingModalShell"),l(H,"formatAddress"),l(Q,"isValidInput"),l(function({className:e=""}){return(0,o.jsx)("svg",{className:e,width:"12",height:"13",viewBox:"0 0 12 13",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M1.75 2.37506V11.7501H7.75V2.37506C7.75 2.07669 7.63147 1.79054 7.4205 1.57957C7.20952 1.36859 6.92337 1.25006 6.625 1.25006H2.875C2.57663 1.25006 2.29048 1.36859 2.0795 1.57957C1.86853 1.79054 1.75 2.07669 1.75 2.37506ZM8.5 10.6251V11.7501H8.875C8.97446 11.7501 9.06984 11.7896 9.14017 11.8599C9.21049 11.9302 9.25 12.0256 9.25 12.1251C9.25 12.2245 9.21049 12.3199 9.14017 12.3902C9.06984 12.4606 8.97446 12.5001 8.875 12.5001H0.625C0.525544 12.5001 0.430161 12.4606 0.359835 12.3902C0.289509 12.3199 0.25 12.2245 0.25 12.1251C0.25 12.0256 0.289509 11.9302 0.359835 11.8599C0.430161 11.7896 0.525544 11.7501 0.625 11.7501H1V2.37506C1 1.87778 1.19754 1.40087 1.54917 1.04924C1.90081 0.697605 2.37772 0.500061 2.875 0.500061H6.625C7.12228 0.500061 7.59919 0.697605 7.95083 1.04924C8.30246 1.40087 8.5 1.87778 8.5 2.37506V9.12506C8.5 9.42343 8.61853 9.70958 8.8295 9.92056C9.04048 10.1315 9.32663 10.2501 9.625 10.2501C9.92337 10.2501 10.2095 10.1315 10.4205 9.92056C10.6315 9.70958 10.75 9.42343 10.75 9.12506V5.87531C10.75 5.63189 10.6711 5.39504 10.525 5.20031L9.7 4.10006C9.64033 4.0205 9.6147 3.92048 9.62877 3.82203C9.64283 3.72357 9.69543 3.63473 9.775 3.57506C9.85456 3.51539 9.95458 3.48976 10.053 3.50383C10.1515 3.5179 10.2403 3.5705 10.3 3.65006L11.125 4.75031C11.3687 5.07431 11.5 5.46956 11.5 5.87531V9.12506C11.5 9.47327 11.403 9.8146 11.22 10.1108C11.0369 10.407 10.775 10.6464 10.4635 10.8021C10.1521 10.9578 9.80342 11.0238 9.45661 10.9925C9.10981 10.9612 8.77857 10.834 8.5 10.6251ZM2.5 2.37506V5.37506C2.5 5.47452 2.53951 5.5699 2.60984 5.64023C2.68016 5.71055 2.77554 5.75006 2.875 5.75006H6.625C6.72446 5.75006 6.81984 5.71055 6.89017 5.64023C6.96049 5.5699 7 5.47452 7 5.37506V2.37506C7 2.2756 6.96049 2.18022 6.89017 2.1099C6.81984 2.03957 6.72446 2.00006 6.625 2.00006H2.875C2.77554 2.00006 2.68016 2.03957 2.60984 2.1099C2.53951 2.18022 2.5 2.2756 2.5 2.37506ZM3.25 2.75006H6.25V5.00006H3.25V2.75006Z"})})},"GasPumpIcon"),l(G,"SearchIcon"),l(R,"CollapsibleFeeSection")},79482:function(e,s,n){n.d(s,{ie:function(){return e6}});var t=n(7653),a=n(27073),o=n(60734),i=n(37553),r=n(27573),l=n(12460),c=n(1666),d=n(56488),x=n(58027),u=n(56752),b=n(24717),h=n(89369),m=n(46575),A=n(74871),p=()=>{let{isConnected:e}=(0,A.m)();return e},f=()=>{let{address:e}=(0,A.m)();return e},g=({token:e,chainId:s,skip:n})=>{let t=(0,o.Zl)();s=s||t;let i=(0,a.AD)(s),r=!!(e&&e!==x.DR);return{chainId:s,enabled:r&&!i&&!n,isErc:r}},w=n(51453),C=n(338),v=n(16395),j=n(7734);function k(e){return"number"==typeof e?e:"wei"===e?0:Math.abs(j.Bd[e])}var N=n(51461),y=n(85705);async function I(e,s){let{allowFailure:n=!0,chainId:t,contracts:a,...o}=s,i=e.getClient({chainId:t});return(0,y.s)(i,N.A,"multicall")({allowFailure:n,contracts:a,...o})}var S=n(41668);async function T(e,s){let{allowFailure:n=!0,blockNumber:t,blockTag:a,...o}=s,i=s.contracts;try{let s={};for(let[n,t]of i.entries()){let a=t.chainId??e.state.chainId;s[a]||(s[a]=[]),s[a]?.push({contract:t,index:n})}let r=(await Promise.all(Object.entries(s).map(([s,i])=>I(e,{...o,allowFailure:n,blockNumber:t,blockTag:a,chainId:Number.parseInt(s),contracts:i.map(({contract:e})=>e)})))).flat(),l=Object.values(s).flatMap(e=>e.map(({index:e})=>e));return r.reduce((e,s,n)=>(e&&(e[l[n]]=s),e),[])}catch(o){if(o instanceof w.uq)throw o;let s=()=>i.map(s=>(0,S.L)(e,{...s,blockNumber:t,blockTag:a}));if(n)return(await Promise.allSettled(s())).map(e=>"fulfilled"===e.status?{result:e.value,status:"success"}:{error:e.reason,result:void 0,status:"failure"});return await Promise.all(s())}}async function B(e,s){let{address:n,chainId:t,formatUnits:a=18}=s;function o(e){return[{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:e}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:e}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]}]}try{let s=o("string"),i={address:n,abi:s,chainId:t},[r,l,d,x]=await T(e,{allowFailure:!0,contracts:[{...i,functionName:"decimals"},{...i,functionName:"name"},{...i,functionName:"symbol"},{...i,functionName:"totalSupply"}]});if(l.error instanceof w.uq)throw l.error;if(d.error instanceof w.uq)throw d.error;if(r.error)throw r.error;if(x.error)throw x.error;return{address:n,decimals:r.result,name:l.result,symbol:d.result,totalSupply:{formatted:(0,c.b)(x.result,k(a)),value:x.result}}}catch(s){if(s instanceof w.uq){let s={address:n,abi:o("bytes32"),chainId:t},[i,r,l,d]=await T(e,{allowFailure:!1,contracts:[{...s,functionName:"decimals"},{...s,functionName:"name"},{...s,functionName:"symbol"},{...s,functionName:"totalSupply"}]});return{address:n,decimals:i,name:(0,C.rR)((0,v.f)(r,{dir:"right"})),symbol:(0,C.rR)((0,v.f)(l,{dir:"right"})),totalSupply:{formatted:(0,c.b)(d,k(a)),value:d}}}throw s}}var F=n(92540),E=n(99688),P=n(7109),O=n(26989),D=e=>{let{token:s}=e,{chainId:n,enabled:t}=g(e),{data:o}=function(){var e,s;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{address:t,query:a={}}=n,o=(0,O.Z)(n),i=(0,P.x)({config:o}),r=function(e,s={}){return{async queryFn({queryKey:s}){let{address:n,scopeKey:t,...a}=s[1];if(!n)throw Error("address is required");return B(e,{...a,address:n})},queryKey:function(e={}){return["token",(0,F.OP)(e)]}(s)}}(o,{...n,chainId:null!==(e=n.chainId)&&void 0!==e?e:i}),l=!!(t&&(null===(s=a.enabled)||void 0===s||s));return(0,E.aM)({...a,...r,enabled:l})}({address:s,query:{enabled:t},chainId:n});if(!o)return(0,a.x8)(n)||void 0;let i=o.symbol||"",r=o.name||"";return{...o,chainId:n,isNative:s===x.DR,symbol:i,name:r}},M=n(79625);async function L(e,s){let{address:n,blockNumber:t,blockTag:a,chainId:o,token:i,unit:r="ether"}=s;if(i)try{return U(e,{balanceAddress:n,chainId:o,symbolType:"string",tokenAddress:i})}catch(s){if(s instanceof w.uq){let s=await U(e,{balanceAddress:n,chainId:o,symbolType:"bytes32",tokenAddress:i}),t=(0,C.rR)((0,v.f)(s.symbol,{dir:"right"}));return{...s,symbol:t}}throw s}let l=e.getClient({chainId:o}),d=(0,y.s)(l,M.s,"getBalance"),x=await d(t?{address:n,blockNumber:t}:{address:n,blockTag:a}),u=e.chains.find(e=>e.id===o)??l.chain;return{decimals:u.nativeCurrency.decimals,formatted:(0,c.b)(x,k(r)),symbol:u.nativeCurrency.symbol,value:x}}async function U(e,s){let{balanceAddress:n,chainId:t,symbolType:a,tokenAddress:o,unit:i}=s,r={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:a}]}],address:o},[l,d,x]=await T(e,{allowFailure:!1,contracts:[{...r,functionName:"balanceOf",args:[n],chainId:t},{...r,functionName:"decimals",chainId:t},{...r,functionName:"symbol",chainId:t}]}),u=(0,c.b)(l??"0",k(i??d));return{decimals:d,formatted:u,symbol:x,value:l}}var H=e=>{let{token:s}=e,{chainId:n,isErc:t}=g(e),a=D(e),{data:i}=function(){var e,s;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{address:t,query:a={}}=n,o=(0,O.Z)(n),i=(0,P.x)({config:o}),r=function(e,s={}){return{async queryFn({queryKey:s}){let{address:n,scopeKey:t,...a}=s[1];if(!n)throw Error("address is required");return await L(e,{...a,address:n})??null},queryKey:function(e={}){return["balance",(0,F.OP)(e)]}(s)}}(o,{...n,chainId:null!==(e=n.chainId)&&void 0!==e?e:i}),l=!!(t&&(null===(s=a.enabled)||void 0===s||s));return(0,E.aM)({...a,...r,enabled:l})}({address:(0,o.b7)(),token:t?s:void 0,chainId:n});if(!i||!a)return;let{formatted:r,value:l}=i;return{...a,balance:l,balanceFloat:parseFloat(r)}},Q=n(42269),G=async({user:e,token:s,spender:n,chainId:t,wagmiConfig:a})=>await (0,S.L)(a,{address:s,abi:Q.Wo,functionName:"allowance",args:[e,n],chainId:t}),R=n(48825),q=async({tx:e,address:s,chainId:n,wagmiConfig:t})=>{let o=function(e,s={}){let n=function(e,s={}){let n;try{n=e.getClient(s)}catch{}return n}(e,s);return n?.extend(R.I)}(t,{chainId:n});if(!(!s||!o))try{let n=o.estimateGas({account:s,...e}),t=o.getGasPrice(),[a,i]=await Promise.all([n,t]);return{gas:a,price:i,value:a*i}}catch(s){if(`${s}`.match(/exceeds the balance/i))return{gas:a.fV,price:a.fV,value:a.fV};let e="couldn't estimate ⛽️";throw console.error(e),new a.tk(`${e}: ${s}`)}},W=n(60590),K=({tx:e,chainId:s,wagmiConfig:n})=>{let{address:t}=(0,W.D)(n);return q({tx:e,address:t,chainId:s,wagmiConfig:n})},V=n(92644),J=({token:e,spender:s,user:n,chainId:a,skip:i,cost:r,dependencies:l=[],wagmiConfig:c})=>{let[d,u]=(0,t.useState)(),[b,h]=(0,t.useState)();return(0,o.bd)(async()=>{if(i||!e||e===x.DR)return;u(await G({wagmiConfig:c,token:e,spender:s,user:n,chainId:a}));let t={to:e,data:(0,V.R)({abi:Q.Wo,functionName:"approve",args:[s,r]})},o=await K({tx:t,chainId:a,wagmiConfig:c});h(o?.gas)},[e,s,n,...l]),e===x.DR?{approved:!0,gasNeeded:0n}:void 0===d?{approved:!1}:{approved:r<=d,gasNeeded:b}},Z=(0,t.createContext)({}),Y=n(73822),z=n(34258),X=n(12660);async function _(e,s){let{addEthereumChainParameter:n,chainId:t}=s,a=e.state.connections.get(s.connector?.uid??e.state.current);if(a){let e=a.connector;if(!e.switchChain)throw new X.O({connector:e});return await e.switchChain({addEthereumChainParameter:n,chainId:t})}let o=e.chains.find(e=>e.id===t);if(!o)throw new z.X4;return e.setState(e=>({...e,chainId:t})),o}var $=n(8123);let ee=[];function es(e){let s=e.chains;return(0,$.v)(ee,s)?ee:(ee=s,s)}var en=n(60040),et=n(85835),ea=(0,t.createContext)({}),eo=e=>{throw e instanceof l.mk&&/user\s*rejected/i.test(e.shortMessage)?new o.Ai("You've rejected the transaction."):new o.KE(e instanceof l.mk||e instanceof w.uq?e.shortMessage:`${e}`)},ei=n(63704),er=n(41111),el=["function approve(address spender, uint256 amount) external"],ec=async({token:e,spender:s,amount:n,wagmiConfig:t})=>{try{return await (0,ei.n)(t,{address:e,abi:(0,er.V)(el),functionName:"approve",args:[s,n]})}catch(e){return eo(e)}},ed=n(52531),ex=async(e,{chainId:s,wagmiConfig:n})=>{try{return await (0,ed.e)(n,{hash:e,chainId:s})}catch(e){eo(e)}},eu=n(5391),eb=n(68),eh=n(17312);async function em(e,s){let n;let{account:t,chainId:a,connector:o,gas:i,...r}=s;n="object"==typeof t&&t?.type==="local"?e.getClient({chainId:a}):await (0,eh.e)(e,{account:t??void 0,chainId:a,connector:o});let{connector:l}=(0,W.D)(e),c=await (async()=>{if(!(!("data"in s)||!s.data||(o??l)?.supportsSimulation)&&null!==i)return void 0===i?(0,y.s)(n,eu.Q,"estimateGas")({...r,account:t,chain:a?{id:a}:null}):i})(),d=(0,y.s)(n,eb.T,"sendTransaction");return await d({...r,...t?{account:t}:{},gas:c,chain:a?{id:a}:null})}(0,h.v)("3.0",6);var eA={hooksContext:({setUseTokenInfo:e,setUseBalance:s,setUseWalletConnected:n,setUseUsersAddress:a,setUseUserApprovedToken:o,children:i})=>((0,t.useEffect)(()=>{e(()=>D),s(()=>H),n(()=>p),a(()=>f),o(()=>J)},[]),(0,r.jsx)(Z.Provider,{value:{},children:i})),networkSelectorContext:({children:e,onConnectWallet:s})=>{let{setSrcChainId:n,setSwitchChain:i}=(0,o.nh)(),{isConnected:l,chain:c}=(0,A.m)(),{switchChainAsync:d}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{mutation:s}=e,n=(0,O.Z)(e),{mutate:a,mutateAsync:o,...i}=(0,Y.D)({...s,mutationFn:e=>_(n,e),mutationKey:["switchChain"]});return{...i,chains:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,O.Z)(e);return(0,t.useSyncExternalStore)(e=>(function(e,s){let{onChange:n}=s;return e._internal.chains.subscribe((e,s)=>{n(e,s)})})(s,{onChange:e}),()=>es(s),()=>es(s))}({config:n}),switchChain:a,switchChainAsync:o}}();(0,en.$)(),(0,t.useEffect)(()=>{i(()=>x)},[d,c]);let x=async e=>(0,a.R2)(e)?l?u(e):(s(),!1):u(e),u=async e=>{if((0,a.R2)(e)&&d&&c)try{return await d({chainId:e}),n(e),!0}catch(e){return e instanceof et.ab?console.error("user rejected chain switch"):console.error(e),!1}return n(e),!0};return(0,t.useEffect)(()=>{c&&n(c.id)},[c]),(0,r.jsx)(ea.Provider,{value:{},children:e})},approveToken:ec,getAllowance:G,executor:async(e,s)=>{let n=e?.chainId,t=s?.chainId,a=s?.wagmiConfig;if(n&&t&&n!=t)throw Error("Cannot Execute: Chain ID Mismatch");let o=(0,W.D)(a),i=async e=>{let s={"0x838b2520":12000n,"0x9a2ac6d5":12000n,"0x4fb1a07b":25000n,"25e16063":25000n,"731133e9":15000n},n=Object.keys(s).find(e=>x?.data?.includes(e.slice(2))),t=(await q({tx:e,address:o.address,wagmiConfig:a}))?.gas;return t&&n?t*s[n]/10000n:t},{maxFeePerGas:r,gasPrice:l,maxPriorityFeePerGas:c,...d}=e,x={...d};r?(x.maxFeePerGas=r,x.maxPriorityFeePerGas=c):x.gasPrice=l;let u=await i(x);try{return await em(a,{...x,gas:u})}catch(e){return eo(e)}},estimateGas:K,confirmTransaction:ex},ep=n(3458),ef=n(68571),eg=Object.defineProperty,ew=(e,s)=>eg(e,"name",{value:s,configurable:!0});function eC(e){var s,n,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e){if(Array.isArray(e))for(s=0;s<e.length;s++)e[s]&&(n=eC(e[s]))&&(t&&(t+=" "),t+=n);else for(s in e)e[s]&&(t&&(t+=" "),t+=s)}return t}function ev(){for(var e,s,n=0,t="";n<arguments.length;)(e=arguments[n++])&&(s=eC(e))&&(t&&(t+=" "),t+=s);return t}ew(eC,"r"),ew(ev,"clsx");var ej={[a.a_.POLYGON]:"Polygon",[a.a_.ARBITRUM]:"Arbitrum",[a.a_.OPTIMISM]:"Optimism",[a.a_.ETHEREUM]:"Ethereum",[a.a_.GOERLI]:"Goerli Ethereum",[a.a_.SOLANA_DEVNET]:"Solana Devnet",[a.a_.SOLANA_MAINNET]:"Solana"};function ek(){let e=(0,o.Zl)();return(0,r.jsxs)("span",{className:"box-rounded-full box-border box-py-[2px] box-px-2",children:[(0,r.jsx)(i.fq,{chainId:e})," ",(0,r.jsx)("span",{className:"box-text-xs box-leading-tight",children:ej[e]})]})}ew(ek,"ChainLabel");var eN=(0,t.createContext)({}),ey=ew(({actionType:e,actionConfig:s,children:n,cost:i,dstChainId:l,paymentButtonText:c})=>{let d=(0,o.Zl)(),[x,u]=(0,t.useState)(1),[b,h]=(0,t.useState)(!1),m=ew(()=>{try{return(0,a.F5)(d)?(0,a.s5)(d):(0,a.s5)(l)}catch(e){return console.error("Error getting default source token:",e),(0,a.s5)(a.a_.ETHEREUM)}},"getDefaultSrcToken"),A=m(),[p,f]=(0,t.useState)(A),g=(0,t.useRef)(null);(0,t.useEffect)(()=>{g.current&&g.current.chainId===d||(f(m()),g.current=null)},[d,l]);let w=ew(e=>{g.current=e||null,f(e||m())},"setUserSelectedSrcToken"),{tokenAddress:C}=i||{},v=(0,o.wp)({token:C,chainId:l}),j=!(0,a.NY)({actionType:e,actionConfig:s})&&!i?.amount;return(0,r.jsx)(eN.Provider,{value:{cost:i,dstToken:v,srcToken:p,dstChainId:l,setSrcToken:w,slippage:x,setSlippage:u,isFree:j,refreshApproval:b,setRefreshApproval:h,paymentButtonText:c||"Pay now"},children:n})},"PaymentContextProvider"),eI=ew(()=>(0,t.useContext)(eN),"usePaymentContext"),eS=ew(()=>eI().dstChainId,"useDstChainId"),eT=ew(({loadingStep:e})=>(0,r.jsxs)("div",{className:"box-flex box-justify-center box-gap-3",children:[(0,r.jsx)("div",{className:"box-w-[10px] box-h-[10px] box-rounded-full box-bg-[#00000019] box-grid box-place-items-center",children:(7===e||1===e||2===e)&&(0,r.jsx)("div",{className:"box-w-[200%] box-h-[200%] box-rounded-full box-radial-purple box-grow"})}),(0,r.jsx)("div",{className:"box-w-[10px] box-h-[10px] box-rounded-full box-bg-[#00000019] box-grid box-place-items-center",children:(4===e||5===e)&&(0,r.jsx)("div",{className:"box-w-[200%] box-h-[200%] box-rounded-full box-radial-purple box-grow"})}),(0,r.jsx)("div",{className:"box-w-[10px] box-h-[10px] box-rounded-full box-bg-[#00000019] box-grid box-place-items-center",children:6===e&&(0,r.jsx)("div",{className:"box-w-[200%] box-h-[200%] box-rounded-full box-radial-purple box-grow"})})]}),"BottomIndicator"),eB=ew((e,s)=>{let[n,a]=(0,t.useState)(void 0);return(0,t.useEffect)(()=>{s&&a(s)},[s]),n&&e?`https://www.decentscan.xyz/?chainId=${e}&txHash=${n}`:""},"useTxLink"),eF=ew((e,s=6)=>{if(0==e)return e;let n=Math.pow(10,s-Math.floor(Math.log10(Math.abs(e)))-1);return Math.round(e*n)/n},"formatSignificantDigits"),eE=ew(e=>e.src?e.src:e,"imgSrc"),eP=(0,t.createContext)({}),eO=ew(({children:e})=>{let[s,n]=(0,t.useState)({loadingStep:0,errorMessage:void 0,showModal:!1,txHash:void 0}),[a,o]=(0,t.useState)("Idle"),[i,l]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{i&&s.showModal&&n(e=>({...e,showModal:!1}))},[i,s.showModal]),(0,r.jsx)(eP.Provider,{value:{loading:s,payStep:a,setPayStep:o,disableModals:i,setLoading:n,setDisableModals:l},children:e})},"StepContextProvider"),eD=ew(()=>(0,t.useContext)(eP),"useStepContext"),eM=new Set([1,2,3,4,5]),eL=ew(()=>(0,r.jsx)("div",{children:(0,r.jsx)("img",{className:"box-mx-auto",src:eE('data:image/svg+xml,<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">%0A  <circle cx="7" cy="7" r="7" fill="%2341C9A7" />%0A  <path d="M10.4621 4.90198L6.05062 9.31344L4.04541 7.30823" stroke="%23E7F8F4" stroke-width="1.21875" stroke-linecap="round" stroke-linejoin="round" />%0A</svg>'),alt:"success",width:80})}),"CheckIcon");function eU(){let{loading:e,setLoading:s}=eD(),{errorMessage:n,loadingStep:t,showModal:a}=e,l=(0,o.Zl)(),c=l!=eS(),d=eB(l,e.txHash),x={1:"Waiting for token approval...",4:"Waiting for confirmation...",5:`${c?"Bridging and ":""}Executing...`,7:n},u={1:"Token Confirmation",2:"Approving in progress",3:"Finding a route",4:"Transaction confirmation",5:"Transaction in progress"},b={1:"Confirm Token",2:"Approving Token",3:"Finding a Route",4:"Confirm Transaction",5:"Completing Transaction",6:"Success",7:"Error"};return(0,r.jsx)(i.Yj,{children:(0,r.jsxs)(i.Oq,{isOpen:a??!1,setClosed:()=>s({...e,showModal:!1}),className:"box-w-full",children:[(0,r.jsx)(ek,{}),(0,r.jsx)("div",{className:"box-text-sm box-text-center box-h-8 box-mt-8 box-mb-6",children:u[t]&&(0,r.jsx)("span",{className:"box-loading-badge",children:u[t]})}),eM.has(t)&&(0,r.jsx)(i.$j,{}),6===t&&(0,r.jsx)(eL,{}),(0,r.jsx)("div",{className:"box-text-2xl box-font-medium box-my-6 box-text-center box-overflow-hidden",children:b[t]&&(0,r.jsx)("div",{children:b[t]})}),(0,r.jsx)("div",{className:"box-h-36 box-text-center",children:6===t?(0,r.jsx)("a",{className:"box-font-medium",target:"_blank",rel:"noreferrer",href:d,children:"View Transaction ->"}):x[t]}),(0,r.jsx)(eT,{loadingStep:t})]})})}ew(eU,"LoadingModal");var eH=(0,t.createContext)({}),eQ=ew(({boxProps:e,children:s})=>(0,r.jsx)(eH.Provider,{value:e,children:s}),"BoxPropsContextProvider"),eG=ew(()=>(0,t.useContext)(eH).disableGuard,"useDisableGuard"),eR=ew(async({confirmTx:e,txHash:s,chainId:n,wagmiConfig:t})=>{for(let o of[,,,,,].keys())try{return await e(s,{chainId:n,wagmiConfig:t})}catch(e){if(e instanceof l.Bh||e instanceof l.Yb){await (0,a._v)(1e3);continue}throw e}throw new a.tk(`
  Tx not found ${(0,a.K6)({hash:s,chainId:n})} (5 retries)`)},"confirmWithRetries");function eq({className:e=""}){return(0,r.jsx)("div",{className:"animate-spin "+e,children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"#FFFFFF",children:(0,r.jsx)("path",{d:"M18.75 10C19.4404 10 20.0081 10.5618 19.922 11.2468C19.729 12.7828 19.1811 14.2591 18.3147 15.5557C17.2159 17.2002 15.6541 18.4819 13.8268 19.2388C11.9996 19.9957 9.98891 20.1937 8.0491 19.8078C6.10929 19.422 4.32746 18.4696 2.92894 17.0711C1.53041 15.6725 0.578004 13.8907 0.192152 11.9509C-0.1937 10.0111 0.00433284 8.00042 0.761209 6.17316C1.51809 4.3459 2.79981 2.78412 4.4443 1.6853C5.74095 0.818913 7.2172 0.271033 8.75322 0.0780196C9.43819 -0.00805244 10 0.559644 10 1.25C10 1.94036 9.43655 2.48939 8.75576 2.60392C7.71517 2.77899 6.71839 3.17253 5.83323 3.76398C4.59986 4.58809 3.63856 5.75943 3.07091 7.12987C2.50325 8.50032 2.35473 10.0083 2.64411 11.4632C2.9335 12.918 3.64781 14.2544 4.6967 15.3033C5.7456 16.3522 7.08197 17.0665 8.53683 17.3559C9.99168 17.6453 11.4997 17.4967 12.8701 16.9291C14.2406 16.3614 15.4119 15.4001 16.236 14.1668C16.8275 13.2816 17.221 12.2848 17.3961 11.2442C17.5106 10.5634 18.0596 10 18.75 10Z",fill:"#ffffff"})})})}ew(eq,"LoadingCircle");var eW=ew(({srcToken:e,userAddress:s,srcChainId:n,hasFunds:l,hasApproval:c,hasGasForApproval:d,hasGasFunds:x,gasError:u,loadingDismissTimeout:b,wagmiConfig:h,chainActions:m,callbacks:A,refreshApproval:p,refreshHasFunds:f,walletConnected:g,disabled:w=!1})=>{let{actionResponse:C,isLoading:v,error:j}=(0,o.Sl)(),{executor:k,confirmTransaction:N,getAllowance:y,approveToken:I}=m,{srcChainId:S,switchChain:T}=(0,o.nh)(),{paymentButtonText:B}=eI(),{setLoading:F,payStep:E,setPayStep:P}=eD(),O=eG(),[D,M]=(0,t.useState)(!1),[L,U]=(0,t.useState)(!1),[H,Q]=(0,t.useState)(),[G,R]=(0,t.useState)(),[q,W]=(0,t.useState)(!0),{data:K}=(0,o.qX)({address:s,token:e.address,chainId:n}),V=K?.balance;(0,o.bd)(async()=>{if(!O){W(!1);return}let{message:e,disable:s}=await O();W(s),R(e)},[O,g]);let J=(0,t.useCallback)(e=>{clearTimeout(H),e instanceof o.Ai?F({loadingStep:7,errorMessage:"You've rejected the transaction.",showModal:!0}):e instanceof a.tk?F({loadingStep:7,errorMessage:"Please refresh page and try again.",showModal:!0}):F({loadingStep:7,errorMessage:"Unable to execute transaction.",showModal:!0}),A.onTxError?.(e),U(!1),Q(setTimeout(()=>{F({loadingStep:0,showModal:!1})},b/4))},[A.onTxError]),Z=(0,t.useCallback)(e=>{e.preventDefault(),T(n),e.stopPropagation()},[T,n]),Y=(0,t.useCallback)(async()=>{if(!C)return;let e=C.tx;clearTimeout(H);try{U(!0),F({loadingStep:4,showModal:!0});let s=await k(e,{chainId:n,wagmiConfig:h});F({loadingStep:5,txHash:s,showModal:!0});let t=await eR({confirmTx:N,txHash:s,chainId:n,wagmiConfig:h});F({loadingStep:6,showModal:!0}),A.onTxReceipt?.(t);let a=setTimeout(()=>{F({loadingStep:0,showModal:!1})},b);Q(a)}catch(e){J(e)}finally{U(!1)}},[C,n,k,h,N,A.onTxReceipt,J,H,b,F]),z=(0,t.useCallback)(async()=>{if(!C||!s)return;let{tokenPayment:e,tx:t}=C;if(!e||!t||e.isNative)return;let{to:a}=t,{amount:o,tokenAddress:i}=e;return eK({token:i,spender:a,user:s,amount:o,srcChainId:n,getAllowance:y,confirmTransaction:N,approveToken:I,wagmiConfig:h})},[C,s,n,y,N,I,h]),X=(0,t.useCallback)(async()=>{try{M(!0),F({loadingStep:2,showModal:!0}),await z(),p(),f(),M(!1),U(!0),await Y()}catch(e){J(e)}finally{M(!1),U(!1)}},[z,p,f,Y,F]),_=(0,t.useCallback)(()=>{if(!g)return"Connect Wallet";if(void 0===V||!C||v)return"Loading";if(S!==n)return"Switch Network";if(q||j)return"Error";if(L)return"Executing";if(!l)return"Insufficient Funds";if(!x)return"Insufficient Funds For Gas";if(u)return"Error Estimating Gas";if(S===n&&C){if(D)return"Approving";if(C.tokenPayment&&!C.tokenPayment.isNative&&!c&&d&&V&&V>=C.tokenPayment.amount)return"Approve Token"}return"Pay"},[g,V,C,v,S,n,q,j,L,l,x,u,D,c,d]);P(_());let $=(0,t.useCallback)(()=>{if(j&&g)return j instanceof a.tk?j.message:"Try another token";switch(E){case"Loading":case"Approving":case"Executing":case"Loading":case"Confirm Executing":return(0,r.jsx)(eq,{className:"box-mx-auto box-w-5"});case"Pay":case"Idle":return B;case"Error":return q?G:E;default:return E}},[E,j]),ee=(0,t.useCallback)(()=>{switch(E){case"Connect Wallet":return A.onConnectWallet;case"Switch Network":return Z;case"Approve Token":return X;case"Pay":return Y;default:return}},[_,A.onConnectWallet,Z,X,w,E]),es=(0,t.useCallback)(()=>!!w||!["Connect Wallet","Switch Network","Approve Token","Pay"].includes(_())||q||!(0,a.F5)(n),[_,w,q,n]),en=(0,t.useCallback)(()=>$(),[$]),et=(0,t.useCallback)(()=>{switch(E){case"Error Estimating Gas":case"Insufficient Funds":case"Insufficient Funds For Gas":case"Error":return"box-buy-btn box-text-red box-bg-red";default:return"box-btn-primary box-buy-btn box-block box-w-full box-flex box-items-center box-justify-center"}},[E]),ea=ee(),eo=es();return(0,r.jsx)(i.Yj,{children:(0,r.jsx)("button",{className:`${et()}`,onClick:ea,disabled:eo,children:en()})})},"PayButton"),eK=ew(async({token:e,spender:s,user:n,amount:t,srcChainId:a,getAllowance:o,confirmTransaction:i,approveToken:r,wagmiConfig:l})=>{if(await o({token:e,spender:s,user:n,wagmiConfig:l})<t){let n=await r({token:e,spender:s,amount:t,wagmiConfig:l});return await i(n,{wagmiConfig:l,chainId:a}),!0}return!1},"checkForApproval");function eV({chainId:e,tokenAddress:s,balance:n,loadingContent:t,loadingClassName:a="box-load-shine box-w-[24px] box-h-[24px]",className:i="",withCommas:l=!1}){let{data:c,isLoading:d}=(0,o.zJ)({chainId:e,tokenAddress:s,enable:!!n&&n>0});if(d)return(0,r.jsx)("div",{className:a,children:t});if(0==n)return(0,r.jsx)("div",{className:i,children:"$0.00"});if(!n||!c||isNaN(Number(c.usdPrice)))return(0,r.jsx)("div",{className:i,children:"-"});let x=(Number(n)*Number(c.usdPrice)).toFixed(2);return l&&(x=eJ(x)),(0,r.jsxs)("div",{className:i,children:["$",x]})}function eJ(e){return e.replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g,",")}ew(eV,"TokenUsdEstimate"),ew(eJ,"numberWithCommas");var eZ=ew(()=>{let e=(0,o.Zl)(),{isLoading:s,actionResponse:n,error:t}=(0,o.Sl)(),{srcToken:l,isFree:c,cost:d,dstToken:x}=eI(),u=(0,o._b)(),{tokenPayment:b}=n||{};if(c)return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"box-text-right box-price",children:"Free"}),(0,r.jsx)("div",{className:"box-text-subtle1 box-text-sm box-font-normal",children:"-"})]});if((!u||!(0,a.F5)(e))&&x&&d){let{amount:e}=d;return(0,r.jsx)(eY,{amount:e,token:x})}if(t)return null;if(s||!l||!b)return(0,r.jsx)(i.Yj,{children:(0,r.jsx)("div",{className:"box-load-shine box-h-[30px] box-w-[90px]"})});let{amount:h}=b;return(0,r.jsx)(eY,{amount:h,token:l})},"Price");function eY({amount:e,token:s}){let{decimals:n,symbol:t}=s,a=eF(parseFloat((0,c.b)(e,n)),4);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"box-text-right box-price",children:`${a} ${t}`}),(0,r.jsx)("div",{className:"box-text-subtle1 box-text-sm box-font-normal",children:s&&(0,r.jsx)(eV,{tokenAddress:s.address,chainId:s.chainId,balance:a,className:"box-text-subtle2",loadingContent:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:"-"}),(0,r.jsx)("div",{className:"box-swap-load-shine box-absolute box-inset-0"})]}),loadingClassName:"box-relative box-text-right box-w-6"})})]})}ew(eY,"PriceComponent");var ez=ew(()=>{let{srcToken:e}=eI(),s=(0,o.Zl)(),n=(0,o.$i)({token:e?.address,chainId:s,skip:s!==e?.chainId});if(!n)return(0,r.jsx)("span",{});let{balanceFloat:t,symbol:a}=n,i=t.toFixed(3);return(0,r.jsx)("div",{className:"box-text-sm box-font-normal box-text-subtle1",children:(0,r.jsxs)("span",{children:["Balance: ",i," ",a]})})},"ShowBalance"),eX=ew(({children:e,apiKey:s,actionConfig:n,actionType:a,mockEvm:i})=>{let l=(0,o.Zl)(),{srcToken:c,dstToken:d,slippage:x,dstChainId:u}=eI(),b=(0,o.b7)(),[h,m]=(0,t.useState)(!0);(0,t.useEffect)(()=>{m(!!(b&&c&&d&&l===c?.chainId))},[b,c,d,l]);let A={actionType:a,actionConfig:n,srcChainId:l,sender:b,slippage:x,srcToken:c.address,dstToken:d.address,dstChainId:u,enable:h};return(0,r.jsx)(o.Ch,{apiKey:s,mockEvm:i,children:(0,r.jsx)(o.NG,{...A,children:e})})},"BoxHooksProviders"),e_=ew((e,s)=>{for(let n of s)if(void 0===e[n])throw new a.IX(`Missing key "${n}" from the actionConfig`)},"checkValidityOfRequiredTypes"),e$=ew((e,s)=>{e_(e,["chainId","contractAddress"])},"validateActionConfig"),e0=ew(()=>{let e=(0,o.Zl)();return(0,r.jsx)("span",{children:a.x8(e)?.symbol})},"ChainSymbol"),e1=ew(({srcChainId:e,wagmiConfig:s})=>{let n=e??(0,o.Zl)(),a=(0,o.b7)(),{actionResponse:i}=(0,o.Sl)(),{tokenPayment:r,tx:l}=i||{},{to:c}=l||{},{amount:d,tokenAddress:x}=r||{},{refreshApproval:u}=eI(),[b,h]=(0,t.useState)(!1),m=ew(()=>h(!b),"refresh"),A=(0,o.$i)({chainId:n}),{approved:p,gasNeeded:f}=(0,o.Gc)({token:x,chainId:n,skip:!x||!d||!c||!a,cost:d,spender:c,user:a,dependencies:[u,b],wagmiConfig:s});if(p)return{approved:p,hasGasForApproval:!0,refresh:m};if(!f||!A)return{approved:!1,refresh:m};let g=A.balance>f;return{approved:p,gasNeeded:f,hasGasForApproval:g,refresh:m}},"useUserApprovedOrHasGasForApproval"),e2=ew(({inputtedSrcChain:e,inputtedSrcToken:s,wagmiConfig:n})=>{let{isFree:i,srcToken:r}=eI(),l=eD(),c=s??r,{actionResponse:d}=(0,o.Sl)(),{amount:x}=d?.tokenPayment||{},u=(0,o.$h)(),b=d?.tx,[h,m]=(0,t.useState)(),[A,p]=(0,t.useState)(null),f=e??(0,o.Zl)(),{approved:g,refresh:w}=e1({srcChainId:f,wagmiConfig:n}),[C,v]=(0,t.useState)(!1),j=ew(()=>{v(!C),w()},"refresh");(0,o.bd)(async()=>{if(l?.setPayStep?.("Loading"),p(null),!u||!b){l?.setPayStep?.("Idle");return}if(!g){l?.setPayStep?.("Approve Token");return}try{let e=await u({tx:b,chainId:f,wagmiConfig:n});m(e?.value),l?.setPayStep?.("Pay")}catch(e){e.message.includes("transfer amount exceeds allowance")?(j(),l?.setPayStep?.("Approve Token")):(p({message:`${e}`,error:e}),l?.setPayStep?.("Error"))}},[u,d,C]);let k=(0,o.$i)({token:c?.address,chainId:f,skip:c?.chainId!==f}),N=(0,o.$i)({chainId:f});return d&&k&&N&&void 0!==h?i?{gas:h,hasFunds:!0,hasGasFunds:h<N.balance,error:A,refresh:j}:void 0===x?{gas:h,hasFunds:!1,hasGasFunds:!1,error:A,refresh:j}:{gas:h,hasFunds:x<=k.balance,hasGasFunds:h!=a.fV&&(c?.isNative?x:0n)+h<N.balance,error:A,refresh:j}:{hasFunds:!1,hasGasFunds:!1,gas:h,error:A,refresh:j}},"useUserHasEnoughFunds"),e5=ew(({className:e,onConnectWallet:s,onTxError:n,onTxPending:l,onTxReceipt:c,disableLoadingModals:u=!1,chains:b,wagmiConfig:h})=>{let{actionResponse:m,actionRequest:A,isLoading:p,actionConfig:f,refreshAction:g}=(0,o.Sl)(),{dstChainId:w,srcToken:C,setSrcToken:v}=eI(),j=(0,o._b)(),{srcChainId:k,switchChain:N}=(0,o.nh)(),{setDisableModals:y}=eD();(0,t.useEffect)(()=>{y(u)},[u]);let[I,S]=(0,t.useState)(!1),T=(0,o.b7)(),{allowSwapping:B=!0}=f,F=(0,i.yl)(),E=(0,o.AT)(),{approved:P,hasGasForApproval:O,refresh:D}=e1({srcChainId:C?.chainId,wagmiConfig:h}),{hasFunds:M,hasGasFunds:L,error:U,gas:H,refresh:Q}=e2({inputtedSrcChain:k,inputtedSrcToken:C,wagmiConfig:h});(0,t.useEffect)(()=>{D(),Q()},[A,j]),(0,t.useEffect)(()=>{g&&g()},[j]);let G=H!=a.fV?H:void 0,R=[["App fee",m?.applicationFee?.amount],["Protocol fee",m?.protocolFee?.amount],["Bridge fee",m?.bridgeFee?.amount],["Gas fee",G]],q=R.reduce((e,[s,n])=>e+(n??0n),0n),W=parseFloat((0,d.d)(q)),K=R.map(([e,s])=>[e,null==s?(0,r.jsxs)(r.Fragment,{children:["- ",(0,r.jsx)(e0,{})]}):(0,r.jsxs)(r.Fragment,{children:[e7(s)," ",(0,r.jsx)(e0,{})]})]);return(0,r.jsxs)("div",{style:F??void 0,className:ev("the-box",e),children:[(0,r.jsxs)("div",{className:"box-main-section",children:[(0,r.jsxs)("div",{className:"box-relative box-w-[40px] box-h-[38px] box-mr-[8px] box-flex box-items-center box-shrink-0",children:[(0,r.jsx)(i.Sj,{token:C,className:"box-w-[36px] box-h-[36px]"}),C&&(0,r.jsx)(i.fq,{chainId:C?.chainId,className:"box-absolute box-right-0 box-bottom-0"})]}),(0,r.jsxs)("div",{className:"box-mr-auto",children:[(0,r.jsxs)("button",{className:"box-font-medium box-whitespace-nowrap box-flex box-items-center",onClick:()=>S(!0),disabled:!B,children:[(0,r.jsx)("span",{className:"box-inline-block box-truncate box-max-w-44",children:C?.name??"Select Token"}),B&&(0,r.jsx)(i.PE,{className:"box-ml-1"})]}),(0,r.jsx)(ez,{})]}),(0,r.jsx)("div",{className:"box-flex box-flex-col box-i box-flex-1 box-items-end box-relative box-ml-auto",children:(0,r.jsx)(eZ,{})})]}),(0,r.jsx)(i.Oq,{isOpen:I,hideCloseIcon:!0,innerClassName:"box-p-1",setClosed:()=>S(!1),children:(0,r.jsx)(i.U9,{className:"box-border-0",selectedToken:C,setSelectedToken:async e=>{await N?.(e?.chainId)&&v(e),S(!1)},selectChains:b??[k],selectTokens:[],address:T})}),(0,r.jsx)(i.vX,{className:"mt-3",totalAmtSlot:(0,r.jsx)(i.Ol,{tokenAddress:x.DR,chainId:C?.chainId??1,balance:W,loading:p}),totalLabel:"Expected Fees",feeLines:K}),(0,r.jsx)(eW,{srcToken:C,hasFunds:M,hasGasFunds:L,gasError:U,hasGasForApproval:O,hasApproval:P,userAddress:T,srcChainId:k,dstChainId:w,wagmiConfig:h,loadingDismissTimeout:5e3,chainActions:E,callbacks:{onConnectWallet:s,onTxError:n,onTxPending:l,onTxReceipt:c},refreshApproval:D,refreshHasFunds:Q,walletConnected:j}),(0,r.jsx)(eU,{})]})},"TheBoxImpl"),e9=ew(e=>{let{actionConfig:s,paymentButtonText:n,providers:t,actionType:a,onConnectWallet:i}=e;e$(s,a);let{cost:l,chainId:c}=s;return(0,r.jsx)(m.J$,{value:{dedupingInterval:100,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1},children:(0,r.jsx)(o.Zr,{dstChainId:c,children:(0,r.jsx)(o.zk,{onConnectWallet:i,providers:{[o.bY.Evm]:eA,...t},children:(0,r.jsx)(eQ,{boxProps:e,children:(0,r.jsx)(eO,{children:(0,r.jsx)(ey,{actionType:a,actionConfig:s,cost:l,dstChainId:c,paymentButtonText:n,children:(0,r.jsx)(eX,{mockEvm:!!ef.env.NEXT_PUBLIC_MOCKED_EVM,...e,children:(0,r.jsx)(e5,{...e})})})})})})})})},"TheBox"),e7=ew(e=>{let s=parseFloat((0,d.d)(e));return 0===s?"-":s<1e-6?"<0.000001":s.toFixed(6)},"formatBigInt"),e6=e9;function e3({className:e=""}){return(0,r.jsx)(i.$C,{status:"loading",className:e})}ew(e3,"LoadingCircle");var e8=ew(({changeWalletIsOpen:e,setChangeWalletIsOpen:s,otherWallet:n,setOtherWallet:a,placeholder:o})=>{let[l,c]=(0,t.useState)(!0),[d,x]=(0,t.useState)(n??"");return(0,r.jsxs)(i.Oq,{closeOnOutsideClick:!1,isOpen:e,setClosed:()=>s(!1),innerClassName:"box-p-6 box-pt-6 box-min-w-80",className:"box-w-[32rem]",children:[(0,r.jsx)("div",{className:"box-font-medium",children:"Change Destination Address"}),(0,r.jsxs)("div",{className:"box-swap-send-wallet-input",children:[(0,r.jsx)("p",{className:"box-font-medium box-text-subtle1 box-px-2 box-font-sm",children:"Send to wallet address"}),(0,r.jsx)("input",{type:"text",className:"box-block box-w-full box-p-2 box-outline-none",value:d,onChange:e=>{let s=e.target.value;e4(s)&&(c(!0),x(s))},placeholder:o})]}),(0,r.jsx)("div",{className:"box-mt-2 box-h-5 px-2 box-text-red",children:!l&&"Invalid address"}),(0,r.jsxs)("button",{className:"box-btn-primary box-w-full box-mt-4",disabled:!l,onClick:()=>{if((0,u.U)(d)||""==d)c(!0);else{c(!1);return}a(""==d?void 0:(0,b.K)(d)),s(!1)},children:["Confirm ",(0,r.jsx)("span",{className:"box-hidden xs:box-inline",children:"new wallet address"})]})]})},"SendToWalletDialog");function e4(e){return!!(void 0===e||""===e||"0x".startsWith(e)||e.match(/^0x[0-9a-fA-F]+$/))}ew(e4,"isValidInput");var se=(0,t.createContext)({}),ss=[a.a_.ETHEREUM,a.a_.POLYGON,a.a_.OPTIMISM,a.a_.ARBITRUM,a.a_.BASE],sn=[a.a_.SEPOLIA,a.a_.ARBITRUM_SEPOLIA,a.a_.OPTIMISM_SEPOLIA,a.a_.BASE_SEPOLIA,a.a_.POLYGON_AMOY],st=ew(({chainIconDictOverride:e,popularTokens:s,chainIds:n,disabled:t,wagmiConfig:a,hidePopularSection:o,enableTestnets:i,children:l})=>(0,r.jsx)(se.Provider,{value:{chainIconDictOverride:e??{},popularTokens:s??[],hidePopularSection:o??!1,chainIds:n??(i?sn:ss),disabled:t??!1,wagmiConfig:a,enableTestnets:i??!1},children:l}),"SwapModalContextProvider"),sa=ew(()=>(0,t.useContext)(se),"useSwapModalContext"),so=ew(()=>sa().chainIconDictOverride,"useChainIconDictOverride");function si(e,s){let n=s.toLowerCase(),t=a.qz(e)?.toLowerCase();return t==n||e.toString()==n?3:t?.startsWith(n)?2:1}ew(si,"getSortRank");var sr=ew(({chainId:e,setChainId:s})=>{let{chainIconDictOverride:n,chainIds:o}=sa(),[l,c]=(0,t.useState)(""),d=o;return l&&(d=o.filter(e=>!!a.qz(e)?.toLowerCase().includes(l.toLowerCase())||!!e.toString().includes(l))).sort((e,s)=>si(s,l)-si(e,l)),(0,r.jsxs)(r.Fragment,{children:[o.length>5&&(0,r.jsxs)("div",{className:"box-address-search-box box-my-4",children:[(0,r.jsx)("span",{children:(0,r.jsx)(i.W1,{className:"box-address-search-icon"})}),(0,r.jsx)("input",{onChange:e=>c(e.target.value),value:l,className:"box-bg-transparent box-outline-none box-flex-1 ",type:"text",placeholder:"Search by chain name or ID"})]}),(0,r.jsxs)("div",{className:"box-chain-select-row",children:[d.slice(0,5).map(t=>(0,r.jsxs)("div",{className:"box-relative",children:[(0,r.jsx)("button",{title:(0,a.qz)(t)??void 0,className:"box-chain-select-btn "+(t==e?"box-border-primary":""),onClick:()=>s(t),children:(0,r.jsx)(i.fq,{className:"box-h-7",chainId:t,chainIconDictOverride:n})}),(0,r.jsx)("div",{className:"box-chain-select-popover",children:(0,a.qz)(t)})]},t)),d.length>5&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(i.oT,{srcChainId:e,setSrcChainId:s,chains:d,title:"",anchorToRight:!0,chainIconDictOverride:n,customTriggerElement:(0,r.jsx)("div",{className:"box-btn box-px-2 box-border box-rounded hover:box-hover-color box-flex box-items-center box-h-[38px] "+(o.slice(5).includes(e)?"box-border-primary":""),children:(0,r.jsxs)("span",{children:["+ ",d.length-5," more"]})})})})]})]})},"ChainSelectRow"),sl=ew(({isOpen:e,setIsOpen:s,chainId:n,setChainId:t,selectedToken:l,setSelectedToken:c})=>{let d=(0,o.b7)(),{popularTokens:x,hidePopularSection:u}=sa();return(0,r.jsxs)(i.Oq,{isOpen:e,hideCloseIcon:!0,setClosed:()=>s(!1),className:"box-h-[40rem]",innerClassName:"box-p-0 box-pt-6 box-max-w-md box-w-screen",children:[(0,r.jsxs)("div",{className:"box-p-6 box-pt-0 box-border-b",children:[(0,r.jsx)("div",{className:"",children:"1. Select Network"}),(0,r.jsx)(sr,{chainId:n,setChainId:t})]}),(0,r.jsxs)("div",{className:"box-p-2",children:[(0,r.jsxs)("div",{className:"box-px-4 box-pt-4",children:["2. Select any token on ",(0,a.qz)(n)]}),(0,r.jsx)(i.kB,{selectedToken:l,setSelectedToken:c,chainId:n,address:d,selectorOnly:!0,searchBoxClassName:"box-py-3",showUsdValue:!0,popularTokens:x,hidePopularSection:u})]})]})},"SwapTokenAndNetworkDialog"),sc=ew(e=>parseFloat((0,d.d)(e)).toFixed(6),"formatFee"),sd=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:"-"}),(0,r.jsx)("div",{className:"box-swap-load-shine box-absolute box-inset-0"})]}),sx="box-relative box-text-right box-w-6";function su({actionRequest:e,actionResponse:s,gasEstimator:n,wagmiConfig:o,setEstimable:i,setGasTokenUsdProps:r,setGasEstimate:l}){(0,t.useEffect)(()=>{ew(async()=>{if(l?.(void 0),i(!1),!s||!e)return;let{tx:t}=s,c=e.srcChainId;if(c)try{let e=await n({tx:t,chainId:c,wagmiConfig:o});if(!e)return;let s=e?.value!=a.fV;i(s),l?.(e),r({tokenAddress:x.DR,chainId:c,balance:Number((0,d.d)(s?e?.value:0n)),loadingContent:sd,loadingClassName:sx})}catch(e){console.error(e)}},"getGasAmount")()},[s])}ew(su,"useGasFee");var sb=ew(()=>{let{wagmiConfig:e}=sa(),[s,n]=(0,t.useState)(!1),{actionResponse:l,actionRequest:c}=(0,o.Sl)(),[d,u]=(0,t.useState)(),[b,h]=(0,t.useState)(!0),[m,A]=(0,t.useState)(),p=(0,o.$h)(),f=m==a.fV?0n:m;su({actionResponse:l,actionRequest:c,gasEstimator:p,wagmiConfig:e,setEstimable:h,setGasTokenUsdProps:u,setGasEstimate:A});let g=[["App fee",l?.applicationFee?.amount],["Protocol fee",l?.protocolFee?.amount],["Bridge fee",l?.bridgeFee?.amount],["Gas fee",f]],w=g.reduce((e,[s,n])=>"bigint"==typeof n?e+n:e,0n);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"box-swap-fee-card",children:[(0,r.jsxs)("div",{className:"box-flex",children:[(0,r.jsx)("div",{className:"box-mr-auto",children:"Expected Fees"}),(0,r.jsxs)("div",{className:"box-flex box-gap-1 box-items-center",children:[w&&c?(0,r.jsx)("div",{children:(0,r.jsx)(eV,{tokenAddress:x.DR,chainId:c.srcChainId,balance:Number(sc(w)),loadingContent:sd,loadingClassName:sx})}):(0,r.jsx)("span",{children:"-"}),(0,r.jsx)("button",{onClick:()=>n(!s),className:"box-ml-[4px] box-opacity-50 group-hover:box-opacity-100 box-transition-transform "+(s?"-box-rotate-90":""),children:(0,r.jsx)(i.PE,{})})]})]}),(0,r.jsx)("div",{className:"box-swap-modal-fees-outer "+(s?"box-swap-modal-fees-open":"box-swap-modal-fees-closed"),children:(0,r.jsxs)("div",{className:"box-swap-modal-fees",children:[g.map(([e,s])=>(0,r.jsxs)("div",{className:"box-flex justify-between",children:[(0,r.jsx)("div",{className:"box-mr-auto box-text-subtle1",children:e}),(0,r.jsx)("div",{className:"box-flex box-gap-1 box-items-center",children:"bigint"==typeof s&&c?(0,r.jsxs)("div",{children:[sc(s)," ",a.x8(c?.srcChainId)?.symbol]}):(0,r.jsx)("span",{children:"-"})})]},e)),(0,r.jsxs)("div",{className:"box-flex justify-between",children:[(0,r.jsx)("div",{className:"box-mr-auto box-text-subtle1",children:"Max slippage"}),(0,r.jsx)("div",{children:"1% auto"})]})]})})]})})},"GasFee");function sh(e){return e>=1e5?e.toFixed(0):e>=1?e.toFixed(2):e>=1e-5?parseFloat(e.toPrecision(5)).toString():e.toFixed(10)}ew(sh,"getRoundedValue");var sm=ew(e=>{let{isFrom:s,selectedToken:n,userBalanceFloat:t,inputEnabled:a,openDropdown:l,input:d,rawInput:x,setRawInput:u,handleInputChange:b,disabled:h=!1}=e,{isLoading:m,actionResponse:A}=(0,o.Sl)(),p=s?A?.tokenPayment:A?.amountOut,f=n&&p?sh(Number((0,c.b)(p.amount,n.decimals))):"0",g=x??f,w=d??Number(f),C=so();return(0,r.jsxs)("div",{className:"box-swap-modal-token-card",children:[(0,r.jsxs)("div",{className:"box-flex box-items-center box-text-sm",children:[(0,r.jsx)("div",{children:s?"From":"To"}),s&&(0,r.jsx)("div",{id:"box-status-indicator",className:"box-ml-auto box-w-fit"})]}),(0,r.jsxs)("div",{className:"box-flex box-gap-1 box-items-center",children:[(0,r.jsxs)("div",{className:"box-relative box-w-[40px] box-h-[38px] box-mr-[8px] box-flex box-items-center box-shrink-0",children:[(0,r.jsx)(i.Sj,{token:n,className:"box-w-[36px] box-h-[36px]"}),n?(0,r.jsx)(i.fq,{chainId:n?.chainId,className:"box-absolute box-right-0 box-bottom-0",chainIconDictOverride:C}):(0,r.jsx)(sA,{className:"box-absolute box-right-0 box-bottom-0"})]}),(0,r.jsxs)("div",{className:"box-mr-auto",children:[(0,r.jsxs)("button",{className:"box-font-medium box-whitespace-nowrap",onClick:()=>l(!0),disabled:h,children:[n?.name??"Select Token",(0,r.jsx)(i.PE,{className:"box-ml-1"})]}),(0,r.jsx)("div",{className:"box-text-subtle1 box-text-sm box-flex box-items-center",children:(0,r.jsxs)("div",{className:"box-text-subtle1 box-mr-2",children:["Balance: ",sp(t??0)]})})]}),(0,r.jsxs)("div",{className:"box-flex box-flex-col box-items-end box-flex-1 box-relative",children:[(0,r.jsxs)("div",{className:"box-relative",children:[(0,r.jsx)("input",{className:"box-swap-input box-font-medium",placeholder:"0",value:g,onChange:b,onClick:e=>{e.currentTarget.select()}}),a&&m&&(0,r.jsx)("div",{className:"box-absolute box-inset-0 box-rounded box-swap-load-shine"})]}),(0,r.jsx)("div",{className:"box-text-subtle1 box-text-sm",children:n&&(0,r.jsx)(eV,{tokenAddress:n.address,chainId:n.chainId,balance:w,className:"box-text-subtle2",loadingContent:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:"-"}),(0,r.jsx)("div",{className:"box-swap-load-shine box-absolute box-inset-0"})]}),loadingClassName:"box-relative box-text-right box-w-6"})})]})]})]})},"TokenCard");function sA({className:e=""}){return(0,r.jsx)("div",{className:"box-chain-placeholder "+e})}function sp(e){return e>1?e.toFixed(4):Number(e.toPrecision(4)).toString()}function sf({className:e=""}){return(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[(0,r.jsx)("path",{d:"M8.62012 17.5C13.3145 17.5 17.1201 13.6944 17.1201 9C17.1201 4.30559 13.3145 0.5 8.62012 0.5C3.9257 0.5 0.120117 4.30559 0.120117 9C0.120117 13.6944 3.9257 17.5 8.62012 17.5Z",className:"box-circle-link-bg"}),(0,r.jsx)("path",{d:"M9.87084 8.67177C9.57777 8.37877 9.18033 8.21417 8.76591 8.21417C8.3515 8.21417 7.95405 8.37877 7.66098 8.67177L6.08251 10.2507C5.78953 10.5437 5.62496 10.9412 5.625 11.3556C5.62504 11.7699 5.7897 12.1673 6.08274 12.4603C6.37579 12.7533 6.77322 12.9179 7.18761 12.9178C7.60199 12.9178 7.99939 12.7531 8.29237 12.4601L8.44031 12.32M8.29237 10.2507C8.43745 10.3958 8.60971 10.511 8.7993 10.5895C8.98888 10.6681 9.19209 10.7085 9.3973 10.7085C9.60251 10.7085 9.80572 10.6681 9.9953 10.5895C10.1849 10.511 10.3571 10.3958 10.5022 10.2507L12.0802 8.67177C12.3733 8.37878 12.5379 7.98139 12.538 7.567C12.538 7.15261 12.3735 6.75518 12.0805 6.46214C11.7875 6.16909 11.3901 6.00444 10.9757 6.00439C10.5613 6.00435 10.1639 6.16892 9.87084 6.46191L9.39707 6.9048",className:"box-circle-link-chain",strokeWidth:"0.921734",strokeLinecap:"round",strokeLinejoin:"round"})]})}function sg({status:e="standby",className:s="",setIsOpen:n}){let t="loading"===e?"box-bg-[#256AF6]":"success"===e?"box-bg-[#11BC91]":"error"===e?"box-bg-[#EB5757]":"box-bg-black";return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("button",{onClick:()=>n(!0),className:"box-status-indicator-btn "+("standby"===e?"box-hidden ":"")+s,children:[(0,r.jsx)("div",{className:"box-rounded-full box-w-1 box-h-1 "+t}),(0,r.jsx)("div",{className:"box-mr-auto",children:"status"}),(0,r.jsx)(i.$C,{status:e,className:"box-w-3"}),(0,r.jsx)("span",{className:"box-lowercase",children:e}),(0,r.jsx)(sf,{})]})})}function sw({submittedTx:e,txHash:s,isOpen:n,setIsOpen:l,resetStatus:d,indicatorSlot:x,className:u=""}){let b=so(),{isLoading:h,data:m,error:A}=(0,o.ch)({txHash:s,chainId:e?.srcToken?.chainId}),p=s&&e,f=ew(()=>{let s=e?.req?.srcChainId,n=e?.req?.dstChainId,t=a.pU(s)?.isCanonicalSrc&&n==(0,a.wi)(s);return p&&(t||s===n)?"Executed":A?"Failed":void 0},"statusOverride")()??m?.status,g=A?.toString()??m?.transaction?.srcTx?.error??m?.transaction?.dstTx?.fast?.error??m?.transaction?.dstTx?.canonical?.error,w="Executed"===f?"success":"Failed"===f?"error":"loading",C=ew(()=>{l(!1),"loading"!=w&&d()},"setClosed"),v=(0,t.useRef)();(0,t.useEffect)(()=>{p&&v.current!==f&&("Executed"===f||"Failed"===f)&&l(!0),v.current=f},[f]);let j=p?(0,c.b)(e?.res?.tokenPayment?.amount.toString(),e?.srcToken?.decimals):"",k=p?(0,c.b)(e?.res?.amountOut?.amount.toString(),e?.dstToken?.decimals):"";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.Oq,{isOpen:n,setClosed:C,className:"box-w-full box-max-w-[28rem] "+u,innerClassName:"",children:[(0,r.jsx)(i.$C,{status:w,className:"box-w-20 box-mx-auto box-py-4"}),(0,r.jsx)("div",{className:"box-px-10 box-py-2 box-text-center",children:"loading"===w?"Transaction processing":"success"===w?"Transaction complete":"error"===w?"Transaction failed":""}),(0,r.jsxs)("div",{className:"box-text-left",children:[p&&"Failed"===f&&(0,r.jsx)("div",{className:"box-status-info-box",children:{STF:"Insufficient slippage for transaction."}[g]??`Something went wrong: ${g}`}),p&&"Failed"!=f&&(0,r.jsxs)("div",{className:"box-status-info-box",children:[(0,r.jsxs)("div",{className:"box-flex",children:[(0,r.jsx)("div",{className:"box-flex box-items-center",children:(0,r.jsxs)("div",{className:"box-relative box-w-[40px] box-h-[38px] box-mr-[8px] box-flex box-items-center box-shrink-0",children:[(0,r.jsx)(i.Sj,{token:e?.srcToken,className:"box-w-[36px] box-h-[36px]"}),(0,r.jsx)(i.fq,{chainId:e?.srcToken?.chainId,className:"box-absolute box-right-0 box-bottom-0",chainIconDictOverride:b})]})}),(0,r.jsx)("div",{className:"box-flex box-flex-grow",children:(0,r.jsxs)("span",{className:"box-block box-w-full box-text-sm",children:["From:\xa0",(0,a.qz)(e?.srcToken?.chainId),(0,r.jsx)("br",{}),sv(j),"\xa0",e?.srcToken?.symbol]})})]}),(0,r.jsx)("div",{className:"box-flex box-items-center box-px-2",children:"→"}),(0,r.jsxs)("div",{className:"box-flex",children:[(0,r.jsx)("div",{className:"box-flex box-items-center",children:(0,r.jsxs)("div",{className:"box-relative box-w-[40px] box-h-[38px] box-mr-[8px] box-flex box-items-center box-shrink-0",children:[(0,r.jsx)(i.Sj,{token:e?.dstToken,className:"box-w-[36px] box-h-[36px]"}),(0,r.jsx)(i.fq,{chainId:e?.dstToken?.chainId,className:"box-absolute box-right-0 box-bottom-0",chainIconDictOverride:b})]})}),(0,r.jsx)("div",{className:"box-flex box-flex-grow",children:(0,r.jsxs)("span",{className:"box-block box-w-full box-text-sm",children:["To:\xa0",(0,a.qz)(e?.dstToken?.chainId),(0,r.jsx)("br",{}),sv(k),"\xa0",e?.dstToken?.symbol]})})]})]}),p&&(0,r.jsx)("div",{className:"box-text-center box-pt-4",children:(0,r.jsx)("a",{href:`https://decentscan.xyz?chainId=${e?.srcToken?.chainId}&txHash=${s}`,target:"_blank",className:"box-block box-text-primary box-text-center box-font-medium box-mx-auto",children:"View On DecentScan"})})]})]}),x&&(0,ep.createPortal)((0,r.jsx)(sg,{status:p?w:"standby",setIsOpen:l}),x)]})}function sC(e,s){return parseFloat(e.toFixed(s)).toString()}function sv(e){let s=parseFloat(e);return s?s>1e3?Math.round(s).toString():s<1?sC(s,5):sC(s,2):e}ew(sA,"ChainPlaceholder"),ew(sp,"formatBalance"),ew(sf,"CircleLink"),ew(sg,"SwapStatusIndicator"),ew(sw,"SwapStatusModal"),ew(sC,"toTrimmedFixed"),ew(sv,"formatTokenAmt");var sj=ew(({srcToken:e,dstToken:s,tokensAreSelected:n,setIsSubmitting:a,resetInputs:o})=>{let[i,l]=(0,t.useState)(!1),{disabled:c,wagmiConfig:d}=sa(),{onClickSubmit:x,isDisabled:u,buttonContent:b,buttonClassName:h,submittedTx:m,txHash:A,resetStatus:p}=sk({srcToken:e,dstToken:s,tokensAreSelected:n,setIsSubmitting:a,resetInputs:o,setStatusIsOpen:l,userSetDisabled:c,wagmiConfig:d});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{className:`box-btn-primary box-buy-btn box-block box-w-full ${h}`,onClick:x,disabled:u,children:b}),(0,r.jsx)(sw,{submittedTx:m,txHash:A,setIsOpen:l,isOpen:i,resetStatus:p,indicatorSlot:document.getElementById("box-status-indicator")})]})},"ExecuteSwapButton");function sk({srcToken:e,dstToken:s,tokensAreSelected:n,setIsSubmitting:i,resetInputs:l,setStatusIsOpen:c,userSetDisabled:d,wagmiConfig:x}){let{actionRequest:u,actionResponse:b,isLoading:h,error:m}=(0,o.Sl)(),[A,p]=(0,t.useState)(),[f,g]=(0,t.useState)(null),[w,C]=(0,t.useState)(!1),{chainId:v}=e,{executor:j,confirmTransaction:k,getAllowance:N,approveToken:y}=(0,o.AT)(),{approved:I,hasGasForApproval:S,refresh:T}=e1({srcChainId:e.chainId,wagmiConfig:x}),{hasFunds:B,hasGasFunds:F,error:E,refresh:P}=e2({inputtedSrcChain:v,inputtedSrcToken:e,wagmiConfig:x}),O=(0,o.b7)(),D=o.qX({address:O,token:e.address,chainId:v})?.data?.balance,{srcChainId:M,switchChain:L}=(0,o.nh)(),[U,H]=(0,t.useState)(!0),[Q,G]=(0,t.useState)(!1),[R,q]=(0,t.useState)(!1),W=ew(()=>{c(!1),g(null),p(null)},"resetStatus"),K=ew(e=>{e.preventDefault(),L(v),e.stopPropagation()},"handleSwitchNetwork"),V=ew(async()=>{if(!b)return;let n=b.tx,{chainId:t}=n;if(t&&t!=v)throw Error("Cannot Execute: Chain ID Mismatch");g({srcToken:e,dstToken:s,req:u,res:b});let a=await j(n,{chainId:v,wagmiConfig:x});p(a),l(),c(!0),C(!0),await eR({confirmTx:k,txHash:a,chainId:v,wagmiConfig:x})},"pay"),J=ew(async()=>{try{q(!0),await V()}catch(e){e instanceof o.Ai?console.error("You've rejected the transaction."):console.error("error!",e)}finally{i(!1),q(!1)}},"carryTxExecution"),Z=ew(async()=>{try{i(!0),G(!0),await Y(),setTimeout(()=>{T(),P()},0),G(!1),q(!0),await V()}catch(e){e instanceof o.Ai?console.error("You've rejected the transaction."):console.error("error!",e)}finally{i(!1),G(!1),q(!1)}},"approveCarryTxExecution"),Y=ew(async()=>{if(!b||!O)return;let{tokenPayment:e,tx:s}=b;if(!e||!s)return;let{to:n}=s,{isNative:t,amount:a,tokenAddress:o}=e;!t&&await sI({token:o,spender:n,user:O,amount:a,srcChainId:v,getAllowance:N,confirmTransaction:k,approveToken:y,wagmiConfig:x})&&H(!1)},"approveTokenHandler"),z=ew(()=>"Switch Network"==ee||"Connect Wallet"==ee?K:"Approve Token"==ee?Z:"Swap"==ee?J:void 0,"getHandler"),X=ew(()=>!!m||!!d||"Switch Network"!=ee&&"Connect Wallet"!=ee&&"Swap"!=ee&&"Approve Token"!=ee,"getIsDisabled"),_=ew(()=>n?O?h?"Fetching Routes...":M!=v?"Switch Network":M==v&&b?Q?"Approving":b.tokenPayment&&!b.tokenPayment.isNative&&!I&&S&&D&&D>=b.tokenPayment.amount?"Approve Token":R?"Executing":B?F?E?"Error Estimating Gas":"Swap":"Insufficient Funds For Gas":"Insufficient Funds":M==v?"Enter an Amount":"Loading":"Connect Wallet":"Select tokens","getProcessStep"),$=ew(()=>{if(m)return m instanceof a.tk?m.message:"Something went wrong";switch(ee){case"Fetching Routes...":case"Approving":case"Executing":case"Loading":return(0,r.jsx)(eq,{className:"box-mx-auto box-w-5"});default:return ee}},"getButtonContent"),ee=_();return{onClickSubmit:z(),isDisabled:X(),submittedTx:f,txHash:A,processStep:ee,resetStatus:W,buttonContent:$(),buttonClassName:sN(ee)}}function sN(e){switch(e){case"Error Estimating Gas":case"Insufficient Funds":case"Insufficient Funds For Gas":return"box-text-red box-bg-red";default:return""}}ew(sk,"useExecuteSwap"),ew(sN,"getButtonClassName");var sy=ew(async({token:e,spender:s,user:n,amount:t,getAllowance:a,wagmiConfig:o})=>await a({token:e,spender:s,user:n,wagmiConfig:o})>=t,"userHasApproval"),sI=ew(async({token:e,spender:s,user:n,amount:t,srcChainId:a,getAllowance:o,confirmTransaction:i,approveToken:r,wagmiConfig:l})=>{if(!await sy({token:e,spender:s,user:n,amount:t,getAllowance:o,wagmiConfig:l})){let n=await r({token:e,spender:s,amount:t,wagmiConfig:l});return await i(n,{wagmiConfig:l,chainId:a}),!0}return!1},"checkForApproval"),sS=["UNCONFIRMED","STATE_ROOT_NOT_PUBLISHED","IN_CHALLENGE_PERIOD"],sT=["READY_TO_PROVE"],sB=["CONFIRMED","READY_FOR_RELAY"],sF=["EXECUTED","RELAYED"];function sE({address:e,chainId:s}){let[n,l]=(0,t.useState)([]),[c,d]=(0,t.useState)(!1),x=(0,o.K7)(),{executor:u}=(0,o.AT)(),{srcChainId:b,switchChain:h}=(0,o.nh)(),{wagmiConfig:m}=sa(),A=ew(async()=>{try{l([]),d(!0);let n=`${(0,a.JW)()}/api/getWithdrawals?chainId=${s}&address=${e}`,t=await x(n);if(!t.ok)throw Error("Could not fetch withdrawals.");let o=await t.json();l(o)}catch(e){l([]),console.error("Error loading withdrawals:",e)}finally{d(!1)}},"loadWithdrawals");(0,t.useEffect)(()=>{A()},[s]);let p=ew(async e=>{try{let n=(0,a.yB)(s);if(b!=n){if(!h)throw Error("Cannot switch network");await h(n)}await u(e,{chainId:n,wagmiConfig:m}),A()}catch(e){console.error(e)}},"handleClaimClick"),[f,g]=(0,t.useState)(!1),w=n?.filter(e=>sS.includes(e.status)).length||0,C=n?.filter(e=>sB.includes(e.status)).length||0,v=n?.filter(e=>sT.includes(e.status)).length||0,j=n?.filter(e=>!sF.includes(e.status))||[];if(0==j.length)return(0,r.jsx)(r.Fragment,{});let k=(0,r.jsxs)("div",{className:"box-flex box-flex-wrap box-items-center box-gap-1 box-mr-auto",children:[(0,r.jsx)("div",{className:"box-pr-2",children:"View\xa0all\xa0withdrawals"}),(0,r.jsxs)("div",{className:"box-flex box-gap-1",children:[w>0&&(0,r.jsxs)("button",{onClick:()=>g(!0),className:"box-swap-withdraw-badge box-swap-badge-yellow",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"box-w-4 box-h-4",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),w," pending"]}),v>0&&(0,r.jsxs)("button",{onClick:()=>g(!0),className:"box-swap-withdraw-badge box-swap-badge-yellow",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"box-w-4 box-h-4",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),v," provable"]}),C>0&&(0,r.jsxs)("button",{onClick:()=>g(!0),className:"box-swap-withdraw-badge box-swap-badge-green",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"box-w-4 box-h-4",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),C," claimable"]})]})]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"box-swap-withdraw-notification",children:[k,(0,r.jsx)("button",{onClick:()=>g(!0),children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"box-w-4 box-h-4",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})})]}),(0,r.jsxs)(i.Oq,{isOpen:f,setClosed:()=>g(!1),className:"box-withdraw-dialog",innerClassName:"box-withdraw-dialog-inner",children:[k,(0,r.jsxs)("div",{className:"box-swap-withdraw-grid",children:[(0,r.jsxs)("div",{className:"box-hidden md:box-contents ",children:[(0,r.jsx)("div",{className:"box-font-medium",children:"Action"}),(0,r.jsx)("div",{className:"box-font-medium",children:"Date"}),(0,r.jsx)("div",{className:"box-font-medium",children:"Token"}),(0,r.jsx)("div",{className:"box-font-medium",children:"From"}),(0,r.jsx)("div",{className:"box-font-medium"}),(0,r.jsx)("div",{className:"box-font-medium",children:"To"}),(0,r.jsx)("hr",{className:"box-col-span-full"})]}),c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"box-h-4 box-w-32 box-swap-load-shine box-rounded"}),(0,r.jsx)("div",{className:"box-h-4 box-w-16 box-swap-load-shine box-rounded"}),(0,r.jsx)("div",{className:"box-h-4 box-w-16 box-swap-load-shine box-rounded"})]}),!c&&j?.map((e,n)=>r.jsx(sP,{withdrawal:e,chainId:s,handleClaimClick:p},n))]})]})]})}function sP({withdrawal:e,chainId:s,handleClaimClick:n}){let t=new Date(1e3*e.timestamp).toLocaleDateString(),o=sB.includes(e.status),l=sT.includes(e.status),c=e.srcToken,d=a.Ub.find(s=>s.id===e.dstChainId),x=a.Ub.find(s=>s.id===e.srcChainId);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"box-hidden md:box-contents",children:[(0,r.jsxs)("div",{className:"box-flex box-gap-2 box-text-sm",children:[(0,r.jsx)("a",{href:(0,a.q_)(s,e.hash),target:"_blank",rel:"noopener",className:"box-bg-gray-100 box-text-black box-rounded-full box-px-2 box-py-1",children:"View\xa0Tx"}),o&&(0,r.jsx)("button",{className:"box-buy-btn box-rounded-full box-px-2 box-py-1",onClick:()=>n(e.tx),disabled:!o,children:"Claim"}),l&&(0,r.jsx)("button",{className:"box-buy-btn box-rounded-full box-px-2 box-py-1",onClick:()=>n(e.tx),disabled:!l,children:"Prove"}),!l&&!o&&(0,r.jsx)("button",{className:"box-bg-gray-100 box-text-black box-rounded-full box-px-2 box-py-1 box-opacity-50",disabled:!0,children:"Pending"})]}),(0,r.jsx)("div",{className:"",children:t}),(0,r.jsxs)("div",{className:"",children:[(0,r.jsx)(i.Sj,{className:"box-inline box-w-3 box-align-baseline box-mr-1",token:c}),e.amount,"\xa0",c?.symbol]}),(0,r.jsxs)("div",{className:"box-flex box-items-center box-gap-1",children:[(0,r.jsx)(i.fq,{chainId:s}),x?.name]}),(0,r.jsx)("div",{children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"box-w-4 box-h-4",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"})})}),(0,r.jsxs)("div",{className:"box-flex box-items-center box-gap-1",children:[(0,r.jsx)(i.fq,{chainId:d?.id}),d?.name]})]}),(0,r.jsxs)("div",{className:"box-swap-withdraw-cell-sm",children:[(0,r.jsxs)("div",{className:"box-text-sm",children:["Date: ",t]}),(0,r.jsxs)("div",{className:"box-flex box-items-center box-gap-2 box-my-3 box-justify-center",children:[(0,r.jsxs)("div",{className:"box-flex box-items-center box-gap-1",children:[(0,r.jsx)(i.fq,{chainId:s}),x?.name]}),(0,r.jsx)("div",{children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"box-w-4 box-h-4",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"})})}),(0,r.jsxs)("div",{className:"box-flex box-items-center box-gap-1",children:[d&&(0,r.jsx)(i.fq,{chainId:d.id}),d&&d?.name]})]}),(0,r.jsxs)("div",{className:"box-text-center box-mb-3",children:[(0,r.jsx)(i.Sj,{className:"box-inline box-w-3 box-align-baseline box-mr-1",token:c}),e.amount,"\xa0",c?.symbol]}),(0,r.jsxs)("div",{className:"box-flex box-gap-2 box-text-center",children:[(0,r.jsx)("a",{href:(0,a.q_)(s,e.hash),target:"_blank",rel:"noopener",className:"box-flex-1 box-bg-gray-100 box-text-black box-rounded-full box-px-4 box-py-2",children:"View\xa0Tx"}),o&&(0,r.jsx)("button",{className:"box-flex-1 box-buy-btn box-rounded-full box-px-2 box-py-1",onClick:()=>n(e.tx),disabled:!o,children:"Claim"}),l&&(0,r.jsx)("button",{className:"box-flex-1 box-buy-btn box-rounded-full box-px-2 box-py-1",onClick:()=>n(e.tx),disabled:!l,children:"Prove"}),!l&&!o&&(0,r.jsx)("button",{className:"box-flex-1 box-bg-gray-100 box-text-black box-rounded-full box-px-2 box-py-1 box-opacity-50",disabled:!0,children:"Pending"})]})]})]})}function sO(){return(0,r.jsxs)("div",{className:"box-withdraw-disclaimer",children:[(0,r.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.49978 0.876953C3.8421 0.876953 0.876953 3.8421 0.876953 7.49978C0.876953 11.1574 3.8421 14.1226 7.49978 14.1226C11.1574 14.1226 14.1226 11.1574 14.1226 7.49978C14.1226 3.8421 11.1574 0.876953 7.49978 0.876953ZM1.82695 7.49978C1.82695 4.36677 4.36677 1.82695 7.49978 1.82695C10.6328 1.82695 13.1726 4.36677 13.1726 7.49978C13.1726 10.6328 10.6328 13.1726 7.49978 13.1726C4.36677 13.1726 1.82695 10.6328 1.82695 7.49978ZM8.2498 4.50005C8.2498 4.91426 7.91401 5.25005 7.4998 5.25005C7.08558 5.25005 6.7498 4.91426 6.7498 4.50005C6.7498 4.08583 7.08558 3.75005 7.4998 3.75005C7.91401 3.75005 8.2498 4.08583 8.2498 4.50005ZM5.99991 6.00005H6.49991H7.49991C7.77606 6.00005 7.99991 6.2239 7.99991 6.50005V10H8.49991H8.99991V11H8.49991H7.49991H6.49991H5.99991V10H6.49991H6.99991V7.00005H6.49991H5.99991V6.00005Z",fill:"#A1A1AA"})}),(0,r.jsx)("div",{children:"Withdrawals over this canonical bridge take ~7 days."})]})}function sD(){return(0,r.jsx)("img",{src:eE("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAA7DcAAOw3AQflZCIAACBISURBVHhe7d15/G1lXS9wuOJAgiKOpBiKOeSYDZqiBKaCaJPzENcrOZWmmGXd8lpWRqnpVdE0zVTUNLPBiTJxwCtdU7vOijlkiWElKKAi0/1811rYYTqc/fvtvdda+3m/X6/Paz3P/sPDy9c5e332Gp5n9wsuuGA3AKAt/204AgANUQAAoEEKAAA0SAEAgAYpAADQIAUAABqkAABAgxQAAGiQAgAADVIAAKBBCgAANEgBAIAGKQAA0CAFAAAapAAAQIMUAABokAIAAA1SAACgQQoAADRIAQCABikAANAgBQAAGqQAAECDFAAAaJACAAANUgAAoEEKAAA0SAEAgAYpAADQIAUAABqkAABAgxQAAGiQAgAADVIAAKBBCgAANEgBAIAGKQAA0CAFAAAapAAAQIMUAABokAIAAA1SAACgQQoAADR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uvw0eTnklrDBLZNAdieayT3Tx6X3Lo+AFiyetCvnkV6RlJP/MNSKADLc5ekrgjUwkLXrg8AtqFO/C9Jnpl8uT6AZVIAlm+P5NCkisDhyf4JwK46PXlh8tzEmiSsjAKwevW8wGHJIcmdklpjAGBH5yT1gPGrkjcl30pgpRSA9aq3Lm6Z3Dn5/uQ2SRWEvRKgLV9MThhSJ3+/9lkrBWB8uyc3Sm48HA9Ivie5ZnKtIVdPrpLsmQDzUJvz1CZjZyS1aM/JSa0tUvlw8tkERqMAzFPdRqjiAEzT15PaoAcmSwEAgAZZCRAAGqQAAECDFAAAaJACAAANUgAAoEEKAAA0SAEAgAYpAADQIAUAABqkAABAgxQAAGiQAgAADVIAAKBBCgAANEgBAIAGKQAA0CAFAAAapAAAQIMUAABokAIAAA1SAACgQQoAADRIAQCABikAANAgBQAAGqQAAECDFAAAaJACAAANUgAAoEEKAAA0SAEAgAYpAADQIAUAABqkAABAgxQAAGiQAgAADVIAAKBBCgAANEgBAIAGKQAA0CAFAAAapAAAQIMUAABokAIAAA1SAACgQQoAADRIAQCABikAANAgBQAAGqQAAECDFAAAaJACAAANUgAAoEEKAAA0SAEAgAYpAADQIAUAABqkAABAgxQAAGiQAgAADVIAAKBBCgAANEgBAIAGKQAA0CAFAAAapAAAQIMUAABokAIAAA1SAACgQQoAADRIAQCABikAANAgBQAAGqQAAECDFAAAaJACAAANUgAAoEEKAAA0SAEAgAYpAADQIAUAABqkAABAgxQAAGiQAgAADVIAAKBBCgAANEgBAIAGKQAA0CAFAAAapAAAQIMUAABozm67/X8LJCeT43/PWQAAAABJRU5ErkJggg=="),className:"box-w-6 box-h-6 box-mix-blend-difference"})}ew(sE,"CanonicalWithdrawalNotification"),ew(sP,"WithdrawalRow"),ew(sO,"WithdrawalDisclaimer"),ew(sD,"WalletArrow");var sM=ew(({receiverAddress:e,hideChangeWalletButton:s=!1,selectedSrcToken:n,selectedDstToken:l,onDstTokenSelected:c,onSrcTokenSelected:d,defaultDstAmount:u,enableTestnets:b=!1,className:m=""})=>{let[A,p]=(0,t.useState)(n?.tokenInfo),[f,g]=(0,t.useState)(n?n.chainId:a.a_.BASE),[w,C]=(0,t.useState)(l?.tokenInfo),[v,j]=(0,t.useState)(l?l.chainId:a.a_.BASE);(0,t.useEffect)(()=>{n?.tokenInfo&&p(n?.tokenInfo),n?.chainId&&g(n?.chainId)},[n]),(0,t.useEffect)(()=>{l?.tokenInfo&&C(l?.tokenInfo),l?.chainId&&j(l?.chainId)},[l]);let[k,N]=(0,t.useState)(null),[y,I]=(0,t.useState)(!1),[S,T]=(0,t.useState)(u?null:"0"),[B,F]=(0,t.useState)(u?u.toString():null),E=sL(S),P=sL(B),O=ew(()=>{T(null),F(null)},"resetInputs"),D=(0,o.b7)(),[M,L]=(0,t.useState)(),U=A??(0,a.x8)(a.a_.ETHEREUM),H=w??(0,a.x8)(a.a_.ETHEREUM),Q=!!A&&!!w,{data:G}=(0,o.qX)({address:D,chainId:U.chainId,token:U.address,enable:!!A}),{data:R}=(0,o.qX)({address:D,chainId:H.chainId,token:H.address,enable:!!w}),q=!!S,W=q&&sU(E)&&Q,K=!q&&sU(P)&&Q,V=W&&E?(0,h.v)(`${E}`,U.decimals):K&&P?(0,h.v)(`${P}`,H.decimals):0n,J={sender:D??"0xAcCC1fe6537eb8EB56b31CcFC48Eb9363e8dd32E",srcToken:U.address,srcChainId:U.chainId,dstToken:H.address,dstChainId:H.chainId,slippage:1,actionType:a.Us.SwapAction,actionConfig:{chainId:U.chainId,swapDirection:W?a.Bj.EXACT_AMOUNT_IN:a.Bj.EXACT_AMOUNT_OUT,receiverAddress:e??M??D,amount:V},enable:W||K};(0,t.useEffect)(()=>{let e=ew(()=>{let e=A?.chainId,s=w?.chainId,n=(0,a.kg)(e),t=(0,a.kg)(s);if(I(n.isCanonicalSrc||t.isCanonicalSrc),n.isCanonicalPendingClaims||t.isCanonicalPendingClaims){N(n.isCanonicalPendingClaims?e:t.isCanonicalPendingClaims?s:null);return}N(null)},"checkPendingClaims");try{e()}catch(e){console.error(e)}},[A,w]),(0,t.useEffect)(()=>{let e=ew(()=>{let e=A?.chainId,s=A?.address,n=(0,a.kg)(e);n.isCanonicalSrc&&!n.isDexChain&&(s===x.DR?C((0,a.c_)(e)):C((0,a.PG)(e,s)))},"autoSelectParentToken");try{e()}catch{}},[A]);let[Z,Y]=(0,t.useState)(!1),[z,X]=(0,t.useState)(!1),[_,$]=(0,t.useState)(!1),[ee,es]=(0,t.useState)(!1),en=ew(()=>{C(A),p(w),g(v),j(f),T(B),F(S),A&&d?.(A),w&&c?.(w)},"flipSwap"),et=(0,i.yl)();return(0,r.jsx)(o.NG,{...J,children:(0,r.jsxs)("div",{className:"box-swap-modal "+m,style:et??void 0,children:[k&&D&&(0,r.jsx)(sE,{address:D,chainId:k}),(0,r.jsxs)("div",{className:"box-swap-modal-content",children:[(0,r.jsx)(sm,{isFrom:!0,selectedToken:A,openDropdown:Y,userBalanceFloat:G?.balanceFloat??0,inputEnabled:!W,handleInputChange:e=>{T(e.target.value),F(null)},input:E,rawInput:S,setRawInput:T}),(0,r.jsx)("div",{className:"box-h-1 box-flex box-items-center box-justify-center",children:ee?(0,r.jsx)("div",{className:"box-p-1.5 box-bg-white box-rounded-full box-border",children:(0,r.jsx)(e3,{className:"box-w-6 box-h-6"})}):(0,r.jsx)("button",{className:"box-swap-switch-btn "+(q?"":"-box-rotate-180"),onClick:en,children:(0,r.jsx)(i.u9,{className:"box-w-6 box-h-6"})})}),(0,r.jsx)(sm,{isFrom:!1,selectedToken:w,openDropdown:X,userBalanceFloat:R?.balanceFloat??0,handleInputChange:e=>{T(null),F(e.target.value)},inputEnabled:!K,input:P,rawInput:B,setRawInput:F})]}),(0,r.jsx)(sb,{}),y&&(0,r.jsx)(sO,{}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"box-flex box-items-center box-justify-between box-gap-4 box-p-4 box-pt-0",children:[(0,r.jsx)(sj,{srcToken:U,dstToken:H,tokensAreSelected:Q,setIsSubmitting:es,resetInputs:O}),!s&&(0,r.jsx)("button",{className:"box-swap-modal-icon-btn",onClick:()=>$(!0),children:(0,r.jsx)(sD,{})})]}),(0,r.jsx)(sl,{isOpen:Z,setIsOpen:Y,chainId:f,setChainId:g,selectedToken:U,setSelectedToken:e=>{p(e),Y(!1),d?.(e)}}),(0,r.jsx)(sl,{isOpen:z,setIsOpen:X,chainId:v,setChainId:j,selectedToken:H,setSelectedToken:e=>{C(e),X(!1),c?.(e)}}),(0,r.jsx)(e8,{changeWalletIsOpen:_,setChangeWalletIsOpen:$,otherWallet:M,setOtherWallet:L,placeholder:e??M??D})]})]})})},"SwapModalImpl");function sL(e,s=500){let[n,a]=(0,t.useState)(0),o=(0,t.useRef)();return(0,t.useEffect)(()=>(o.current=setTimeout(()=>{let s=Number(e);null==e?a(void 0):0==s?a(0):sU(s)?a(s):a(NaN)},s),()=>{clearTimeout(o.current)}),[e,s]),n}function sU(e){return!(!e||isNaN(e)||e<=0||e<1e-6)}ew(e=>{let{providers:s,apiKey:n,onConnectWallet:t}=e;return(0,r.jsx)(o.Zr,{dstChainId:a.a_.ETHEREUM,children:(0,r.jsx)(o.zk,{onConnectWallet:t,providers:{[o.bY.Evm]:eA,...s},children:(0,r.jsx)(o.Ch,{apiKey:n,children:(0,r.jsx)(st,{...e,children:(0,r.jsx)(sM,{...e})})})})})},"SwapModal"),ew(sL,"useDebouncedNumInput"),ew(sU,"isValidNumber");var sH=(0,a.s5)(a.a_.ETHEREUM),sQ="0xAcCC1fe6537eb8EB56b31CcFC48Eb9363e8dd32E",sG={sender:sQ,srcToken:sH.address,srcChainId:sH.chainId,dstToken:sH.address,dstChainId:sH.chainId,slippage:1,actionType:a.Us.SwapAction,actionConfig:{chainId:sH.chainId,swapDirection:a.Bj.EXACT_AMOUNT_IN,receiverAddress:sQ,amount:0n},enable:!1},sR=(0,t.createContext)({wagmiConfig:{},setActionTxArgs:()=>{},onConnectWallet:()=>{},apiKey:"",chainIds:[a.a_.ETHEREUM]}),sq=ew(()=>(0,t.useContext)(sR),"useOnboardingProps"),sW=ew(({onboardingProps:e,children:s})=>{let[n,a]=(0,t.useState)(sG);return(0,r.jsx)(sR.Provider,{value:{...e,setActionTxArgs:a},children:(0,r.jsx)(o.Ch,{apiKey:e.apiKey,children:(0,r.jsx)(o.NG,{...n,children:s})})})},"OnboardingProvider");function sK(){let{receiverAddress:e,setActionTxArgs:s,wagmiConfig:n,className:l,sendInfoTooltip:d,selectedSrcToken:x,selectedDstToken:u,chainIds:b}=sq(),[m,A]=(0,t.useState)(!1),p=(0,o.b7)(),[f,g]=(0,t.useState)("1.00"),w=sL(f),[C,v]=(0,t.useState)(x?.tokenInfo),[j,k]=(0,t.useState)(u?.tokenInfo),N=C??sH,y=j??sH,I=(0,i.yl)(),[S,T]=(0,t.useState)(!1),{actionResponse:B,actionRequest:F,isLoading:E}=(0,o.Sl)();(0,t.useEffect)(()=>{x?.tokenInfo&&v(x?.tokenInfo)},[x]),(0,t.useEffect)(()=>{u?.tokenInfo&&k(u?.tokenInfo)},[u]);let{data:P}=(0,o.qX)({address:p,chainId:N.chainId,token:N.address,enable:!!N}),O=P?.balanceFloat?sp(P?.balanceFloat):"0";(0,t.useEffect)(()=>{let n=w?(0,h.v)(w.toString(),N.decimals):0n;s({sender:p??sQ,srcToken:N.address,srcChainId:N.chainId,dstToken:y.address,dstChainId:y.chainId,slippage:1,actionType:a.Us.SwapAction,actionConfig:{chainId:N.chainId,swapDirection:a.Bj.EXACT_AMOUNT_IN,receiverAddress:e??p,amount:n},enable:!0})},[p,N,y,e,w]);let D=B?.amountOut,M=D?sh(Number((0,c.b)(D.amount,y.decimals))):"0",[L,U]=(0,t.useState)(!1),{onClickSubmit:H,isDisabled:Q,buttonContent:G,buttonClassName:R,submittedTx:q,txHash:W,resetStatus:K}=sk({srcToken:N,dstToken:y,tokensAreSelected:!!C&&!!j,setIsSubmitting:T,resetInputs:()=>{},setStatusIsOpen:U,wagmiConfig:n,userSetDisabled:!1}),[V,J]=(0,t.useState)({chainId:N.chainId,tokenAddress:y.address}),[Z,Y]=(0,t.useState)(!0);su({actionResponse:B,actionRequest:F,gasEstimator:(0,o.$h)(),wagmiConfig:n,setEstimable:Y,setGasTokenUsdProps:J});let z=B?.applicationFee&&F?.srcChainId&&sc(B?.applicationFee?.amount)+" "+a.x8(F?.srcChainId)?.symbol,X=[];return X.push(["Expected Gas Fee",Z?(0,r.jsx)(eV,{...V}):"-"]),X.push(["Max Slippage","1%"]),(0,r.jsxs)(i.Aw,{style:I??void 0,className:l,onSrcTokenClicked:()=>A(!0),srcToken:C,dstToken:j,srcConvertedSlot:(0,r.jsx)(eV,{balance:w,chainId:N.chainId,tokenAddress:N.address,withCommas:!0}),srcInputValue:f,onInputChanged:e=>g(e),feeLines:X,isButtonDisabled:Q,onButtonClicked:H,buttonSlot:G,buttonClassName:R,isSpinning:S,onSpinnerClicked:()=>U(!0),balanceSlot:O,dstAmountSlot:E?(0,r.jsx)("div",{className:"box-load-shine box-w-10 box-h-4"}):M,dstConvertedSlot:(0,r.jsx)(eV,{balance:Number(M),chainId:y.chainId,tokenAddress:y.address,withCommas:!0}),appFeeAmtSlot:z??"-",receiverAddress:e??p,sendInfoTooltip:d,children:[(0,r.jsx)(sw,{className:"box-w-almost-full",submittedTx:q,txHash:W,setIsOpen:U,isOpen:L,resetStatus:K}),(0,r.jsx)(i.Oq,{isOpen:m,hideCloseIcon:!0,innerClassName:"box-p-1",setClosed:()=>A(!1),children:(0,r.jsx)(i.U9,{className:"box-border-0",selectedToken:C,setSelectedToken:e=>{v(e),A(!1)},selectChains:b,selectTokens:[],address:p})})]})}ew(sK,"OnboardingModalImpl"),ew(function(e){let{providers:s,onConnectWallet:n}=e;return(0,r.jsx)(o.Zr,{dstChainId:a.a_.ETHEREUM,children:(0,r.jsx)(o.zk,{onConnectWallet:n,providers:{[o.bY.Evm]:eA,...s},children:(0,r.jsx)(sW,{onboardingProps:e,children:(0,r.jsx)(sK,{...e})})})})},"OnboardingModal")},52531:function(e,s,n){n.d(s,{e:function(){return l}});var t=n(338),a=n(8789),o=n(19628),i=n(33467),r=n(85705);async function l(e,s){let{chainId:n,timeout:l=0,...c}=s,d=e.getClient({chainId:n}),x=(0,r.s)(d,a.e,"waitForTransactionReceipt"),u=await x({...c,timeout:l});if("reverted"===u.status){let e=(0,r.s)(d,o.f,"getTransaction"),s=await e({hash:u.transactionHash}),n=(0,r.s)(d,i.R,"call"),a=await n({...s,gasPrice:"eip1559"!==s.type?s.gasPrice:void 0,maxFeePerGas:"eip1559"===s.type?s.maxFeePerGas:void 0,maxPriorityFeePerGas:"eip1559"===s.type?s.maxPriorityFeePerGas:void 0});throw Error(a?.data?(0,t.rR)(`0x${a.data.substring(138)}`):"unknown reason")}return{...u,chainId:d.chain.id}}},92540:function(e,s,n){n.d(s,{OP:function(){return l},if:function(){return o},kq:function(){return i}});var t=n(63583),a=n(8123);function o(e,s){return(0,a.v)(e,s)?e:(0,t.Q$)(e,s)}function i(e){return JSON.stringify(e,(e,s)=>!function(e){if(!r(e))return!1;let s=e.constructor;if(void 0===s)return!0;let n=s.prototype;return!!(r(n)&&n.hasOwnProperty("isPrototypeOf"))}(s)?"bigint"==typeof s?s.toString():s:Object.keys(s).sort().reduce((e,n)=>(e[n]=s[n],e),{}))}function r(e){return"[object Object]"===Object.prototype.toString.call(e)}function l(e){let{_defaulted:s,behavior:n,gcTime:t,initialData:a,initialDataUpdatedAt:o,maxPages:i,meta:r,networkMode:l,queryFn:c,queryHash:d,queryKey:x,queryKeyHashFn:u,retry:b,retryDelay:h,structuralSharing:m,getPreviousPageParam:A,getNextPageParam:p,initialPageParam:f,_optimisticResults:g,enabled:w,notifyOnChangeProps:C,placeholderData:v,refetchInterval:j,refetchIntervalInBackground:k,refetchOnMount:N,refetchOnReconnect:y,refetchOnWindowFocus:I,retryOnMount:S,select:T,staleTime:B,suspense:F,throwOnError:E,config:P,connector:O,query:D,...M}=e;return M}},46711:function(e,s,n){n.d(s,{t:function(){return i}});var t=n(85835),a=n(24491),o=n(99493);function i(e,s){return function(e,s={}){let{key:n="fallback",name:i="Fallback",rank:r=!1,retryCount:l,retryDelay:c}=s;return({chain:s,pollingInterval:d=4e3,timeout:x,...u})=>{let b=e,h=()=>{},m=(0,o.q)({key:n,name:i,async request({method:e,params:n}){let a=async(o=0)=>{let i=b[o]({...u,chain:s,retryCount:0,timeout:x});try{let s=await i.request({method:e,params:n});return h({method:e,params:n,response:s,transport:i,status:"success"}),s}catch(s){if(h({error:s,method:e,params:n,transport:i,status:"error"}),"code"in s&&"number"==typeof s.code&&(s.code===t.KB.code||s.code===t.ab.code||5e3===s.code)||o===b.length-1)throw s;return a(o+1)}};return a()},retryCount:l,retryDelay:c,type:"fallback"},{onResponse:e=>h=e,transports:b.map(e=>e({chain:s,retryCount:0}))});if(r){let e="object"==typeof r?r:{};!function({chain:e,interval:s=4e3,onTransports:n,sampleCount:t=10,timeout:o=1e3,transports:i,weights:r={}}){let{stability:l=.7,latency:c=.3}=r,d=[],x=async()=>{let r=await Promise.all(i.map(async s=>{let n,t;let a=s({chain:e,retryCount:0,timeout:o}),i=Date.now();try{await a.request({method:"net_listening"}),t=1}catch{t=0}finally{n=Date.now()}return{latency:n-i,success:t}}));d.push(r),d.length>t&&d.shift();let u=Math.max(...d.map(e=>Math.max(...e.map(({latency:e})=>e))));n(i.map((e,s)=>{let n=d.map(e=>e[s].latency),t=n.reduce((e,s)=>e+s,0)/n.length,a=d.map(e=>e[s].success),o=a.reduce((e,s)=>e+s,0)/a.length;return 0===o?[0,s]:[c*(1-t/u)+l*o,s]}).sort((e,s)=>s[0]-e[0]).map(([,e])=>i[e])),await (0,a.D)(s),x()};x()}({chain:s,interval:e.interval??d,onTransports:e=>b=e,sampleCount:e.sampleCount,timeout:e.timeout,transports:b,weights:e.weights})}return m}}(e,s)}},7109:function(e,s,n){function t(e){return e.state.chainId}n.d(s,{x:function(){return i}});var a=n(7653),o=n(26989);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,o.Z)(e);return(0,a.useSyncExternalStore)(e=>(function(e,s){let{onChange:n}=s;return e.subscribe(e=>e.chainId,n)})(s,{onChange:e}),()=>t(s),()=>t(s))}},60040:function(e,s,n){n.d(s,{$:function(){return x}});var t=n(73822),a=n(34258);async function o(e,s){let n;if((n="function"==typeof s.connector?e._internal.connectors.setup(s.connector):s.connector).uid===e.state.current)throw new a.wi;try{e.setState(e=>({...e,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});let t=await n.connect({chainId:s.chainId}),a=t.accounts;return n.emitter.off("connect",e._internal.events.connect),n.emitter.on("change",e._internal.events.change),n.emitter.on("disconnect",e._internal.events.disconnect),await e.storage?.setItem("recentConnectorId",n.id),e.setState(e=>({...e,connections:new Map(e.connections).set(n.uid,{accounts:a,chainId:t.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:a,chainId:t.chainId}}catch(s){throw e.setState(e=>({...e,status:e.current?"connected":"disconnected"})),s}}var i=n(7653),r=n(26989),l=n(8123);let c=[];function d(e){let s=e.connectors;return(0,l.v)(c,s)?c:(c=s,s)}function x(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{mutation:s}=e,n=(0,r.Z)(e),{mutate:a,mutateAsync:l,...c}=(0,t.D)({...s,mutationFn:e=>o(n,e),mutationKey:["connect"]});return(0,i.useEffect)(()=>n.subscribe(e=>{let{status:s}=e;return s},(e,s)=>{"connected"===s&&"disconnected"===e&&c.reset()}),[n,c.reset]),{...c,connect:a,connectAsync:l,connectors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,r.Z)(e);return(0,i.useSyncExternalStore)(e=>(function(e,s){let{onChange:n}=s;return e._internal.connectors.subscribe((e,s)=>{n(Object.values(e),s)})})(s,{onChange:e}),()=>d(s),()=>d(s))}({config:n})}}},99688:function(e,s,n){n.d(s,{aM:function(){return o}});var t=n(2560),a=n(92540);function o(e){let s=(0,t.a)({...e,queryKeyHashFn:a.kq});return s.queryKey=e.queryKey,s}}}]);