@liberfi.io/ui-tokens 3.0.91 → 3.0.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import {memo,useMemo,useState,useRef,useCallback,useEffect,useSyncExternalStore}from'react';import {List}from'react-window';import {StyledTooltip,HorsePowerHighIcon,HorsePowerLowIcon,HorsePowerIcon,cn,useCopyToClipboard,toast,CheckIcon,CopyIcon,Link,WebsiteIcon,TwitterIcon,TelegramIcon,DiscordIcon,SearchIcon,PeopleIcon,KlineCandlesIcon,StarIcon,UserWithStarBadgeIcon,CookIcon,SniperIcon,RatIcon,BundlesIcon,TriangleUpIcon,TriangleDownIcon,Avatar,CameraIcon,Image,PauseIcon,HorizontalScrollContainer,Button,TrashIcon,Chip,StyledInput,XCloseIcon,Kbd,Spinner,EmptyIcon,useScreen,StyledModal,ModalContent,ModalHeader,ModalBody,useDisclosure,FilterIcon,ScrollShadow,ModalFooter,RefreshIcon,StyledPlainTabs,Tab,ChevronDownIcon,TableColumn,Sortable,StyledTable,TableHeader,TableBody,CrownIcon,ShiningStarIcon,TableRow,Skeleton,Progress,StyledLightTabs,StyledBadge,TableCell,StyledNumberInput}from'@liberfi.io/ui';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {useTickAge,useResizeObserver,useCallbackRef}from'@liberfi.io/hooks';import {useTranslation,useLocalizedTimeFormatter}from'@liberfi.io/i18n';import {formatMCapInUsd,SafeBigNumber,formatPercent,searchTwitterUrl,formatAmount,formatAmountInUsd,formatPriceInUsd,parseTokenProtocolFamily,searchImageUrl,formatPrice,formatTokenProtocolName}from'@liberfi.io/utils';export{formatAmount}from'@liberfi.io/utils';import {SolanaTokenProtocol,Chain}from'@liberfi.io/types';import {useNewPoolsQuery,useNewPoolsSubscription,useNewTokensMetadataSubscription,useMigratedTokensQuery,useFinalStretchTokensQuery,useSearchTokensInfiniteQuery,useTrendingTokensQuery,useTrendingTokensSubscription,useTokenHoldersQuery,useTokenSubscription,useTokenActivitiesQuery,useTokenActivitiesSubscription,useTokenSecurityQuery,useTokenStatsQuery,useWalletTokenPositionsQuery,useWalletLimitOrdersQuery,useTokenTopTradersQuery,useTokensByCreatorQuery,useSearchTokensQuery,useStockTokensQuery,useStockTokensSubscription,useTokensQuery,useTokenMarketRuntime,tokenMarketKey,useTokenMarket}from'@liberfi.io/react';import {AsyncModal,useAsyncModal,StatsFlipPanel}from'@liberfi.io/ui-scaffold';import {createBrowserSearchHistoryStorage,createMemorySearchHistoryStorage,useSearchKeyboardNavigation,useSearchController}from'@liberfi.io/ui/search';import {useInfiniteLoader}from'react-window-infinite-loader';import {createRealtimeCursorCollection}from'@liberfi.io/utils/realtime-cursor-collection';function Xn({title:e,isPaused:t,extra:o,className:n}){return jsxs("div",{className:cn("w-full h-12 px-3 flex-none bg-surface-base flex items-center justify-between gap-4 border-b border-border-subtle/60",n),children:[jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[jsx("h2",{className:"min-w-0 truncate font-semibold",children:e}),t&&jsx("div",{className:"flex flex-none items-center gap-1 text-primary",children:jsx(PauseIcon,{className:"w-4 h-4"})})]}),o&&jsx("div",{className:"flex min-w-0 items-center gap-3",children:o})]})}function Ko({isLast:e=false,className:t}){return jsxs("div",{className:cn("w-full h-full overflow-hidden px-4 py-3 animate-pulse",t),style:{borderBottom:e?"none":"1px solid var(--color-border-subtle)"},children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx("div",{className:"w-20 h-20 rounded-sm bg-content2"}),jsx("div",{className:"w-14 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"w-16 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-20 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-8 h-3 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-3 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-10 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5",children:[jsx("div",{className:"flex flex-col items-end gap-1",children:jsx("div",{className:"w-16 h-4 rounded bg-content2"})}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-14 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]}),jsx("div",{className:"w-10 h-2.5 rounded bg-content2"})]})]}),jsxs("div",{className:"mt-2.5 flex items-center gap-4",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1",children:[jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"})]}),jsx("div",{className:"w-16 h-7 rounded-md bg-content2 flex-none"})]})]})}function $({icon:e,value:t,tooltip:o,warning:n,disable:s=false,className:r,tooltipPlacement:i="top"}){return jsx(StyledTooltip,{content:o,placement:i,children:jsxs("div",{className:cn("shrink-0 px-2 py-0.5 flex items-center gap-1 rounded-full text-xs border border-border/60",n?"text-danger-500":s?"text-text-muted":"text-primary",r),children:[e,jsx("span",{children:t})]})})}var _o={kol:{label:"KOL",labelKey:"common.walletTag.kol",bgClass:"bg-warning/15",textClass:"text-warning"},smart:{label:"Smart",labelKey:"common.walletTag.smart",bgClass:"bg-sky-500/15",textClass:"text-sky-400"},sniper:{label:"Sniper",labelKey:"common.walletTag.sniper",bgClass:"bg-danger/15",textClass:"text-danger"},dev:{label:"Dev",labelKey:"common.walletTag.dev",bgClass:"bg-negative/15",textClass:"text-negative"},bundle:{label:"Bundle",labelKey:"common.walletTag.bundle",bgClass:"bg-purple-500/15",textClass:"text-purple-400"},bluechip:{label:"Bluechip",labelKey:"common.walletTag.bluechip",bgClass:"bg-success/15",textClass:"text-success"},insider:{label:"Insider",labelKey:"common.walletTag.insider",bgClass:"bg-fuchsia-500/15",textClass:"text-fuchsia-400"},fresh:{label:"Fresh",labelKey:"common.walletTag.fresh",bgClass:"bg-teal-500/15",textClass:"text-teal-400"}};function td({tag:e,className:t}){let{t:o}=useTranslation(),n=_o[e]??{label:e,bgClass:"bg-default/20",textClass:"text-text-muted"};return jsx("span",{className:cn("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide",n.bgClass,n.textClass,t),children:n.labelKey?o(n.labelKey):n.label})}function jn({tags:e,className:t,max:o}){if(!e||e.length===0)return null;let n=o!=null&&o>0?e.slice(0,o):e,s=e.length-n.length;return jsxs("div",{className:cn("flex flex-wrap items-center gap-1",t),children:[n.map(r=>jsx(td,{tag:r},r)),s>0&&jsxs("span",{className:"inline-flex items-center rounded bg-default/20 px-1.5 py-0.5 text-[10px] font-medium text-text-muted",children:["+",s]})]})}function od({tag:e,className:t}){let o=_o[e]??{label:e,bgClass:"bg-default/20",textClass:"text-text-muted"};return jsx("span",{className:cn("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide",o.bgClass,o.textClass,t),children:o.label})}function qt({tags:e,className:t,max:o}){if(!e||e.length===0)return null;let n=o!=null&&o>0?e.slice(0,o):e,s=e.length-n.length;return jsxs("div",{className:cn("flex flex-wrap items-center gap-1",t),children:[n.map(r=>jsx(od,{tag:r},r)),s>0&&jsxs("span",{className:"inline-flex items-center rounded bg-default/20 px-1.5 py-0.5 text-[10px] font-medium text-text-muted",children:["+",s]})]})}var nd={[SolanaTokenProtocol.BAGS]:{text:"text-bags",bg:"bg-bags",bg5:"bg-bags/5",bg20:"bg-bags/20",border:"border-bags"},[SolanaTokenProtocol.BELIEVE]:{text:"text-believe",bg:"bg-believe",bg5:"bg-believe/5",bg20:"bg-believe/20",border:"border-believe"},[SolanaTokenProtocol.BONK]:{text:"text-bonk",bg:"bg-bonk",bg5:"bg-bonk/5",bg20:"bg-bonk/20",border:"border-bonk"},[SolanaTokenProtocol.BOOP]:{text:"text-boop",bg:"bg-boop",bg5:"bg-boop/5",bg20:"bg-boop/20",border:"border-boop"},[SolanaTokenProtocol.HEAVEN]:{text:"text-heaven",bg:"bg-heaven",bg5:"bg-heaven/5",bg20:"bg-heaven/20",border:"border-heaven"},[SolanaTokenProtocol.JUPSTUDIO]:{text:"text-jupstudio",bg:"bg-jupstudio",bg5:"bg-jupstudio/5",bg20:"bg-jupstudio/20",border:"border-jupstudio"},[SolanaTokenProtocol.LAUNCHLAB]:{text:"text-launchlab",bg:"bg-launchlab",bg5:"bg-launchlab/5",bg20:"bg-launchlab/20",border:"border-launchlab"},[SolanaTokenProtocol.METEORA]:{text:"text-meteora",bg:"bg-meteora",bg5:"bg-meteora/5",bg20:"bg-meteora/20",border:"border-meteora"},[SolanaTokenProtocol.MOONIT]:{text:"text-moonit",bg:"bg-moonit",bg5:"bg-moonit/5",bg20:"bg-moonit/20",border:"border-moonit"},[SolanaTokenProtocol.MOONSHOT]:{text:"text-moonshot",bg:"bg-moonshot",bg5:"bg-moonshot/5",bg20:"bg-moonshot/20",border:"border-moonshot"},[SolanaTokenProtocol.ORCA]:{text:"text-orca",bg:"bg-orca",bg5:"bg-orca/5",bg20:"bg-orca/20",border:"border-orca"},[SolanaTokenProtocol.PUMP]:{text:"text-pump",bg:"bg-pump",bg5:"bg-pump/5",bg20:"bg-pump/20",border:"border-pump"},[SolanaTokenProtocol.RAYDIUM]:{text:"text-raydium",bg:"bg-raydium",bg5:"bg-raydium/5",bg20:"bg-raydium/20",border:"border-raydium"},[SolanaTokenProtocol.SUGAR]:{text:"text-sugar",bg:"bg-sugar",bg5:"bg-sugar/5",bg20:"bg-sugar/20",border:"border-sugar"},[SolanaTokenProtocol.VIRTUAL_CURVE]:{text:"text-virtual-curve",bg:"bg-virtual-curve",bg5:"bg-virtual-curve/5",bg20:"bg-virtual-curve/20",border:"border-virtual-curve"},[SolanaTokenProtocol.PUMP_AMM]:{text:"text-pump-amm",bg:"bg-pump-amm",bg5:"bg-pump-amm/5",bg20:"bg-pump-amm/20",border:"border-pump-amm"}},rd={text:"text-text-muted",bg:"bg-text-muted",bg5:"bg-text-muted/5",bg20:"bg-text-muted/20",border:"border-border-control"};function Ke(e){return nd[e]??rd}function he({token:e,enablePreview:t=true,enableSearch:o=true,showProgress:n=true,showProtocolFamily:s=true,radius:r="sm",className:i,classNames:a}){let d=useMemo(()=>e.launchedFrom?.protocolFamily?parseTokenProtocolFamily(e.chain,e.launchedFrom.protocolFamily):void 0,[e.chain,e.launchedFrom?.protocolFamily]),l=useMemo(()=>s&&d,[s,d]),c=useMemo(()=>n&&e.migrateProgress&&new SafeBigNumber(e.migrateProgress).lt(100),[n,e.migrateProgress]),u=useMemo(()=>o&&e.image,[o,e.image]),m=useMemo(()=>(e.symbol??e.name??e.address??"L").slice(0,1).toUpperCase(),[e.symbol,e.name,e.address]),[p,g]=useState(false),f=useCallback(()=>{g(true);},[]),k=useCallback(()=>{g(false);},[]),x=useCallback(h=>{if(h.stopPropagation(),!e.image)return;let T=searchImageUrl(e.image);window.open(T,"_blank");},[e.image]);return jsxs("div",{className:cn("relative justify-center items-center",i??"w-15 h-15"),children:[!c&&jsx("div",{className:cn("absolute inset-0",`rounded-${r}`,d?Ke(d).bg:"bg-surface-strong/60",a?.background)}),c&&jsx("div",{className:cn("absolute -inset-0.5",`rounded-${r}`),children:jsx(cd,{className:cn(d?Ke(d).text:"text-surface-strong/60",a?.progress),progress:e.migrateProgress??"0"})}),jsx("div",{className:cn("absolute inset-0 p-px flex items-center justify-center",`rounded-${r}`,d?Ke(d).bg20:"bg-surface-strong/12",a?.avatarWrapper),children:jsx(ld,{token:e,radius:r,enableSearch:o,enablePreview:t,classNames:a,children:jsxs("div",{className:cn("relative w-full h-full bg-content1 flex items-center justify-center p-0.5",`rounded-${r}`,p&&u&&"cursor-pointer"),onMouseEnter:f,onMouseLeave:k,children:[jsx(Avatar,{showFallback:true,src:e.image,name:m,imgProps:{loading:"lazy",decoding:"async"},className:cn("w-full h-full bg-content1 text-text-muted text-2xl",`rounded-${r}`,a?.avatar)}),p&&u&&jsx("div",{className:cn("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${r}`,a?.searchWrapper),onClick:x,children:jsx(CameraIcon,{className:cn("w-6 h-6",a?.searchIcon)})})]})})}),l&&jsx("div",{className:"contents",children:jsx(StyledTooltip,{content:e.launchedFrom?.protocolFamily??d,placement:"bottom",children:jsx("div",{className:cn("absolute -bottom-1 -right-1 rounded-full p-px w-4 h-4",d&&Ke(d).bg,a?.protocolFamilyIconWrapper),children:jsx(Image,{removeWrapper:true,src:`/images/protocols/${d}.svg`,loading:"lazy",decoding:"async",className:cn("w-full h-full rounded-full bg-content1",a?.protocolFamilyIcon)})})})})]})}function ld({token:e,radius:t,enableSearch:o,enablePreview:n,classNames:s,children:r}){return useMemo(()=>n&&e.image,[n,e.image])?jsx(StyledTooltip,{content:jsx(dd,{token:e,radius:t,enableSearch:o,classNames:s}),closeDelay:100,placement:"bottom-start",classNames:{content:"p-1"},children:r}):r}function dd({token:e,enableSearch:t,radius:o,classNames:n}){let s=useMemo(()=>t&&e.image,[t,e.image]),r=useMemo(()=>(e.symbol??e.name??e.address??"L").slice(0,1).toUpperCase(),[e.symbol,e.name,e.address]),[i,a]=useState(false),d=useCallback(()=>{a(true);},[]),l=useCallback(()=>{a(false);},[]),c=useCallback(u=>{if(u.stopPropagation(),!e.image)return;let m=searchImageUrl(e.image);window.open(m,"_blank");},[e.image]);return jsxs("div",{className:cn("relative flex items-center justify-center w-60 h-60",`rounded-${o}`,i&&s&&"cursor-pointer",n?.previewWrapper),onMouseEnter:d,onMouseLeave:l,children:[jsx(Avatar,{showFallback:true,src:e.image,name:r,className:cn("w-full h-full bg-content1 text-text-muted text-3xl",`rounded-${o}`,n?.previewAvatar)}),i&&s&&jsx("div",{className:cn("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${o}`,n?.previewSearchWrapper),onClick:c,children:jsx(CameraIcon,{className:cn("w-10 h-10",n?.previewSearchIcon)})})]})}function cd({progress:e,className:t}){let o=useMemo(()=>296-Number(e)*296/100,[e]);return jsxs("svg",{viewBox:"0 0 78 78",className:"w-full h-full",children:[jsx("path",{className:`${t} opacity-40`,stroke:"currentColor",fill:"transparent",strokeWidth:"1",d:`
1
+ import {memo,useMemo,useState,useRef,useCallback,useEffect,useSyncExternalStore}from'react';import {List}from'react-window';import {StyledTooltip,HorsePowerHighIcon,HorsePowerLowIcon,HorsePowerIcon,cn,useCopyToClipboard,toast,CheckIcon,CopyIcon,Link,WebsiteIcon,TwitterIcon,TelegramIcon,DiscordIcon,SearchIcon,PeopleIcon,KlineCandlesIcon,StarIcon,UserWithStarBadgeIcon,CookIcon,SniperIcon,RatIcon,BundlesIcon,TriangleUpIcon,TriangleDownIcon,Avatar,CameraIcon,Image,PauseIcon,HorizontalScrollContainer,Button,TrashIcon,Chip,StyledInput,XCloseIcon,Kbd,Spinner,EmptyIcon,useScreen,StyledModal,ModalContent,ModalHeader,ModalBody,useDisclosure,FilterIcon,ScrollShadow,ModalFooter,RefreshIcon,StyledPlainTabs,Tab,ChevronDownIcon,TableColumn,Sortable,StyledTable,TableHeader,TableBody,CrownIcon,ShiningStarIcon,TableRow,Skeleton,Progress,StyledLightTabs,StyledBadge,TableCell,StyledNumberInput}from'@liberfi.io/ui';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {useTickAge,useResizeObserver,useCallbackRef}from'@liberfi.io/hooks';import {useTranslation,useLocalizedTimeFormatter}from'@liberfi.io/i18n';import {formatMCapInUsd,SafeBigNumber,formatPercent,searchTwitterUrl,formatAmount,formatAmountInUsd,formatPriceInUsd,parseTokenProtocolFamily,searchImageUrl,formatPrice,formatTokenProtocolName}from'@liberfi.io/utils';export{formatAmount}from'@liberfi.io/utils';import {SolanaTokenProtocol,Chain}from'@liberfi.io/types';import {useNewPoolsQuery,useNewPoolsSubscription,useNewTokensMetadataSubscription,useMigratedTokensQuery,useFinalStretchTokensQuery,useSearchTokensInfiniteQuery,useTrendingTokensQuery,useTrendingTokensSubscription,useTokenHoldersQuery,useTokenSubscription,useTokenActivitiesQuery,useTokenActivitiesSubscription,useTokenSecurityQuery,useTokenStatsQuery,useWalletTokenPositionsQuery,useWalletLimitOrdersQuery,useTokenTopTradersQuery,useTokensByCreatorQuery,useSearchTokensQuery,useStockTokensQuery,useStockTokensSubscription,useTokensQuery,useTokenMarketRuntime,tokenMarketKey,useTokenMarket}from'@liberfi.io/react';import {AsyncModal,useAsyncModal,StatsFlipPanel}from'@liberfi.io/ui-scaffold';import {createBrowserSearchHistoryStorage,createMemorySearchHistoryStorage,useSearchKeyboardNavigation,useSearchController}from'@liberfi.io/ui/search';import {useInfiniteLoader}from'react-window-infinite-loader';import {createRealtimeCursorCollection}from'@liberfi.io/utils/realtime-cursor-collection';function Yn({title:e,isPaused:t,extra:o,className:n}){return jsxs("div",{className:cn("w-full h-12 px-3 flex-none bg-surface-base flex items-center justify-between gap-4 border-b border-border-subtle/60",n),children:[jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[jsx("h2",{className:"min-w-0 truncate font-semibold",children:e}),t&&jsx("div",{className:"flex flex-none items-center gap-1 text-primary",children:jsx(PauseIcon,{className:"w-4 h-4"})})]}),o&&jsx("div",{className:"flex min-w-0 items-center gap-3",children:o})]})}function Ko({isLast:e=false,className:t}){return jsxs("div",{className:cn("w-full h-full overflow-hidden px-4 py-3 animate-pulse",t),style:{borderBottom:e?"none":"1px solid var(--color-border-subtle)"},children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx("div",{className:"w-20 h-20 rounded-sm bg-content2"}),jsx("div",{className:"w-14 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"w-16 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-20 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-8 h-3 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-3 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-10 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5",children:[jsx("div",{className:"flex flex-col items-end gap-1",children:jsx("div",{className:"w-16 h-4 rounded bg-content2"})}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-14 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]}),jsx("div",{className:"w-10 h-2.5 rounded bg-content2"})]})]}),jsxs("div",{className:"mt-2.5 flex items-center gap-4",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1",children:[jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"})]}),jsx("div",{className:"w-16 h-7 rounded-md bg-content2 flex-none"})]})]})}function $({icon:e,value:t,tooltip:o,warning:n,disable:s=false,className:r,tooltipPlacement:i="top"}){return jsx(StyledTooltip,{content:o,placement:i,children:jsxs("div",{className:cn("shrink-0 px-2 py-0.5 flex items-center gap-1 rounded-full text-xs border border-border/60",n?"text-danger-500":s?"text-text-muted":"text-primary",r),children:[e,jsx("span",{children:t})]})})}var _o={kol:{label:"KOL",labelKey:"common.walletTag.kol",bgClass:"bg-warning/15",textClass:"text-warning"},smart:{label:"Smart",labelKey:"common.walletTag.smart",bgClass:"bg-sky-500/15",textClass:"text-sky-400"},sniper:{label:"Sniper",labelKey:"common.walletTag.sniper",bgClass:"bg-danger/15",textClass:"text-danger"},dev:{label:"Dev",labelKey:"common.walletTag.dev",bgClass:"bg-negative/15",textClass:"text-negative"},bundle:{label:"Bundle",labelKey:"common.walletTag.bundle",bgClass:"bg-purple-500/15",textClass:"text-purple-400"},bluechip:{label:"Bluechip",labelKey:"common.walletTag.bluechip",bgClass:"bg-success/15",textClass:"text-success"},insider:{label:"Insider",labelKey:"common.walletTag.insider",bgClass:"bg-fuchsia-500/15",textClass:"text-fuchsia-400"},fresh:{label:"Fresh",labelKey:"common.walletTag.fresh",bgClass:"bg-teal-500/15",textClass:"text-teal-400"}};function td({tag:e,className:t}){let{t:o}=useTranslation(),n=_o[e]??{label:e,bgClass:"bg-default/20",textClass:"text-text-muted"};return jsx("span",{className:cn("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide",n.bgClass,n.textClass,t),children:n.labelKey?o(n.labelKey):n.label})}function tr({tags:e,className:t,max:o}){if(!e||e.length===0)return null;let n=o!=null&&o>0?e.slice(0,o):e,s=e.length-n.length;return jsxs("div",{className:cn("flex flex-wrap items-center gap-1",t),children:[n.map(r=>jsx(td,{tag:r},r)),s>0&&jsxs("span",{className:"inline-flex items-center rounded bg-default/20 px-1.5 py-0.5 text-[10px] font-medium text-text-muted",children:["+",s]})]})}function od({tag:e,className:t}){let o=_o[e]??{label:e,bgClass:"bg-default/20",textClass:"text-text-muted"};return jsx("span",{className:cn("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide",o.bgClass,o.textClass,t),children:o.label})}function qt({tags:e,className:t,max:o}){if(!e||e.length===0)return null;let n=o!=null&&o>0?e.slice(0,o):e,s=e.length-n.length;return jsxs("div",{className:cn("flex flex-wrap items-center gap-1",t),children:[n.map(r=>jsx(od,{tag:r},r)),s>0&&jsxs("span",{className:"inline-flex items-center rounded bg-default/20 px-1.5 py-0.5 text-[10px] font-medium text-text-muted",children:["+",s]})]})}var nd={[SolanaTokenProtocol.BAGS]:{text:"text-bags",bg:"bg-bags",bg5:"bg-bags/5",bg20:"bg-bags/20",border:"border-bags"},[SolanaTokenProtocol.BELIEVE]:{text:"text-believe",bg:"bg-believe",bg5:"bg-believe/5",bg20:"bg-believe/20",border:"border-believe"},[SolanaTokenProtocol.BONK]:{text:"text-bonk",bg:"bg-bonk",bg5:"bg-bonk/5",bg20:"bg-bonk/20",border:"border-bonk"},[SolanaTokenProtocol.BOOP]:{text:"text-boop",bg:"bg-boop",bg5:"bg-boop/5",bg20:"bg-boop/20",border:"border-boop"},[SolanaTokenProtocol.HEAVEN]:{text:"text-heaven",bg:"bg-heaven",bg5:"bg-heaven/5",bg20:"bg-heaven/20",border:"border-heaven"},[SolanaTokenProtocol.JUPSTUDIO]:{text:"text-jupstudio",bg:"bg-jupstudio",bg5:"bg-jupstudio/5",bg20:"bg-jupstudio/20",border:"border-jupstudio"},[SolanaTokenProtocol.LAUNCHLAB]:{text:"text-launchlab",bg:"bg-launchlab",bg5:"bg-launchlab/5",bg20:"bg-launchlab/20",border:"border-launchlab"},[SolanaTokenProtocol.METEORA]:{text:"text-meteora",bg:"bg-meteora",bg5:"bg-meteora/5",bg20:"bg-meteora/20",border:"border-meteora"},[SolanaTokenProtocol.MOONIT]:{text:"text-moonit",bg:"bg-moonit",bg5:"bg-moonit/5",bg20:"bg-moonit/20",border:"border-moonit"},[SolanaTokenProtocol.MOONSHOT]:{text:"text-moonshot",bg:"bg-moonshot",bg5:"bg-moonshot/5",bg20:"bg-moonshot/20",border:"border-moonshot"},[SolanaTokenProtocol.ORCA]:{text:"text-orca",bg:"bg-orca",bg5:"bg-orca/5",bg20:"bg-orca/20",border:"border-orca"},[SolanaTokenProtocol.PUMP]:{text:"text-pump",bg:"bg-pump",bg5:"bg-pump/5",bg20:"bg-pump/20",border:"border-pump"},[SolanaTokenProtocol.RAYDIUM]:{text:"text-raydium",bg:"bg-raydium",bg5:"bg-raydium/5",bg20:"bg-raydium/20",border:"border-raydium"},[SolanaTokenProtocol.SUGAR]:{text:"text-sugar",bg:"bg-sugar",bg5:"bg-sugar/5",bg20:"bg-sugar/20",border:"border-sugar"},[SolanaTokenProtocol.VIRTUAL_CURVE]:{text:"text-virtual-curve",bg:"bg-virtual-curve",bg5:"bg-virtual-curve/5",bg20:"bg-virtual-curve/20",border:"border-virtual-curve"},[SolanaTokenProtocol.PUMP_AMM]:{text:"text-pump-amm",bg:"bg-pump-amm",bg5:"bg-pump-amm/5",bg20:"bg-pump-amm/20",border:"border-pump-amm"}},rd={text:"text-text-muted",bg:"bg-text-muted",bg5:"bg-text-muted/5",bg20:"bg-text-muted/20",border:"border-border-control"};function _e(e){return nd[e]??rd}function he({token:e,enablePreview:t=true,enableSearch:o=true,showProgress:n=true,showProtocolFamily:s=true,radius:r="sm",className:i,classNames:a}){let d=useMemo(()=>e.launchedFrom?.protocolFamily?parseTokenProtocolFamily(e.chain,e.launchedFrom.protocolFamily):void 0,[e.chain,e.launchedFrom?.protocolFamily]),l=useMemo(()=>s&&d,[s,d]),c=useMemo(()=>n&&e.migrateProgress&&new SafeBigNumber(e.migrateProgress).lt(100),[n,e.migrateProgress]),u=useMemo(()=>o&&e.image,[o,e.image]),m=useMemo(()=>(e.symbol??e.name??e.address??"L").slice(0,1).toUpperCase(),[e.symbol,e.name,e.address]),[p,g]=useState(false),f=useCallback(()=>{g(true);},[]),k=useCallback(()=>{g(false);},[]),x=useCallback(y=>{if(y.stopPropagation(),!e.image)return;let T=searchImageUrl(e.image);window.open(T,"_blank");},[e.image]);return jsxs("div",{className:cn("relative justify-center items-center",i??"w-15 h-15"),children:[!c&&jsx("div",{className:cn("absolute inset-0",`rounded-${r}`,d?_e(d).bg:"bg-surface-strong/60",a?.background)}),c&&jsx("div",{className:cn("absolute -inset-0.5",`rounded-${r}`),children:jsx(cd,{className:cn(d?_e(d).text:"text-surface-strong/60",a?.progress),progress:e.migrateProgress??"0"})}),jsx("div",{className:cn("absolute inset-0 p-px flex items-center justify-center",`rounded-${r}`,d?_e(d).bg20:"bg-surface-strong/12",a?.avatarWrapper),children:jsx(ld,{token:e,radius:r,enableSearch:o,enablePreview:t,classNames:a,children:jsxs("div",{className:cn("relative w-full h-full bg-content1 flex items-center justify-center p-0.5",`rounded-${r}`,p&&u&&"cursor-pointer"),onMouseEnter:f,onMouseLeave:k,children:[jsx(Avatar,{showFallback:true,src:e.image,name:m,imgProps:{loading:"lazy",decoding:"async"},className:cn("w-full h-full bg-content1 text-text-muted text-2xl",`rounded-${r}`,a?.avatar)}),p&&u&&jsx("div",{className:cn("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${r}`,a?.searchWrapper),onClick:x,children:jsx(CameraIcon,{className:cn("w-6 h-6",a?.searchIcon)})})]})})}),l&&jsx("div",{className:"contents",children:jsx(StyledTooltip,{content:e.launchedFrom?.protocolFamily??d,placement:"bottom",children:jsx("div",{className:cn("absolute -bottom-1 -right-1 rounded-full p-px w-4 h-4",d&&_e(d).bg,a?.protocolFamilyIconWrapper),children:jsx(Image,{removeWrapper:true,src:`/images/protocols/${d}.svg`,loading:"lazy",decoding:"async",className:cn("w-full h-full rounded-full bg-content1",a?.protocolFamilyIcon)})})})})]})}function ld({token:e,radius:t,enableSearch:o,enablePreview:n,classNames:s,children:r}){return useMemo(()=>n&&e.image,[n,e.image])?jsx(StyledTooltip,{content:jsx(dd,{token:e,radius:t,enableSearch:o,classNames:s}),closeDelay:100,placement:"bottom-start",classNames:{content:"p-1"},children:r}):r}function dd({token:e,enableSearch:t,radius:o,classNames:n}){let s=useMemo(()=>t&&e.image,[t,e.image]),r=useMemo(()=>(e.symbol??e.name??e.address??"L").slice(0,1).toUpperCase(),[e.symbol,e.name,e.address]),[i,a]=useState(false),d=useCallback(()=>{a(true);},[]),l=useCallback(()=>{a(false);},[]),c=useCallback(u=>{if(u.stopPropagation(),!e.image)return;let m=searchImageUrl(e.image);window.open(m,"_blank");},[e.image]);return jsxs("div",{className:cn("relative flex items-center justify-center w-60 h-60",`rounded-${o}`,i&&s&&"cursor-pointer",n?.previewWrapper),onMouseEnter:d,onMouseLeave:l,children:[jsx(Avatar,{showFallback:true,src:e.image,name:r,className:cn("w-full h-full bg-content1 text-text-muted text-3xl",`rounded-${o}`,n?.previewAvatar)}),i&&s&&jsx("div",{className:cn("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${o}`,n?.previewSearchWrapper),onClick:c,children:jsx(CameraIcon,{className:cn("w-10 h-10",n?.previewSearchIcon)})})]})}function cd({progress:e,className:t}){let o=useMemo(()=>296-Number(e)*296/100,[e]);return jsxs("svg",{viewBox:"0 0 78 78",className:"w-full h-full",children:[jsx("path",{className:`${t} opacity-40`,stroke:"currentColor",fill:"transparent",strokeWidth:"1",d:`
2
2
  M 76 76
3
3
  L 6 76
4
4
  Q 2 76 2 72
@@ -18,7 +18,7 @@ import {memo,useMemo,useState,useRef,useCallback,useEffect,useSyncExternalStore}
18
18
  Q 76 2 76 6
19
19
  L 76 72
20
20
  Q 76 76 76 76
21
- `})]})}function mr({token:e,renderAction:t,isLast:o=false,onSelectToken:n,className:s}){let{t:r}=useTranslation(),{formatAge:i}=useLocalizedTimeFormatter(),a=useCopyToClipboard(),d=useTickAge(e.createdAt),l=e.marketData,c=e.stats?.["1h"],u=useCallback(()=>{n?.(e);},[n,e]),m=useCallback(R=>{R.stopPropagation(),a(e.address,()=>toast.success(r("tokens.copied.address")));},[a,e.address,r]),p=useMemo(()=>c?.volumesInUsd,[c?.volumesInUsd]),g=useMemo(()=>c?.buyVolumesInUsd,[c?.buyVolumesInUsd]),f=useMemo(()=>c?.sellVolumesInUsd,[c?.sellVolumesInUsd]),k=useMemo(()=>c?.trades,[c?.trades]),x=useMemo(()=>l?.marketCapInUsd,[l?.marketCapInUsd]),h=useMemo(()=>l?.tvlInUsd,[l?.tvlInUsd]),T=useMemo(()=>{let R=new SafeBigNumber(x);return R.lt(1e3)?"text-foreground":R.lt(1e6)?"text-secondary":"text-primary"},[x]),S=useMemo(()=>new SafeBigNumber(l?.top10HoldingsRatio).gte(.1),[l?.top10HoldingsRatio]),y=useMemo(()=>new SafeBigNumber(l?.devHoldingsRatio).gte(.1),[l?.devHoldingsRatio]),b=useMemo(()=>new SafeBigNumber(l?.insiderHoldingsRatio).gte(.1),[l?.insiderHoldingsRatio]),w=useMemo(()=>new SafeBigNumber(l?.sniperHoldingsRatio).gte(.1),[l?.sniperHoldingsRatio]),v=useMemo(()=>new SafeBigNumber(l?.bundleHoldingsRatio).gte(.1),[l?.bundleHoldingsRatio]),N=l?.holders!==void 0&&l.holders>0,F=l?.proHolders!==void 0&&l.proHolders>0,fe=l?.kolHolders!==void 0&&l.kolHolders>0,Y=N||F||fe;return jsxs("div",{className:cn("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer",s),style:{borderBottom:o?"none":"1px solid var(--color-border-subtle)"},onClick:n?u:void 0,children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx(he,{token:e,enableSearch:true,enablePreview:!!e.image,showProgress:true,className:"w-20 h-20"}),jsxs("button",{type:"button",className:"text-xs font-mono text-text-muted hover:text-foreground leading-none",onClick:m,"aria-label":r("tokens.copied.address"),title:r("tokens.copied.address"),children:[e.address.slice(0,4),"...",e.address.slice(-4)]})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 text-left",onClick:m,"aria-label":r("tokens.copied.address"),title:r("tokens.copied.address"),children:[jsx("span",{className:"flex-none text-sm font-semibold leading-none whitespace-nowrap overflow-hidden text-ellipsis max-w-24",children:e.symbol}),jsx(StyledTooltip,{content:e.name,children:jsx("span",{className:"text-[13px] leading-none text-text-muted truncate max-w-20",children:e.name})}),jsx(CopyIcon,{className:"flex-none w-3.5 h-3.5 text-text-muted"})]}),jsxs("div",{className:"flex items-center gap-2 leading-none",children:[jsx("span",{className:"text-[13px] font-mono font-medium text-text-muted",children:i(d)}),e.socialMedias?.website&&jsx(Link,{href:e.socialMedias.website,className:"text-text-muted hover:text-primary",target:"_blank",onClick:R=>R.stopPropagation(),children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.twitter&&jsx(Link,{href:e.socialMedias.twitter,className:"text-text-muted hover:text-primary",target:"_blank",onClick:R=>R.stopPropagation(),children:jsx(TwitterIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.telegram&&jsx(Link,{href:e.socialMedias.telegram,className:"text-text-muted hover:text-primary",target:"_blank",onClick:R=>R.stopPropagation(),children:jsx(TelegramIcon,{className:"w-3.5 h-3.5"})}),jsx(Link,{href:searchTwitterUrl(`${e.symbol} OR ${e.address}`),className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",onClick:R=>R.stopPropagation(),children:jsx(SearchIcon,{className:"w-3.5 h-3.5"})})]}),jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-foreground/80 leading-none",children:[jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-text-muted",children:"MC"}),jsx("span",{className:cn(T),children:formatMCapInUsd(x)})]}),jsx("span",{className:"text-text-muted/30",children:"\xB7"}),jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-text-muted",children:r("tokens.listHeader.liqShort")}),jsx("span",{children:formatAmountInUsd(h)})]})]}),Y&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-text-muted leading-none",children:[N&&jsx(StyledTooltip,{content:r("tokens.tokenInfo.holders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(PeopleIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(l?.holders)]})}),F&&jsx(StyledTooltip,{content:r("tokens.tokenInfo.proHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(KlineCandlesIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(l?.proHolders)]})}),fe&&jsx(StyledTooltip,{content:r("tokens.tokenInfo.kolHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(StarIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(l?.kolHolders)]})})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5 leading-none font-mono",children:[jsx("div",{className:"flex flex-col items-end gap-1",children:jsx("span",{className:cn("text-base font-bold leading-none",T),children:formatMCapInUsd(x)})}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-text-muted",children:"V"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmountInUsd(p)})]}),jsxs("span",{className:"text-[10px] leading-none",children:[jsx("span",{className:"text-positive",children:formatAmountInUsd(g)}),jsx("span",{className:"text-text-muted/50 mx-0.5",children:"/"}),jsx("span",{className:"text-negative",children:formatAmountInUsd(f)})]})]}),jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-text-muted",children:"TX"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmount(k)})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-start gap-4 relative",children:[jsx(HorizontalScrollContainer,{className:"flex-auto min-w-0",forceShowArrows:true,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(l?.top10HoldingsRatio),tooltip:r("tokens.tokenInfo.top10HoldingsRatio"),warning:S,disable:!l?.top10HoldingsRatio||l?.top10HoldingsRatio==="0"}),jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(l?.devHoldingsRatio),tooltip:r("tokens.tokenInfo.devHoldingsRatio"),warning:y,disable:!l?.devHoldingsRatio||l?.devHoldingsRatio==="0"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(l?.sniperHoldingsRatio),tooltip:r("tokens.tokenInfo.sniperHoldingsRatio"),warning:w,disable:!l?.sniperHoldingsRatio||l?.sniperHoldingsRatio==="0"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(l?.insiderHoldingsRatio),tooltip:r("tokens.tokenInfo.insiderHoldingsRatio"),warning:b,disable:!l?.insiderHoldingsRatio||l?.insiderHoldingsRatio==="0"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(l?.bundleHoldingsRatio),tooltip:r("tokens.tokenInfo.bundleHoldingsRatio"),warning:v,disable:!l?.bundleHoldingsRatio||l?.bundleHoldingsRatio==="0"})]})}),t&&jsx("div",{className:"flex-none relative",onClick:R=>R.stopPropagation(),children:t(e)})]})]})}var Ud=152,pr=10;function Od({index:e,style:t,data:o,skeletonCount:n,renderItemAction:s,onSelectToken:r}){if(!o)return jsx("div",{style:t,children:jsx(Ko,{isLast:e===n-1})});let i=o[e];return i?jsx("div",{style:t,children:jsx(mr,{token:i,isLast:e===o.length-1,renderAction:s,onSelectToken:r})}):jsx("div",{style:t,children:jsx(Ko,{isLast:e===o.length-1})})}function Ze({title:e,tokens:t,isLoading:o,itemHeight:n=Ud,renderHeaderExtra:s,renderItemAction:r,onSelectToken:i,onPauseChange:a,onScrollingChange:d,className:l,hideHeader:c}){let u=o||!t?void 0:t,m=u?u.length:pr,p=useMemo(()=>({data:u,skeletonCount:pr,renderItemAction:r,onSelectToken:i}),[u,r,i]),[g,f]=useState(false),k=useRef(void 0),x=useRef(false),h=useCallback(()=>{f(true),a?.(true);},[a]),T=useCallback(()=>{f(false),a?.(false);},[a]),S=useCallback(()=>{x.current||(x.current=true,d?.(true)),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{x.current=false,d?.(false);},180);},[d]);return useEffect(()=>()=>{k.current&&clearTimeout(k.current),x.current&&d?.(false);},[d]),jsxs("div",{className:cn("w-full h-full bg-surface-base overflow-hidden flex flex-col border border-border-subtle/60 rounded-lg",l),onMouseEnter:h,onMouseLeave:T,children:[!c&&jsx(Xn,{title:e,isPaused:g,extra:s}),jsx("div",{className:"flex-1 w-full overflow-hidden",onScrollCapture:S,children:jsx(List,{className:"h-full w-full",rowCount:m,rowHeight:n,rowComponent:Od,rowProps:p,overscanCount:10})})]})}function zo(e,t){let o={...e};for(let n of Object.keys(t))t[n]!==void 0&&(o[n]=t[n]);return o}var Bd=["1m","5m","15m","30m","1h","4h","24h"];function Wd(e,t){if(!t)return e;if(!e)return t;let o={...e};for(let n of Bd)t[n]&&(o[n]=e[n]?zo(e[n],t[n]):t[n]);return o}function Vd(e,t){return t?e?zo(e,t):t:e}function Jt(e,t){return t?e?zo(e,t):t:e}function oe(e,t){let{chain:o,address:n,stats:s,marketData:r,socialMedias:i,security:a,launchedFrom:d,migratedTo:l,...c}=t,u={...e};for(let m of Object.keys(c))c[m]!==void 0&&(u[m]=c[m]);return u.stats=Wd(e.stats,s),u.marketData=Vd(e.marketData,r),u.socialMedias=Jt(e.socialMedias,i),u.security=Jt(e.security,a),u.launchedFrom=Jt(e.launchedFrom,d),u.migratedTo=Jt(e.migratedTo,l),u}function Yt(e,t){let o=new Map(e.map(n=>[n.address,n]));return t.map(n=>{let s=o.get(n.address);return s?oe(s,n):n})}function Kd(e){return e.chain!==void 0&&e.address!==void 0&&e.address!==""&&e.name!==void 0&&e.symbol!==void 0&&e.decimals!==void 0}function Me(e,t){if(t.length===0)return e;let o=[...e],n=false;for(let s of t){let r=o.findIndex(i=>i.address===s.address);if(r>=0){o[r]=oe(o[r],s),n=true;continue}Kd(s)&&(o.push(s),n=true);}return n?o:e}var qd=["24h","12h","30m","15m","30s","15s","1m","5m","1h","4h","1s"],$d=new Set(["price","marketCap","athMarketCap","tvl","holders","top10Holdings","top10Ratio","top100Holdings","top100Ratio","creatorsHoldings","creatorsRatio","createdAt","launchedFromProtocolFamily","migratedToProtocolFamily","tag"]),zd=new Set(["priceChange","volumes","trades","traders","buys","sells"]);function J(e){if(e==null||e==="")return;let t=Number(e);return Number.isFinite(t)?t:void 0}function gr(e){for(let t of qd){if(!e.endsWith(t))continue;let o=e.slice(0,-t.length);return o?{metric:o,resolution:t}:void 0}}function kr(e){if($d.has(e))return true;let t=gr(e);return t?zd.has(t.metric):false}function Zt(e,t){switch(t){case "price":return J(e.marketData?.priceInUsd);case "marketCap":return J(e.marketData?.marketCapInUsd);case "athMarketCap":return J(e.marketData?.athMarketCapInUsd);case "tvl":return J(e.marketData?.tvlInUsd);case "holders":return J(e.marketData?.holders);case "top10Holdings":return J(e.marketData?.top10Holdings);case "top10Ratio":return J(e.marketData?.top10HoldingsRatio);case "top100Holdings":return J(e.marketData?.top100Holdings);case "top100Ratio":return J(e.marketData?.top100HoldingsRatio);case "creatorsHoldings":return J(e.marketData?.devHoldings);case "creatorsRatio":return J(e.marketData?.devHoldingsRatio);case "createdAt":return e.createdAt?.getTime();case "launchedFromProtocolFamily":return fr(e,e.launchedFrom?.protocolFamily);case "migratedToProtocolFamily":return fr(e,e.migratedTo?.protocolFamily);case "tag":return e.tags?.[0];}let o=gr(t);if(!o)return;let n=e.stats,s=n&&o.resolution in n?n[o.resolution]:void 0;switch(o.metric){case "priceChange":return J(s?.priceChange);case "volumes":return J(s?.volumesInUsd);case "trades":return J(s?.trades);case "traders":return J(s?.traders);case "buys":return J(s?.buys);case "sells":return J(s?.sells);default:return}}function fr(e,t){if(t)return parseTokenProtocolFamily(e.chain,t)??t}var Qd=new Set(["top10Ratio","top100Ratio","creatorsRatio"]);function xr(e){let t=e.trim().toLowerCase();return t.length>0?t:void 0}function Gd(e){return [e.name,e.symbol].filter(Boolean).join(" ").toLowerCase()}function Xd(e){return Array.isArray(e)?e:void 0}function Jd(e){return Array.isArray(e)?void 0:e}function Tr(e,t){if(!Qd.has(e))return t;let o=Number(t);return Number.isFinite(o)?o/100:t}function ye(e,t){let o=Jd(t);return o===void 0?void 0:Tr(e,o)}function Qo(e,t){return Xd(t)?.map(o=>Tr(e,o))}function je(e,t){if(typeof e=="number"){let o=Number(t);return Number.isFinite(o)?e-o:void 0}if(typeof e=="string")return e.localeCompare(String(t))}function jt(e,t){if(typeof e=="number"){let o=Number(t);return Number.isFinite(o)&&e===o}return String(e)===String(t)}function Yd(e,t){if(!kr(t.field))return false;let o=Zt(e,t.field),n=o===void 0;if(t.operator==="isNull")return n;if(t.operator==="isNotNull")return !n;if(n)return false;switch(t.operator){case "eq":{let s=ye(t.field,t.value);return s!==void 0&&jt(o,s)}case "ne":{let s=ye(t.field,t.value);return s!==void 0&&!jt(o,s)}case "gt":{let s=ye(t.field,t.value),r=s!==void 0?je(o,s):void 0;return r!==void 0&&r>0}case "gte":{let s=ye(t.field,t.value),r=s!==void 0?je(o,s):void 0;return r!==void 0&&r>=0}case "lt":{let s=ye(t.field,t.value),r=s!==void 0?je(o,s):void 0;return r!==void 0&&r<0}case "lte":{let s=ye(t.field,t.value),r=s!==void 0?je(o,s):void 0;return r!==void 0&&r<=0}case "between":{let s=Qo(t.field,t.value);if(!s||s.length<2)return false;let r=je(o,s[0]),i=je(o,s[1]);return r!==void 0&&i!==void 0&&r>=0&&i<=0}case "in":{let s=Qo(t.field,t.value);return s?s.some(r=>jt(o,r)):false}case "nin":{let s=Qo(t.field,t.value);return s?s.every(r=>!jt(o,r)):false}case "contains":{let s=ye(t.field,t.value);return s!==void 0&&String(o).includes(String(s))}case "notContains":{let s=ye(t.field,t.value);return s!==void 0&&!String(o).includes(String(s))}case "startsWith":{let s=ye(t.field,t.value);return s!==void 0&&String(o).startsWith(String(s))}case "endsWith":{let s=ye(t.field,t.value);return s!==void 0&&String(o).endsWith(String(s))}default:return false}}function ce(e,t){let o=t?.keywords?.map(xr).filter(r=>r!==void 0),n=t?.excludeKeywords?.map(xr).filter(r=>r!==void 0),s=t?.filters;return !o?.length&&!n?.length&&!s?.length?e:e.filter(r=>{let i=Gd(r);return !(o?.length&&!o.some(a=>i.includes(a))||n?.length&&n.some(a=>i.includes(a))||s?.length&&!s.every(a=>Yd(r,a)))})}function me({applyUpdates:e,paused:t=false,flushInterval:o=500}){let n=useRef(e),s=useRef(t),r=useRef([]),i=useRef(void 0),a=useRef(void 0);n.current=e,s.current=t;let d=useCallback(()=>{i.current!==void 0&&(clearTimeout(i.current),i.current=void 0),a.current!==void 0&&(cancelAnimationFrame(a.current),a.current=void 0);},[]),l=useCallback(()=>{if(d(),s.current){i.current=setTimeout(l,o);return}let m=r.current;m.length!==0&&(r.current=[],n.current(m));},[d,o]),c=useCallback(()=>{i.current!==void 0||a.current!==void 0||(i.current=setTimeout(()=>{i.current=void 0,a.current=requestAnimationFrame(()=>{a.current=void 0,l();});},o));},[l,o]),u=useCallback(m=>{m.length!==0&&(r.current.push(...m),c());},[c]);return useEffect(()=>{t||l();},[l,t]),useEffect(()=>d,[d]),{enqueueUpdates:u,flush:l}}function Sr({chain:e,tokens:t,onUpdate:o,enabled:n=true}){let s=useTokenMarketRuntime(),r=useRef(new Map),i=useRef(o);i.current=o;let a=useMemo(()=>Array.from(new Set(t.map(c=>c.address.trim()).filter(Boolean))).sort().join(","),[t]),d=useMemo(()=>a?a.split(","):[],[a]),l=()=>{r.current.forEach(c=>c()),r.current.clear();};useEffect(()=>l,[e,s,n]),useEffect(()=>{if(!n){l();return}let c=new Set(d),u=r.current;for(let[m,p]of u)c.has(m)||(p(),u.delete(m));for(let m of d){if(u.has(m))continue;let p=tokenMarketKey(e,m),g=s.subscribe(p,k=>{k.token&&i.current([k.token]);}),f=s.retain(p);u.set(m,()=>{g(),f();});}},[d,e,n,s]);}var nc=80;function Rr(e){return {chain:e.chain,address:e.address,name:e.name??"",symbol:e.symbol??"",decimals:e.decimals??0,image:e.image,description:e.description,socialMedias:e.socialMedias,launchedFrom:e.launchedFrom,migratedTo:e.migratedTo,createdAt:e.createdAt}}function rc(e,t,o){return e===t?o:e===o?t:o||t}function Xo(e){let t=e.token?.address??e.tokenAAddress??"",o=e.token;return {...o,chain:e.chain,address:t,name:o?.name??"",symbol:o?.symbol??"",decimals:o?.decimals??0,createdAt:o?.createdAt??e.createdAt,liquidities:[{poolAddress:e.poolAddress,pairAddress:rc(t,e.tokenAAddress,e.tokenBAddress),image:e.dex?.image,programAddress:e.dex?.programAddress,protocolFamily:e.dex?.protocolFamily,protocolName:e.dex?.protocolName}]}}function sc(e){return {...Rr(Xo(e)),...e.token??{},liquidities:Xo(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function Pr(e){return e.sort((t,o)=>{let n=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-n}),e.slice(0,nc)}function Ar({chain:e,filters:t,isPaused:o=false,deferUpdates:n=false,updateFlushInterval:s}){let r=useMemo(()=>({chain:e}),[e]),i=useRef(o);i.current=o;let a=useRef(e),[d,l]=useState(true),[c,u]=useState([]);useEffect(()=>{e!==a.current&&(l(true),u([]),a.current=e);},[e]);let{data:m,isPending:p}=useNewPoolsQuery(r);useEffect(()=>{m&&(u(T=>{let S=i.current,y=T.length===0&&m.length>0,b=[...T];for(let w of m){let v=sc(w),N=b.findIndex(F=>F.address===v.address);N>=0?b[N]=oe(b[N],v):(!S||y)&&b.push(v);}return S?b:Pr(b)}),l(false));},[m]);let g=useCallback(T=>{u(S=>{let y=i.current,b=[...S],w=false;for(let v of T){let N=b.findIndex(F=>F.address===v.address);N>=0?(w=true,b[N]=oe(b[N],v)):y||(w=true,b.push(Rr(v)));}return w?y?b:Pr(b):S});},[]),{enqueueUpdates:f}=me({applyUpdates:g,paused:n,flushInterval:s}),k=useCallback(T=>{f(T.map(Xo));},[f]);useNewPoolsSubscription({chain:e},k),useNewTokensMetadataSubscription({chain:e},f),Sr({chain:e,tokens:c,onUpdate:f});let x=useMemo(()=>p||d,[p,d]);return {tokens:useMemo(()=>ce(c,t),[c,t]),isLoading:x}}function Eh({chain:e,filters:t,title:o,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,className:i,hideHeader:a}){let[d,l]=useState(false),[c,u]=useState(false),{tokens:m,isLoading:p}=Ar({chain:e,filters:t,isPaused:d,deferUpdates:c}),g=useCallback(f=>{l(f);},[]);return jsx(Ze,{title:o,tokens:m,isLoading:p,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,onPauseChange:g,onScrollingChange:u,className:i,hideHeader:a})}function et({chain:e,tokens:t,onUpdate:o,enabled:n=true}){let s=useTokenMarketRuntime(),r=useRef(new Map),i=useRef(o);i.current=o;let a=useMemo(()=>Array.from(new Set(t.map(c=>c.address.trim()).filter(Boolean))).sort().join(","),[t]),d=useMemo(()=>a?a.split(","):[],[a]),l=()=>{r.current.forEach(c=>c()),r.current.clear();};useEffect(()=>l,[e,s,n]),useEffect(()=>{if(!n){l();return}let c=new Set(d),u=r.current;for(let[m,p]of u)c.has(m)||(p(),u.delete(m));for(let m of d){if(u.has(m))continue;let p=tokenMarketKey(e,m),g=s.subscribe(p,k=>{k.token&&i.current([k.token]);}),f=s.retain(p);u.set(m,()=>{g(),f();});}},[d,e,n,s]);}function Er({chain:e,filters:t,isPaused:o=false,refetchInterval:n=3e4,deferUpdates:s=false,updateFlushInterval:r}){let i=useMemo(()=>({chain:e}),[e]),a=useRef(o);a.current=o;let d=useRef(e),[l,c]=useState(true),[u,m]=useState([]);useEffect(()=>{e!==d.current&&(c(true),m([]),d.current=e);},[e]);let{data:p,isPending:g}=useMigratedTokensQuery(i,{refetchInterval:n});useEffect(()=>{p&&(m(T=>{let S=a.current,y=[...T];for(let b of p){let w=y.findIndex(v=>v.address===b.address);w>=0?y[w]=oe(y[w],b):S||y.unshift(b);}return y}),c(false));},[p]);let f=useCallback(T=>{m(S=>Me(S,T));},[]),{enqueueUpdates:k}=me({applyUpdates:f,paused:s,flushInterval:r});et({chain:e,tokens:u,onUpdate:k});let x=useMemo(()=>g||l,[g,l]);return {tokens:useMemo(()=>ce(u,t),[u,t]),isLoading:x}}function ty({chain:e,filters:t,title:o,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,className:i,hideHeader:a}){let[d,l]=useState(false),[c,u]=useState(false),{tokens:m,isLoading:p}=Er({chain:e,filters:t,isPaused:d,deferUpdates:c}),g=useCallback(f=>{l(f);},[]);return jsx(Ze,{title:o,tokens:m,isLoading:p,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,onPauseChange:g,onScrollingChange:u,className:i,hideHeader:a})}function kc(e){return e.sort((t,o)=>{let n=Number(t.migrateProgress??0);return Number(o.migrateProgress??0)-n})}function _r({chain:e,filters:t,isPaused:o=false,refetchInterval:n=15e3,deferUpdates:s=false,updateFlushInterval:r}){let i=useMemo(()=>({chain:e}),[e]),a=useRef(o);a.current=o;let d=useRef(e),[l,c]=useState(true),[u,m]=useState([]);useEffect(()=>{e!==d.current&&(c(true),m([]),d.current=e);},[e]);let{data:p,isPending:g}=useFinalStretchTokensQuery(i,{refetchInterval:n});useEffect(()=>{p&&(m(T=>{let S=a.current,y=T.length===0&&p.length>0,b=[...T];for(let w of p){let v=b.findIndex(N=>N.address===w.address);v>=0?b[v]=oe(b[v],w):(!S||y)&&b.push(w);}return S?b:kc(b)}),c(false));},[p]);let f=useCallback(T=>{m(S=>Me(S,T));},[]),{enqueueUpdates:k}=me({applyUpdates:f,paused:s,flushInterval:r});et({chain:e,tokens:u,onUpdate:k});let x=useMemo(()=>g||l,[g,l]);return {tokens:useMemo(()=>ce(u,t),[u,t]),isLoading:x}}function gy({chain:e,filters:t,title:o,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,className:i,hideHeader:a}){let[d,l]=useState(false),[c,u]=useState(false),{tokens:m,isLoading:p}=_r({chain:e,filters:t,isPaused:d,deferUpdates:c}),g=useCallback(f=>{l(f);},[]);return jsx(Ze,{title:o,tokens:m,isLoading:p,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,onPauseChange:g,onScrollingChange:u,className:i,hideHeader:a})}var Nc=10,Cc="liberfi:search_histories";function bt(){return createBrowserSearchHistoryStorage({key:Cc,fallback:createMemorySearchHistoryStorage()})}function wc(e,t){return e.length===t.length&&e.every((o,n)=>o===t[n])}function zr(){let e=useMemo(()=>bt(),[]),t=useRef(e.read()),o=()=>{let i=e.read();return wc(t.current,i)?t.current:(t.current=i,i)},n=useSyncExternalStore(e.subscribe,o,o),s=useCallback(i=>{let a=i.trim();if(!a)return;let d=e.read().filter(l=>l!==a);e.write([a,...d].slice(0,Nc));},[e]),r=useCallback(()=>{e.clear();},[e]);return {histories:n,addHistory:s,clearHistories:r}}function Xr({histories:e,onSelect:t,onClear:o,className:n}){let{t:s}=useTranslation();return e.length===0?null:jsxs("div",{className:cn("px-4 pb-4",n),children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"text-sm font-medium",children:s("tokens.search.history")}),jsx(Button,{isIconOnly:true,size:"sm",className:"bg-transparent min-w-6 w-6 h-6 text-text-muted",onPress:o,children:jsx(TrashIcon,{width:20,height:20})})]}),jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:e.map(r=>jsx(Chip,{size:"sm",variant:"bordered",className:cn("text-text-muted","border-border border-1","cursor-pointer","hover:opacity-hover"),onClick:()=>t?.(r),children:jsx("span",{children:r})},r))})]})}function Jr({onSelect:e,histories:t,onClear:o,className:n}){let s=zr(),r=t?[...t]:s.histories,i=o??s.clearHistories;return jsx(Xr,{className:cn(n),histories:r,onSelect:e,onClear:i})}var Bc=["ArrowDown","ArrowUp","Enter","Escape"];function Wc(e){return Bc.includes(e)}function Yr({value:e,onValueChange:t,onClear:o,onEscape:n,onNavigateKey:s,className:r}){let{t:i}=useTranslation();return jsx("div",{className:r,children:jsx(StyledInput,{autoFocus:true,variant:"bordered",radius:"full",value:e,onValueChange:t,onKeyDown:a=>{Wc(a.key)&&(a.key!=="Escape"&&a.preventDefault(),s?.(a.key));},placeholder:i("tokens.search.placeholder"),classNames:{inputWrapper:["!bg-surface-strong/60","!border-border-control/50","data-[hover=true]:!bg-surface-strong","group-data-[focus=true]:!bg-surface-strong","group-data-[focus=true]:!border-border-control/80"].join(" ")},startContent:jsx(SearchIcon,{width:20,height:20,className:"text-text-muted"}),endContent:e?jsx(Button,{isIconOnly:true,className:"bg-transparent min-w-6 w-6 h-6 text-text-muted",onPress:o,children:jsx(XCloseIcon,{width:20,height:20})}):jsx(Kbd,{className:"min-w-8 justify-center text-xs text-text-muted bg-transparent border border-border-control/50 rounded-full cursor-pointer select-none",onMouseDown:a=>{a.preventDefault(),n?.();},children:"ESC"})})})}function to({token:e,highlighted:t=false,className:o}){let{t:n}=useTranslation(),{formatAge:s}=useLocalizedTimeFormatter(),r=useTickAge(e.createdAt),i=useMemo(()=>e.marketData?.priceInUsd,[e]),a=useMemo(()=>e.marketData?.marketCapInUsd,[e]),d=useMemo(()=>e.marketData?.tvlInUsd,[e]),l=useMemo(()=>e.stats?.["24h"]?.priceChange,[e]),c=useMemo(()=>l?new SafeBigNumber(l).abs().toString():void 0,[l]),u=useMemo(()=>l!=null&&new SafeBigNumber(l).gte(0),[l]);return jsxs("div",{className:cn("w-full h-full px-3 flex items-center justify-between gap-2","hover:cursor-pointer hover:bg-content2 rounded-lg",t&&"bg-content2",o),"data-highlighted":t?"true":"false","aria-selected":t,children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2.5",children:[jsx(he,{token:e,className:"w-10 h-10 flex-none",showProtocolFamily:true,classNames:{searchIcon:"w-5 h-5"}}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"font-medium text-sm truncate",children:e.symbol}),jsx("span",{className:"text-xs text-primary font-medium",children:s(r)})]}),jsxs("div",{className:"flex items-center gap-1 text-xs text-text-muted",children:[jsxs("span",{children:[n("tokens.listHeader.mcShort")," ",formatMCapInUsd(a)]}),jsx("span",{children:"/"}),jsxs("span",{children:[n("tokens.listHeader.liqShort")," ",formatAmountInUsd(d)]})]})]})]}),jsxs("div",{className:"flex-none w-20 flex flex-col items-end",children:[jsx("span",{className:"text-xs",children:formatPriceInUsd(i)}),jsxs("span",{className:cn("inline-flex gap-0.5 items-center text-xs",u?"text-positive":"text-negative"),children:[u?jsx(TriangleUpIcon,{width:8,height:8}):jsx(TriangleDownIcon,{width:8,height:8}),jsx("span",{children:formatPercent(c)})]})]})]})}function oo({className:e}){let{t}=useTranslation();return jsxs("div",{className:cn("h-9 px-3 flex items-center justify-between","text-xs font-medium text-text-muted","sticky top-0 z-10",e),children:[jsx("div",{className:"flex-1",children:jsxs("span",{children:[t("tokens.listHeader.token")," / ",t("tokens.listHeader.age")," /"," ",t("tokens.listHeader.marketCap")," /"," ",t("tokens.listHeader.liquidity")]})}),jsx("div",{className:"flex-none w-20 text-right",children:jsxs("span",{children:[t("tokens.listHeader.price")," / ",t("tokens.listHeader.24hChange")]})})]})}function jc(){return jsxs("div",{className:"w-full h-14 px-3 flex items-center justify-between gap-2",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[jsx(Skeleton,{className:"flex-none w-8 h-8 rounded-full"}),jsxs("div",{className:"flex flex-col gap-1.5",children:[jsx(Skeleton,{className:"w-24 h-4 rounded-md"}),jsx(Skeleton,{className:"w-36 h-3 rounded-md"})]})]}),jsxs("div",{className:"flex-none w-20 flex flex-col items-end gap-1.5",children:[jsx(Skeleton,{className:"w-14 h-4 rounded-md"}),jsx(Skeleton,{className:"w-10 h-3 rounded-md"})]})]})}function ro({rows:e=6,className:t}){return jsx("div",{className:cn("w-full",t),children:Array.from({length:e}).map((o,n)=>jsx(jc,{},n))})}function os({keyword:e,chains:t,limit:o=50}){let n=useMemo(()=>({keyword:e,chains:t,limit:o}),[e,t,o]),{data:s,isLoading:r,isFetchingNextPage:i,hasNextPage:a,fetchNextPage:d}=useSearchTokensInfiniteQuery(n,{enabled:!!e}),l=useMemo(()=>s?.pages.flatMap(c=>c.data)??[],[s]);return {tokens:l,items:l,isLoading:r,isFetchingNextPage:i,hasNextPage:a??false,fetchNextPage:d}}var cm=56;function ss({onSelectToken:e,className:t,navigationRef:o,onEscape:n,...s}){let{tokens:r,isLoading:i,isFetchingNextPage:a,hasNextPage:d,fetchNextPage:l}=os(s),c=useRef(null),{height:u}=useResizeObserver({ref:c}),m=useCallback(h=>h<r.length,[r]),p=useCallback(async()=>{d&&!a&&await l();},[d,a,l]),g=useMemo(()=>d?r.length+1:r.length,[r,d]),f=useInfiniteLoader({isRowLoaded:m,loadMoreRows:p,rowCount:g,threshold:5}),k=i?0:r.length,x=useSearchKeyboardNavigation({itemCount:k,hasNextPage:d&&!i,isFetchingNextPage:a,onSelectIndex:h=>{let T=r[h];T&&e?.(T);},onRequestNextPage:()=>{d&&!a&&l();},onEscape:()=>n?.()});return o&&(o.current=x),useEffect(()=>()=>{o&&o.current===x&&(o.current=null);},[x,o]),useEffect(()=>{x.reset();},[s.keyword,x]),i?jsxs("div",{className:cn("w-full",t),children:[jsx(oo,{}),jsx(ro,{})]}):r.length===0?jsxs("div",{className:cn("w-full",t),children:[jsx(oo,{}),jsx(um,{})]}):jsxs("div",{className:cn("w-full h-full flex flex-col",t),children:[jsx(oo,{className:"flex-none"}),jsx("div",{className:"flex-auto min-h-0",ref:c,children:jsx(List,{style:{height:u},onRowsRendered:f,rowComponent:mm,rowCount:g,rowHeight:cm,rowProps:{tokens:r,onSelectToken:e,highlightedIndex:x.highlightedIndex},overscanCount:5})})]})}function mm({index:e,style:t,tokens:o,onSelectToken:n,highlightedIndex:s}){let r=o[e];return r?jsx("div",{style:t,"data-index":e,onClick:()=>n?.(r),children:jsx(to,{token:r,highlighted:s===e})}):jsx("div",{style:t,className:"flex items-center justify-center",children:jsx(Spinner,{size:"sm"})})}function um(){let{t:e}=useTranslation();return jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[jsx(EmptyIcon,{width:28,height:28,className:"text-text-muted"}),jsx("p",{className:"mt-2 text-sm text-text-muted",children:e("tokens.search.noResults")})]})}function pm(e,t){return typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t))}function rt(e,t){let o=Object.keys(t??{})[0];if(!o)return e;let n=t?.[o];if(n!=="asc"&&n!=="desc")return e;let s=e.map((r,i)=>({token:r,index:i,value:Zt(r,o)}));return s.every(({value:r})=>r===void 0)?e:s.sort((r,i)=>{let a=r.value===void 0,d=i.value===void 0;if(a&&d)return r.index-i.index;if(a)return 1;if(d)return -1;let l=pm(r.value,i.value);return l===0?r.index-i.index:n==="asc"?l:-l}).map(({token:r})=>r)}function ao({chain:e,resolution:t,filters:o,sortDirections:n,refetchInterval:s=3e4,deferUpdates:r=false,updateFlushInterval:i}){let a=useMemo(()=>({chain:e,resolution:t}),[e,t]),d=useRef(a),[l,c]=useState(true);useEffect(()=>{JSON.stringify(a)!==JSON.stringify(d.current)&&(c(true),m([]),d.current=a);},[a]);let[u,m]=useState([]),{data:p,isPending:g}=useTrendingTokensQuery(a,{refetchInterval:s});useEffect(()=>{p&&(m(S=>Yt(S,p)),c(false));},[p]);let f=useCallback(S=>{m(y=>Me(y,S));},[]),{enqueueUpdates:k}=me({applyUpdates:f,paused:r,flushInterval:i});useTrendingTokensSubscription({chain:e},k);let x=useMemo(()=>!!(g||l),[g,l]),h=useMemo(()=>ce(u,o),[u,o]);return {tokens:useMemo(()=>rt(h,n),[h,n]),isLoading:x}}var ym=Chain.ETHEREUM,bm="24h",vm=56;function ls({chains:e,onSelectToken:t,className:o}){let n=e?.length===1?e[0]:e?.[0]??ym,{tokens:s,isLoading:r}=ao({chain:n,resolution:bm});return jsx("div",{className:cn("w-full flex flex-col overflow-hidden",o),children:r?jsx(ro,{}):jsx("div",{className:"overflow-y-auto",children:s.map(i=>jsx("div",{style:{height:vm},onClick:()=>t?.(i),children:jsx(to,{token:i,className:"h-full"})},i.address))})})}function ms({chains:e,onKeywordChange:t,onSelectToken:o,onEscape:n}){let s=useMemo(()=>bt(),[]),r=useSearchController({storage:s,onQueryChange:t??ds,onDismiss:n??ds}),i=useRef(null),a=r.dismiss,d=useCallback(l=>{if(i.current){i.current.onKey(l);return}l==="Escape"&&a();},[a]);return jsxs("div",{className:"w-full h-full flex flex-col gap-3",children:[jsx(Yr,{value:r.text,onValueChange:r.setText,onClear:r.clearQuery,onEscape:r.dismiss,onNavigateKey:d}),r.query?jsx(ss,{className:"flex-auto min-h-0",keyword:r.query,chains:e,onSelectToken:o,navigationRef:i,onEscape:r.dismiss}):jsxs("div",{className:"flex-auto min-h-0 flex flex-col overflow-hidden",children:[jsx(Jr,{histories:r.history,onSelect:r.commitQuery,onClear:r.clearHistory}),jsx(ls,{className:"flex-auto min-h-0",chains:e,onSelectToken:o})]})]})}function ds(){}var en="search";function tv({id:e=en}){return jsx(AsyncModal,{id:e,children:t=>jsx(Om,{...t})})}function Om({params:e,isOpen:t,onOpenChange:o,onResult:n}){let{t:s}=useTranslation(),{isMobile:r}=useScreen(),i=useCallback(a=>{n(a);},[n]);return jsx(StyledModal,{isOpen:t,onOpenChange:o,size:r?"full":"lg",hideCloseButton:true,backdrop:"opaque",radius:"lg",children:jsxs(ModalContent,{className:"w-full h-full",style:{borderRadius:r?void 0:14,border:r?void 0:"1px solid var(--color-border-control)",background:"var(--color-surface-interactive)",boxShadow:r?void 0:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden"},children:[jsxs(ModalHeader,{className:"sm:hidden flex items-center justify-between pt-4 pb-2",children:[jsx("span",{className:"text-base font-semibold",children:s("tokens.search.title")}),jsx(Button,{isIconOnly:true,onPress:()=>o(false),size:"sm",className:"bg-transparent min-w-6 w-6 h-6",children:jsx(XCloseIcon,{width:20,height:20})})]}),jsx(ModalBody,{className:"p-4",children:jsx(ms,{chains:e?.chains,onSelectToken:i,onEscape:()=>o(false)})})]})})}function cv({chains:e,onSelectToken:t,className:o}){let{t:n}=useTranslation(),{isDesktop:s}=useScreen(),{onOpen:r,onClose:i}=useAsyncModal(en),a=useCallbackRef(t),d=useCallbackRef(async()=>{let c=await r({params:{chains:e}});c&&a(c);}),l=useCallbackRef(()=>{i();});return useEffect(()=>{let c=u=>{let m=document.activeElement,p=!!m&&(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.getAttribute("contenteditable")==="true");u.key==="/"&&!p&&(u.preventDefault(),d()),u.key==="Escape"&&(u.preventDefault(),l());};return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c);}},[d,l]),s?jsx(Button,{size:"sm",radius:"full",onPress:d,variant:"bordered",startContent:jsx(SearchIcon,{width:16,height:16,className:"text-foreground"}),endContent:jsx(Kbd,{className:"min-w-6 justify-center text-xs text-foreground bg-content3 rounded-lg",children:"/"}),className:cn("w-56 min-w-0 h-8 min-h-0 border-transparent hover:border-border bg-content2 pl-3 pr-1.5 text-text-muted",o),children:n("tokens.search.placeholder")}):jsx(Button,{size:"sm",radius:"full",isIconOnly:true,onPress:d,variant:"bordered",className:cn("w-8 min-w-0 h-8 min-h-0 border-1 border-border bg-content2",o),children:jsx(SearchIcon,{width:16,height:16,className:"text-foreground"})})}var ks=()=>{};function kv({onKeywordChange:e}){let t=useMemo(()=>bt(),[]),o=useSearchController({storage:t,onQueryChange:e??ks,onDismiss:ks});return {text:o.text,keyword:o.query,setText:o.setText,setKeyword:o.commitQuery,clearKeyword:o.clearQuery}}function Ct(e){return e==null||e===""?"--":formatPercent(Number(e)/100)}function be(e,t=4,o=4){return e?e.length<=t+o+1?e:`${e.slice(0,t)}\u2026${e.slice(-o)}`:"--"}function Ae(e,t,o=Date.now()){if(e==null)return "--";let n=typeof e=="string"||typeof e=="number"?new Date(e):e,s=typeof o=="number"?new Date(o):o;return t(Math.max(0,s.getTime()-n.getTime()))}function O(e,t){let{token:o,isLoading:n}=useTokenMarket({chain:e,address:t});return {token:o,isLoading:n}}function st({label:e,totalFormatted:t,buysFormatted:o,sellsFormatted:n,totalValue:s=0,buysValue:r=0,className:i}){let{t:a}=useTranslation(),d=new SafeBigNumber(s??0),l=new SafeBigNumber(r??0),c=d.eq(0)?0:l.div(d).times(100).toNumber();return jsxs("div",{className:cn("flex flex-col gap-1",i),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-xs text-text-muted",children:e}),jsx("span",{className:"text-xs text-foreground",children:t})]}),jsx(Progress,{size:"sm",value:c,classNames:{track:"bg-negative/40",indicator:"bg-positive"},"aria-label":a("tokens.tokenDetail.buyShare",{label:e})}),jsxs("div",{className:"flex justify-between gap-4 text-[10px]",children:[jsx("span",{className:"text-positive",children:a("tokens.tokenDetail.buys",{value:o})}),jsx("span",{className:"text-negative",children:a("tokens.tokenDetail.sells",{value:n})})]})]})}function Ts({token:e,actions:t,dataStrip:o,className:n,onCopyAddress:s}){let r=e?.address;return jsxs("div",{className:cn("flex w-full flex-wrap items-center gap-4 px-4 py-3",n),children:[jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e&&jsx(he,{token:e,radius:"lg",className:"h-10 w-10"}),jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"truncate text-base font-semibold text-foreground",children:e?.symbol??"--"}),jsx("span",{className:"truncate text-xs text-text-muted",children:e?.name})]}),r&&jsxs("button",{type:"button",onClick:()=>s?.(r),className:"flex items-center gap-1 text-[11px] text-text-muted transition-colors hover:text-foreground",title:r,children:[be(r,6,6),jsx(CopyIcon,{width:12,height:12})]})]})]}),o&&jsx("div",{className:"flex-1 min-w-0",children:o}),t&&jsx("div",{className:"ml-auto flex items-center gap-2",children:t})]})}function hs(e,t){return O(e,t)}function bs({price:e,marketCap:t,volume:o,holdersCount:n,socialMedia:s,className:r}){return jsxs("div",{className:cn("flex flex-wrap items-center gap-x-6 gap-y-3",r),children:[e,jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-3",children:[t,o,n]}),jsx("div",{className:"ml-auto",children:s})]})}function rS(e,t){return O(e,t)}function Ss({holders:e,top10HoldingsRatio:t,top100HoldingsRatio:o,className:n}){let{t:s}=useTranslation();return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",n),children:[jsxs("div",{className:"text-xs font-medium text-text-muted",children:[jsx("span",{className:"text-foreground",children:e!=null?formatAmount(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Ct(t)}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Ct(o)})]}),jsx("div",{className:"text-[10px] text-text-muted",children:s("tokens.tokenDetail.holdersSummary")})]})}function Ns(e,t){return O(e,t)}function Cs({chain:e,address:t,className:o}){let{token:n}=Ns(e,t);return jsx(Ss,{holders:n?.marketData?.holders,top10HoldingsRatio:n?.marketData?.top10HoldingsRatio,top100HoldingsRatio:n?.marketData?.top100HoldingsRatio,className:o})}function Ls({marketCapInUsd:e,tvlInUsd:t,createdAt:o,className:n}){let{t:s}=useTranslation(),{formatAge:r}=useLocalizedTimeFormatter();return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",n),children:[jsxs("div",{className:"text-xs font-medium text-text-muted",children:[jsx("span",{className:"text-foreground",children:e?formatMCapInUsd(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:t?formatAmountInUsd(t):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Ae(o,r)})]}),jsx("div",{className:"text-[10px] text-text-muted",children:s("tokens.tokenDetail.marketCapSummary")})]})}function Ps(e,t){return O(e,t)}function Rs({chain:e,address:t,className:o}){let{token:n}=Ps(e,t);return jsx(Ls,{marketCapInUsd:n?.marketData?.marketCapInUsd,tvlInUsd:n?.marketData?.tvlInUsd,createdAt:n?.createdAt,className:o})}function Ms({priceInUsd:e,price24hAgoInUsd:t,className:o}){let{t:n}=useTranslation(),{bearish:s,priceChange:r}=useMemo(()=>{if(!e||!t)return {bearish:false,priceChange:void 0};let i=new SafeBigNumber(e),a=new SafeBigNumber(t);return a.lte(0)?{bearish:false,priceChange:void 0}:{bearish:i.lt(a),priceChange:i.minus(a).div(a).abs().toNumber()}},[e,t]);return jsxs("div",{className:cn("group flex flex-col gap-1",o),"data-bearish":s,children:[jsx("div",{className:"text-base font-medium leading-none text-positive group-data-[bearish=true]:text-negative",children:e?formatPriceInUsd(e):"--"}),jsxs("div",{className:"flex items-center gap-2 text-[10px] leading-none",children:[jsx("span",{className:"text-text-muted",children:n("tokens.tokenDetail.change24h")}),jsx("span",{className:"text-positive group-data-[bearish=true]:text-negative",children:r!=null?formatPercent(r):"--"})]})]})}function Hs(e,t){return O(e,t)}function Ds({chain:e,address:t,className:o}){let{token:n}=Hs(e,t);return jsx(Ms,{priceInUsd:n?.marketData?.priceInUsd,price24hAgoInUsd:n?.stats?.["24h"]?.openPriceInUsd,className:o})}function bu(e,t){switch(e){case "website":return jsx(WebsiteIcon,{width:t,height:t});case "twitter":return jsx(TwitterIcon,{width:t,height:t});case "telegram":return jsx(TelegramIcon,{width:t,height:t});case "discord":return jsx(DiscordIcon,{width:t,height:t});default:return jsx("span",{className:"text-[9px] font-medium uppercase",children:e.slice(0,2)})}}function Fs({socials:e,className:t,iconSize:o=16}){if(!e)return null;let s=["website","twitter","telegram","discord","github","reddit","youtube","medium"].filter(r=>!!e[r]);return s.length===0?null:jsx("div",{className:cn("flex items-center gap-3",t),children:s.map(r=>jsx("a",{href:e[r],target:"_blank",rel:"noreferrer noopener",className:"flex items-center justify-center text-text-muted transition-colors hover:text-foreground",style:{width:o,height:o},children:bu(r,o)},r))})}function Us(e,t){return O(e,t)}function Os({chain:e,address:t,className:o,iconSize:n}){let{token:s}=Us(e,t);return jsx(Fs,{socials:s?.socialMedias,className:o,iconSize:n})}function Ws({volumesInUsd:e,trades:t,traders:o,className:n}){let{t:s}=useTranslation();return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",n),children:[jsxs("div",{className:"text-xs font-medium text-text-muted",children:[jsx("span",{className:"text-foreground",children:e?formatAmountInUsd(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:t!=null?formatAmount(t):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:o!=null?formatAmount(o):"--"})]}),jsx("div",{className:"text-[10px] text-text-muted",children:s("tokens.tokenDetail.volumeSummary")})]})}function Vs(e,t){return O(e,t)}function Ks({chain:e,address:t,className:o}){let{token:n}=Vs(e,t),s=n?.stats?.["24h"];return jsx(Ws,{volumesInUsd:s?.volumesInUsd,trades:s?.trades,traders:s?.traders,className:o})}function _s({chain:e,address:t,className:o}){return jsx(bs,{className:o,price:jsx(Ds,{chain:e,address:t}),marketCap:jsx(Rs,{chain:e,address:t}),volume:jsx(Ks,{chain:e,address:t}),holdersCount:jsx(Cs,{chain:e,address:t}),socialMedia:jsx(Os,{chain:e,address:t})})}function _N({chain:e,address:t,actions:o,dataStrip:n,className:s,onCopyAddress:r}){let{token:i}=hs(e,t);return jsx(Ts,{token:i,actions:o,dataStrip:n===void 0?jsx(_s,{chain:e,address:t}):n,className:s,onCopyAddress:r})}var Iu=["holdingUsd","lastActiveAt"];function zs({holders:e,isLoading:t,sortBy:o,sortDirection:n,onSortByChange:s,onlyTracked:r=false,onOnlyTrackedChange:i,onLoadMore:a,hasMore:d,now:l=Date.now(),wellKnownAddresses:c,className:u,renderAddress:m}){let{t:p}=useTranslation(),g=r?e.filter(f=>f.tags&&f.tags.length>0):e;return jsxs("div",{className:cn("flex flex-col",u),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("span",{className:"text-xs font-medium text-text-muted",children:p("tokens.tokenDetail.holders.title")}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-text-muted",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:r,onChange:f=>i?.(f.target.checked)}),p("tokens.tokenDetail.filter.onlyTracked")]})]}),jsx("div",{className:"flex items-center gap-1",children:Iu.map(f=>jsx("button",{type:"button",onClick:()=>s(f,n??"desc"),className:cn("rounded px-2 py-1 text-[11px] transition-colors",o===f?"bg-default-100 text-foreground":"text-text-muted hover:text-foreground"),children:p(f==="holdingUsd"?"tokens.tokenDetail.columns.value":"tokens.tokenDetail.columns.lastActive")},f))})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[640px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[30%] px-3 py-2 text-left font-normal",children:p("tokens.tokenDetail.columns.wallet")}),jsx("th",{className:"w-[20%] px-3 py-2 text-left font-normal",children:p("tokens.tokenDetail.columns.tags")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:p("tokens.tokenDetail.columns.value")}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"%"}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:p("tokens.tokenDetail.columns.firstHeld")}),jsx("th",{className:"w-[13%] px-3 py-2 text-right font-normal",children:p("tokens.tokenDetail.columns.lastActive")})]})}),jsxs("tbody",{children:[g.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-text-muted",children:p("tokens.tokenDetail.holders.empty")})}),g.map(f=>jsx(Mu,{holder:f,now:l,wellKnownAddresses:c,renderAddress:m},f.address)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-text-muted",children:p("tokens.tokenDetail.loading")})})]})]})}),d&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:a,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:p("tokens.tokenDetail.loadMore")})})]})}function Mu({holder:e,now:t,wellKnownAddresses:o,renderAddress:n}){let{formatAge:s}=useLocalizedTimeFormatter(),r=o?.[e.address],i=useMemo(()=>n?n(e.address):r?jsx("span",{className:"rounded bg-default-100 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-text-muted",children:r}):jsx("span",{className:"font-mono text-[11px] text-text-muted",children:be(e.address,6,6)}),[e.address,n,r]);return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:i}),jsx("td",{className:"px-3 py-2 align-middle",children:jsx(qt,{tags:e.tags,max:3})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:formatAmountInUsd(e.amountInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:Ct(e.ratio)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.startHoldingAt?Ae(e.startHoldingAt,s,t):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.lastActiveAt?Ae(e.lastActiveAt,s,t):"--"})]})}function Xs({chain:e,address:t,limit:o=50,initialSortBy:n,initialSortDirection:s}){let[r,i]=useState(n),[a,d]=useState(s),[l,c]=useState(void 0),[u,m]=useState([]),p=useCallback(()=>{c(void 0),m([]);},[]),g=useCallback((N,F)=>{N===r&&F===a||(i(N),d(F),p());},[p,r,a]),f=useCallback(N=>{g(N,a??"desc");},[g,a]),k=useCallback(N=>{N!==a&&(d(N),p());},[p,a]);useEffect(()=>{p();},[e,t,p]);let x=useMemo(()=>({chain:e,address:t,cursor:l,limit:o,sortBy:r,sortDirection:a}),[e,t,l,o,r,a]),{data:h,isPending:T,isFetching:S}=useTokenHoldersQuery(x);useEffect(()=>{h&&m(N=>l==null?[h]:N[N.length-1]?.endCursor===h.endCursor?N:[...N,h]);},[h,l]),useTokenSubscription({chain:e,address:t},()=>{});let y=useMemo(()=>u.flatMap(N=>N.data),[u]),b=u[u.length-1],w=!!(b?.hasNext&&b.endCursor),v=useCallback(()=>{!b?.endCursor||!b.hasNext||c(b.endCursor);},[b]);return {holders:y,isLoading:T||S,sortBy:r,sortDirection:a,setSortBy:f,setSort:g,setSortDirection:k,hasMore:w,loadMore:v}}function mC({chain:e,address:t,limit:o,initialSortBy:n,initialSortDirection:s,initialOnlyTracked:r=false,wellKnownAddresses:i,className:a,renderAddress:d}){let[l,c]=useState(r),{holders:u,isLoading:m,sortBy:p,sortDirection:g,setSort:f,hasMore:k,loadMore:x}=Xs({chain:e,address:t,limit:o,initialSortBy:n,initialSortDirection:s});return jsx(zs,{holders:u,isLoading:m,sortBy:p,sortDirection:g,onSortByChange:f,onlyTracked:l,onOnlyTrackedChange:c,wellKnownAddresses:i,hasMore:k,onLoadMore:x,className:a,renderAddress:d})}var Vu=["timestamp","totalUsd"],Ku=["all","buy","sell"],_u=["all","dev","tracked","you"];function Js({activities:e,isLoading:t,sortBy:o,sortDirection:n="desc",onSortByChange:s,typeFilter:r="all",onTypeFilterChange:i,traderFilter:a="all",onTraderFilterChange:d,youWalletAddress:l,currency:c="usd",onCurrencyChange:u,onLoadMore:m,hasMore:p,now:g=Date.now(),nativeDecimals:f=9,nativeSymbol:k="SOL",className:x,onRowClick:h}){let{t:T}=useTranslation(),S=$u(e,a,l);return jsxs("div",{className:cn("flex flex-col",x),children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-1",children:[Ku.map(y=>jsx("button",{type:"button",onClick:()=>i?.(y),className:cn("rounded px-2 py-1 text-[11px] transition-colors",r===y?"bg-default-100 text-foreground":"text-text-muted hover:text-foreground"),children:T(y==="all"?"tokens.tokenDetail.filter.all":y==="buy"?"tokens.tokenDetail.filter.buys":"tokens.tokenDetail.filter.sells")},y)),jsx("span",{className:"mx-1 h-3 w-px bg-default-200","aria-hidden":true}),_u.map(y=>{let b=a===y,w=y==="you"&&!l;return jsx("button",{type:"button",disabled:w,onClick:()=>d?.(y),className:cn("rounded px-2 py-1 text-[11px] transition-colors",b?"bg-default-100 text-foreground":"text-text-muted hover:text-foreground",w&&"cursor-not-allowed opacity-50"),children:T(`tokens.tokenDetail.filter.${y}`)},y)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(zu,{value:c,nativeSymbol:k,onChange:u}),jsx("div",{className:"flex items-center gap-1",children:Vu.map(y=>{let b=o===y,w=b&&n==="desc"?"asc":b&&n==="asc"?void 0:"desc",v=w?y:void 0;return jsx("button",{type:"button",onClick:()=>s(v,w),className:cn("rounded px-2 py-1 text-[11px] transition-colors",b?"bg-default-100 text-foreground":"text-text-muted hover:text-foreground"),children:T(y==="timestamp"?"tokens.tokenDetail.filter.latest":"tokens.tokenDetail.filter.topUsd")},y)})})]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[780px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[10%] px-3 py-2 text-left font-normal",children:T("tokens.tokenDetail.columns.side")}),jsx("th",{className:"w-[25%] px-3 py-2 text-left font-normal",children:T("tokens.tokenDetail.columns.trader")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.amount")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.usd")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.price")}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.gas")}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.age")})]})}),jsxs("tbody",{children:[S.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-8 text-center text-text-muted",children:T("tokens.tokenDetail.activities.empty")})}),S.map(y=>jsx(Gu,{activity:y,now:g,nativeDecimals:f,nativeSymbol:k,currency:c,onRowClick:h},y.txHash)),t&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-4 text-center text-text-muted",children:T("tokens.tokenDetail.loading")})})]})]})}),p&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:m,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:T("tokens.tokenDetail.loadMore")})})]})}function qu(e){return e.type==="buy"?e.to:e.type==="sell"?e.from:e.to}function $u(e,t,o){if(t==="all")return e;if(t==="you"){if(!o)return [];let s=o.toLowerCase();return e.filter(r=>r.walletAddress?.toLowerCase()===s)}if(t==="dev")return e.filter(s=>s.traderTags?.some(r=>r==="dev"));let n=new Set(["kol","smart","bluechip"]);return e.filter(s=>s.traderTags?.some(r=>n.has(r)))}function zu({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[22px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn("rounded px-2 transition-colors",e===s.k?"bg-default-200 text-foreground":"text-text-muted hover:text-foreground"),children:s.label},s.k))})}function Qu(e,t,o){if(!e)return "--";let n=Number(e)/Math.pow(10,t);return Number.isFinite(n)?`${formatAmount(n)} ${o}`:"--"}function Gu({activity:e,now:t,nativeDecimals:o,nativeSymbol:n,currency:s,onRowClick:r}){let{formatAge:i}=useLocalizedTimeFormatter(),a=qu(e),d=e.type==="buy"?"Buy":e.type==="sell"?"Sell":e.type.replace(/_/g," "),l=e.type==="buy"?"text-positive":e.type==="sell"?"text-negative":"text-text-muted";return jsxs("tr",{className:cn("border-b border-default-50 hover:bg-default-50/60",r&&"cursor-pointer"),onClick:r?()=>r(e):void 0,children:[jsx("td",{className:cn("px-3 py-2 align-middle font-medium capitalize",l),children:d}),jsx("td",{className:"px-3 py-2 align-middle",children:jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("span",{className:"font-mono text-[11px] text-text-muted",children:be(e.walletAddress,6,6)}),jsx(jn,{tags:e.traderTags,max:2})]})}),jsxs("td",{className:"px-3 py-2 text-right align-middle",children:[formatAmount(a.amount)," ",a.symbol]}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:s==="native"&&a.amountInNative?`${formatAmount(a.amountInNative)} ${a.symbol}`:a.amountInUsd?formatAmountInUsd(a.amountInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:a.priceInUsd?`$${formatPrice(a.priceInUsd)}`:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:Qu(e.gasFee,o,n)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:Ae(e.time,i,t)})]})}var Xu=500;function ln({sortBy:e,sortDirection:t,typeFilter:o}){return {getKey:an,compare:(n,s)=>Zu(n,s,e,t),include:n=>Yu(n,o),merge:(n,s,r)=>r.incomingSource==="live"?{item:s,placement:"incoming"}:r.previousSource==="live"?{item:n,placement:"previous"}:{item:n,placement:"previous"},maxLiveItems:Xu}}function ei(e){return Object.freeze({cursor:null,generation:e,mode:"replace"})}function ti(e=ln({sortDirection:"desc",typeFilter:"all"})){let{snapshot:t}=createRealtimeCursorCollection(e);return {collection:t,request:ei(t.generation)}}function Rt(e,t,o){let{reduce:n}=createRealtimeCursorCollection(o);switch(t.type){case "reset":{let s=n(e.collection,{type:"reset"});return {collection:s,request:ei(s.generation)}}case "load-more":return Ju(e);case "live":return t.items.length===0?e:{collection:n(e.collection,{type:"live",items:t.items}),request:e.request};case "page":return t.request.mode==="append"&&t.nextCursor===e.collection.nextCursor?e:{collection:n(e.collection,{type:"page",mode:t.request.mode,generation:t.request.generation,items:t.items,nextCursor:t.nextCursor,hasNextPage:t.hasNextPage}),request:e.request};default:return t}}function Ju(e){let{collection:t,request:o}=e;return !t.hasNextPage||t.nextCursor==null||o.mode==="append"&&o.cursor===t.nextCursor&&o.generation===t.generation?e:{collection:t,request:Object.freeze({cursor:t.nextCursor,generation:t.generation,mode:"append"})}}function Yu(e,t){return t==="all"?true:e.type===t}function Zu(e,t,o,n){let r=(o??"timestamp")==="totalUsd"?sn(Zs(e),Zs(t)):sn(mo(e),mo(t)),i=Ys(r,n);if(i!==0)return i;let a=Ys(sn(mo(e),mo(t)),"desc");return a!==0?a:an(e).localeCompare(an(t))}function Ys(e,t){return t==="asc"?e:-e}function sn(e,t){return e<t?-1:e>t?1:0}function mo(e){let t=e.time instanceof Date?e.time.getTime():new Date(e.time).getTime();return Number.isFinite(t)?t:0}function Zs(e){let t=e.type==="sell"?e.from:e.to,o=Number(t.amountInUsd);return Number.isFinite(o)?o:0}function an(e){return e.txHash}function ri({chain:e,address:t,limit:o=50,initialSortBy:n,initialSortDirection:s="desc",initialTypeFilter:r="all"}){let[i,a]=useState(n),[d,l]=useState(s),[c,u]=useState(r),m=useMemo(()=>ln({sortBy:i,sortDirection:d,typeFilter:c}),[i,d,c]),p=useRef(m);p.current=m;let[g,f]=useState(()=>ti(m)),k=useRef(true),x=useCallback(()=>{f(V=>Rt(V,{type:"reset"},p.current));},[]),h=useCallback((V,Te)=>{let G=Te??(V===i?d:"desc");V===i&&G===d||(a(V),l(G),x());},[i,d,x]),T=useCallback(V=>{V!==d&&(l(V),x());},[d,x]),S=useCallback(V=>{V!==c&&(u(V),x());},[c,x]);useEffect(()=>{if(k.current){k.current=false;return}x();},[e,t,x]);let y=c==="all"?void 0:c,{collection:b,request:w}=g,v=useMemo(()=>({chain:e,address:t,cursor:w.cursor??void 0,limit:o,sortBy:i,sortDirection:d,type:y}),[e,t,w,o,i,d,y]),{data:N,isPending:F,isFetching:fe}=useTokenActivitiesQuery(v);useEffect(()=>{N&&f(V=>Rt(V,{type:"page",request:w,items:N.data,nextCursor:N.endCursor??null,hasNextPage:!!N.hasNext},m));},[N,w,m]),useTokenActivitiesSubscription({chain:e,address:t},V=>{V?.length&&f(Te=>Rt(Te,{type:"live",items:V},m));});let Y=useMemo(()=>b.items.slice(),[b]),R=!!(b.hasNextPage&&b.nextCursor),ae=useCallback(()=>{f(V=>Rt(V,{type:"load-more"},m));},[m]);return {activities:Y,isLoading:F||fe,sortBy:i,sortDirection:d,setSortBy:h,setSortDirection:T,typeFilter:c,setTypeFilter:S,hasMore:R,loadMore:ae}}function DC({chain:e,address:t,limit:o,initialSortBy:n,initialSortDirection:s,initialTypeFilter:r,initialTraderFilter:i="all",initialCurrency:a="usd",youWalletAddress:d,nativeDecimals:l,nativeSymbol:c,className:u,onRowClick:m}){let[p,g]=useState(i),[f,k]=useState(a),{activities:x,isLoading:h,sortBy:T,sortDirection:S,setSortBy:y,typeFilter:b,setTypeFilter:w,hasMore:v,loadMore:N}=ri({chain:e,address:t,limit:o,initialSortBy:n,initialSortDirection:s,initialTypeFilter:r});return jsx(Js,{activities:x,isLoading:h,sortBy:T,sortDirection:S,onSortByChange:y,typeFilter:b,onTypeFilterChange:w,traderFilter:p,onTraderFilterChange:g,youWalletAddress:d,currency:f,onCurrencyChange:k,hasMore:v,onLoadMore:N,className:u,nativeDecimals:l,nativeSymbol:c,onRowClick:m})}function ii({stats:e,resolution:t,className:o}){let{t:n}=useTranslation(),s=e?.[t],r=s?.traders??0,i=s?.buyers??0,a=s?.sellers??0;return jsx(st,{className:o,label:n("tokens.listHeader.traders",{resolution:n(`common.resolution.${t}`)}),totalFormatted:formatAmount(r),buysFormatted:formatAmount(i),sellsFormatted:formatAmount(a),totalValue:r,buysValue:i})}function ai(e,t){return O(e,t)}function JC({chain:e,address:t,resolution:o="24h",className:n}){let{token:s}=ai(e,t);return jsx(ii,{stats:s?.stats,resolution:o,className:n})}function li({stats:e,resolution:t,className:o}){let{t:n}=useTranslation(),s=e?.[t],r=s?.trades??0,i=s?.buys??0,a=s?.sells??0;return jsx(st,{className:o,label:n("tokens.listHeader.txs",{resolution:n(`common.resolution.${t}`)}),totalFormatted:formatAmount(r),buysFormatted:formatAmount(i),sellsFormatted:formatAmount(a),totalValue:r,buysValue:i})}function di(e,t){return O(e,t)}function u0({chain:e,address:t,resolution:o="24h",className:n}){let{token:s}=di(e,t);return jsx(li,{stats:s?.stats,resolution:o,className:n})}function ci({stats:e,resolution:t,className:o}){let{t:n}=useTranslation(),s=e?.[t],r=s?.volumesInUsd??"0",i=s?.buyVolumesInUsd??"0",a=s?.sellVolumesInUsd??"0";return jsx(st,{className:o,label:n("tokens.listHeader.volumes",{resolution:n(`common.resolution.${t}`)}),totalFormatted:formatAmountInUsd(r),buysFormatted:formatAmountInUsd(i),sellsFormatted:formatAmountInUsd(a),totalValue:r,buysValue:i})}function mi(e,t){return O(e,t)}function P0({chain:e,address:t,resolution:o="24h",className:n}){let{token:s}=mi(e,t);return jsx(ci,{stats:s?.stats,resolution:o,className:n})}function pi({security:e,externalUrl:t,externalLabel:o,className:n}){let{t:s}=useTranslation(),r=[{title:s("tokens.tokenDetail.security.transferFee"),value:e?.hasTransferFee,safeWhen:false,description:s("tokens.tokenDetail.security.transferFeeDescription")},{title:s("tokens.tokenDetail.security.feeNotUpgradable"),value:e?.isTransferFeeUpgradable,safeWhen:false,description:s("tokens.tokenDetail.security.feeNotUpgradableDescription")},{title:s("tokens.tokenDetail.security.transferable"),value:e?.isTransferable,safeWhen:true,description:s("tokens.tokenDetail.security.transferableDescription")},{title:s("tokens.tokenDetail.security.notFreezable"),value:e?.isFreezable,safeWhen:false,description:s("tokens.tokenDetail.security.notFreezableDescription")},{title:s("tokens.tokenDetail.security.notClosable"),value:e?.isClosable,safeWhen:false,description:s("tokens.tokenDetail.security.notClosableDescription")}],i=r.every(a=>a.value!==void 0&&a.value===a.safeWhen);return jsxs("section",{className:cn("flex w-full flex-col gap-3",n),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-sm font-medium text-foreground",children:s("tokens.tokenDetail.security.title")}),jsx("span",{className:cn("text-xs",e===void 0?"text-text-muted":i?"text-success-500":"text-danger-500"),children:e===void 0?"--":s(i?"tokens.tokenDetail.security.safe":"tokens.tokenDetail.security.review")})]}),jsx("div",{className:"flex flex-col",children:r.map(a=>jsx(mp,{...a},a.title))}),t&&o&&jsx("div",{className:"flex justify-center",children:jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-text-muted transition-colors hover:text-foreground",children:o})})]})}function mp({title:e,value:t,safeWhen:o,description:n}){let{t:s}=useTranslation(),r=t!==void 0&&t===o,i=t===void 0?"--":s(r?"tokens.tokenDetail.security.ok":"tokens.tokenDetail.security.risk");return jsxs("div",{className:"flex h-8 items-center justify-between gap-2",children:[jsx("span",{className:"text-xs text-text-muted",title:n,children:e}),jsx("span",{className:cn("text-xs",t===void 0?"text-text-muted":r?"text-success-500":"text-danger-500"),children:i})]})}function fi(e,t){let{data:o,isLoading:n}=useTokenSecurityQuery({chain:e,address:t});return {security:o,isLoading:n}}function _0({chain:e,address:t,externalUrl:o,externalLabel:n,className:s}){let{security:r}=fi(e,t);return jsx(pi,{security:r,externalUrl:o,externalLabel:n,className:s})}function gi({token:e,className:t}){let{t:o}=useTranslation();return e?jsxs("section",{className:cn("flex w-full flex-col gap-2",t),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:o("tokens.tokenDetail.about",{symbol:e.symbol})}),e.description?jsx("p",{className:"whitespace-pre-line text-xs text-text-muted",children:e.description}):jsx("p",{className:"text-xs text-text-muted",children:o("tokens.tokenDetail.noDescription")})]}):null}function ki(e,t){return O(e,t)}function rw({chain:e,address:t,className:o}){let{token:n}=ki(e,t);return jsx(gi,{token:n,className:o})}function hi({liquidities:e,totalTvlInUsd:t,collapseAt:o=3,className:n,onPoolClick:s}){let{t:r}=useTranslation(),[i,a]=useState(!e||e.length<=o),d=useCallback(()=>a(l=>!l),[]);return jsxs("section",{className:cn("flex w-full flex-col gap-3",n),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-sm font-medium text-foreground",children:r("tokens.tokenDetail.liquidity")}),t&&jsx("span",{className:"text-xs text-foreground",children:formatAmountInUsd(t)})]}),(!e||e.length===0)&&jsx("div",{className:"py-4 text-center text-xs text-text-muted",children:r("tokens.tokenDetail.noPools")}),e&&e.length>0&&jsxs("div",{className:"flex flex-col gap-2",children:[e.map((l,c)=>jsxs("div",{className:cn("flex h-10 w-full items-center justify-between overflow-hidden text-xs",c>=o&&!i&&"hidden",s&&"cursor-pointer hover:bg-default-50"),onClick:s?()=>s(l):void 0,children:[jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("span",{className:"text-foreground",children:l.protocolFamily??l.protocolName??r("tokens.tokenDetail.unknownProtocol")}),l.poolAddress&&jsx("span",{className:"font-mono text-[10px] text-text-muted",children:r("tokens.tokenDetail.poolAddress",{address:be(l.poolAddress,6,6)})})]}),jsx("div",{className:"text-text-muted",children:formatAmountInUsd(l.tvlInUsd??0)})]},l.poolAddress??`${l.protocolFamily}-${c}`)),e.length>o&&jsx("div",{className:"flex justify-center pt-1",children:jsx("button",{type:"button",onClick:d,className:"rounded px-2 py-1 text-xs text-text-muted transition-colors hover:text-foreground",children:r(i?"tokens.tokenDetail.showLess":"tokens.tokenDetail.showMore")})})]})]})}function yi(e,t){return O(e,t)}function vw({chain:e,address:t,collapseAt:o,className:n,onPoolClick:s}){let{token:r}=yi(e,t);return jsx(hi,{liquidities:r?.liquidities,totalTvlInUsd:r?.marketData?.tvlInUsd,collapseAt:o,className:n,onPoolClick:s})}function bi({cexes:e,collapseAt:t=4,className:o}){let{t:n}=useTranslation(),[s,r]=useState(!e||e.length<=t),i=useCallback(()=>r(a=>!a),[]);return !e||e.length===0?null:jsxs("section",{className:cn("w-full",o),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:n("tokens.tokenDetail.cexListings")}),jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((a,d)=>{let l=d>=t&&!s,c=jsx(Chip,{startContent:a.logo?jsx(Image,{src:a.logo,width:20,height:20,alt:a.name}):void 0,className:cn("bg-default-100 text-xs",l&&"hidden"),children:a.name},a.id);return a.url?jsx("a",{href:a.url,target:"_blank",rel:"noreferrer noopener",className:cn(l&&"hidden"),children:c},a.id):c})}),e.length>t&&jsx("div",{className:"mt-3 flex justify-center",children:jsx("button",{type:"button",onClick:i,className:"rounded px-2 py-1 text-xs text-text-muted transition-colors hover:text-foreground",children:n(s?"tokens.tokenDetail.showLess":"tokens.tokenDetail.showMore")})})]})}function vi(e){return {cexes:e}}function Ow({cexes:e,collapseAt:t,className:o}){let{cexes:n}=vi(e);return jsx(bi,{cexes:n,collapseAt:t,className:o})}function Ni({categories:e,collapseAt:t=4,className:o,onCategoryClick:n}){let{t:s}=useTranslation(),[r,i]=useState(!e||e.length<=t),a=useCallback(()=>i(d=>!d),[]);return !e||e.length===0?null:jsxs("section",{className:cn("w-full",o),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:s("tokens.tokenDetail.categories")}),jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((d,l)=>{let c=l>=t&&!r;return jsx(Chip,{size:"sm",className:cn("bg-default-100",c&&"hidden",n&&"cursor-pointer"),onClick:n?()=>n(d):void 0,children:d},d)})}),e.length>t&&jsx("div",{className:"mt-3 flex justify-center",children:jsx("button",{type:"button",onClick:a,className:"rounded px-2 py-1 text-xs text-text-muted transition-colors hover:text-foreground",children:s(r?"tokens.tokenDetail.showLess":"tokens.tokenDetail.showMore")})})]})}function Ci(e,t){return O(e,t)}function jw({chain:e,address:t,collapseAt:o,className:n,onCategoryClick:s}){let{token:r}=Ci(e,t);return jsx(Ni,{categories:r?.tags,collapseAt:o,className:n,onCategoryClick:s})}var wi=["5m","1h","4h","24h"];function Li({stats:e,resolution:t,className:o}){let{t:n}=useTranslation(),s=e?.[t],r=new SafeBigNumber(s?.buyVolumesInUsd??0),i=new SafeBigNumber(s?.sellVolumesInUsd??0),a=r.plus(i),d=r.minus(i),l=a.eq(0)?50:Math.min(100,Math.max(0,r.div(a).times(100).toNumber())),c=[{label:n("tokens.listHeader.volumes",{resolution:n(`common.resolution.${t}`)}),value:formatAmountInUsd(a.toString()),className:"text-foreground"},{label:n("tokens.tokenDetail.stats.buys"),value:formatAmountInUsd(r.toString()),className:"text-positive"},{label:n("tokens.tokenDetail.stats.sells"),value:formatAmountInUsd(i.toString()),className:"text-negative"},{label:n("tokens.tokenDetail.stats.netVolume"),value:formatAmountInUsd(d.abs().toString()),className:d.gte(0)?"text-positive":"text-negative"}];return jsxs("div",{className:cn("flex h-full w-full flex-col",o),children:[jsx("div",{className:"grid flex-1 grid-cols-4 items-center",children:c.map(u=>jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] px-2",children:[jsx("span",{className:"text-[10px] leading-none text-text-muted",children:u.label}),jsx("span",{className:cn("text-[13px] font-medium leading-none tabular-nums",u.className),children:u.value})]},u.label))}),jsx("div",{className:"relative h-[2px] w-full overflow-hidden bg-negative",children:jsx("div",{className:"absolute inset-y-0 left-0 bg-positive transition-[width] duration-200 ease-out",style:{width:`${l}%`}})})]})}function Pi({stats:e,resolutions:t,className:o}){return jsx("div",{className:cn("grid h-full w-full grid-cols-4 items-center",o),children:t.map(n=>{let r=e?.[n]?.priceChange,i=r?new SafeBigNumber(r):void 0,a=i?i.gte(0):void 0,d=n,l=i?formatPercent(i,{showPlusGtThanZero:true}):"\u2014";return jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] px-2",children:[jsx("span",{className:"text-[10px] leading-none text-text-muted",children:d}),jsx("span",{className:cn("text-[13px] font-medium leading-none tabular-nums",a===void 0?"text-foreground":a?"text-positive":"text-negative"),children:l})]},n)})})}function Ri({chain:e,address:t}){let{data:o,isLoading:n}=useTokenStatsQuery({chain:e,address:t});return {stats:o,isLoading:n}}function kL({chain:e,address:t,baseResolution:o="5m",hoverResolutions:n=wi,height:s=64,className:r}){let{stats:i}=Ri({chain:e,address:t});return jsx(StatsFlipPanel,{className:r,height:s,base:jsx(Li,{stats:i,resolution:o}),hover:jsx(Pi,{stats:i,resolutions:n})})}function Ai({positions:e,isLoading:t,hasMore:o,onLoadMore:n,currency:s="usd",onCurrencyChange:r,showHidden:i=false,onShowHiddenChange:a,nativeSymbol:d,renderActions:l,className:c}){let{t:u}=useTranslation(),m=d??u("tokens.tokenDetail.native");return jsxs("div",{className:cn("flex flex-col",c),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("span",{className:"text-xs font-medium text-text-muted",children:u("tokens.tokenDetail.positions.title")}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-text-muted",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:i,onChange:p=>a?.(p.target.checked)}),u("tokens.tokenDetail.filter.showHidden")]})]}),jsx(qp,{value:s,nativeSymbol:m,onChange:r})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[720px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[26%] px-3 py-2 text-left font-normal",children:u("tokens.tokenDetail.columns.token")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.bought")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.sold")}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.remaining")}),jsx("th",{className:"w-[18%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.pnl")}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.actions")})]})}),jsxs("tbody",{children:[e.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-text-muted",children:u("tokens.tokenDetail.positions.empty")})}),e.map(p=>jsx($p,{position:p,currency:s,renderActions:l},`${p.chain}:${p.address}`)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-text-muted",children:u("tokens.tokenDetail.loading")})})]})]})}),o&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:n,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:u("tokens.tokenDetail.loadMore")})})]})}function qp({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn("rounded px-2 transition-colors",e===s.k?"bg-default-200 text-foreground":"text-text-muted hover:text-foreground"),children:s.label},s.k))})}function $p({position:e,currency:t,renderActions:o}){let{bought:n,sold:s,remaining:r,pnl:i}=useMemo(()=>zp(e,t),[e,t]),a=jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.image??void 0,name:(e.symbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-col",children:[jsx("span",{className:"truncate text-foreground",children:e.symbol}),jsx("span",{className:"truncate text-[10px] text-text-muted",children:e.name})]})]});return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:a}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:s}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r}),jsx("td",{className:cn("px-3 py-2 text-right align-middle font-medium",i.isPositive===void 0?"text-text-muted":i.isPositive?"text-positive":"text-negative"),children:jsxs("div",{className:"flex flex-col items-end leading-tight",children:[jsx("span",{children:i.amount}),i.ratio?jsx("span",{className:"text-[10px]",children:i.ratio}):null]})}),jsx("td",{className:"px-3 py-2 text-right align-middle",children:o?o(e):jsx("span",{className:"text-text-muted",children:"--"})})]})}function zp(e,t){let o=t==="usd"?e.buyVolumesInUsd:e.buyVolumes,n=t==="usd"?e.sellVolumesInUsd:e.sellVolumes,s=t==="usd"?e.amountInUsd:e.amount,r=e.totalProfitInUsd,i=t==="usd"?formatAmountInUsd(o??0):formatAmount(o??0),a=t==="usd"?formatAmountInUsd(n??0):formatAmount(n??0),d=t==="usd"?formatAmountInUsd(s??0):formatAmount(s??0),l=r?new SafeBigNumber(r):void 0,c=l?l.gte(0):void 0,u=l?(c?"+":"")+formatAmountInUsd(l.toString()):"--",m=e.totalProfitRatio?formatPercent(e.totalProfitRatio,{showPlusGtThanZero:true}):void 0;return {bought:i,sold:a,remaining:d,pnl:{amount:u,ratio:m,isPositive:c}}}function Hi({chain:e,wallet:t,limit:o=50,initialShowHidden:n=false}){let[s,r]=useState(void 0),[i,a]=useState([]),[d,l]=useState(n);useEffect(()=>{r(void 0),a([]);},[e,t]);let c=useMemo(()=>({chain:e,address:t??"",cursor:s,limit:o,positionState:"open"}),[e,t,s,o]),{data:u,isPending:m,isFetching:p}=useWalletTokenPositionsQuery(c,{enabled:!!t});useEffect(()=>{u&&a(h=>s==null?[u]:h[h.length-1]?.endCursor===u.endCursor?h:[...h,u]);},[u,s]);let g=useMemo(()=>i.flatMap(h=>h.portfolios),[i]),f=i[i.length-1],k=!!(f?.hasNext&&f.endCursor),x=useCallback(()=>{!f?.endCursor||!f.hasNext||r(f.endCursor);},[f]);return {positions:g,isLoading:!!t&&(m||p),hasMore:k,loadMore:x,showHidden:d,setShowHidden:l}}function FL({chain:e,wallet:t,limit:o,initialCurrency:n="usd",nativeSymbol:s,renderActions:r,className:i}){let[a,d]=useState(n),{positions:l,isLoading:c,hasMore:u,loadMore:m,showHidden:p,setShowHidden:g}=Hi({chain:e,wallet:t,limit:o});return jsx(Ai,{className:i,positions:l,isLoading:c,hasMore:u,onLoadMore:m,currency:a,onCurrencyChange:d,showHidden:p,onShowHiddenChange:g,nativeSymbol:s,renderActions:r})}function Fi({orders:e,isLoading:t,unavailable:o,hasMore:n,onLoadMore:s,stateFilter:r,onStateFilterChange:i,onlyThisToken:a=false,onOnlyThisTokenChange:d,tokenSymbol:l,currency:c="usd",onCurrencyChange:u,nativeSymbol:m,onCancelAll:p,renderActions:g,className:f}){let{t:k}=useTranslation(),x=m??k("tokens.tokenDetail.native");return jsxs("div",{className:cn("flex flex-col",f),children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"active",labelKey:"tokens.tokenDetail.activeOrders"},{k:"history",labelKey:"tokens.tokenDetail.orderHistory"}].map(h=>jsx("button",{type:"button",onClick:()=>i(h.k),className:cn("rounded px-2 transition-colors",r===h.k?"bg-default-200 text-foreground":"text-text-muted hover:text-foreground"),children:k(h.labelKey)},h.k))}),l?jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-text-muted",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:a,onChange:h=>d?.(h.target.checked)}),k("tokens.tokenDetail.filter.onlyToken",{symbol:l})]}):null]}),jsxs("div",{className:"flex items-center gap-2",children:[p?jsx("button",{type:"button",onClick:p,className:"rounded px-2 py-1 text-[11px] text-negative transition-colors hover:bg-default-100",children:k("tokens.tokenDetail.cancelAll")}):null,jsx(nf,{value:c,nativeSymbol:x,onChange:u})]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[760px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[22%] px-3 py-2 text-left font-normal",children:k("tokens.tokenDetail.columns.token")}),jsx("th",{className:"w-[10%] px-3 py-2 text-left font-normal",children:k("tokens.tokenDetail.columns.type")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.amount")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.currentMarketCap")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.targetMarketCap")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.settings")}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.action")})]})}),jsxs("tbody",{children:[o?jsx("tr",{children:jsx("td",{colSpan:7,className:"py-10 text-center text-text-muted",children:k("tokens.tokenDetail.orders.unavailable")})}):e.length===0&&!t?jsx("tr",{children:jsx("td",{colSpan:7,className:"py-10 text-center text-text-muted",children:k(r==="active"?"tokens.tokenDetail.orders.emptyActive":"tokens.tokenDetail.orders.emptyHistorical")})}):e.map(h=>jsx(rf,{order:h,currency:c,renderActions:g},h.id)),t&&!o&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-4 text-center text-text-muted",children:k("tokens.tokenDetail.loading")})})]})]})}),!o&&n&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:s,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:k("tokens.tokenDetail.loadMore")})})]})}function nf({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn("rounded px-2 transition-colors",e===s.k?"bg-default-200 text-foreground":"text-text-muted hover:text-foreground"),children:s.label},s.k))})}function rf({order:e,currency:t,renderActions:o}){let n=useMemo(()=>t==="usd"&&e.amountInUsd?formatAmountInUsd(e.amountInUsd):formatAmount(e.amount),[t,e.amount,e.amountInUsd]),s=e.side==="buy"?"Buy":"Sell",r=e.side==="buy"?"text-positive":"text-negative";return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.tokenImage??void 0,name:(e.tokenSymbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsx("span",{className:"truncate text-foreground",children:e.tokenSymbol??"--"})]})}),jsx("td",{className:cn("px-3 py-2 align-middle font-medium",r),children:s}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.currentMarketCapInUsd?formatMCapInUsd(e.currentMarketCapInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:e.targetMarketCapInUsd?formatMCapInUsd(e.targetMarketCapInUsd):e.targetPriceInUsd?formatPriceInUsd(e.targetPriceInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.slippage!=null?`Slip ${e.slippage}%`:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle",children:o?o(e):jsx("span",{className:"text-text-muted",children:"--"})})]})}function af(e){return e instanceof Error&&e.code==="NotImplemented"}function lf(e){return e==="active"?"active":"filled"}function Bi({chain:e,wallet:t,tokenAddress:o,limit:n=50,initialStateFilter:s="active",initialOnlyThisToken:r=false}){let[i,a]=useState(s),[d,l]=useState(r),[c,u]=useState(void 0),[m,p]=useState([]);useEffect(()=>{u(void 0),p([]);},[e,t,i,d,o]);let g=useCallback(N=>{N!==i&&a(N);},[i]),f=useMemo(()=>({chain:e,address:t??"",cursor:c,limit:n,state:lf(i),tokenAddress:d?o:void 0}),[e,t,c,n,i,d,o]),{data:k,isPending:x,isFetching:h,error:T}=useWalletLimitOrdersQuery(f,{enabled:!!t});useEffect(()=>{k&&p(N=>c==null?[k]:N[N.length-1]?.endCursor===k.endCursor?N:[...N,k]);},[k,c]);let S=!!T&&af(T),y=useMemo(()=>m.flatMap(N=>N.data),[m]),b=m[m.length-1],w=!!(b?.hasNext&&b.endCursor),v=useCallback(()=>{!b?.endCursor||!b.hasNext||u(b.endCursor);},[b]);return {orders:y,isLoading:!!t&&!S&&(x||h),unavailable:S,hasMore:w,loadMore:v,stateFilter:i,setStateFilter:g,onlyThisToken:d,setOnlyThisToken:l}}function eP({chain:e,wallet:t,tokenAddress:o,tokenSymbol:n,limit:s,initialStateFilter:r="active",initialCurrency:i="usd",nativeSymbol:a,onCancelAll:d,renderActions:l,className:c}){let[u,m]=useState(i),{orders:p,isLoading:g,unavailable:f,hasMore:k,loadMore:x,stateFilter:h,setStateFilter:T,onlyThisToken:S,setOnlyThisToken:y}=Bi({chain:e,wallet:t,tokenAddress:o,limit:s,initialStateFilter:r});return jsx(Fi,{className:c,orders:p,isLoading:g,unavailable:f,hasMore:k,onLoadMore:x,stateFilter:h,onStateFilterChange:T,onlyThisToken:S,onOnlyThisTokenChange:y,tokenSymbol:n,currency:u,onCurrencyChange:m,nativeSymbol:a,onCancelAll:f?void 0:d,renderActions:l})}function Vi({traders:e,isLoading:t,hasMore:o,onLoadMore:n,onlyTracked:s=false,onOnlyTrackedChange:r,now:i=Date.now(),renderAddress:a,className:d}){let{t:l}=useTranslation();return jsxs("div",{className:cn("flex flex-col",d),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsx("span",{className:"text-xs font-medium text-text-muted",children:l("tokens.tokenDetail.topTraders")}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-text-muted",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:s,onChange:c=>r?.(c.target.checked)}),l("tokens.tokenDetail.filter.onlyTracked")]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[680px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[28%] px-3 py-2 text-left font-normal",children:l("tokens.tokenDetail.columns.wallet")}),jsx("th",{className:"w-[20%] px-3 py-2 text-left font-normal",children:l("tokens.tokenDetail.columns.tags")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:l("tokens.tokenDetail.columns.value")}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"%"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:l("tokens.tokenDetail.columns.realizedPnl")}),jsx("th",{className:"w-[13%] px-3 py-2 text-right font-normal",children:l("tokens.tokenDetail.columns.lastActive")})]})}),jsxs("tbody",{children:[e.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-text-muted",children:l("tokens.tokenDetail.topTraders.empty")})}),e.map(c=>jsx(gf,{trader:c,now:i,renderAddress:a},c.address)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-text-muted",children:l("tokens.tokenDetail.loading")})})]})]})}),o&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:n,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:l("tokens.tokenDetail.loadMore")})})]})}function gf({trader:e,now:t,renderAddress:o}){let{formatAge:n}=useLocalizedTimeFormatter(),s=useMemo(()=>o?o(e.address):jsx("span",{className:"font-mono text-[11px] text-text-muted",children:be(e.address,6,6)}),[e.address,o]);return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:s}),jsx("td",{className:"px-3 py-2 align-middle",children:jsx(qt,{tags:e.tags,max:3})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:formatAmountInUsd(e.amountInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:formatAmountInUsd(e.totalRealizedPnlInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.lastActiveAt?Ae(e.lastActiveAt,n,t):"--"})]})}function _i({chain:e,address:t,limit:o=50,initialSortBy:n,initialSortDirection:s,initialOnlyTracked:r=false}){let[i,a]=useState(n),[d,l]=useState(s),[c,u]=useState(void 0),[m,p]=useState([]),[g,f]=useState(r),k=useCallback(()=>{u(void 0),p([]);},[]),x=useCallback((R,ae)=>{R===i&&ae===d||(a(R),l(ae),k());},[k,i,d]),h=useCallback(R=>{x(R,d??"desc");},[x,d]),T=useCallback(R=>{R!==d&&(l(R),k());},[k,d]);useEffect(()=>{k();},[e,t,k]);let S=useMemo(()=>({chain:e,address:t,cursor:c,limit:o,sortBy:i,sortDirection:d}),[e,t,c,o,i,d]),{data:y,isPending:b,isFetching:w}=useTokenTopTradersQuery(S);useEffect(()=>{y&&p(R=>c==null?[y]:R[R.length-1]?.endCursor===y.endCursor?R:[...R,y]);},[y,c]);let v=useMemo(()=>m.flatMap(R=>R.data),[m]),N=useMemo(()=>g?v.filter(R=>R.tags&&R.tags.length>0):v,[v,g]),F=m[m.length-1],fe=!!(F?.hasNext&&F.endCursor),Y=useCallback(()=>{!F?.endCursor||!F.hasNext||u(F.endCursor);},[F]);return {traders:N,isLoading:b||w,sortBy:i,sortDirection:d,setSortBy:h,setSortDirection:T,setSort:x,hasMore:fe,loadMore:Y,onlyTracked:g,setOnlyTracked:f}}function yP({chain:e,address:t,limit:o,className:n,renderAddress:s}){let{traders:r,isLoading:i,hasMore:a,loadMore:d,onlyTracked:l,setOnlyTracked:c}=_i({chain:e,address:t,limit:o});return jsx(Vi,{className:n,traders:r,isLoading:i,hasMore:a,onLoadMore:d,onlyTracked:l,onOnlyTrackedChange:c,renderAddress:s})}var yf="\u2713";function Qi({tokens:e,isLoading:t,unavailable:o,hasMore:n,onLoadMore:s,renderTokenLink:r,className:i}){let{t:a}=useTranslation();return jsxs("div",{className:cn("flex flex-col",i),children:[jsx("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:jsx("span",{className:"text-xs font-medium text-text-muted",children:a("tokens.tokenDetail.devTokens.title")})}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[700px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[28%] px-3 py-2 text-left font-normal",children:a("tokens.tokenDetail.columns.token")}),jsx("th",{className:"w-[10%] px-3 py-2 text-center font-normal",children:a("tokens.tokenDetail.columns.migrated")}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:a("tokens.tokenDetail.columns.marketCap")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:a("tokens.tokenDetail.columns.ath")}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:a("tokens.tokenDetail.liquidity")}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:a("tokens.tokenDetail.columns.volume1h")})]})}),jsxs("tbody",{children:[o?jsx("tr",{children:jsx("td",{colSpan:6,className:"py-10 text-center text-text-muted",children:a("tokens.tokenDetail.devTokens.unavailable")})}):e.length===0&&!t?jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-text-muted",children:a("tokens.tokenDetail.devTokens.empty")})}):e.map(d=>jsx(bf,{token:d,renderTokenLink:r},`${d.chain}:${d.address}`)),!o&&t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-text-muted",children:a("tokens.tokenDetail.loading")})})]})]})}),!o&&n&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:s,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:a("tokens.tokenDetail.loadMore")})})]})}function bf({token:e,renderTokenLink:t}){let o=e.marketData?.marketCapInUsd??e.marketData?.marketCap,n=e.marketData?.tvlInUsd,r=e.stats?.["1h"]?.volumesInUsd,i=!!e.migratedTo,a=t?t(e):jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.image??void 0,name:(e.symbol??e.name??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-col",children:[jsx("span",{className:"truncate text-foreground",children:e.symbol}),jsx("span",{className:"truncate text-[10px] text-text-muted",children:e.name})]})]});return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:a}),jsx("td",{className:"px-3 py-2 text-center align-middle",children:i?jsx("span",{className:"text-positive",children:yf}):jsx("span",{className:"text-text-muted",children:"\u2014"})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:o?formatMCapInUsd(o):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n?formatAmountInUsd(n):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r?formatAmountInUsd(r):"--"})]})}function Gi({tokens:e,className:t}){let{t:o}=useTranslation(),n=e.length,s=e.filter(d=>!!d.migratedTo).length,r=n===0?0:Math.round(s/n*100),i=e.map(d=>d.stats?.["1h"]?.volumesInUsd??"0").reduce((d,l)=>d.plus(new SafeBigNumber(l)),new SafeBigNumber(0)),a=e.map(d=>d.marketData?.marketCapInUsd??d.marketData?.marketCap??"0").reduce((d,l)=>d.plus(new SafeBigNumber(l)),new SafeBigNumber(0));return jsxs("div",{className:cn("flex flex-col gap-2 p-3",t),children:[jsx("div",{className:"flex items-center justify-between",children:jsx("span",{className:"text-xs font-medium text-text-muted",children:o("tokens.tokenDetail.devTokens.stats")})}),jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsx(ho,{label:o("tokens.tokenDetail.devTokens.total"),value:String(n)}),jsx(ho,{label:o("tokens.tokenDetail.columns.migrated"),value:`${s} (${r}%)`}),jsx(ho,{label:o("tokens.tokenDetail.devTokens.totalMarketCap"),value:formatMCapInUsd(a.toString())}),jsx(ho,{label:o("tokens.tokenDetail.devTokens.totalVolume1h"),value:formatAmountInUsd(i.toString())})]})]})}function ho({label:e,value:t}){return jsxs("div",{className:"flex flex-col gap-[2px]",children:[jsx("span",{className:"text-[10px] text-text-muted",children:e}),jsx("span",{className:"text-[13px] font-medium text-foreground",children:t})]})}function Sf(e){return e instanceof Error&&e.code==="NotImplemented"}function ji({chain:e,creator:t,limit:o=20}){let[n,s]=useState(void 0),[r,i]=useState([]),a=useCallback(()=>{s(void 0),i([]);},[]);useEffect(()=>{a();},[e,t,a]);let d=useMemo(()=>({chain:e,creator:t??"",cursor:n,limit:o}),[e,t,n,o]),{data:l,isPending:c,isFetching:u,error:m}=useTokensByCreatorQuery(d,{enabled:!!t});useEffect(()=>{l&&i(h=>n==null?[l]:h[h.length-1]?.endCursor===l.endCursor?h:[...h,l]);},[l,n]);let p=useMemo(()=>r.flatMap(h=>h.data),[r]),g=r[r.length-1],f=!!(g?.hasNext&&g.endCursor),k=!!m&&Sf(m),x=useCallback(()=>{!g?.endCursor||!g.hasNext||s(g.endCursor);},[g]);return {tokens:p,isLoading:!!t&&!k&&(c||u),unavailable:k,hasMore:f,loadMore:x}}function OP({chain:e,creator:t,limit:o,showSummary:n=false,renderTokenLink:s,className:r}){let{tokens:i,isLoading:a,unavailable:d,hasMore:l,loadMore:c}=ji({chain:e,creator:t,limit:o});return jsxs("div",{className:r,children:[jsx(Qi,{tokens:i,isLoading:a,unavailable:d,hasMore:l,onLoadMore:c,renderTokenLink:s}),n&&!d?jsx(Gi,{tokens:i}):null]})}function ra({token:e,athInUsd:t,athAt:o,globalFeesPaidInUsd:n,rank:s,onTogglePin:r,pinned:i,className:a}){let{t:d}=useTranslation(),l=e?.marketData?.priceInUsd,c=e?.marketData?.tvlInUsd,u=e?.marketData?.totalSupply;return jsxs("div",{className:cn("flex h-[48px] w-full flex-row items-center gap-4 overflow-x-auto px-3 text-[12px]",a),children:[jsx(mt,{label:d("tokens.tokenDetail.chart.price"),value:l?formatPriceInUsd(l):"--"}),jsx(mt,{label:d("tokens.tokenDetail.chart.liquidity"),value:c?formatAmountInUsd(c):"--"}),jsx(mt,{label:d("tokens.tokenDetail.chart.supply"),value:u?formatAmount(u):"--"}),n?jsx(mt,{label:d("tokens.tokenDetail.chart.feesPaid"),value:formatAmountInUsd(n)}):null,t?jsx(mt,{label:d("tokens.tokenDetail.chart.ath"),value:formatPriceInUsd(t),title:o?d("tokens.tokenDetail.chart.athAt",{date:o.toLocaleDateString()}):void 0}):null,s!==void 0?jsx(mt,{label:d("tokens.tokenDetail.chart.rank"),value:`#${s}`}):null,jsx("div",{className:"flex-1"}),r?jsx("button",{type:"button",onClick:r,"aria-pressed":i,className:cn("flex size-[26px] items-center justify-center rounded text-text-muted transition-colors hover:bg-default-100 hover:text-foreground",i&&"text-foreground"),title:d(i?"tokens.tokenDetail.chart.unpin":"tokens.tokenDetail.chart.pin"),children:i?"\u2605":"\u2606"}):null]})}function mt({label:e,value:t,title:o}){return jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] whitespace-nowrap",title:o,children:[jsx("span",{className:"text-[10px] leading-none text-text-muted",children:e}),jsx("span",{className:"text-[13px] font-medium leading-none tabular-nums text-foreground",children:t})]})}function ia({chain:e,address:t}){return O(e,t)}function jP({chain:e,address:t,athInUsd:o,athAt:n,globalFeesPaidInUsd:s,rank:r,pinned:i,onTogglePin:a,className:d}){let{token:l}=ia({chain:e,address:t});return jsx(ra,{className:d,token:l,athInUsd:o,athAt:n,globalFeesPaidInUsd:s,rank:r,pinned:i,onTogglePin:a})}function aa({tokens:e,isLoading:t,unavailable:o,onTokenClick:n,className:s}){let{t:r}=useTranslation();return o?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-text-muted",s),children:r("tokens.tokenDetail.similarUnavailable")}):!t&&e.length===0?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-text-muted",s),children:r("tokens.tokenDetail.noSimilarTokens")}):jsxs("ul",{className:cn("flex flex-col",s),children:[e.map(i=>jsxs("li",{className:cn("flex cursor-pointer items-center gap-2 border-b border-default-50 px-3 py-2 last:border-0 hover:bg-default-50/60",!n&&"cursor-default"),onClick:n?()=>n(i):void 0,children:[jsx(Avatar,{src:i.image??void 0,name:(i.symbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[jsx("span",{className:"truncate text-[12px] text-foreground",children:i.symbol}),jsx("span",{className:"truncate text-[10px] text-text-muted",children:i.name})]}),jsx("span",{className:"text-[11px] tabular-nums text-text-muted",children:i.marketData?.marketCapInUsd?formatMCapInUsd(i.marketData.marketCapInUsd):"--"})]},`${i.chain}:${i.address}`)),t&&jsx("li",{className:"py-2 text-center text-[11px] text-text-muted",children:r("tokens.tokenDetail.loading")})]})}function la({chain:e,address:t,keyword:o,limit:n=10}){let s=!!o&&o.length>0,{data:r,isPending:i,isFetching:a}=useSearchTokensQuery({chains:[e],keyword:o,limit:n+1},{enabled:s});return {tokens:useMemo(()=>{if(!r)return [];let l=t.toLowerCase();return (r.data??[]).filter(c=>c.address.toLowerCase()!==l).slice(0,n)},[r,t,n]),isLoading:s&&(i||a),unavailable:!s}}function k1({chain:e,address:t,keyword:o,limit:n,onTokenClick:s,className:r}){let{tokens:i,isLoading:a,unavailable:d}=la({chain:e,address:t,keyword:o,limit:n});return jsx(aa,{className:r,tokens:i,isLoading:a,unavailable:d,onTokenClick:s})}function da({tokens:e=[],unavailable:t=true,onTokenClick:o,className:n}){let{t:s}=useTranslation();return t?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-text-muted",n),children:s("tokens.tokenDetail.reusedImagesUnavailable")}):e.length===0?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-text-muted",n),children:s("tokens.tokenDetail.noReusedImages")}):jsx("div",{className:cn("flex flex-row flex-wrap gap-2 p-3",n),children:e.map(r=>jsx("button",{type:"button",onClick:o?()=>o(r):void 0,className:"flex size-10 items-center justify-center overflow-hidden rounded-full border border-default-100 transition-opacity hover:opacity-80",title:r.symbol,children:jsx(Avatar,{src:r.image??void 0,name:(r.symbol??"?").slice(0,1),className:"size-full bg-default-100 text-[10px] text-text-muted",showFallback:true})},`${r.chain}:${r.address}`))})}function ca(e){return {tokens:[],isLoading:false,unavailable:true}}function A1({chain:e,address:t,onTokenClick:o,className:n}){let{tokens:s,unavailable:r}=ca();return jsx(da,{className:n,tokens:s,unavailable:r,onTokenClick:o})}function ga({keywords:e,excludeKeywords:t,onKeywordsChange:o,onExcludeKeywordsChange:n,className:s}){let{t:r}=useTranslation(),[i,a]=useState(e?.join(", ")??""),[d,l]=useState(t?.join(", ")??"");useEffect(()=>{a(m=>{let p=bo(m);return p===void 0&&e===void 0?m:p===void 0?e?.join(", ")??"":e===void 0?"":p.join("")===e.join("")?m:e.join(", ")});},[e]),useEffect(()=>{l(m=>{let p=bo(m);return p===void 0&&t===void 0?m:p===void 0?t?.join(", ")??"":t===void 0?"":p.join("")===t.join("")?m:t.join(", ")});},[t]);let c=useCallback(m=>{a(m),o?.(bo(m));},[o]),u=useCallback(m=>{l(m),n?.(bo(m));},[n]);return jsxs("div",{className:cn("grid grid-cols-2 gap-3 px-4",s),children:[jsxs("div",{className:"flex flex-col gap-3",children:[jsx("h3",{className:"text-xs text-text-muted",children:r("tokens.filters.keywords.title")}),jsx(StyledInput,{variant:"bordered",radius:"lg",size:"sm",placeholder:r("tokens.filters.keywords.placeholder"),value:i,onValueChange:c})]}),jsxs("div",{className:"flex flex-col gap-3",children:[jsx("h3",{className:"text-xs text-text-muted",children:r("tokens.filters.keywords.exclude.title")}),jsx(StyledInput,{variant:"bordered",radius:"lg",size:"sm",placeholder:r("tokens.filters.keywords.placeholder"),value:d,onValueChange:u})]})]})}function bo(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);return t.length>0?t:void 0}function ba({protocols:e,selectedProtocols:t=[],onSelectedProtocolsChange:o,className:n}){let{t:s}=useTranslation(),[r,i]=useState(t);useEffect(()=>{i(t);},[t]);let a=useMemo(()=>e.every(c=>r.includes(c)),[e,r]),d=useCallback(()=>{if(a){let c=[];i(c),o?.(c);}else {let c=[...e];i(c),o?.(c);}},[e,o,a]),l=useCallback(c=>()=>{if(r.includes(c)){let u=r.filter(m=>m!==c);i(u),o?.(u);}else {let u=[...r,c];i(u),o?.(u);}},[r,o]);return jsxs("div",{className:cn("flex flex-col gap-3 px-4",n),children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-xs text-text-muted",children:s("tokens.filters.protocols.title")}),jsx(Button,{variant:"light",color:"default",size:"sm",radius:"full",onPress:d,children:s(a?"tokens.filters.protocols.unselectAll":"tokens.filters.protocols.selectAll")})]}),jsx("div",{className:"grid grid-cols-3 gap-3",children:e.map(c=>{let u=Ke(c);return jsx(Button,{variant:"bordered",size:"sm",radius:"full",className:cn("w-fit h-6 px-2.5",u.text,u.bg5,"border",u.border,{"opacity-40 data-[hover=true]:!opacity-30":!r.includes(c)}),startContent:jsx(Image,{width:14,height:14,src:`/images/protocols/${c}.svg`,alt:formatTokenProtocolName(c)}),onPress:l(c),children:formatTokenProtocolName(c)},c)})})]})}function we({title:e,field:t,value:o,onChange:n}){let{t:s}=useTranslation(),[r,i]=useState(o?Pn(o).min:NaN),[a,d]=useState(o?Pn(o).max:NaN);useEffect(()=>{if(o===void 0)i(NaN),d(NaN);else {let{min:u,max:m}=Pn(o);i(u),d(m);}},[o]);let l=useCallback(u=>{i(u),n?.(Ca(t,u,a));},[t,n,a]),c=useCallback(u=>{d(u),n?.(Ca(t,r,u));},[t,n,r]);return jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsx("h3",{className:"text-xs text-text-muted",children:e}),jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsx(StyledNumberInput,{value:r,onValueChange:l,variant:"bordered",radius:"lg",size:"sm",placeholder:s("tokens.filters.stats.min"),"aria-label":`${e} min`}),jsx(StyledNumberInput,{value:a,onValueChange:c,variant:"bordered",radius:"lg",size:"sm",placeholder:s("tokens.filters.stats.max"),"aria-label":`${e} max`})]})]})}function Pn(e){if(e.operator==="between"){let[t,o]=e.value;return {min:t,max:o}}return e.operator==="gte"?{min:e.value,max:NaN}:e.operator==="lte"?{min:NaN,max:e.value}:{min:NaN,max:NaN}}function Ca(e,t,o){if(!(isNaN(t)&&isNaN(o)))return isNaN(t)?{field:e,operator:"lte",value:o}:isNaN(o)?{field:e,operator:"gte",value:t}:{field:e,operator:"between",value:[t,o]}}function La({values:e,onValuesChange:t,className:o}){let{t:n}=useTranslation(),[s,r]=useState(e);useEffect(()=>{r(e);},[e]);let i=useCallback(a=>d=>{if(d===void 0){let l=(s??[]).filter(c=>c.field!==a);l=l.length>0?l:void 0,r(l),t?.(l);}else {let l=[...(s??[]).filter(c=>c.field!==a),d];r(l),t?.(l);}},[s,t]);return jsxs("div",{className:cn("flex flex-col gap-4",o),children:[jsx(we,{field:"holders",title:n("tokens.filters.stats.audits.holders"),value:s?.find(a=>a.field==="holders"),onChange:i("holders")}),jsx(we,{field:"top10Ratio",title:n("tokens.filters.stats.audits.top10HoldingsRatio"),value:s?.find(a=>a.field==="top10Ratio"),onChange:i("top10Ratio")}),jsx(we,{field:"top100Ratio",title:n("tokens.filters.stats.audits.top100HoldingsRatio"),value:s?.find(a=>a.field==="top100Ratio"),onChange:i("top100Ratio")}),jsx(we,{field:"creatorsRatio",title:n("tokens.filters.stats.audits.devHoldingsRatio"),value:s?.find(a=>a.field==="creatorsRatio"),onChange:i("creatorsRatio")})]})}function Pa({resolution:e,values:t,onValuesChange:o,className:n}){let{t:s}=useTranslation(),[r,i]=useState(t);useEffect(()=>{i(t);},[t]);let a=useCallback(d=>l=>{if(l===void 0){let c=(r??[]).filter(u=>u.field!==d);c=c.length>0?c:void 0,i(c),o?.(c);}else {let c=[...(r??[]).filter(u=>u.field!==d),l];i(c),o?.(c);}},[r,o]);return jsxs("div",{className:cn("flex flex-col gap-4",n),children:[jsx(we,{field:"marketCap",title:s("tokens.filters.stats.metrics.marketCap"),value:r?.find(d=>d.field==="marketCap"),onChange:a("marketCap")}),jsx(we,{field:"tvl",title:s("tokens.filters.stats.metrics.liquidity"),value:r?.find(d=>d.field==="tvl"),onChange:a("tvl")}),jsx(we,{field:`volumes${e}`,title:s("tokens.filters.stats.metrics.volumes",{resolution:s(`common.resolution.${e}`)}),value:r?.find(d=>d.field===`volumes${e}`),onChange:a(`volumes${e}`)}),jsx(we,{field:`trades${e}`,title:s("tokens.filters.stats.metrics.txns",{resolution:s(`common.resolution.${e}`)}),value:r?.find(d=>d.field===`trades${e}`),onChange:a(`trades${e}`)})]})}function Da({resolution:e,values:t,onValuesChange:o,className:n}){let{t:s}=useTranslation(),[r,i]=useState("audits"),[a,d]=useState(t);useEffect(()=>{d(t);},[t]);let l=useCallback(m=>{d(m),o?.(m);},[o]),c=useMemo(()=>{let m=["holders","top10Ratio","top100Ratio","creatorsRatio"];return a?.filter(p=>m.includes(p.field))?.length??0},[a]),u=useMemo(()=>{let m=["marketCap","tvl",`volumes${e}`,`trades${e}`];return a?.filter(p=>m.includes(p.field)).length??0},[a,e]);return jsxs("div",{className:cn("flex flex-col gap-3 px-4",n),children:[jsxs(StyledLightTabs,{color:"default",radius:"full",size:"sm",selectedKey:r,onSelectionChange:i,children:[jsx(Tab,{title:c===0?s("tokens.filters.stats.audits"):jsx(StyledBadge,{color:"primary",size:"sm",content:c,shape:"circle",children:s("tokens.filters.stats.audits")})},"audits"),jsx(Tab,{title:u===0?s("tokens.filters.stats.metrics"):jsx(StyledBadge,{color:"primary",size:"sm",content:u,shape:"circle",children:s("tokens.filters.stats.metrics")})},"metrics")]}),jsx(La,{values:a,onValuesChange:l,className:cn({hidden:r!=="audits"})}),jsx(Pa,{values:a,onValuesChange:l,resolution:e,className:cn({hidden:r!=="metrics"})})]})}function Ro({protocols:e,resolution:t,filters:o,onFiltersChange:n,className:s}){let[r,i]=useState(Fa(o?.filters,e));useEffect(()=>{i(Fa(o?.filters,e));},[o?.filters,e]);let[a,d]=useState(o?.keywords);useEffect(()=>{d(o?.keywords);},[o?.keywords]);let[l,c]=useState(o?.excludeKeywords);useEffect(()=>{c(o?.excludeKeywords);},[o?.excludeKeywords]);let[u,m]=useState(o?.filters);useEffect(()=>{m(o?.filters);},[o?.filters]);let p=useCallback(x=>{i(x),n?.(Po(e,x,a,l,u));},[e,a,l,u,n]),g=useCallback(x=>{d(x),n?.(Po(e,r,x,l,u));},[e,r,l,u,n]),f=useCallback(x=>{c(x),n?.(Po(e,r,a,x,u));},[e,r,a,u,n]),k=useCallback(x=>{m(x),n?.(Po(e,r,a,l,x));},[e,r,a,l,n]);return jsxs("div",{className:cn("flex flex-col gap-4",s),children:[e&&e.length>0&&jsxs(Fragment,{children:[jsx(ba,{protocols:e,selectedProtocols:r,onSelectedProtocolsChange:p}),jsx("div",{style:{height:1,background:"var(--color-surface-strong)"}})]}),jsx(ga,{keywords:a,excludeKeywords:l,onKeywordsChange:g,onExcludeKeywordsChange:f}),jsx("div",{style:{height:1,background:"var(--color-surface-strong)"}}),jsx(Da,{resolution:t,values:u,onValuesChange:k})]})}function Fa(e,t){let o=e?.find(n=>n.field==="launchedFromProtocolFamily");return o?o.operator==="in"?o.value:(console.warn("invalid token protocols filter",o),[...t||[]]):[...t||[]]}function Po(e,t,o,n,s){let r=s?[...s.filter(i=>i.field!=="launchedFromProtocolFamily")]:[];return e&&e.length>0&&(e.every(a=>t.includes(a))||r.push({field:"launchedFromProtocolFamily",operator:"in",value:t})),o===void 0&&n===void 0&&r.length===0?void 0:{keywords:o,excludeKeywords:n,filters:r.length>0?r:void 0}}function Ba({protocols:e,resolution:t,filters:o,onFiltersChange:n,triggerVariant:s="default",badgePlacement:r="outer",className:i}){let{t:a}=useTranslation(),{isOpen:d,onOpen:l,onClose:c,onOpenChange:u}=useDisclosure(),[m,p]=useState(o),g=useCallback(()=>{p(void 0);},[]),f=useCallback(()=>{n?.(m),c();},[m,n,c]);useEffect(()=>{p(o);},[d,o]);let k=useMemo(()=>Object.values(o||{}).every(x=>x===void 0),[o]);return jsxs(Fragment,{children:[jsxs("button",{type:"button",className:i,onClick:l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:9999,border:s==="plain"?"none":"1px solid rgba(63,63,70,0.5)",background:s==="plain"?"transparent":"hsl(var(--heroui-content3) / 0.6)",width:32,height:32,minHeight:32,padding:0,cursor:"pointer",position:"relative"},children:[jsx(FilterIcon,{width:16,height:16,className:"text-text-secondary"}),!k&&jsx("span",{style:{position:"absolute",top:r==="icon"?6:-2,right:r==="icon"?6:-2,width:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),jsx(StyledModal,{isOpen:d,onOpenChange:u,size:"md",scrollBehavior:"inside",children:jsxs(ModalContent,{className:"w-full h-full",children:[jsx(ModalHeader,{className:"px-4 py-2",children:jsx("span",{className:"text-base font-semibold",children:a("tokens.filters.modal.title")})}),jsx(ModalBody,{className:"px-0 pt-0 pb-4",children:jsx(ScrollShadow,{children:jsx(Ro,{protocols:e,resolution:t,filters:m,onFiltersChange:p,className:"pb-4"})})}),jsx(ModalFooter,{className:"px-4",children:jsxs("div",{className:"w-full flex justify-between items-center",children:[jsx(Button,{variant:"light",color:"default",size:"sm",radius:"full",startContent:jsx(RefreshIcon,{width:16,height:16}),onPress:g,children:a("common.reset")}),jsx(Button,{color:"primary",size:"sm",radius:"full",onPress:f,children:a("common.apply")})]})})]})})]})}var _a={display:"inline-flex",alignItems:"center",gap:8,borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"hsl(var(--heroui-content3) / 0.6)",padding:"6px 12px",fontSize:14,fontWeight:700,color:"var(--color-text-primary)",cursor:"pointer",transition:"all 0.15s",height:32},Ag={position:"absolute",right:0,top:"100%",zIndex:20,marginTop:8,borderRadius:14,border:"1px solid var(--color-border-control)",background:"var(--color-surface-interactive)",boxShadow:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden"},Ig={height:1,background:"var(--color-surface-strong)",margin:0};function qa({protocols:e,resolution:t,filters:o,onFiltersChange:n,iconOnly:s=false,className:r}){let{t:i}=useTranslation(),[a,d]=useState(false),l=useRef(null),[c,u]=useState(o),m=useCallback(()=>{u(void 0);},[]),p=useCallback(()=>{n?.(c),d(false);},[c,n]);useEffect(()=>{u(o);},[a,o]),useEffect(()=>{let f=k=>{l.current&&!l.current.contains(k.target)&&d(false);};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[]),useEffect(()=>{if(!a)return;let f=k=>{k.key==="Escape"&&d(false);};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[a]);let g=useMemo(()=>Object.values(o||{}).every(f=>f===void 0),[o]);return jsxs("div",{ref:l,style:{position:"relative"},children:[jsxs("div",{style:{position:"relative",display:"inline-flex"},children:[jsxs("button",{type:"button",className:r,style:s?{..._a,justifyContent:"center",gap:0,width:32,minWidth:32,padding:0}:_a,onMouseEnter:f=>{f.currentTarget.style.background="var(--color-surface-strong)";},onMouseLeave:f=>{f.currentTarget.style.background="hsl(var(--heroui-content3) / 0.6)";},onClick:()=>d(f=>!f),children:[jsx(FilterIcon,{width:16,height:16,className:"flex-none"}),!s&&jsxs(Fragment,{children:[jsx("span",{className:"hidden sm:block",children:i("tokens.listHeader.filter")}),jsx(Mg,{open:a})]})]}),!g&&jsx("span",{style:{position:"absolute",top:-4,right:-4,minWidth:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),a&&jsxs("div",{style:{...Ag,width:420},children:[jsx("div",{style:{padding:"16px 0"},children:jsx(ScrollShadow,{className:"w-full max-h-120 px-4",children:jsx(Ro,{protocols:e,resolution:t,filters:c,onFiltersChange:u})})}),jsx("div",{style:Ig}),jsxs("div",{style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Button,{variant:"light",size:"sm",color:"default",radius:"full",startContent:jsx(RefreshIcon,{width:16,height:16}),onPress:m,children:i("common.reset")}),jsx(Button,{variant:"solid",size:"sm",color:"primary",radius:"full",onPress:p,children:i("common.apply")})]})]})]})}function Mg({open:e}){return jsx("svg",{viewBox:"0 0 24 24",style:{width:14,height:14,color:"var(--color-text-muted)",transition:"transform 0.15s",transform:e?"rotate(180deg)":void 0},fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"m6 9 6 6 6-6"})})}function vR({popoverPlacement:e="bottom-end",iconOnly:t,className:o,desktopOverlay:n="popover",...s}){let{isMobile:r}=useScreen();return r||n==="modal"?jsx(Ba,{className:o,...s}):jsx(qa,{placement:e,iconOnly:t,className:o,...s})}function Qa({resolution:e,onResolutionChange:t,resolutionOptions:o=["1m","5m","1h","4h","24h"]}){let{t:n}=useTranslation(),s=useCallback(r=>{t?.(r);},[t]);return jsx(StyledPlainTabs,{color:"primary",radius:"lg",selectedKey:e,onSelectionChange:s,"aria-label":n("tokens.resolutionSelector.ariaLabel"),classNames:{tabList:"gap-0",tab:"px-2",tabContent:"!text-text-muted group-data-[hover=true]:!text-foreground group-data-[selected=true]:!text-primary"},children:o.map(r=>jsx(Tab,{title:n(`common.resolution.${r}`)},r))})}var zg={display:"inline-flex",alignItems:"center",gap:4,borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"hsl(var(--heroui-content3) / 0.6)",padding:"0 10px",fontSize:12,fontWeight:500,color:"var(--color-text-primary)",cursor:"pointer",height:32,minHeight:32},Qg={position:"absolute",left:0,top:"100%",zIndex:20,marginTop:6,borderRadius:14,border:"1px solid var(--color-border-control)",background:"var(--color-surface-interactive)",boxShadow:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden",padding:"6px",minWidth:"100%"};function Xa({resolution:e,onResolutionChange:t,resolutionOptions:o=["1m","5m","1h","4h","24h"]}){let{t:n}=useTranslation(),[s,r]=useState(false),i=useRef(null),a=useCallback(d=>{t?.(d),r(false);},[t]);return useEffect(()=>{if(!s)return;let d=c=>{i.current&&!i.current.contains(c.target)&&r(false);},l=c=>{c.key==="Escape"&&r(false);};return document.addEventListener("mousedown",d),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",l);}},[s]),jsxs("div",{ref:i,style:{position:"relative",zIndex:50},children:[jsxs("button",{type:"button",style:zg,onClick:()=>r(d=>!d),children:[jsx("span",{children:e?n(`common.resolution.${e}`):"\u2014"}),jsx(ChevronDownIcon,{width:14,height:14,className:"text-text-muted",style:{transition:"transform 0.15s",transform:s?"rotate(180deg)":void 0}})]}),s&&jsx("div",{style:Qg,children:o.map(d=>jsx("button",{type:"button",onClick:()=>a(d),className:cn("w-full text-left px-3 py-1.5 rounded-lg text-xs font-medium transition-colors cursor-pointer",d===e?"text-primary bg-primary/10":"text-text-secondary hover:text-foreground hover:bg-surface-interactive"),children:n(`common.resolution.${d}`)},d))})]})}function BR(e){let{isMobile:t}=useScreen();return t?jsx(Xa,{...e}):jsx(Qa,{...e})}var Ya=memo(function({token:t}){let o=useMemo(()=>t.marketData?.athMarketCapInUsd,[t.marketData?.athMarketCapInUsd]);return jsx(Fragment,{children:formatMCapInUsd(o)})});var ja=memo(function({token:t}){let{t:o}=useTranslation(),n=useMemo(()=>t.marketData?.bluechipHoldingsRatio,[t.marketData?.bluechipHoldingsRatio]),s=useMemo(()=>n!==void 0&&new SafeBigNumber(n).gte(.1),[n]),r=useMemo(()=>n===void 0||new SafeBigNumber(n).lt(.05),[n]);return jsx(StyledTooltip,{content:o("tokens.bluechip.explained"),children:jsxs("div",{className:"flex items-center gap-2.5",children:[s&&jsx(HorsePowerHighIcon,{}),r&&jsx(HorsePowerLowIcon,{}),!s&&!r&&jsx(HorsePowerIcon,{}),jsx("span",{className:cn(s&&"text-positive",!s&&!r&&"text-negative",n===void 0&&"text-text-muted"),children:formatPercent(n)})]})})});function vk(e){return e.length<=10?e:`${e.slice(0,4)}...${e.slice(-4)}`}var il=memo(function({token:t}){let o=useCopyToClipboard(),[n,s]=useState(false),[r,i]=useState(false),a=useRef(void 0),d=useRef(void 0),{t:l}=useTranslation(),{formatAge:c}=useLocalizedTimeFormatter(),u=useCallback(g=>{g.preventDefault(),g.stopPropagation(),o(t.name,()=>{toast.success(l("tokens.copied.name")),s(true),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{s(false);},2e3);});},[o,t.name,l]),m=useCallback(g=>{g.preventDefault(),g.stopPropagation(),o(t.address,()=>{toast.success(l("tokens.copied.address")),i(true),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{i(false);},2e3);});},[o,t.address,l]);useEffect(()=>()=>{a.current&&clearTimeout(a.current),d.current&&clearTimeout(d.current);},[]);let p=useTickAge(t.createdAt);return jsxs("div",{className:"w-full flex justify-start items-center gap-3",children:[jsx(he,{token:t,showProgress:false,className:"w-10 h-10 sm:w-16 sm:h-16 flex-none"}),jsxs("div",{className:"flex-auto flex flex-col gap-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"flex-none font-medium tracking-[-0.02em]",children:t.symbol}),jsx(StyledTooltip,{content:t.name,children:jsxs("div",{className:"flex-initial flex items-center gap-1 min-w-0 text-text-muted hover:text-primary-200 cursor-pointer",onClick:u,children:[jsx("div",{className:"flex-initial whitespace-nowrap truncate",children:t.name}),n?jsx(CheckIcon,{className:"flex-none w-3 h-3 sm:w-3.5 sm:h-3.5"}):jsx(CopyIcon,{className:"flex-none w-3 h-3 sm:w-3.5 sm:h-3.5"})]})})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-primary text-xs sm:text-sm font-medium",children:c(p)}),jsxs("button",{type:"button",className:"group flex items-center gap-1 min-w-0 max-w-28 sm:max-w-36 text-text-muted hover:text-primary-200 cursor-pointer",onClick:m,"aria-label":l("tokens.copied.address"),children:[jsx("span",{className:"min-w-0 truncate text-left text-xs font-mono text-text-muted/70 group-hover:text-primary-200",children:vk(t.address)}),r?jsx(CheckIcon,{className:"flex-none w-3 h-3"}):jsx(CopyIcon,{className:"flex-none w-3 h-3"})]}),t.socialMedias?.website&&jsx(Link,{href:t.socialMedias.website,className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.twitter&&jsx(Link,{href:t.socialMedias.twitter,className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(TwitterIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.telegram&&jsx(Link,{href:t.socialMedias.telegram,className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(TelegramIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.discord&&jsx(Link,{href:t.socialMedias.discord,className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(DiscordIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),jsx(Link,{href:searchTwitterUrl(`${t.symbol} OR ${t.address}`),className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(SearchIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})]})});var al=memo(function({token:t}){let{t:o}=useTranslation(),n=t.marketData,s=useMemo(()=>new SafeBigNumber(n?.top10HoldingsRatio).gte(.1),[n?.top10HoldingsRatio]),r=useMemo(()=>new SafeBigNumber(n?.devHoldingsRatio).gte(.1),[n?.devHoldingsRatio]),i=useMemo(()=>new SafeBigNumber(n?.sniperHoldingsRatio).gte(.1),[n?.sniperHoldingsRatio]),a=useMemo(()=>new SafeBigNumber(n?.insiderHoldingsRatio).gte(.1),[n?.insiderHoldingsRatio]),d=useMemo(()=>new SafeBigNumber(n?.bundleHoldingsRatio).gte(.1),[n?.bundleHoldingsRatio]);return jsxs("div",{className:"w-full h-full flex flex-col gap-1 justify-center",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(PeopleIcon,{width:12,height:12}),value:formatAmount(n?.holders),tooltip:o("tokens.tokenInfo.holders"),warning:false,disable:!n?.holders}),jsx($,{icon:jsx(KlineCandlesIcon,{width:12,height:12}),value:formatAmount(n?.proHolders),tooltip:o("tokens.tokenInfo.proHolders"),warning:false,disable:!n?.proHolders}),jsx($,{icon:jsx(StarIcon,{width:12,height:12}),value:formatAmount(n?.kolHolders),tooltip:o("tokens.tokenInfo.kolHolders"),warning:false,disable:!n?.kolHolders}),jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(n?.top10HoldingsRatio),tooltip:o("tokens.tokenInfo.top10HoldingsRatio"),warning:s,disable:!n?.top10HoldingsRatio||n?.top10HoldingsRatio==="0"})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(n?.devHoldingsRatio),tooltip:o("tokens.tokenInfo.devHoldingsRatio"),warning:r,disable:!n?.devHoldingsRatio||n?.devHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(n?.sniperHoldingsRatio),tooltip:o("tokens.tokenInfo.sniperHoldingsRatio"),warning:i,disable:!n?.sniperHoldingsRatio||n?.sniperHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(n?.insiderHoldingsRatio),tooltip:o("tokens.tokenInfo.insiderHoldingsRatio"),warning:a,disable:!n?.insiderHoldingsRatio||n?.insiderHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(n?.bundleHoldingsRatio),tooltip:o("tokens.tokenInfo.bundleHoldingsRatio"),warning:d,disable:!n?.bundleHoldingsRatio||n?.bundleHoldingsRatio==="0",tooltipPlacement:"bottom"})]})]})});var ll=memo(function({token:t}){let o=useMemo(()=>t.marketData?.tvlInUsd,[t.marketData?.tvlInUsd]);return jsx(Fragment,{children:formatAmountInUsd(o)})});var dl=memo(function({token:t}){let o=useMemo(()=>t.marketData?.marketCapInUsd,[t.marketData?.marketCapInUsd]);return jsx(Fragment,{children:formatMCapInUsd(o)})});var ul=memo(function({token:t,resolution:o}){let n=useMemo(()=>t.marketData?.priceInUsd,[t.marketData?.priceInUsd]),s=useMemo(()=>t.stats?.[o]?.priceChange,[t,o]),r=useMemo(()=>s?new SafeBigNumber(s).abs().toString():void 0,[s]),i=useMemo(()=>s&&new SafeBigNumber(s).gte(0),[s]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatPriceInUsd(n)}),jsxs("span",{className:cn("inline-flex gap-1 items-center text-xs",i?"text-positive":"text-negative"),children:[i?jsx(TriangleUpIcon,{width:10,height:10}):jsx(TriangleDownIcon,{width:10,height:10}),jsx("span",{children:formatPercent(r)})]})]})});var fl=memo(function({token:t,resolution:o}){let n=t.stats?.[o],s=n?.traders,r=n?.buyers,i=n?.sellers;return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmount(s)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-positive",children:formatAmount(r)}),"/",jsx("span",{className:"text-negative",children:formatAmount(i)})]})]})});var kl=memo(function({token:t,resolution:o}){let n=t.stats?.[o],s=n?.trades,r=n?.buys,i=n?.sells;return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmount(s)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-positive",children:formatAmount(r)}),"/",jsx("span",{className:"text-negative",children:formatAmount(i)})]})]})});var Tl=memo(function({token:t,resolution:o}){let n=t.stats?.[o],s=n?.volumesInUsd,r=n?.buyVolumesInUsd,i=n?.sellVolumesInUsd;return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmountInUsd(s)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-positive",children:formatAmountInUsd(r)}),"/",jsx("span",{className:"text-negative",children:formatAmountInUsd(i)})]})]})});var Zk=`
21
+ `})]})}function pr({token:e,renderAction:t,isLast:o=false,onSelectToken:n,className:s}){let{t:r}=useTranslation(),{formatAge:i}=useLocalizedTimeFormatter(),a=useCopyToClipboard(),d=useTickAge(e.createdAt),l=e.marketData,c=e.stats?.["1h"],u=useCallback(()=>{n?.(e);},[n,e]),m=useCallback(R=>{R.stopPropagation(),a(e.address,()=>toast.success(r("tokens.copied.address")));},[a,e.address,r]),p=useMemo(()=>c?.volumesInUsd,[c?.volumesInUsd]),g=useMemo(()=>c?.buyVolumesInUsd,[c?.buyVolumesInUsd]),f=useMemo(()=>c?.sellVolumesInUsd,[c?.sellVolumesInUsd]),k=useMemo(()=>c?.trades,[c?.trades]),x=useMemo(()=>l?.marketCapInUsd,[l?.marketCapInUsd]),y=useMemo(()=>l?.tvlInUsd,[l?.tvlInUsd]),T=useMemo(()=>{let R=new SafeBigNumber(x);return R.lt(1e3)?"text-foreground":R.lt(1e6)?"text-secondary":"text-primary"},[x]),S=useMemo(()=>new SafeBigNumber(l?.top10HoldingsRatio).gte(.1),[l?.top10HoldingsRatio]),h=useMemo(()=>new SafeBigNumber(l?.devHoldingsRatio).gte(.1),[l?.devHoldingsRatio]),b=useMemo(()=>new SafeBigNumber(l?.insiderHoldingsRatio).gte(.1),[l?.insiderHoldingsRatio]),w=useMemo(()=>new SafeBigNumber(l?.sniperHoldingsRatio).gte(.1),[l?.sniperHoldingsRatio]),v=useMemo(()=>new SafeBigNumber(l?.bundleHoldingsRatio).gte(.1),[l?.bundleHoldingsRatio]),N=l?.holders!==void 0&&l.holders>0,F=l?.proHolders!==void 0&&l.proHolders>0,fe=l?.kolHolders!==void 0&&l.kolHolders>0,Y=N||F||fe;return jsxs("div",{className:cn("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer",s),style:{borderBottom:o?"none":"1px solid var(--color-border-subtle)"},onClick:n?u:void 0,children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx(he,{token:e,enableSearch:true,enablePreview:!!e.image,showProgress:true,className:"w-20 h-20"}),jsxs("button",{type:"button",className:"text-xs font-mono text-text-muted hover:text-foreground leading-none",onClick:m,"aria-label":r("tokens.copied.address"),title:r("tokens.copied.address"),children:[e.address.slice(0,4),"...",e.address.slice(-4)]})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 text-left",onClick:m,"aria-label":r("tokens.copied.address"),title:r("tokens.copied.address"),children:[jsx("span",{className:"flex-none text-sm font-semibold leading-none whitespace-nowrap overflow-hidden text-ellipsis max-w-24",children:e.symbol}),jsx(StyledTooltip,{content:e.name,children:jsx("span",{className:"text-[13px] leading-none text-text-muted truncate max-w-20",children:e.name})}),jsx(CopyIcon,{className:"flex-none w-3.5 h-3.5 text-text-muted"})]}),jsxs("div",{className:"flex items-center gap-2 leading-none",children:[jsx("span",{className:"text-[13px] font-mono font-medium text-text-muted",children:i(d)}),e.socialMedias?.website&&jsx(Link,{href:e.socialMedias.website,className:"text-text-muted hover:text-primary",target:"_blank",onClick:R=>R.stopPropagation(),children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.twitter&&jsx(Link,{href:e.socialMedias.twitter,className:"text-text-muted hover:text-primary",target:"_blank",onClick:R=>R.stopPropagation(),children:jsx(TwitterIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.telegram&&jsx(Link,{href:e.socialMedias.telegram,className:"text-text-muted hover:text-primary",target:"_blank",onClick:R=>R.stopPropagation(),children:jsx(TelegramIcon,{className:"w-3.5 h-3.5"})}),jsx(Link,{href:searchTwitterUrl(`${e.symbol} OR ${e.address}`),className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",onClick:R=>R.stopPropagation(),children:jsx(SearchIcon,{className:"w-3.5 h-3.5"})})]}),jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-foreground/80 leading-none",children:[jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-text-muted",children:"MC"}),jsx("span",{className:cn(T),children:formatMCapInUsd(x)})]}),jsx("span",{className:"text-text-muted/30",children:"\xB7"}),jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-text-muted",children:r("tokens.listHeader.liqShort")}),jsx("span",{children:formatAmountInUsd(y)})]})]}),Y&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-text-muted leading-none",children:[N&&jsx(StyledTooltip,{content:r("tokens.tokenInfo.holders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(PeopleIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(l?.holders)]})}),F&&jsx(StyledTooltip,{content:r("tokens.tokenInfo.proHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(KlineCandlesIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(l?.proHolders)]})}),fe&&jsx(StyledTooltip,{content:r("tokens.tokenInfo.kolHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(StarIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(l?.kolHolders)]})})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5 leading-none font-mono",children:[jsx("div",{className:"flex flex-col items-end gap-1",children:jsx("span",{className:cn("text-base font-bold leading-none",T),children:formatMCapInUsd(x)})}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-text-muted",children:"V"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmountInUsd(p)})]}),jsxs("span",{className:"text-[10px] leading-none",children:[jsx("span",{className:"text-positive",children:formatAmountInUsd(g)}),jsx("span",{className:"text-text-muted/50 mx-0.5",children:"/"}),jsx("span",{className:"text-negative",children:formatAmountInUsd(f)})]})]}),jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-text-muted",children:"TX"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmount(k)})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-start gap-4 relative",children:[jsx(HorizontalScrollContainer,{className:"flex-auto min-w-0",forceShowArrows:true,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(l?.top10HoldingsRatio),tooltip:r("tokens.tokenInfo.top10HoldingsRatio"),warning:S,disable:!l?.top10HoldingsRatio||l?.top10HoldingsRatio==="0"}),jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(l?.devHoldingsRatio),tooltip:r("tokens.tokenInfo.devHoldingsRatio"),warning:h,disable:!l?.devHoldingsRatio||l?.devHoldingsRatio==="0"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(l?.sniperHoldingsRatio),tooltip:r("tokens.tokenInfo.sniperHoldingsRatio"),warning:w,disable:!l?.sniperHoldingsRatio||l?.sniperHoldingsRatio==="0"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(l?.insiderHoldingsRatio),tooltip:r("tokens.tokenInfo.insiderHoldingsRatio"),warning:b,disable:!l?.insiderHoldingsRatio||l?.insiderHoldingsRatio==="0"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(l?.bundleHoldingsRatio),tooltip:r("tokens.tokenInfo.bundleHoldingsRatio"),warning:v,disable:!l?.bundleHoldingsRatio||l?.bundleHoldingsRatio==="0"})]})}),t&&jsx("div",{className:"flex-none relative",onClick:R=>R.stopPropagation(),children:t(e)})]})]})}var Ud=152,gr=10;function Od({index:e,style:t,data:o,skeletonCount:n,renderItemAction:s,onSelectToken:r}){if(!o)return jsx("div",{style:t,children:jsx(Ko,{isLast:e===n-1})});let i=o[e];return i?jsx("div",{style:t,children:jsx(pr,{token:i,isLast:e===o.length-1,renderAction:s,onSelectToken:r})}):jsx("div",{style:t,children:jsx(Ko,{isLast:e===o.length-1})})}function je({title:e,tokens:t,isLoading:o,itemHeight:n=Ud,renderHeaderExtra:s,renderItemAction:r,onSelectToken:i,onPauseChange:a,onScrollingChange:d,className:l,hideHeader:c}){let u=o||!t?void 0:t,m=u?u.length:gr,p=useMemo(()=>({data:u,skeletonCount:gr,renderItemAction:r,onSelectToken:i}),[u,r,i]),[g,f]=useState(false),k=useRef(void 0),x=useRef(false),y=useCallback(()=>{f(true),a?.(true);},[a]),T=useCallback(()=>{f(false),a?.(false);},[a]),S=useCallback(()=>{x.current||(x.current=true,d?.(true)),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{x.current=false,d?.(false);},180);},[d]);return useEffect(()=>()=>{k.current&&clearTimeout(k.current),x.current&&d?.(false);},[d]),jsxs("div",{className:cn("w-full h-full bg-surface-base overflow-hidden flex flex-col border border-border-subtle/60 rounded-lg",l),onMouseEnter:y,onMouseLeave:T,children:[!c&&jsx(Yn,{title:e,isPaused:g,extra:s}),jsx("div",{className:"flex-1 w-full overflow-hidden",onScrollCapture:S,children:jsx(List,{className:"h-full w-full",rowCount:m,rowHeight:n,rowComponent:Od,rowProps:p,overscanCount:10})})]})}function zo(e,t){let o={...e};for(let n of Object.keys(t))t[n]!==void 0&&(o[n]=t[n]);return o}var Bd=["1m","5m","15m","30m","1h","4h","24h"];function Wd(e,t){if(!t)return e;if(!e)return t;let o={...e};for(let n of Bd)t[n]&&(o[n]=e[n]?zo(e[n],t[n]):t[n]);return o}function Vd(e,t){return t?e?zo(e,t):t:e}function Jt(e,t){return t?e?zo(e,t):t:e}function oe(e,t){let{chain:o,address:n,stats:s,marketData:r,socialMedias:i,security:a,launchedFrom:d,migratedTo:l,...c}=t,u={...e};for(let m of Object.keys(c))c[m]!==void 0&&(u[m]=c[m]);return u.stats=Wd(e.stats,s),u.marketData=Vd(e.marketData,r),u.socialMedias=Jt(e.socialMedias,i),u.security=Jt(e.security,a),u.launchedFrom=Jt(e.launchedFrom,d),u.migratedTo=Jt(e.migratedTo,l),u}function Yt(e,t){let o=new Map(e.map(n=>[n.address,n]));return t.map(n=>{let s=o.get(n.address);return s?oe(s,n):n})}function Kd(e){return e.chain!==void 0&&e.address!==void 0&&e.address!==""&&e.name!==void 0&&e.symbol!==void 0&&e.decimals!==void 0}function He(e,t){if(t.length===0)return e;let o=[...e],n=false;for(let s of t){let r=o.findIndex(i=>i.address===s.address);if(r>=0){o[r]=oe(o[r],s),n=true;continue}Kd(s)&&(o.push(s),n=true);}return n?o:e}var qd=["24h","12h","30m","15m","30s","15s","1m","5m","1h","4h","1s"],$d=new Set(["price","marketCap","athMarketCap","tvl","holders","top10Holdings","top10Ratio","top100Holdings","top100Ratio","creatorsHoldings","creatorsRatio","createdAt","launchedFromProtocolFamily","migratedToProtocolFamily","tag"]),zd=new Set(["priceChange","volumes","trades","traders","buys","sells"]);function J(e){if(e==null||e==="")return;let t=Number(e);return Number.isFinite(t)?t:void 0}function xr(e){for(let t of qd){if(!e.endsWith(t))continue;let o=e.slice(0,-t.length);return o?{metric:o,resolution:t}:void 0}}function Tr(e){if($d.has(e))return true;let t=xr(e);return t?zd.has(t.metric):false}function Zt(e,t){switch(t){case "price":return J(e.marketData?.priceInUsd);case "marketCap":return J(e.marketData?.marketCapInUsd);case "athMarketCap":return J(e.marketData?.athMarketCapInUsd);case "tvl":return J(e.marketData?.tvlInUsd);case "holders":return J(e.marketData?.holders);case "top10Holdings":return J(e.marketData?.top10Holdings);case "top10Ratio":return J(e.marketData?.top10HoldingsRatio);case "top100Holdings":return J(e.marketData?.top100Holdings);case "top100Ratio":return J(e.marketData?.top100HoldingsRatio);case "creatorsHoldings":return J(e.marketData?.devHoldings);case "creatorsRatio":return J(e.marketData?.devHoldingsRatio);case "createdAt":return e.createdAt?.getTime();case "launchedFromProtocolFamily":return kr(e,e.launchedFrom?.protocolFamily);case "migratedToProtocolFamily":return kr(e,e.migratedTo?.protocolFamily);case "tag":return e.tags?.[0];}let o=xr(t);if(!o)return;let n=e.stats,s=n&&o.resolution in n?n[o.resolution]:void 0;switch(o.metric){case "priceChange":return J(s?.priceChange);case "volumes":return J(s?.volumesInUsd);case "trades":return J(s?.trades);case "traders":return J(s?.traders);case "buys":return J(s?.buys);case "sells":return J(s?.sells);default:return}}function kr(e,t){if(t)return parseTokenProtocolFamily(e.chain,t)??t}var Qd=new Set(["top10Ratio","top100Ratio","creatorsRatio"]);function hr(e){let t=e.trim().toLowerCase();return t.length>0?t:void 0}function Gd(e){return [e.name,e.symbol].filter(Boolean).join(" ").toLowerCase()}function Xd(e){return Array.isArray(e)?e:void 0}function Jd(e){return Array.isArray(e)?void 0:e}function yr(e,t){if(!Qd.has(e))return t;let o=Number(t);return Number.isFinite(o)?o/100:t}function ye(e,t){let o=Jd(t);return o===void 0?void 0:yr(e,o)}function Qo(e,t){return Xd(t)?.map(o=>yr(e,o))}function et(e,t){if(typeof e=="number"){let o=Number(t);return Number.isFinite(o)?e-o:void 0}if(typeof e=="string")return e.localeCompare(String(t))}function jt(e,t){if(typeof e=="number"){let o=Number(t);return Number.isFinite(o)&&e===o}return String(e)===String(t)}function Yd(e,t){if(!Tr(t.field))return false;let o=Zt(e,t.field),n=o===void 0;if(t.operator==="isNull")return n;if(t.operator==="isNotNull")return !n;if(n)return false;switch(t.operator){case "eq":{let s=ye(t.field,t.value);return s!==void 0&&jt(o,s)}case "ne":{let s=ye(t.field,t.value);return s!==void 0&&!jt(o,s)}case "gt":{let s=ye(t.field,t.value),r=s!==void 0?et(o,s):void 0;return r!==void 0&&r>0}case "gte":{let s=ye(t.field,t.value),r=s!==void 0?et(o,s):void 0;return r!==void 0&&r>=0}case "lt":{let s=ye(t.field,t.value),r=s!==void 0?et(o,s):void 0;return r!==void 0&&r<0}case "lte":{let s=ye(t.field,t.value),r=s!==void 0?et(o,s):void 0;return r!==void 0&&r<=0}case "between":{let s=Qo(t.field,t.value);if(!s||s.length<2)return false;let r=et(o,s[0]),i=et(o,s[1]);return r!==void 0&&i!==void 0&&r>=0&&i<=0}case "in":{let s=Qo(t.field,t.value);return s?s.some(r=>jt(o,r)):false}case "nin":{let s=Qo(t.field,t.value);return s?s.every(r=>!jt(o,r)):false}case "contains":{let s=ye(t.field,t.value);return s!==void 0&&String(o).includes(String(s))}case "notContains":{let s=ye(t.field,t.value);return s!==void 0&&!String(o).includes(String(s))}case "startsWith":{let s=ye(t.field,t.value);return s!==void 0&&String(o).startsWith(String(s))}case "endsWith":{let s=ye(t.field,t.value);return s!==void 0&&String(o).endsWith(String(s))}default:return false}}function ce(e,t){let o=t?.keywords?.map(hr).filter(r=>r!==void 0),n=t?.excludeKeywords?.map(hr).filter(r=>r!==void 0),s=t?.filters;return !o?.length&&!n?.length&&!s?.length?e:e.filter(r=>{let i=Gd(r);return !(o?.length&&!o.some(a=>i.includes(a))||n?.length&&n.some(a=>i.includes(a))||s?.length&&!s.every(a=>Yd(r,a)))})}function me({applyUpdates:e,paused:t=false,flushInterval:o=500}){let n=useRef(e),s=useRef(t),r=useRef([]),i=useRef(void 0),a=useRef(void 0);n.current=e,s.current=t;let d=useCallback(()=>{i.current!==void 0&&(clearTimeout(i.current),i.current=void 0),a.current!==void 0&&(cancelAnimationFrame(a.current),a.current=void 0);},[]),l=useCallback(()=>{if(d(),s.current){i.current=setTimeout(l,o);return}let m=r.current;m.length!==0&&(r.current=[],n.current(m));},[d,o]),c=useCallback(()=>{i.current!==void 0||a.current!==void 0||(i.current=setTimeout(()=>{i.current=void 0,a.current=requestAnimationFrame(()=>{a.current=void 0,l();});},o));},[l,o]),u=useCallback(m=>{m.length!==0&&(r.current.push(...m),c());},[c]);return useEffect(()=>{t||l();},[l,t]),useEffect(()=>d,[d]),{enqueueUpdates:u,flush:l}}function Cr({chain:e,tokens:t,onUpdate:o,enabled:n=true}){let s=useTokenMarketRuntime(),r=useRef(new Map),i=useRef(o);i.current=o;let a=useMemo(()=>Array.from(new Set(t.map(c=>c.address.trim()).filter(Boolean))).sort().join(","),[t]),d=useMemo(()=>a?a.split(","):[],[a]),l=()=>{r.current.forEach(c=>c()),r.current.clear();};useEffect(()=>l,[e,s,n]),useEffect(()=>{if(!n){l();return}let c=new Set(d),u=r.current;for(let[m,p]of u)c.has(m)||(p(),u.delete(m));for(let m of d){if(u.has(m))continue;let p=tokenMarketKey(e,m),g=s.subscribe(p,k=>{k.token&&i.current([k.token]);}),f=s.retain(p);u.set(m,()=>{g(),f();});}},[d,e,n,s]);}var nc=80;function Ir(e){return {chain:e.chain,address:e.address,name:e.name??"",symbol:e.symbol??"",decimals:e.decimals??0,image:e.image,description:e.description,socialMedias:e.socialMedias,launchedFrom:e.launchedFrom,migratedTo:e.migratedTo,createdAt:e.createdAt}}function rc(e,t,o){return e===t?o:e===o?t:o||t}function Xo(e){let t=e.token?.address??e.tokenAAddress??"",o=e.token;return {...o,chain:e.chain,address:t,name:o?.name??"",symbol:o?.symbol??"",decimals:o?.decimals??0,createdAt:o?.createdAt??e.createdAt,liquidities:[{poolAddress:e.poolAddress,pairAddress:rc(t,e.tokenAAddress,e.tokenBAddress),image:e.dex?.image,programAddress:e.dex?.programAddress,protocolFamily:e.dex?.protocolFamily,protocolName:e.dex?.protocolName}]}}function sc(e){return {...Ir(Xo(e)),...e.token??{},liquidities:Xo(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function Ar(e){return e.sort((t,o)=>{let n=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-n}),e.slice(0,nc)}function Mr({chain:e,filters:t,isPaused:o=false,deferUpdates:n=false,updateFlushInterval:s}){let r=useMemo(()=>({chain:e}),[e]),i=useRef(o);i.current=o;let a=useRef(e),[d,l]=useState(true),[c,u]=useState([]);useEffect(()=>{e!==a.current&&(l(true),u([]),a.current=e);},[e]);let{data:m,isPending:p}=useNewPoolsQuery(r);useEffect(()=>{m&&(u(T=>{let S=i.current,h=T.length===0&&m.length>0,b=[...T];for(let w of m){let v=sc(w),N=b.findIndex(F=>F.address===v.address);N>=0?b[N]=oe(b[N],v):(!S||h)&&b.push(v);}return S?b:Ar(b)}),l(false));},[m]);let g=useCallback(T=>{u(S=>{let h=i.current,b=[...S],w=false;for(let v of T){let N=b.findIndex(F=>F.address===v.address);N>=0?(w=true,b[N]=oe(b[N],v)):h||(w=true,b.push(Ir(v)));}return w?h?b:Ar(b):S});},[]),{enqueueUpdates:f}=me({applyUpdates:g,paused:n,flushInterval:s}),k=useCallback(T=>{f(T.map(Xo));},[f]);useNewPoolsSubscription({chain:e},k),useNewTokensMetadataSubscription({chain:e},f),Cr({chain:e,tokens:c,onUpdate:f});let x=useMemo(()=>p||d,[p,d]);return {tokens:useMemo(()=>ce(c,t),[c,t]),isLoading:x}}function Eh({chain:e,filters:t,title:o,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,className:i,hideHeader:a}){let[d,l]=useState(false),[c,u]=useState(false),{tokens:m,isLoading:p}=Mr({chain:e,filters:t,isPaused:d,deferUpdates:c}),g=useCallback(f=>{l(f);},[]);return jsx(je,{title:o,tokens:m,isLoading:p,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,onPauseChange:g,onScrollingChange:u,className:i,hideHeader:a})}function be({chain:e,tokens:t,onUpdate:o,enabled:n=true}){let s=useTokenMarketRuntime(),r=useRef(new Map),i=useRef(o);i.current=o;let a=useMemo(()=>Array.from(new Set(t.map(c=>c.address.trim()).filter(Boolean))).sort().join(","),[t]),d=useMemo(()=>a?a.split(","):[],[a]),l=()=>{r.current.forEach(c=>c()),r.current.clear();};useEffect(()=>l,[e,s,n]),useEffect(()=>{if(!n){l();return}let c=new Set(d),u=r.current;for(let[m,p]of u)c.has(m)||(p(),u.delete(m));for(let m of d){if(u.has(m))continue;let p=tokenMarketKey(e,m),g=s.subscribe(p,k=>{k.token&&i.current([k.token]);}),f=s.retain(p);u.set(m,()=>{g(),f();});}},[d,e,n,s]);}function Wr({chain:e,filters:t,isPaused:o=false,refetchInterval:n=3e4,deferUpdates:s=false,updateFlushInterval:r}){let i=useMemo(()=>({chain:e}),[e]),a=useRef(o);a.current=o;let d=useRef(e),[l,c]=useState(true),[u,m]=useState([]);useEffect(()=>{e!==d.current&&(c(true),m([]),d.current=e);},[e]);let{data:p,isPending:g}=useMigratedTokensQuery(i,{refetchInterval:n});useEffect(()=>{p&&(m(T=>{let S=a.current,h=[...T];for(let b of p){let w=h.findIndex(v=>v.address===b.address);w>=0?h[w]=oe(h[w],b):S||h.unshift(b);}return h}),c(false));},[p]);let f=useCallback(T=>{m(S=>He(S,T));},[]),{enqueueUpdates:k}=me({applyUpdates:f,paused:s,flushInterval:r});be({chain:e,tokens:u,onUpdate:k});let x=useMemo(()=>g||l,[g,l]);return {tokens:useMemo(()=>ce(u,t),[u,t]),isLoading:x}}function ty({chain:e,filters:t,title:o,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,className:i,hideHeader:a}){let[d,l]=useState(false),[c,u]=useState(false),{tokens:m,isLoading:p}=Wr({chain:e,filters:t,isPaused:d,deferUpdates:c}),g=useCallback(f=>{l(f);},[]);return jsx(je,{title:o,tokens:m,isLoading:p,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,onPauseChange:g,onScrollingChange:u,className:i,hideHeader:a})}function kc(e){return e.sort((t,o)=>{let n=Number(t.migrateProgress??0);return Number(o.migrateProgress??0)-n})}function $r({chain:e,filters:t,isPaused:o=false,refetchInterval:n=15e3,deferUpdates:s=false,updateFlushInterval:r}){let i=useMemo(()=>({chain:e}),[e]),a=useRef(o);a.current=o;let d=useRef(e),[l,c]=useState(true),[u,m]=useState([]);useEffect(()=>{e!==d.current&&(c(true),m([]),d.current=e);},[e]);let{data:p,isPending:g}=useFinalStretchTokensQuery(i,{refetchInterval:n});useEffect(()=>{p&&(m(T=>{let S=a.current,h=T.length===0&&p.length>0,b=[...T];for(let w of p){let v=b.findIndex(N=>N.address===w.address);v>=0?b[v]=oe(b[v],w):(!S||h)&&b.push(w);}return S?b:kc(b)}),c(false));},[p]);let f=useCallback(T=>{m(S=>He(S,T));},[]),{enqueueUpdates:k}=me({applyUpdates:f,paused:s,flushInterval:r});be({chain:e,tokens:u,onUpdate:k});let x=useMemo(()=>g||l,[g,l]);return {tokens:useMemo(()=>ce(u,t),[u,t]),isLoading:x}}function gy({chain:e,filters:t,title:o,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,className:i,hideHeader:a}){let[d,l]=useState(false),[c,u]=useState(false),{tokens:m,isLoading:p}=$r({chain:e,filters:t,isPaused:d,deferUpdates:c}),g=useCallback(f=>{l(f);},[]);return jsx(je,{title:o,tokens:m,isLoading:p,renderHeaderExtra:n,renderItemAction:s,onSelectToken:r,onPauseChange:g,onScrollingChange:u,className:i,hideHeader:a})}var Nc=10,Cc="liberfi:search_histories";function bt(){return createBrowserSearchHistoryStorage({key:Cc,fallback:createMemorySearchHistoryStorage()})}function wc(e,t){return e.length===t.length&&e.every((o,n)=>o===t[n])}function Gr(){let e=useMemo(()=>bt(),[]),t=useRef(e.read()),o=()=>{let i=e.read();return wc(t.current,i)?t.current:(t.current=i,i)},n=useSyncExternalStore(e.subscribe,o,o),s=useCallback(i=>{let a=i.trim();if(!a)return;let d=e.read().filter(l=>l!==a);e.write([a,...d].slice(0,Nc));},[e]),r=useCallback(()=>{e.clear();},[e]);return {histories:n,addHistory:s,clearHistories:r}}function Yr({histories:e,onSelect:t,onClear:o,className:n}){let{t:s}=useTranslation();return e.length===0?null:jsxs("div",{className:cn("px-4 pb-4",n),children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"text-sm font-medium",children:s("tokens.search.history")}),jsx(Button,{isIconOnly:true,size:"sm",className:"bg-transparent min-w-6 w-6 h-6 text-text-muted",onPress:o,children:jsx(TrashIcon,{width:20,height:20})})]}),jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:e.map(r=>jsx(Chip,{size:"sm",variant:"bordered",className:cn("text-text-muted","border-border border-1","cursor-pointer","hover:opacity-hover"),onClick:()=>t?.(r),children:jsx("span",{children:r})},r))})]})}function Zr({onSelect:e,histories:t,onClear:o,className:n}){let s=Gr(),r=t?[...t]:s.histories,i=o??s.clearHistories;return jsx(Yr,{className:cn(n),histories:r,onSelect:e,onClear:i})}var Bc=["ArrowDown","ArrowUp","Enter","Escape"];function Wc(e){return Bc.includes(e)}function jr({value:e,onValueChange:t,onClear:o,onEscape:n,onNavigateKey:s,className:r}){let{t:i}=useTranslation();return jsx("div",{className:r,children:jsx(StyledInput,{autoFocus:true,variant:"bordered",radius:"full",value:e,onValueChange:t,onKeyDown:a=>{Wc(a.key)&&(a.key!=="Escape"&&a.preventDefault(),s?.(a.key));},placeholder:i("tokens.search.placeholder"),classNames:{inputWrapper:["!bg-surface-strong/60","!border-border-control/50","data-[hover=true]:!bg-surface-strong","group-data-[focus=true]:!bg-surface-strong","group-data-[focus=true]:!border-border-control/80"].join(" ")},startContent:jsx(SearchIcon,{width:20,height:20,className:"text-text-muted"}),endContent:e?jsx(Button,{isIconOnly:true,className:"bg-transparent min-w-6 w-6 h-6 text-text-muted",onPress:o,children:jsx(XCloseIcon,{width:20,height:20})}):jsx(Kbd,{className:"min-w-8 justify-center text-xs text-text-muted bg-transparent border border-border-control/50 rounded-full cursor-pointer select-none",onMouseDown:a=>{a.preventDefault(),n?.();},children:"ESC"})})})}function to({token:e,highlighted:t=false,className:o}){let{t:n}=useTranslation(),{formatAge:s}=useLocalizedTimeFormatter(),r=useTickAge(e.createdAt),i=useMemo(()=>e.marketData?.priceInUsd,[e]),a=useMemo(()=>e.marketData?.marketCapInUsd,[e]),d=useMemo(()=>e.marketData?.tvlInUsd,[e]),l=useMemo(()=>e.stats?.["24h"]?.priceChange,[e]),c=useMemo(()=>l?new SafeBigNumber(l).abs().toString():void 0,[l]),u=useMemo(()=>l!=null&&new SafeBigNumber(l).gte(0),[l]);return jsxs("div",{className:cn("w-full h-full px-3 flex items-center justify-between gap-2","hover:cursor-pointer hover:bg-content2 rounded-lg",t&&"bg-content2",o),"data-highlighted":t?"true":"false","aria-selected":t,children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2.5",children:[jsx(he,{token:e,className:"w-10 h-10 flex-none",showProtocolFamily:true,classNames:{searchIcon:"w-5 h-5"}}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"font-medium text-sm truncate",children:e.symbol}),jsx("span",{className:"text-xs text-primary font-medium",children:s(r)})]}),jsxs("div",{className:"flex items-center gap-1 text-xs text-text-muted",children:[jsxs("span",{children:[n("tokens.listHeader.mcShort")," ",formatMCapInUsd(a)]}),jsx("span",{children:"/"}),jsxs("span",{children:[n("tokens.listHeader.liqShort")," ",formatAmountInUsd(d)]})]})]})]}),jsxs("div",{className:"flex-none w-20 flex flex-col items-end",children:[jsx("span",{className:"text-xs",children:formatPriceInUsd(i)}),jsxs("span",{className:cn("inline-flex gap-0.5 items-center text-xs",u?"text-positive":"text-negative"),children:[u?jsx(TriangleUpIcon,{width:8,height:8}):jsx(TriangleDownIcon,{width:8,height:8}),jsx("span",{children:formatPercent(c)})]})]})]})}function oo({className:e}){let{t}=useTranslation();return jsxs("div",{className:cn("h-9 px-3 flex items-center justify-between","text-xs font-medium text-text-muted","sticky top-0 z-10",e),children:[jsx("div",{className:"flex-1",children:jsxs("span",{children:[t("tokens.listHeader.token")," / ",t("tokens.listHeader.age")," /"," ",t("tokens.listHeader.marketCap")," /"," ",t("tokens.listHeader.liquidity")]})}),jsx("div",{className:"flex-none w-20 text-right",children:jsxs("span",{children:[t("tokens.listHeader.price")," / ",t("tokens.listHeader.24hChange")]})})]})}function jc(){return jsxs("div",{className:"w-full h-14 px-3 flex items-center justify-between gap-2",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[jsx(Skeleton,{className:"flex-none w-8 h-8 rounded-full"}),jsxs("div",{className:"flex flex-col gap-1.5",children:[jsx(Skeleton,{className:"w-24 h-4 rounded-md"}),jsx(Skeleton,{className:"w-36 h-3 rounded-md"})]})]}),jsxs("div",{className:"flex-none w-20 flex flex-col items-end gap-1.5",children:[jsx(Skeleton,{className:"w-14 h-4 rounded-md"}),jsx(Skeleton,{className:"w-10 h-3 rounded-md"})]})]})}function ro({rows:e=6,className:t}){return jsx("div",{className:cn("w-full",t),children:Array.from({length:e}).map((o,n)=>jsx(jc,{},n))})}function rs({keyword:e,chains:t,limit:o=50}){let n=useMemo(()=>({keyword:e,chains:t,limit:o}),[e,t,o]),{data:s,isLoading:r,isFetchingNextPage:i,hasNextPage:a,fetchNextPage:d}=useSearchTokensInfiniteQuery(n,{enabled:!!e}),l=useMemo(()=>s?.pages.flatMap(c=>c.data)??[],[s]);return {tokens:l,items:l,isLoading:r,isFetchingNextPage:i,hasNextPage:a??false,fetchNextPage:d}}var cm=56;function as({onSelectToken:e,className:t,navigationRef:o,onEscape:n,...s}){let{tokens:r,isLoading:i,isFetchingNextPage:a,hasNextPage:d,fetchNextPage:l}=rs(s),c=useRef(null),{height:u}=useResizeObserver({ref:c}),m=useCallback(y=>y<r.length,[r]),p=useCallback(async()=>{d&&!a&&await l();},[d,a,l]),g=useMemo(()=>d?r.length+1:r.length,[r,d]),f=useInfiniteLoader({isRowLoaded:m,loadMoreRows:p,rowCount:g,threshold:5}),k=i?0:r.length,x=useSearchKeyboardNavigation({itemCount:k,hasNextPage:d&&!i,isFetchingNextPage:a,onSelectIndex:y=>{let T=r[y];T&&e?.(T);},onRequestNextPage:()=>{d&&!a&&l();},onEscape:()=>n?.()});return o&&(o.current=x),useEffect(()=>()=>{o&&o.current===x&&(o.current=null);},[x,o]),useEffect(()=>{x.reset();},[s.keyword,x]),i?jsxs("div",{className:cn("w-full",t),children:[jsx(oo,{}),jsx(ro,{})]}):r.length===0?jsxs("div",{className:cn("w-full",t),children:[jsx(oo,{}),jsx(um,{})]}):jsxs("div",{className:cn("w-full h-full flex flex-col",t),children:[jsx(oo,{className:"flex-none"}),jsx("div",{className:"flex-auto min-h-0",ref:c,children:jsx(List,{style:{height:u},onRowsRendered:f,rowComponent:mm,rowCount:g,rowHeight:cm,rowProps:{tokens:r,onSelectToken:e,highlightedIndex:x.highlightedIndex},overscanCount:5})})]})}function mm({index:e,style:t,tokens:o,onSelectToken:n,highlightedIndex:s}){let r=o[e];return r?jsx("div",{style:t,"data-index":e,onClick:()=>n?.(r),children:jsx(to,{token:r,highlighted:s===e})}):jsx("div",{style:t,className:"flex items-center justify-center",children:jsx(Spinner,{size:"sm"})})}function um(){let{t:e}=useTranslation();return jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[jsx(EmptyIcon,{width:28,height:28,className:"text-text-muted"}),jsx("p",{className:"mt-2 text-sm text-text-muted",children:e("tokens.search.noResults")})]})}function pm(e,t){return typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t))}function rt(e,t){let o=Object.keys(t??{})[0];if(!o)return e;let n=t?.[o];if(n!=="asc"&&n!=="desc")return e;let s=e.map((r,i)=>({token:r,index:i,value:Zt(r,o)}));return s.every(({value:r})=>r===void 0)?e:s.sort((r,i)=>{let a=r.value===void 0,d=i.value===void 0;if(a&&d)return r.index-i.index;if(a)return 1;if(d)return -1;let l=pm(r.value,i.value);return l===0?r.index-i.index:n==="asc"?l:-l}).map(({token:r})=>r)}function ao({chain:e,resolution:t,filters:o,sortDirections:n,subscriptionTokens:s=[],refetchInterval:r=3e4,deferUpdates:i=false,updateFlushInterval:a}){let d=useMemo(()=>({chain:e,resolution:t}),[e,t]),l=useRef(d),[c,u]=useState(true);useEffect(()=>{JSON.stringify(d)!==JSON.stringify(l.current)&&(u(true),p([]),l.current=d);},[d]);let[m,p]=useState([]),{data:g,isPending:f}=useTrendingTokensQuery(d,{refetchInterval:r});useEffect(()=>{g&&(p(h=>Yt(h,g)),u(false));},[g]);let k=useCallback(h=>{p(b=>He(b,h));},[]),{enqueueUpdates:x}=me({applyUpdates:k,paused:i,flushInterval:a});useTrendingTokensSubscription({chain:e},x),be({chain:e,tokens:s.filter(h=>h.chain===e),onUpdate:x});let y=useMemo(()=>!!(f||c),[f,c]),T=useMemo(()=>ce(m,o),[m,o]);return {tokens:useMemo(()=>rt(T,n),[T,n]),isLoading:y}}var ym=Chain.ETHEREUM,bm="24h",vm=56;function cs({chains:e,onSelectToken:t,className:o}){let n=e?.length===1?e[0]:e?.[0]??ym,{tokens:s,isLoading:r}=ao({chain:n,resolution:bm});return jsx("div",{className:cn("w-full flex flex-col overflow-hidden",o),children:r?jsx(ro,{}):jsx("div",{className:"overflow-y-auto",children:s.map(i=>jsx("div",{style:{height:vm},onClick:()=>t?.(i),children:jsx(to,{token:i,className:"h-full"})},i.address))})})}function ps({chains:e,onKeywordChange:t,onSelectToken:o,onEscape:n}){let s=useMemo(()=>bt(),[]),r=useSearchController({storage:s,onQueryChange:t??ms,onDismiss:n??ms}),i=useRef(null),a=r.dismiss,d=useCallback(l=>{if(i.current){i.current.onKey(l);return}l==="Escape"&&a();},[a]);return jsxs("div",{className:"w-full h-full flex flex-col gap-3",children:[jsx(jr,{value:r.text,onValueChange:r.setText,onClear:r.clearQuery,onEscape:r.dismiss,onNavigateKey:d}),r.query?jsx(as,{className:"flex-auto min-h-0",keyword:r.query,chains:e,onSelectToken:o,navigationRef:i,onEscape:r.dismiss}):jsxs("div",{className:"flex-auto min-h-0 flex flex-col overflow-hidden",children:[jsx(Zr,{histories:r.history,onSelect:r.commitQuery,onClear:r.clearHistory}),jsx(cs,{className:"flex-auto min-h-0",chains:e,onSelectToken:o})]})]})}function ms(){}var en="search";function ov({id:e=en}){return jsx(AsyncModal,{id:e,children:t=>jsx(Om,{...t})})}function Om({params:e,isOpen:t,onOpenChange:o,onResult:n}){let{t:s}=useTranslation(),{isMobile:r}=useScreen(),i=useCallback(a=>{n(a);},[n]);return jsx(StyledModal,{isOpen:t,onOpenChange:o,size:r?"full":"lg",hideCloseButton:true,backdrop:"opaque",radius:"lg",children:jsxs(ModalContent,{className:"w-full h-full",style:{borderRadius:r?void 0:14,border:r?void 0:"1px solid var(--color-border-control)",background:"var(--color-surface-interactive)",boxShadow:r?void 0:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden"},children:[jsxs(ModalHeader,{className:"sm:hidden flex items-center justify-between pt-4 pb-2",children:[jsx("span",{className:"text-base font-semibold",children:s("tokens.search.title")}),jsx(Button,{isIconOnly:true,onPress:()=>o(false),size:"sm",className:"bg-transparent min-w-6 w-6 h-6",children:jsx(XCloseIcon,{width:20,height:20})})]}),jsx(ModalBody,{className:"p-4",children:jsx(ps,{chains:e?.chains,onSelectToken:i,onEscape:()=>o(false)})})]})})}function mv({chains:e,onSelectToken:t,className:o}){let{t:n}=useTranslation(),{isDesktop:s}=useScreen(),{onOpen:r,onClose:i}=useAsyncModal(en),a=useCallbackRef(t),d=useCallbackRef(async()=>{let c=await r({params:{chains:e}});c&&a(c);}),l=useCallbackRef(()=>{i();});return useEffect(()=>{let c=u=>{let m=document.activeElement,p=!!m&&(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.getAttribute("contenteditable")==="true");u.key==="/"&&!p&&(u.preventDefault(),d()),u.key==="Escape"&&(u.preventDefault(),l());};return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c);}},[d,l]),s?jsx(Button,{size:"sm",radius:"full",onPress:d,variant:"bordered",startContent:jsx(SearchIcon,{width:16,height:16,className:"text-foreground"}),endContent:jsx(Kbd,{className:"min-w-6 justify-center text-xs text-foreground bg-content3 rounded-lg",children:"/"}),className:cn("w-56 min-w-0 h-8 min-h-0 border-transparent hover:border-border bg-content2 pl-3 pr-1.5 text-text-muted",o),children:n("tokens.search.placeholder")}):jsx(Button,{size:"sm",radius:"full",isIconOnly:true,onPress:d,variant:"bordered",className:cn("w-8 min-w-0 h-8 min-h-0 border-1 border-border bg-content2",o),children:jsx(SearchIcon,{width:16,height:16,className:"text-foreground"})})}var Ts=()=>{};function xv({onKeywordChange:e}){let t=useMemo(()=>bt(),[]),o=useSearchController({storage:t,onQueryChange:e??Ts,onDismiss:Ts});return {text:o.text,keyword:o.query,setText:o.setText,setKeyword:o.commitQuery,clearKeyword:o.clearQuery}}function Ct(e){return e==null||e===""?"--":formatPercent(Number(e)/100)}function ve(e,t=4,o=4){return e?e.length<=t+o+1?e:`${e.slice(0,t)}\u2026${e.slice(-o)}`:"--"}function Ie(e,t,o=Date.now()){if(e==null)return "--";let n=typeof e=="string"||typeof e=="number"?new Date(e):e,s=typeof o=="number"?new Date(o):o;return t(Math.max(0,s.getTime()-n.getTime()))}function O(e,t){let{token:o,isLoading:n}=useTokenMarket({chain:e,address:t});return {token:o,isLoading:n}}function st({label:e,totalFormatted:t,buysFormatted:o,sellsFormatted:n,totalValue:s=0,buysValue:r=0,className:i}){let{t:a}=useTranslation(),d=new SafeBigNumber(s??0),l=new SafeBigNumber(r??0),c=d.eq(0)?0:l.div(d).times(100).toNumber();return jsxs("div",{className:cn("flex flex-col gap-1",i),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-xs text-text-muted",children:e}),jsx("span",{className:"text-xs text-foreground",children:t})]}),jsx(Progress,{size:"sm",value:c,classNames:{track:"bg-negative/40",indicator:"bg-positive"},"aria-label":a("tokens.tokenDetail.buyShare",{label:e})}),jsxs("div",{className:"flex justify-between gap-4 text-[10px]",children:[jsx("span",{className:"text-positive",children:a("tokens.tokenDetail.buys",{value:o})}),jsx("span",{className:"text-negative",children:a("tokens.tokenDetail.sells",{value:n})})]})]})}function ys({token:e,actions:t,dataStrip:o,className:n,onCopyAddress:s}){let r=e?.address;return jsxs("div",{className:cn("flex w-full flex-wrap items-center gap-4 px-4 py-3",n),children:[jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e&&jsx(he,{token:e,radius:"lg",className:"h-10 w-10"}),jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"truncate text-base font-semibold text-foreground",children:e?.symbol??"--"}),jsx("span",{className:"truncate text-xs text-text-muted",children:e?.name})]}),r&&jsxs("button",{type:"button",onClick:()=>s?.(r),className:"flex items-center gap-1 text-[11px] text-text-muted transition-colors hover:text-foreground",title:r,children:[ve(r,6,6),jsx(CopyIcon,{width:12,height:12})]})]})]}),o&&jsx("div",{className:"flex-1 min-w-0",children:o}),t&&jsx("div",{className:"ml-auto flex items-center gap-2",children:t})]})}function bs(e,t){return O(e,t)}function Ss({price:e,marketCap:t,volume:o,holdersCount:n,socialMedia:s,className:r}){return jsxs("div",{className:cn("flex flex-wrap items-center gap-x-6 gap-y-3",r),children:[e,jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-3",children:[t,o,n]}),jsx("div",{className:"ml-auto",children:s})]})}function sS(e,t){return O(e,t)}function Cs({holders:e,top10HoldingsRatio:t,top100HoldingsRatio:o,className:n}){let{t:s}=useTranslation();return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",n),children:[jsxs("div",{className:"text-xs font-medium text-text-muted",children:[jsx("span",{className:"text-foreground",children:e!=null?formatAmount(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Ct(t)}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Ct(o)})]}),jsx("div",{className:"text-[10px] text-text-muted",children:s("tokens.tokenDetail.holdersSummary")})]})}function ws(e,t){return O(e,t)}function Ls({chain:e,address:t,className:o}){let{token:n}=ws(e,t);return jsx(Cs,{holders:n?.marketData?.holders,top10HoldingsRatio:n?.marketData?.top10HoldingsRatio,top100HoldingsRatio:n?.marketData?.top100HoldingsRatio,className:o})}function Rs({marketCapInUsd:e,tvlInUsd:t,createdAt:o,className:n}){let{t:s}=useTranslation(),{formatAge:r}=useLocalizedTimeFormatter();return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",n),children:[jsxs("div",{className:"text-xs font-medium text-text-muted",children:[jsx("span",{className:"text-foreground",children:e?formatMCapInUsd(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:t?formatAmountInUsd(t):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Ie(o,r)})]}),jsx("div",{className:"text-[10px] text-text-muted",children:s("tokens.tokenDetail.marketCapSummary")})]})}function As(e,t){return O(e,t)}function Is({chain:e,address:t,className:o}){let{token:n}=As(e,t);return jsx(Rs,{marketCapInUsd:n?.marketData?.marketCapInUsd,tvlInUsd:n?.marketData?.tvlInUsd,createdAt:n?.createdAt,className:o})}function Ds({priceInUsd:e,price24hAgoInUsd:t,className:o}){let{t:n}=useTranslation(),{bearish:s,priceChange:r}=useMemo(()=>{if(!e||!t)return {bearish:false,priceChange:void 0};let i=new SafeBigNumber(e),a=new SafeBigNumber(t);return a.lte(0)?{bearish:false,priceChange:void 0}:{bearish:i.lt(a),priceChange:i.minus(a).div(a).abs().toNumber()}},[e,t]);return jsxs("div",{className:cn("group flex flex-col gap-1",o),"data-bearish":s,children:[jsx("div",{className:"text-base font-medium leading-none text-positive group-data-[bearish=true]:text-negative",children:e?formatPriceInUsd(e):"--"}),jsxs("div",{className:"flex items-center gap-2 text-[10px] leading-none",children:[jsx("span",{className:"text-text-muted",children:n("tokens.tokenDetail.change24h")}),jsx("span",{className:"text-positive group-data-[bearish=true]:text-negative",children:r!=null?formatPercent(r):"--"})]})]})}function Fs(e,t){return O(e,t)}function Us({chain:e,address:t,className:o}){let{token:n}=Fs(e,t);return jsx(Ds,{priceInUsd:n?.marketData?.priceInUsd,price24hAgoInUsd:n?.stats?.["24h"]?.openPriceInUsd,className:o})}function bu(e,t){switch(e){case "website":return jsx(WebsiteIcon,{width:t,height:t});case "twitter":return jsx(TwitterIcon,{width:t,height:t});case "telegram":return jsx(TelegramIcon,{width:t,height:t});case "discord":return jsx(DiscordIcon,{width:t,height:t});default:return jsx("span",{className:"text-[9px] font-medium uppercase",children:e.slice(0,2)})}}function Os({socials:e,className:t,iconSize:o=16}){if(!e)return null;let s=["website","twitter","telegram","discord","github","reddit","youtube","medium"].filter(r=>!!e[r]);return s.length===0?null:jsx("div",{className:cn("flex items-center gap-3",t),children:s.map(r=>jsx("a",{href:e[r],target:"_blank",rel:"noreferrer noopener",className:"flex items-center justify-center text-text-muted transition-colors hover:text-foreground",style:{width:o,height:o},children:bu(r,o)},r))})}function Es(e,t){return O(e,t)}function Bs({chain:e,address:t,className:o,iconSize:n}){let{token:s}=Es(e,t);return jsx(Os,{socials:s?.socialMedias,className:o,iconSize:n})}function Ks({volumesInUsd:e,trades:t,traders:o,className:n}){let{t:s}=useTranslation();return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",n),children:[jsxs("div",{className:"text-xs font-medium text-text-muted",children:[jsx("span",{className:"text-foreground",children:e?formatAmountInUsd(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:t!=null?formatAmount(t):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:o!=null?formatAmount(o):"--"})]}),jsx("div",{className:"text-[10px] text-text-muted",children:s("tokens.tokenDetail.volumeSummary")})]})}function _s(e,t){return O(e,t)}function qs({chain:e,address:t,className:o}){let{token:n}=_s(e,t),s=n?.stats?.["24h"];return jsx(Ks,{volumesInUsd:s?.volumesInUsd,trades:s?.trades,traders:s?.traders,className:o})}function $s({chain:e,address:t,className:o}){return jsx(Ss,{className:o,price:jsx(Us,{chain:e,address:t}),marketCap:jsx(Is,{chain:e,address:t}),volume:jsx(qs,{chain:e,address:t}),holdersCount:jsx(Ls,{chain:e,address:t}),socialMedia:jsx(Bs,{chain:e,address:t})})}function qN({chain:e,address:t,actions:o,dataStrip:n,className:s,onCopyAddress:r}){let{token:i}=bs(e,t);return jsx(ys,{token:i,actions:o,dataStrip:n===void 0?jsx($s,{chain:e,address:t}):n,className:s,onCopyAddress:r})}var Iu=["holdingUsd","lastActiveAt"];function Gs({holders:e,isLoading:t,sortBy:o,sortDirection:n,onSortByChange:s,onlyTracked:r=false,onOnlyTrackedChange:i,onLoadMore:a,hasMore:d,now:l=Date.now(),wellKnownAddresses:c,className:u,renderAddress:m}){let{t:p}=useTranslation(),g=r?e.filter(f=>f.tags&&f.tags.length>0):e;return jsxs("div",{className:cn("flex flex-col",u),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("span",{className:"text-xs font-medium text-text-muted",children:p("tokens.tokenDetail.holders.title")}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-text-muted",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:r,onChange:f=>i?.(f.target.checked)}),p("tokens.tokenDetail.filter.onlyTracked")]})]}),jsx("div",{className:"flex items-center gap-1",children:Iu.map(f=>jsx("button",{type:"button",onClick:()=>s(f,n??"desc"),className:cn("rounded px-2 py-1 text-[11px] transition-colors",o===f?"bg-default-100 text-foreground":"text-text-muted hover:text-foreground"),children:p(f==="holdingUsd"?"tokens.tokenDetail.columns.value":"tokens.tokenDetail.columns.lastActive")},f))})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[640px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[30%] px-3 py-2 text-left font-normal",children:p("tokens.tokenDetail.columns.wallet")}),jsx("th",{className:"w-[20%] px-3 py-2 text-left font-normal",children:p("tokens.tokenDetail.columns.tags")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:p("tokens.tokenDetail.columns.value")}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"%"}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:p("tokens.tokenDetail.columns.firstHeld")}),jsx("th",{className:"w-[13%] px-3 py-2 text-right font-normal",children:p("tokens.tokenDetail.columns.lastActive")})]})}),jsxs("tbody",{children:[g.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-text-muted",children:p("tokens.tokenDetail.holders.empty")})}),g.map(f=>jsx(Mu,{holder:f,now:l,wellKnownAddresses:c,renderAddress:m},f.address)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-text-muted",children:p("tokens.tokenDetail.loading")})})]})]})}),d&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:a,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:p("tokens.tokenDetail.loadMore")})})]})}function Mu({holder:e,now:t,wellKnownAddresses:o,renderAddress:n}){let{formatAge:s}=useLocalizedTimeFormatter(),r=o?.[e.address],i=useMemo(()=>n?n(e.address):r?jsx("span",{className:"rounded bg-default-100 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-text-muted",children:r}):jsx("span",{className:"font-mono text-[11px] text-text-muted",children:ve(e.address,6,6)}),[e.address,n,r]);return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:i}),jsx("td",{className:"px-3 py-2 align-middle",children:jsx(qt,{tags:e.tags,max:3})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:formatAmountInUsd(e.amountInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:Ct(e.ratio)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.startHoldingAt?Ie(e.startHoldingAt,s,t):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.lastActiveAt?Ie(e.lastActiveAt,s,t):"--"})]})}function Ys({chain:e,address:t,limit:o=50,initialSortBy:n,initialSortDirection:s}){let[r,i]=useState(n),[a,d]=useState(s),[l,c]=useState(void 0),[u,m]=useState([]),p=useCallback(()=>{c(void 0),m([]);},[]),g=useCallback((N,F)=>{N===r&&F===a||(i(N),d(F),p());},[p,r,a]),f=useCallback(N=>{g(N,a??"desc");},[g,a]),k=useCallback(N=>{N!==a&&(d(N),p());},[p,a]);useEffect(()=>{p();},[e,t,p]);let x=useMemo(()=>({chain:e,address:t,cursor:l,limit:o,sortBy:r,sortDirection:a}),[e,t,l,o,r,a]),{data:y,isPending:T,isFetching:S}=useTokenHoldersQuery(x);useEffect(()=>{y&&m(N=>l==null?[y]:N[N.length-1]?.endCursor===y.endCursor?N:[...N,y]);},[y,l]),useTokenSubscription({chain:e,address:t},()=>{});let h=useMemo(()=>u.flatMap(N=>N.data),[u]),b=u[u.length-1],w=!!(b?.hasNext&&b.endCursor),v=useCallback(()=>{!b?.endCursor||!b.hasNext||c(b.endCursor);},[b]);return {holders:h,isLoading:T||S,sortBy:r,sortDirection:a,setSortBy:f,setSort:g,setSortDirection:k,hasMore:w,loadMore:v}}function uC({chain:e,address:t,limit:o,initialSortBy:n,initialSortDirection:s,initialOnlyTracked:r=false,wellKnownAddresses:i,className:a,renderAddress:d}){let[l,c]=useState(r),{holders:u,isLoading:m,sortBy:p,sortDirection:g,setSort:f,hasMore:k,loadMore:x}=Ys({chain:e,address:t,limit:o,initialSortBy:n,initialSortDirection:s});return jsx(Gs,{holders:u,isLoading:m,sortBy:p,sortDirection:g,onSortByChange:f,onlyTracked:l,onOnlyTrackedChange:c,wellKnownAddresses:i,hasMore:k,onLoadMore:x,className:a,renderAddress:d})}var Vu=["timestamp","totalUsd"],Ku=["all","buy","sell"],_u=["all","dev","tracked","you"];function Zs({activities:e,isLoading:t,sortBy:o,sortDirection:n="desc",onSortByChange:s,typeFilter:r="all",onTypeFilterChange:i,traderFilter:a="all",onTraderFilterChange:d,youWalletAddress:l,currency:c="usd",onCurrencyChange:u,onLoadMore:m,hasMore:p,now:g=Date.now(),nativeDecimals:f=9,nativeSymbol:k="SOL",className:x,onRowClick:y}){let{t:T}=useTranslation(),S=$u(e,a,l);return jsxs("div",{className:cn("flex flex-col",x),children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-1",children:[Ku.map(h=>jsx("button",{type:"button",onClick:()=>i?.(h),className:cn("rounded px-2 py-1 text-[11px] transition-colors",r===h?"bg-default-100 text-foreground":"text-text-muted hover:text-foreground"),children:T(h==="all"?"tokens.tokenDetail.filter.all":h==="buy"?"tokens.tokenDetail.filter.buys":"tokens.tokenDetail.filter.sells")},h)),jsx("span",{className:"mx-1 h-3 w-px bg-default-200","aria-hidden":true}),_u.map(h=>{let b=a===h,w=h==="you"&&!l;return jsx("button",{type:"button",disabled:w,onClick:()=>d?.(h),className:cn("rounded px-2 py-1 text-[11px] transition-colors",b?"bg-default-100 text-foreground":"text-text-muted hover:text-foreground",w&&"cursor-not-allowed opacity-50"),children:T(`tokens.tokenDetail.filter.${h}`)},h)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(zu,{value:c,nativeSymbol:k,onChange:u}),jsx("div",{className:"flex items-center gap-1",children:Vu.map(h=>{let b=o===h,w=b&&n==="desc"?"asc":b&&n==="asc"?void 0:"desc",v=w?h:void 0;return jsx("button",{type:"button",onClick:()=>s(v,w),className:cn("rounded px-2 py-1 text-[11px] transition-colors",b?"bg-default-100 text-foreground":"text-text-muted hover:text-foreground"),children:T(h==="timestamp"?"tokens.tokenDetail.filter.latest":"tokens.tokenDetail.filter.topUsd")},h)})})]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[780px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[10%] px-3 py-2 text-left font-normal",children:T("tokens.tokenDetail.columns.side")}),jsx("th",{className:"w-[25%] px-3 py-2 text-left font-normal",children:T("tokens.tokenDetail.columns.trader")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.amount")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.usd")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.price")}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.gas")}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:T("tokens.tokenDetail.columns.age")})]})}),jsxs("tbody",{children:[S.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-8 text-center text-text-muted",children:T("tokens.tokenDetail.activities.empty")})}),S.map(h=>jsx(Gu,{activity:h,now:g,nativeDecimals:f,nativeSymbol:k,currency:c,onRowClick:y},h.txHash)),t&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-4 text-center text-text-muted",children:T("tokens.tokenDetail.loading")})})]})]})}),p&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:m,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:T("tokens.tokenDetail.loadMore")})})]})}function qu(e){return e.type==="buy"?e.to:e.type==="sell"?e.from:e.to}function $u(e,t,o){if(t==="all")return e;if(t==="you"){if(!o)return [];let s=o.toLowerCase();return e.filter(r=>r.walletAddress?.toLowerCase()===s)}if(t==="dev")return e.filter(s=>s.traderTags?.some(r=>r==="dev"));let n=new Set(["kol","smart","bluechip"]);return e.filter(s=>s.traderTags?.some(r=>n.has(r)))}function zu({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[22px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn("rounded px-2 transition-colors",e===s.k?"bg-default-200 text-foreground":"text-text-muted hover:text-foreground"),children:s.label},s.k))})}function Qu(e,t,o){if(!e)return "--";let n=Number(e)/Math.pow(10,t);return Number.isFinite(n)?`${formatAmount(n)} ${o}`:"--"}function Gu({activity:e,now:t,nativeDecimals:o,nativeSymbol:n,currency:s,onRowClick:r}){let{formatAge:i}=useLocalizedTimeFormatter(),a=qu(e),d=e.type==="buy"?"Buy":e.type==="sell"?"Sell":e.type.replace(/_/g," "),l=e.type==="buy"?"text-positive":e.type==="sell"?"text-negative":"text-text-muted";return jsxs("tr",{className:cn("border-b border-default-50 hover:bg-default-50/60",r&&"cursor-pointer"),onClick:r?()=>r(e):void 0,children:[jsx("td",{className:cn("px-3 py-2 align-middle font-medium capitalize",l),children:d}),jsx("td",{className:"px-3 py-2 align-middle",children:jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("span",{className:"font-mono text-[11px] text-text-muted",children:ve(e.walletAddress,6,6)}),jsx(tr,{tags:e.traderTags,max:2})]})}),jsxs("td",{className:"px-3 py-2 text-right align-middle",children:[formatAmount(a.amount)," ",a.symbol]}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:s==="native"&&a.amountInNative?`${formatAmount(a.amountInNative)} ${a.symbol}`:a.amountInUsd?formatAmountInUsd(a.amountInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:a.priceInUsd?`$${formatPrice(a.priceInUsd)}`:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:Qu(e.gasFee,o,n)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:Ie(e.time,i,t)})]})}var Xu=500;function ln({sortBy:e,sortDirection:t,typeFilter:o}){return {getKey:an,compare:(n,s)=>Zu(n,s,e,t),include:n=>Yu(n,o),merge:(n,s,r)=>r.incomingSource==="live"?{item:s,placement:"incoming"}:r.previousSource==="live"?{item:n,placement:"previous"}:{item:n,placement:"previous"},maxLiveItems:Xu}}function oi(e){return Object.freeze({cursor:null,generation:e,mode:"replace"})}function ni(e=ln({sortDirection:"desc",typeFilter:"all"})){let{snapshot:t}=createRealtimeCursorCollection(e);return {collection:t,request:oi(t.generation)}}function Rt(e,t,o){let{reduce:n}=createRealtimeCursorCollection(o);switch(t.type){case "reset":{let s=n(e.collection,{type:"reset"});return {collection:s,request:oi(s.generation)}}case "load-more":return Ju(e);case "live":return t.items.length===0?e:{collection:n(e.collection,{type:"live",items:t.items}),request:e.request};case "page":return t.request.mode==="append"&&t.nextCursor===e.collection.nextCursor?e:{collection:n(e.collection,{type:"page",mode:t.request.mode,generation:t.request.generation,items:t.items,nextCursor:t.nextCursor,hasNextPage:t.hasNextPage}),request:e.request};default:return t}}function Ju(e){let{collection:t,request:o}=e;return !t.hasNextPage||t.nextCursor==null||o.mode==="append"&&o.cursor===t.nextCursor&&o.generation===t.generation?e:{collection:t,request:Object.freeze({cursor:t.nextCursor,generation:t.generation,mode:"append"})}}function Yu(e,t){return t==="all"?true:e.type===t}function Zu(e,t,o,n){let r=(o??"timestamp")==="totalUsd"?sn(ei(e),ei(t)):sn(mo(e),mo(t)),i=js(r,n);if(i!==0)return i;let a=js(sn(mo(e),mo(t)),"desc");return a!==0?a:an(e).localeCompare(an(t))}function js(e,t){return t==="asc"?e:-e}function sn(e,t){return e<t?-1:e>t?1:0}function mo(e){let t=e.time instanceof Date?e.time.getTime():new Date(e.time).getTime();return Number.isFinite(t)?t:0}function ei(e){let t=e.type==="sell"?e.from:e.to,o=Number(t.amountInUsd);return Number.isFinite(o)?o:0}function an(e){return e.txHash}function ii({chain:e,address:t,limit:o=50,initialSortBy:n,initialSortDirection:s="desc",initialTypeFilter:r="all"}){let[i,a]=useState(n),[d,l]=useState(s),[c,u]=useState(r),m=useMemo(()=>ln({sortBy:i,sortDirection:d,typeFilter:c}),[i,d,c]),p=useRef(m);p.current=m;let[g,f]=useState(()=>ni(m)),k=useRef(true),x=useCallback(()=>{f(V=>Rt(V,{type:"reset"},p.current));},[]),y=useCallback((V,Te)=>{let G=Te??(V===i?d:"desc");V===i&&G===d||(a(V),l(G),x());},[i,d,x]),T=useCallback(V=>{V!==d&&(l(V),x());},[d,x]),S=useCallback(V=>{V!==c&&(u(V),x());},[c,x]);useEffect(()=>{if(k.current){k.current=false;return}x();},[e,t,x]);let h=c==="all"?void 0:c,{collection:b,request:w}=g,v=useMemo(()=>({chain:e,address:t,cursor:w.cursor??void 0,limit:o,sortBy:i,sortDirection:d,type:h}),[e,t,w,o,i,d,h]),{data:N,isPending:F,isFetching:fe}=useTokenActivitiesQuery(v);useEffect(()=>{N&&f(V=>Rt(V,{type:"page",request:w,items:N.data,nextCursor:N.endCursor??null,hasNextPage:!!N.hasNext},m));},[N,w,m]),useTokenActivitiesSubscription({chain:e,address:t},V=>{V?.length&&f(Te=>Rt(Te,{type:"live",items:V},m));});let Y=useMemo(()=>b.items.slice(),[b]),R=!!(b.hasNextPage&&b.nextCursor),ae=useCallback(()=>{f(V=>Rt(V,{type:"load-more"},m));},[m]);return {activities:Y,isLoading:F||fe,sortBy:i,sortDirection:d,setSortBy:y,setSortDirection:T,typeFilter:c,setTypeFilter:S,hasMore:R,loadMore:ae}}function FC({chain:e,address:t,limit:o,initialSortBy:n,initialSortDirection:s,initialTypeFilter:r,initialTraderFilter:i="all",initialCurrency:a="usd",youWalletAddress:d,nativeDecimals:l,nativeSymbol:c,className:u,onRowClick:m}){let[p,g]=useState(i),[f,k]=useState(a),{activities:x,isLoading:y,sortBy:T,sortDirection:S,setSortBy:h,typeFilter:b,setTypeFilter:w,hasMore:v,loadMore:N}=ii({chain:e,address:t,limit:o,initialSortBy:n,initialSortDirection:s,initialTypeFilter:r});return jsx(Zs,{activities:x,isLoading:y,sortBy:T,sortDirection:S,onSortByChange:h,typeFilter:b,onTypeFilterChange:w,traderFilter:p,onTraderFilterChange:g,youWalletAddress:d,currency:f,onCurrencyChange:k,hasMore:v,onLoadMore:N,className:u,nativeDecimals:l,nativeSymbol:c,onRowClick:m})}function li({stats:e,resolution:t,className:o}){let{t:n}=useTranslation(),s=e?.[t],r=s?.traders??0,i=s?.buyers??0,a=s?.sellers??0;return jsx(st,{className:o,label:n("tokens.listHeader.traders",{resolution:n(`common.resolution.${t}`)}),totalFormatted:formatAmount(r),buysFormatted:formatAmount(i),sellsFormatted:formatAmount(a),totalValue:r,buysValue:i})}function di(e,t){return O(e,t)}function YC({chain:e,address:t,resolution:o="24h",className:n}){let{token:s}=di(e,t);return jsx(li,{stats:s?.stats,resolution:o,className:n})}function ci({stats:e,resolution:t,className:o}){let{t:n}=useTranslation(),s=e?.[t],r=s?.trades??0,i=s?.buys??0,a=s?.sells??0;return jsx(st,{className:o,label:n("tokens.listHeader.txs",{resolution:n(`common.resolution.${t}`)}),totalFormatted:formatAmount(r),buysFormatted:formatAmount(i),sellsFormatted:formatAmount(a),totalValue:r,buysValue:i})}function mi(e,t){return O(e,t)}function p0({chain:e,address:t,resolution:o="24h",className:n}){let{token:s}=mi(e,t);return jsx(ci,{stats:s?.stats,resolution:o,className:n})}function ui({stats:e,resolution:t,className:o}){let{t:n}=useTranslation(),s=e?.[t],r=s?.volumesInUsd??"0",i=s?.buyVolumesInUsd??"0",a=s?.sellVolumesInUsd??"0";return jsx(st,{className:o,label:n("tokens.listHeader.volumes",{resolution:n(`common.resolution.${t}`)}),totalFormatted:formatAmountInUsd(r),buysFormatted:formatAmountInUsd(i),sellsFormatted:formatAmountInUsd(a),totalValue:r,buysValue:i})}function pi(e,t){return O(e,t)}function R0({chain:e,address:t,resolution:o="24h",className:n}){let{token:s}=pi(e,t);return jsx(ui,{stats:s?.stats,resolution:o,className:n})}function gi({security:e,externalUrl:t,externalLabel:o,className:n}){let{t:s}=useTranslation(),r=[{title:s("tokens.tokenDetail.security.transferFee"),value:e?.hasTransferFee,safeWhen:false,description:s("tokens.tokenDetail.security.transferFeeDescription")},{title:s("tokens.tokenDetail.security.feeNotUpgradable"),value:e?.isTransferFeeUpgradable,safeWhen:false,description:s("tokens.tokenDetail.security.feeNotUpgradableDescription")},{title:s("tokens.tokenDetail.security.transferable"),value:e?.isTransferable,safeWhen:true,description:s("tokens.tokenDetail.security.transferableDescription")},{title:s("tokens.tokenDetail.security.notFreezable"),value:e?.isFreezable,safeWhen:false,description:s("tokens.tokenDetail.security.notFreezableDescription")},{title:s("tokens.tokenDetail.security.notClosable"),value:e?.isClosable,safeWhen:false,description:s("tokens.tokenDetail.security.notClosableDescription")}],i=r.every(a=>a.value!==void 0&&a.value===a.safeWhen);return jsxs("section",{className:cn("flex w-full flex-col gap-3",n),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-sm font-medium text-foreground",children:s("tokens.tokenDetail.security.title")}),jsx("span",{className:cn("text-xs",e===void 0?"text-text-muted":i?"text-success-500":"text-danger-500"),children:e===void 0?"--":s(i?"tokens.tokenDetail.security.safe":"tokens.tokenDetail.security.review")})]}),jsx("div",{className:"flex flex-col",children:r.map(a=>jsx(mp,{...a},a.title))}),t&&o&&jsx("div",{className:"flex justify-center",children:jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-text-muted transition-colors hover:text-foreground",children:o})})]})}function mp({title:e,value:t,safeWhen:o,description:n}){let{t:s}=useTranslation(),r=t!==void 0&&t===o,i=t===void 0?"--":s(r?"tokens.tokenDetail.security.ok":"tokens.tokenDetail.security.risk");return jsxs("div",{className:"flex h-8 items-center justify-between gap-2",children:[jsx("span",{className:"text-xs text-text-muted",title:n,children:e}),jsx("span",{className:cn("text-xs",t===void 0?"text-text-muted":r?"text-success-500":"text-danger-500"),children:i})]})}function ki(e,t){let{data:o,isLoading:n}=useTokenSecurityQuery({chain:e,address:t});return {security:o,isLoading:n}}function q0({chain:e,address:t,externalUrl:o,externalLabel:n,className:s}){let{security:r}=ki(e,t);return jsx(gi,{security:r,externalUrl:o,externalLabel:n,className:s})}function xi({token:e,className:t}){let{t:o}=useTranslation();return e?jsxs("section",{className:cn("flex w-full flex-col gap-2",t),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:o("tokens.tokenDetail.about",{symbol:e.symbol})}),e.description?jsx("p",{className:"whitespace-pre-line text-xs text-text-muted",children:e.description}):jsx("p",{className:"text-xs text-text-muted",children:o("tokens.tokenDetail.noDescription")})]}):null}function Ti(e,t){return O(e,t)}function sw({chain:e,address:t,className:o}){let{token:n}=Ti(e,t);return jsx(xi,{token:n,className:o})}function bi({liquidities:e,totalTvlInUsd:t,collapseAt:o=3,className:n,onPoolClick:s}){let{t:r}=useTranslation(),[i,a]=useState(!e||e.length<=o),d=useCallback(()=>a(l=>!l),[]);return jsxs("section",{className:cn("flex w-full flex-col gap-3",n),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-sm font-medium text-foreground",children:r("tokens.tokenDetail.liquidity")}),t&&jsx("span",{className:"text-xs text-foreground",children:formatAmountInUsd(t)})]}),(!e||e.length===0)&&jsx("div",{className:"py-4 text-center text-xs text-text-muted",children:r("tokens.tokenDetail.noPools")}),e&&e.length>0&&jsxs("div",{className:"flex flex-col gap-2",children:[e.map((l,c)=>jsxs("div",{className:cn("flex h-10 w-full items-center justify-between overflow-hidden text-xs",c>=o&&!i&&"hidden",s&&"cursor-pointer hover:bg-default-50"),onClick:s?()=>s(l):void 0,children:[jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("span",{className:"text-foreground",children:l.protocolFamily??l.protocolName??r("tokens.tokenDetail.unknownProtocol")}),l.poolAddress&&jsx("span",{className:"font-mono text-[10px] text-text-muted",children:r("tokens.tokenDetail.poolAddress",{address:ve(l.poolAddress,6,6)})})]}),jsx("div",{className:"text-text-muted",children:formatAmountInUsd(l.tvlInUsd??0)})]},l.poolAddress??`${l.protocolFamily}-${c}`)),e.length>o&&jsx("div",{className:"flex justify-center pt-1",children:jsx("button",{type:"button",onClick:d,className:"rounded px-2 py-1 text-xs text-text-muted transition-colors hover:text-foreground",children:r(i?"tokens.tokenDetail.showLess":"tokens.tokenDetail.showMore")})})]})]})}function vi(e,t){return O(e,t)}function Sw({chain:e,address:t,collapseAt:o,className:n,onPoolClick:s}){let{token:r}=vi(e,t);return jsx(bi,{liquidities:r?.liquidities,totalTvlInUsd:r?.marketData?.tvlInUsd,collapseAt:o,className:n,onPoolClick:s})}function Si({cexes:e,collapseAt:t=4,className:o}){let{t:n}=useTranslation(),[s,r]=useState(!e||e.length<=t),i=useCallback(()=>r(a=>!a),[]);return !e||e.length===0?null:jsxs("section",{className:cn("w-full",o),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:n("tokens.tokenDetail.cexListings")}),jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((a,d)=>{let l=d>=t&&!s,c=jsx(Chip,{startContent:a.logo?jsx(Image,{src:a.logo,width:20,height:20,alt:a.name}):void 0,className:cn("bg-default-100 text-xs",l&&"hidden"),children:a.name},a.id);return a.url?jsx("a",{href:a.url,target:"_blank",rel:"noreferrer noopener",className:cn(l&&"hidden"),children:c},a.id):c})}),e.length>t&&jsx("div",{className:"mt-3 flex justify-center",children:jsx("button",{type:"button",onClick:i,className:"rounded px-2 py-1 text-xs text-text-muted transition-colors hover:text-foreground",children:n(s?"tokens.tokenDetail.showLess":"tokens.tokenDetail.showMore")})})]})}function Ni(e){return {cexes:e}}function Ew({cexes:e,collapseAt:t,className:o}){let{cexes:n}=Ni(e);return jsx(Si,{cexes:n,collapseAt:t,className:o})}function wi({categories:e,collapseAt:t=4,className:o,onCategoryClick:n}){let{t:s}=useTranslation(),[r,i]=useState(!e||e.length<=t),a=useCallback(()=>i(d=>!d),[]);return !e||e.length===0?null:jsxs("section",{className:cn("w-full",o),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:s("tokens.tokenDetail.categories")}),jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((d,l)=>{let c=l>=t&&!r;return jsx(Chip,{size:"sm",className:cn("bg-default-100",c&&"hidden",n&&"cursor-pointer"),onClick:n?()=>n(d):void 0,children:d},d)})}),e.length>t&&jsx("div",{className:"mt-3 flex justify-center",children:jsx("button",{type:"button",onClick:a,className:"rounded px-2 py-1 text-xs text-text-muted transition-colors hover:text-foreground",children:s(r?"tokens.tokenDetail.showLess":"tokens.tokenDetail.showMore")})})]})}function Li(e,t){return O(e,t)}function eL({chain:e,address:t,collapseAt:o,className:n,onCategoryClick:s}){let{token:r}=Li(e,t);return jsx(wi,{categories:r?.tags,collapseAt:o,className:n,onCategoryClick:s})}var Pi=["5m","1h","4h","24h"];function Ri({stats:e,resolution:t,className:o}){let{t:n}=useTranslation(),s=e?.[t],r=new SafeBigNumber(s?.buyVolumesInUsd??0),i=new SafeBigNumber(s?.sellVolumesInUsd??0),a=r.plus(i),d=r.minus(i),l=a.eq(0)?50:Math.min(100,Math.max(0,r.div(a).times(100).toNumber())),c=[{label:n("tokens.listHeader.volumes",{resolution:n(`common.resolution.${t}`)}),value:formatAmountInUsd(a.toString()),className:"text-foreground"},{label:n("tokens.tokenDetail.stats.buys"),value:formatAmountInUsd(r.toString()),className:"text-positive"},{label:n("tokens.tokenDetail.stats.sells"),value:formatAmountInUsd(i.toString()),className:"text-negative"},{label:n("tokens.tokenDetail.stats.netVolume"),value:formatAmountInUsd(d.abs().toString()),className:d.gte(0)?"text-positive":"text-negative"}];return jsxs("div",{className:cn("flex h-full w-full flex-col",o),children:[jsx("div",{className:"grid flex-1 grid-cols-4 items-center",children:c.map(u=>jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] px-2",children:[jsx("span",{className:"text-[10px] leading-none text-text-muted",children:u.label}),jsx("span",{className:cn("text-[13px] font-medium leading-none tabular-nums",u.className),children:u.value})]},u.label))}),jsx("div",{className:"relative h-[2px] w-full overflow-hidden bg-negative",children:jsx("div",{className:"absolute inset-y-0 left-0 bg-positive transition-[width] duration-200 ease-out",style:{width:`${l}%`}})})]})}function Ai({stats:e,resolutions:t,className:o}){return jsx("div",{className:cn("grid h-full w-full grid-cols-4 items-center",o),children:t.map(n=>{let r=e?.[n]?.priceChange,i=r?new SafeBigNumber(r):void 0,a=i?i.gte(0):void 0,d=n,l=i?formatPercent(i,{showPlusGtThanZero:true}):"\u2014";return jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] px-2",children:[jsx("span",{className:"text-[10px] leading-none text-text-muted",children:d}),jsx("span",{className:cn("text-[13px] font-medium leading-none tabular-nums",a===void 0?"text-foreground":a?"text-positive":"text-negative"),children:l})]},n)})})}function Ii({chain:e,address:t}){let{data:o,isLoading:n}=useTokenStatsQuery({chain:e,address:t});return {stats:o,isLoading:n}}function xL({chain:e,address:t,baseResolution:o="5m",hoverResolutions:n=Pi,height:s=64,className:r}){let{stats:i}=Ii({chain:e,address:t});return jsx(StatsFlipPanel,{className:r,height:s,base:jsx(Ri,{stats:i,resolution:o}),hover:jsx(Ai,{stats:i,resolutions:n})})}function Mi({positions:e,isLoading:t,hasMore:o,onLoadMore:n,currency:s="usd",onCurrencyChange:r,showHidden:i=false,onShowHiddenChange:a,nativeSymbol:d,renderActions:l,className:c}){let{t:u}=useTranslation(),m=d??u("tokens.tokenDetail.native");return jsxs("div",{className:cn("flex flex-col",c),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("span",{className:"text-xs font-medium text-text-muted",children:u("tokens.tokenDetail.positions.title")}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-text-muted",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:i,onChange:p=>a?.(p.target.checked)}),u("tokens.tokenDetail.filter.showHidden")]})]}),jsx(qp,{value:s,nativeSymbol:m,onChange:r})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[720px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[26%] px-3 py-2 text-left font-normal",children:u("tokens.tokenDetail.columns.token")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.bought")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.sold")}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.remaining")}),jsx("th",{className:"w-[18%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.pnl")}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:u("tokens.tokenDetail.columns.actions")})]})}),jsxs("tbody",{children:[e.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-text-muted",children:u("tokens.tokenDetail.positions.empty")})}),e.map(p=>jsx($p,{position:p,currency:s,renderActions:l},`${p.chain}:${p.address}`)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-text-muted",children:u("tokens.tokenDetail.loading")})})]})]})}),o&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:n,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:u("tokens.tokenDetail.loadMore")})})]})}function qp({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn("rounded px-2 transition-colors",e===s.k?"bg-default-200 text-foreground":"text-text-muted hover:text-foreground"),children:s.label},s.k))})}function $p({position:e,currency:t,renderActions:o}){let{bought:n,sold:s,remaining:r,pnl:i}=useMemo(()=>zp(e,t),[e,t]),a=jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.image??void 0,name:(e.symbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-col",children:[jsx("span",{className:"truncate text-foreground",children:e.symbol}),jsx("span",{className:"truncate text-[10px] text-text-muted",children:e.name})]})]});return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:a}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:s}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r}),jsx("td",{className:cn("px-3 py-2 text-right align-middle font-medium",i.isPositive===void 0?"text-text-muted":i.isPositive?"text-positive":"text-negative"),children:jsxs("div",{className:"flex flex-col items-end leading-tight",children:[jsx("span",{children:i.amount}),i.ratio?jsx("span",{className:"text-[10px]",children:i.ratio}):null]})}),jsx("td",{className:"px-3 py-2 text-right align-middle",children:o?o(e):jsx("span",{className:"text-text-muted",children:"--"})})]})}function zp(e,t){let o=t==="usd"?e.buyVolumesInUsd:e.buyVolumes,n=t==="usd"?e.sellVolumesInUsd:e.sellVolumes,s=t==="usd"?e.amountInUsd:e.amount,r=e.totalProfitInUsd,i=t==="usd"?formatAmountInUsd(o??0):formatAmount(o??0),a=t==="usd"?formatAmountInUsd(n??0):formatAmount(n??0),d=t==="usd"?formatAmountInUsd(s??0):formatAmount(s??0),l=r?new SafeBigNumber(r):void 0,c=l?l.gte(0):void 0,u=l?(c?"+":"")+formatAmountInUsd(l.toString()):"--",m=e.totalProfitRatio?formatPercent(e.totalProfitRatio,{showPlusGtThanZero:true}):void 0;return {bought:i,sold:a,remaining:d,pnl:{amount:u,ratio:m,isPositive:c}}}function Fi({chain:e,wallet:t,limit:o=50,initialShowHidden:n=false}){let[s,r]=useState(void 0),[i,a]=useState([]),[d,l]=useState(n);useEffect(()=>{r(void 0),a([]);},[e,t]);let c=useMemo(()=>({chain:e,address:t??"",cursor:s,limit:o,positionState:"open"}),[e,t,s,o]),{data:u,isPending:m,isFetching:p}=useWalletTokenPositionsQuery(c,{enabled:!!t});useEffect(()=>{u&&a(y=>s==null?[u]:y[y.length-1]?.endCursor===u.endCursor?y:[...y,u]);},[u,s]);let g=useMemo(()=>i.flatMap(y=>y.portfolios),[i]),f=i[i.length-1],k=!!(f?.hasNext&&f.endCursor),x=useCallback(()=>{!f?.endCursor||!f.hasNext||r(f.endCursor);},[f]);return {positions:g,isLoading:!!t&&(m||p),hasMore:k,loadMore:x,showHidden:d,setShowHidden:l}}function UL({chain:e,wallet:t,limit:o,initialCurrency:n="usd",nativeSymbol:s,renderActions:r,className:i}){let[a,d]=useState(n),{positions:l,isLoading:c,hasMore:u,loadMore:m,showHidden:p,setShowHidden:g}=Fi({chain:e,wallet:t,limit:o});return jsx(Mi,{className:i,positions:l,isLoading:c,hasMore:u,onLoadMore:m,currency:a,onCurrencyChange:d,showHidden:p,onShowHiddenChange:g,nativeSymbol:s,renderActions:r})}function Oi({orders:e,isLoading:t,unavailable:o,hasMore:n,onLoadMore:s,stateFilter:r,onStateFilterChange:i,onlyThisToken:a=false,onOnlyThisTokenChange:d,tokenSymbol:l,currency:c="usd",onCurrencyChange:u,nativeSymbol:m,onCancelAll:p,renderActions:g,className:f}){let{t:k}=useTranslation(),x=m??k("tokens.tokenDetail.native");return jsxs("div",{className:cn("flex flex-col",f),children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"active",labelKey:"tokens.tokenDetail.activeOrders"},{k:"history",labelKey:"tokens.tokenDetail.orderHistory"}].map(y=>jsx("button",{type:"button",onClick:()=>i(y.k),className:cn("rounded px-2 transition-colors",r===y.k?"bg-default-200 text-foreground":"text-text-muted hover:text-foreground"),children:k(y.labelKey)},y.k))}),l?jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-text-muted",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:a,onChange:y=>d?.(y.target.checked)}),k("tokens.tokenDetail.filter.onlyToken",{symbol:l})]}):null]}),jsxs("div",{className:"flex items-center gap-2",children:[p?jsx("button",{type:"button",onClick:p,className:"rounded px-2 py-1 text-[11px] text-negative transition-colors hover:bg-default-100",children:k("tokens.tokenDetail.cancelAll")}):null,jsx(nf,{value:c,nativeSymbol:x,onChange:u})]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[760px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[22%] px-3 py-2 text-left font-normal",children:k("tokens.tokenDetail.columns.token")}),jsx("th",{className:"w-[10%] px-3 py-2 text-left font-normal",children:k("tokens.tokenDetail.columns.type")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.amount")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.currentMarketCap")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.targetMarketCap")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.settings")}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:k("tokens.tokenDetail.columns.action")})]})}),jsxs("tbody",{children:[o?jsx("tr",{children:jsx("td",{colSpan:7,className:"py-10 text-center text-text-muted",children:k("tokens.tokenDetail.orders.unavailable")})}):e.length===0&&!t?jsx("tr",{children:jsx("td",{colSpan:7,className:"py-10 text-center text-text-muted",children:k(r==="active"?"tokens.tokenDetail.orders.emptyActive":"tokens.tokenDetail.orders.emptyHistorical")})}):e.map(y=>jsx(rf,{order:y,currency:c,renderActions:g},y.id)),t&&!o&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-4 text-center text-text-muted",children:k("tokens.tokenDetail.loading")})})]})]})}),!o&&n&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:s,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:k("tokens.tokenDetail.loadMore")})})]})}function nf({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn("rounded px-2 transition-colors",e===s.k?"bg-default-200 text-foreground":"text-text-muted hover:text-foreground"),children:s.label},s.k))})}function rf({order:e,currency:t,renderActions:o}){let n=useMemo(()=>t==="usd"&&e.amountInUsd?formatAmountInUsd(e.amountInUsd):formatAmount(e.amount),[t,e.amount,e.amountInUsd]),s=e.side==="buy"?"Buy":"Sell",r=e.side==="buy"?"text-positive":"text-negative";return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.tokenImage??void 0,name:(e.tokenSymbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsx("span",{className:"truncate text-foreground",children:e.tokenSymbol??"--"})]})}),jsx("td",{className:cn("px-3 py-2 align-middle font-medium",r),children:s}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.currentMarketCapInUsd?formatMCapInUsd(e.currentMarketCapInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:e.targetMarketCapInUsd?formatMCapInUsd(e.targetMarketCapInUsd):e.targetPriceInUsd?formatPriceInUsd(e.targetPriceInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.slippage!=null?`Slip ${e.slippage}%`:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle",children:o?o(e):jsx("span",{className:"text-text-muted",children:"--"})})]})}function af(e){return e instanceof Error&&e.code==="NotImplemented"}function lf(e){return e==="active"?"active":"filled"}function Vi({chain:e,wallet:t,tokenAddress:o,limit:n=50,initialStateFilter:s="active",initialOnlyThisToken:r=false}){let[i,a]=useState(s),[d,l]=useState(r),[c,u]=useState(void 0),[m,p]=useState([]);useEffect(()=>{u(void 0),p([]);},[e,t,i,d,o]);let g=useCallback(N=>{N!==i&&a(N);},[i]),f=useMemo(()=>({chain:e,address:t??"",cursor:c,limit:n,state:lf(i),tokenAddress:d?o:void 0}),[e,t,c,n,i,d,o]),{data:k,isPending:x,isFetching:y,error:T}=useWalletLimitOrdersQuery(f,{enabled:!!t});useEffect(()=>{k&&p(N=>c==null?[k]:N[N.length-1]?.endCursor===k.endCursor?N:[...N,k]);},[k,c]);let S=!!T&&af(T),h=useMemo(()=>m.flatMap(N=>N.data),[m]),b=m[m.length-1],w=!!(b?.hasNext&&b.endCursor),v=useCallback(()=>{!b?.endCursor||!b.hasNext||u(b.endCursor);},[b]);return {orders:h,isLoading:!!t&&!S&&(x||y),unavailable:S,hasMore:w,loadMore:v,stateFilter:i,setStateFilter:g,onlyThisToken:d,setOnlyThisToken:l}}function tP({chain:e,wallet:t,tokenAddress:o,tokenSymbol:n,limit:s,initialStateFilter:r="active",initialCurrency:i="usd",nativeSymbol:a,onCancelAll:d,renderActions:l,className:c}){let[u,m]=useState(i),{orders:p,isLoading:g,unavailable:f,hasMore:k,loadMore:x,stateFilter:y,setStateFilter:T,onlyThisToken:S,setOnlyThisToken:h}=Vi({chain:e,wallet:t,tokenAddress:o,limit:s,initialStateFilter:r});return jsx(Oi,{className:c,orders:p,isLoading:g,unavailable:f,hasMore:k,onLoadMore:x,stateFilter:y,onStateFilterChange:T,onlyThisToken:S,onOnlyThisTokenChange:h,tokenSymbol:n,currency:u,onCurrencyChange:m,nativeSymbol:a,onCancelAll:f?void 0:d,renderActions:l})}function _i({traders:e,isLoading:t,hasMore:o,onLoadMore:n,onlyTracked:s=false,onOnlyTrackedChange:r,now:i=Date.now(),renderAddress:a,className:d}){let{t:l}=useTranslation();return jsxs("div",{className:cn("flex flex-col",d),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsx("span",{className:"text-xs font-medium text-text-muted",children:l("tokens.tokenDetail.topTraders")}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-text-muted",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:s,onChange:c=>r?.(c.target.checked)}),l("tokens.tokenDetail.filter.onlyTracked")]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[680px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[28%] px-3 py-2 text-left font-normal",children:l("tokens.tokenDetail.columns.wallet")}),jsx("th",{className:"w-[20%] px-3 py-2 text-left font-normal",children:l("tokens.tokenDetail.columns.tags")}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:l("tokens.tokenDetail.columns.value")}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"%"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:l("tokens.tokenDetail.columns.realizedPnl")}),jsx("th",{className:"w-[13%] px-3 py-2 text-right font-normal",children:l("tokens.tokenDetail.columns.lastActive")})]})}),jsxs("tbody",{children:[e.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-text-muted",children:l("tokens.tokenDetail.topTraders.empty")})}),e.map(c=>jsx(gf,{trader:c,now:i,renderAddress:a},c.address)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-text-muted",children:l("tokens.tokenDetail.loading")})})]})]})}),o&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:n,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:l("tokens.tokenDetail.loadMore")})})]})}function gf({trader:e,now:t,renderAddress:o}){let{formatAge:n}=useLocalizedTimeFormatter(),s=useMemo(()=>o?o(e.address):jsx("span",{className:"font-mono text-[11px] text-text-muted",children:ve(e.address,6,6)}),[e.address,o]);return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:s}),jsx("td",{className:"px-3 py-2 align-middle",children:jsx(qt,{tags:e.tags,max:3})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:formatAmountInUsd(e.amountInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:formatAmountInUsd(e.totalRealizedPnlInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-text-muted",children:e.lastActiveAt?Ie(e.lastActiveAt,n,t):"--"})]})}function $i({chain:e,address:t,limit:o=50,initialSortBy:n,initialSortDirection:s,initialOnlyTracked:r=false}){let[i,a]=useState(n),[d,l]=useState(s),[c,u]=useState(void 0),[m,p]=useState([]),[g,f]=useState(r),k=useCallback(()=>{u(void 0),p([]);},[]),x=useCallback((R,ae)=>{R===i&&ae===d||(a(R),l(ae),k());},[k,i,d]),y=useCallback(R=>{x(R,d??"desc");},[x,d]),T=useCallback(R=>{R!==d&&(l(R),k());},[k,d]);useEffect(()=>{k();},[e,t,k]);let S=useMemo(()=>({chain:e,address:t,cursor:c,limit:o,sortBy:i,sortDirection:d}),[e,t,c,o,i,d]),{data:h,isPending:b,isFetching:w}=useTokenTopTradersQuery(S);useEffect(()=>{h&&p(R=>c==null?[h]:R[R.length-1]?.endCursor===h.endCursor?R:[...R,h]);},[h,c]);let v=useMemo(()=>m.flatMap(R=>R.data),[m]),N=useMemo(()=>g?v.filter(R=>R.tags&&R.tags.length>0):v,[v,g]),F=m[m.length-1],fe=!!(F?.hasNext&&F.endCursor),Y=useCallback(()=>{!F?.endCursor||!F.hasNext||u(F.endCursor);},[F]);return {traders:N,isLoading:b||w,sortBy:i,sortDirection:d,setSortBy:y,setSortDirection:T,setSort:x,hasMore:fe,loadMore:Y,onlyTracked:g,setOnlyTracked:f}}function bP({chain:e,address:t,limit:o,className:n,renderAddress:s}){let{traders:r,isLoading:i,hasMore:a,loadMore:d,onlyTracked:l,setOnlyTracked:c}=$i({chain:e,address:t,limit:o});return jsx(_i,{className:n,traders:r,isLoading:i,hasMore:a,onLoadMore:d,onlyTracked:l,onOnlyTrackedChange:c,renderAddress:s})}var yf="\u2713";function Xi({tokens:e,isLoading:t,unavailable:o,hasMore:n,onLoadMore:s,renderTokenLink:r,className:i}){let{t:a}=useTranslation();return jsxs("div",{className:cn("flex flex-col",i),children:[jsx("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:jsx("span",{className:"text-xs font-medium text-text-muted",children:a("tokens.tokenDetail.devTokens.title")})}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[700px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-text-muted",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[28%] px-3 py-2 text-left font-normal",children:a("tokens.tokenDetail.columns.token")}),jsx("th",{className:"w-[10%] px-3 py-2 text-center font-normal",children:a("tokens.tokenDetail.columns.migrated")}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:a("tokens.tokenDetail.columns.marketCap")}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:a("tokens.tokenDetail.columns.ath")}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:a("tokens.tokenDetail.liquidity")}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:a("tokens.tokenDetail.columns.volume1h")})]})}),jsxs("tbody",{children:[o?jsx("tr",{children:jsx("td",{colSpan:6,className:"py-10 text-center text-text-muted",children:a("tokens.tokenDetail.devTokens.unavailable")})}):e.length===0&&!t?jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-text-muted",children:a("tokens.tokenDetail.devTokens.empty")})}):e.map(d=>jsx(bf,{token:d,renderTokenLink:r},`${d.chain}:${d.address}`)),!o&&t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-text-muted",children:a("tokens.tokenDetail.loading")})})]})]})}),!o&&n&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:s,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-text-muted transition-colors hover:bg-default-200 disabled:opacity-50",children:a("tokens.tokenDetail.loadMore")})})]})}function bf({token:e,renderTokenLink:t}){let o=e.marketData?.marketCapInUsd??e.marketData?.marketCap,n=e.marketData?.tvlInUsd,r=e.stats?.["1h"]?.volumesInUsd,i=!!e.migratedTo,a=t?t(e):jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.image??void 0,name:(e.symbol??e.name??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-col",children:[jsx("span",{className:"truncate text-foreground",children:e.symbol}),jsx("span",{className:"truncate text-[10px] text-text-muted",children:e.name})]})]});return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:a}),jsx("td",{className:"px-3 py-2 text-center align-middle",children:i?jsx("span",{className:"text-positive",children:yf}):jsx("span",{className:"text-text-muted",children:"\u2014"})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:o?formatMCapInUsd(o):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n?formatAmountInUsd(n):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r?formatAmountInUsd(r):"--"})]})}function Ji({tokens:e,className:t}){let{t:o}=useTranslation(),n=e.length,s=e.filter(d=>!!d.migratedTo).length,r=n===0?0:Math.round(s/n*100),i=e.map(d=>d.stats?.["1h"]?.volumesInUsd??"0").reduce((d,l)=>d.plus(new SafeBigNumber(l)),new SafeBigNumber(0)),a=e.map(d=>d.marketData?.marketCapInUsd??d.marketData?.marketCap??"0").reduce((d,l)=>d.plus(new SafeBigNumber(l)),new SafeBigNumber(0));return jsxs("div",{className:cn("flex flex-col gap-2 p-3",t),children:[jsx("div",{className:"flex items-center justify-between",children:jsx("span",{className:"text-xs font-medium text-text-muted",children:o("tokens.tokenDetail.devTokens.stats")})}),jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsx(ho,{label:o("tokens.tokenDetail.devTokens.total"),value:String(n)}),jsx(ho,{label:o("tokens.tokenDetail.columns.migrated"),value:`${s} (${r}%)`}),jsx(ho,{label:o("tokens.tokenDetail.devTokens.totalMarketCap"),value:formatMCapInUsd(a.toString())}),jsx(ho,{label:o("tokens.tokenDetail.devTokens.totalVolume1h"),value:formatAmountInUsd(i.toString())})]})]})}function ho({label:e,value:t}){return jsxs("div",{className:"flex flex-col gap-[2px]",children:[jsx("span",{className:"text-[10px] text-text-muted",children:e}),jsx("span",{className:"text-[13px] font-medium text-foreground",children:t})]})}function Sf(e){return e instanceof Error&&e.code==="NotImplemented"}function ta({chain:e,creator:t,limit:o=20}){let[n,s]=useState(void 0),[r,i]=useState([]),a=useCallback(()=>{s(void 0),i([]);},[]);useEffect(()=>{a();},[e,t,a]);let d=useMemo(()=>({chain:e,creator:t??"",cursor:n,limit:o}),[e,t,n,o]),{data:l,isPending:c,isFetching:u,error:m}=useTokensByCreatorQuery(d,{enabled:!!t});useEffect(()=>{l&&i(y=>n==null?[l]:y[y.length-1]?.endCursor===l.endCursor?y:[...y,l]);},[l,n]);let p=useMemo(()=>r.flatMap(y=>y.data),[r]),g=r[r.length-1],f=!!(g?.hasNext&&g.endCursor),k=!!m&&Sf(m),x=useCallback(()=>{!g?.endCursor||!g.hasNext||s(g.endCursor);},[g]);return {tokens:p,isLoading:!!t&&!k&&(c||u),unavailable:k,hasMore:f,loadMore:x}}function EP({chain:e,creator:t,limit:o,showSummary:n=false,renderTokenLink:s,className:r}){let{tokens:i,isLoading:a,unavailable:d,hasMore:l,loadMore:c}=ta({chain:e,creator:t,limit:o});return jsxs("div",{className:r,children:[jsx(Xi,{tokens:i,isLoading:a,unavailable:d,hasMore:l,onLoadMore:c,renderTokenLink:s}),n&&!d?jsx(Ji,{tokens:i}):null]})}function ia({token:e,athInUsd:t,athAt:o,globalFeesPaidInUsd:n,rank:s,onTogglePin:r,pinned:i,className:a}){let{t:d}=useTranslation(),l=e?.marketData?.priceInUsd,c=e?.marketData?.tvlInUsd,u=e?.marketData?.totalSupply;return jsxs("div",{className:cn("flex h-[48px] w-full flex-row items-center gap-4 overflow-x-auto px-3 text-[12px]",a),children:[jsx(mt,{label:d("tokens.tokenDetail.chart.price"),value:l?formatPriceInUsd(l):"--"}),jsx(mt,{label:d("tokens.tokenDetail.chart.liquidity"),value:c?formatAmountInUsd(c):"--"}),jsx(mt,{label:d("tokens.tokenDetail.chart.supply"),value:u?formatAmount(u):"--"}),n?jsx(mt,{label:d("tokens.tokenDetail.chart.feesPaid"),value:formatAmountInUsd(n)}):null,t?jsx(mt,{label:d("tokens.tokenDetail.chart.ath"),value:formatPriceInUsd(t),title:o?d("tokens.tokenDetail.chart.athAt",{date:o.toLocaleDateString()}):void 0}):null,s!==void 0?jsx(mt,{label:d("tokens.tokenDetail.chart.rank"),value:`#${s}`}):null,jsx("div",{className:"flex-1"}),r?jsx("button",{type:"button",onClick:r,"aria-pressed":i,className:cn("flex size-[26px] items-center justify-center rounded text-text-muted transition-colors hover:bg-default-100 hover:text-foreground",i&&"text-foreground"),title:d(i?"tokens.tokenDetail.chart.unpin":"tokens.tokenDetail.chart.pin"),children:i?"\u2605":"\u2606"}):null]})}function mt({label:e,value:t,title:o}){return jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] whitespace-nowrap",title:o,children:[jsx("span",{className:"text-[10px] leading-none text-text-muted",children:e}),jsx("span",{className:"text-[13px] font-medium leading-none tabular-nums text-foreground",children:t})]})}function la({chain:e,address:t}){return O(e,t)}function e1({chain:e,address:t,athInUsd:o,athAt:n,globalFeesPaidInUsd:s,rank:r,pinned:i,onTogglePin:a,className:d}){let{token:l}=la({chain:e,address:t});return jsx(ia,{className:d,token:l,athInUsd:o,athAt:n,globalFeesPaidInUsd:s,rank:r,pinned:i,onTogglePin:a})}function da({tokens:e,isLoading:t,unavailable:o,onTokenClick:n,className:s}){let{t:r}=useTranslation();return o?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-text-muted",s),children:r("tokens.tokenDetail.similarUnavailable")}):!t&&e.length===0?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-text-muted",s),children:r("tokens.tokenDetail.noSimilarTokens")}):jsxs("ul",{className:cn("flex flex-col",s),children:[e.map(i=>jsxs("li",{className:cn("flex cursor-pointer items-center gap-2 border-b border-default-50 px-3 py-2 last:border-0 hover:bg-default-50/60",!n&&"cursor-default"),onClick:n?()=>n(i):void 0,children:[jsx(Avatar,{src:i.image??void 0,name:(i.symbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[jsx("span",{className:"truncate text-[12px] text-foreground",children:i.symbol}),jsx("span",{className:"truncate text-[10px] text-text-muted",children:i.name})]}),jsx("span",{className:"text-[11px] tabular-nums text-text-muted",children:i.marketData?.marketCapInUsd?formatMCapInUsd(i.marketData.marketCapInUsd):"--"})]},`${i.chain}:${i.address}`)),t&&jsx("li",{className:"py-2 text-center text-[11px] text-text-muted",children:r("tokens.tokenDetail.loading")})]})}function ca({chain:e,address:t,keyword:o,limit:n=10}){let s=!!o&&o.length>0,{data:r,isPending:i,isFetching:a}=useSearchTokensQuery({chains:[e],keyword:o,limit:n+1},{enabled:s});return {tokens:useMemo(()=>{if(!r)return [];let l=t.toLowerCase();return (r.data??[]).filter(c=>c.address.toLowerCase()!==l).slice(0,n)},[r,t,n]),isLoading:s&&(i||a),unavailable:!s}}function x1({chain:e,address:t,keyword:o,limit:n,onTokenClick:s,className:r}){let{tokens:i,isLoading:a,unavailable:d}=ca({chain:e,address:t,keyword:o,limit:n});return jsx(da,{className:r,tokens:i,isLoading:a,unavailable:d,onTokenClick:s})}function ma({tokens:e=[],unavailable:t=true,onTokenClick:o,className:n}){let{t:s}=useTranslation();return t?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-text-muted",n),children:s("tokens.tokenDetail.reusedImagesUnavailable")}):e.length===0?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-text-muted",n),children:s("tokens.tokenDetail.noReusedImages")}):jsx("div",{className:cn("flex flex-row flex-wrap gap-2 p-3",n),children:e.map(r=>jsx("button",{type:"button",onClick:o?()=>o(r):void 0,className:"flex size-10 items-center justify-center overflow-hidden rounded-full border border-default-100 transition-opacity hover:opacity-80",title:r.symbol,children:jsx(Avatar,{src:r.image??void 0,name:(r.symbol??"?").slice(0,1),className:"size-full bg-default-100 text-[10px] text-text-muted",showFallback:true})},`${r.chain}:${r.address}`))})}function ua(e){return {tokens:[],isLoading:false,unavailable:true}}function I1({chain:e,address:t,onTokenClick:o,className:n}){let{tokens:s,unavailable:r}=ua();return jsx(ma,{className:n,tokens:s,unavailable:r,onTokenClick:o})}function xa({keywords:e,excludeKeywords:t,onKeywordsChange:o,onExcludeKeywordsChange:n,className:s}){let{t:r}=useTranslation(),[i,a]=useState(e?.join(", ")??""),[d,l]=useState(t?.join(", ")??"");useEffect(()=>{a(m=>{let p=bo(m);return p===void 0&&e===void 0?m:p===void 0?e?.join(", ")??"":e===void 0?"":p.join("")===e.join("")?m:e.join(", ")});},[e]),useEffect(()=>{l(m=>{let p=bo(m);return p===void 0&&t===void 0?m:p===void 0?t?.join(", ")??"":t===void 0?"":p.join("")===t.join("")?m:t.join(", ")});},[t]);let c=useCallback(m=>{a(m),o?.(bo(m));},[o]),u=useCallback(m=>{l(m),n?.(bo(m));},[n]);return jsxs("div",{className:cn("grid grid-cols-2 gap-3 px-4",s),children:[jsxs("div",{className:"flex flex-col gap-3",children:[jsx("h3",{className:"text-xs text-text-muted",children:r("tokens.filters.keywords.title")}),jsx(StyledInput,{variant:"bordered",radius:"lg",size:"sm",placeholder:r("tokens.filters.keywords.placeholder"),value:i,onValueChange:c})]}),jsxs("div",{className:"flex flex-col gap-3",children:[jsx("h3",{className:"text-xs text-text-muted",children:r("tokens.filters.keywords.exclude.title")}),jsx(StyledInput,{variant:"bordered",radius:"lg",size:"sm",placeholder:r("tokens.filters.keywords.placeholder"),value:d,onValueChange:u})]})]})}function bo(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);return t.length>0?t:void 0}function Sa({protocols:e,selectedProtocols:t=[],onSelectedProtocolsChange:o,className:n}){let{t:s}=useTranslation(),[r,i]=useState(t);useEffect(()=>{i(t);},[t]);let a=useMemo(()=>e.every(c=>r.includes(c)),[e,r]),d=useCallback(()=>{if(a){let c=[];i(c),o?.(c);}else {let c=[...e];i(c),o?.(c);}},[e,o,a]),l=useCallback(c=>()=>{if(r.includes(c)){let u=r.filter(m=>m!==c);i(u),o?.(u);}else {let u=[...r,c];i(u),o?.(u);}},[r,o]);return jsxs("div",{className:cn("flex flex-col gap-3 px-4",n),children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-xs text-text-muted",children:s("tokens.filters.protocols.title")}),jsx(Button,{variant:"light",color:"default",size:"sm",radius:"full",onPress:d,children:s(a?"tokens.filters.protocols.unselectAll":"tokens.filters.protocols.selectAll")})]}),jsx("div",{className:"grid grid-cols-3 gap-3",children:e.map(c=>{let u=_e(c);return jsx(Button,{variant:"bordered",size:"sm",radius:"full",className:cn("w-fit h-6 px-2.5",u.text,u.bg5,"border",u.border,{"opacity-40 data-[hover=true]:!opacity-30":!r.includes(c)}),startContent:jsx(Image,{width:14,height:14,src:`/images/protocols/${c}.svg`,alt:formatTokenProtocolName(c)}),onPress:l(c),children:formatTokenProtocolName(c)},c)})})]})}function Le({title:e,field:t,value:o,onChange:n}){let{t:s}=useTranslation(),[r,i]=useState(o?Pn(o).min:NaN),[a,d]=useState(o?Pn(o).max:NaN);useEffect(()=>{if(o===void 0)i(NaN),d(NaN);else {let{min:u,max:m}=Pn(o);i(u),d(m);}},[o]);let l=useCallback(u=>{i(u),n?.(La(t,u,a));},[t,n,a]),c=useCallback(u=>{d(u),n?.(La(t,r,u));},[t,n,r]);return jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsx("h3",{className:"text-xs text-text-muted",children:e}),jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsx(StyledNumberInput,{value:r,onValueChange:l,variant:"bordered",radius:"lg",size:"sm",placeholder:s("tokens.filters.stats.min"),"aria-label":`${e} min`}),jsx(StyledNumberInput,{value:a,onValueChange:c,variant:"bordered",radius:"lg",size:"sm",placeholder:s("tokens.filters.stats.max"),"aria-label":`${e} max`})]})]})}function Pn(e){if(e.operator==="between"){let[t,o]=e.value;return {min:t,max:o}}return e.operator==="gte"?{min:e.value,max:NaN}:e.operator==="lte"?{min:NaN,max:e.value}:{min:NaN,max:NaN}}function La(e,t,o){if(!(isNaN(t)&&isNaN(o)))return isNaN(t)?{field:e,operator:"lte",value:o}:isNaN(o)?{field:e,operator:"gte",value:t}:{field:e,operator:"between",value:[t,o]}}function Ra({values:e,onValuesChange:t,className:o}){let{t:n}=useTranslation(),[s,r]=useState(e);useEffect(()=>{r(e);},[e]);let i=useCallback(a=>d=>{if(d===void 0){let l=(s??[]).filter(c=>c.field!==a);l=l.length>0?l:void 0,r(l),t?.(l);}else {let l=[...(s??[]).filter(c=>c.field!==a),d];r(l),t?.(l);}},[s,t]);return jsxs("div",{className:cn("flex flex-col gap-4",o),children:[jsx(Le,{field:"holders",title:n("tokens.filters.stats.audits.holders"),value:s?.find(a=>a.field==="holders"),onChange:i("holders")}),jsx(Le,{field:"top10Ratio",title:n("tokens.filters.stats.audits.top10HoldingsRatio"),value:s?.find(a=>a.field==="top10Ratio"),onChange:i("top10Ratio")}),jsx(Le,{field:"top100Ratio",title:n("tokens.filters.stats.audits.top100HoldingsRatio"),value:s?.find(a=>a.field==="top100Ratio"),onChange:i("top100Ratio")}),jsx(Le,{field:"creatorsRatio",title:n("tokens.filters.stats.audits.devHoldingsRatio"),value:s?.find(a=>a.field==="creatorsRatio"),onChange:i("creatorsRatio")})]})}function Aa({resolution:e,values:t,onValuesChange:o,className:n}){let{t:s}=useTranslation(),[r,i]=useState(t);useEffect(()=>{i(t);},[t]);let a=useCallback(d=>l=>{if(l===void 0){let c=(r??[]).filter(u=>u.field!==d);c=c.length>0?c:void 0,i(c),o?.(c);}else {let c=[...(r??[]).filter(u=>u.field!==d),l];i(c),o?.(c);}},[r,o]);return jsxs("div",{className:cn("flex flex-col gap-4",n),children:[jsx(Le,{field:"marketCap",title:s("tokens.filters.stats.metrics.marketCap"),value:r?.find(d=>d.field==="marketCap"),onChange:a("marketCap")}),jsx(Le,{field:"tvl",title:s("tokens.filters.stats.metrics.liquidity"),value:r?.find(d=>d.field==="tvl"),onChange:a("tvl")}),jsx(Le,{field:`volumes${e}`,title:s("tokens.filters.stats.metrics.volumes",{resolution:s(`common.resolution.${e}`)}),value:r?.find(d=>d.field===`volumes${e}`),onChange:a(`volumes${e}`)}),jsx(Le,{field:`trades${e}`,title:s("tokens.filters.stats.metrics.txns",{resolution:s(`common.resolution.${e}`)}),value:r?.find(d=>d.field===`trades${e}`),onChange:a(`trades${e}`)})]})}function Ua({resolution:e,values:t,onValuesChange:o,className:n}){let{t:s}=useTranslation(),[r,i]=useState("audits"),[a,d]=useState(t);useEffect(()=>{d(t);},[t]);let l=useCallback(m=>{d(m),o?.(m);},[o]),c=useMemo(()=>{let m=["holders","top10Ratio","top100Ratio","creatorsRatio"];return a?.filter(p=>m.includes(p.field))?.length??0},[a]),u=useMemo(()=>{let m=["marketCap","tvl",`volumes${e}`,`trades${e}`];return a?.filter(p=>m.includes(p.field)).length??0},[a,e]);return jsxs("div",{className:cn("flex flex-col gap-3 px-4",n),children:[jsxs(StyledLightTabs,{color:"default",radius:"full",size:"sm",selectedKey:r,onSelectionChange:i,children:[jsx(Tab,{title:c===0?s("tokens.filters.stats.audits"):jsx(StyledBadge,{color:"primary",size:"sm",content:c,shape:"circle",children:s("tokens.filters.stats.audits")})},"audits"),jsx(Tab,{title:u===0?s("tokens.filters.stats.metrics"):jsx(StyledBadge,{color:"primary",size:"sm",content:u,shape:"circle",children:s("tokens.filters.stats.metrics")})},"metrics")]}),jsx(Ra,{values:a,onValuesChange:l,className:cn({hidden:r!=="audits"})}),jsx(Aa,{values:a,onValuesChange:l,resolution:e,className:cn({hidden:r!=="metrics"})})]})}function Ro({protocols:e,resolution:t,filters:o,onFiltersChange:n,className:s}){let[r,i]=useState(Oa(o?.filters,e));useEffect(()=>{i(Oa(o?.filters,e));},[o?.filters,e]);let[a,d]=useState(o?.keywords);useEffect(()=>{d(o?.keywords);},[o?.keywords]);let[l,c]=useState(o?.excludeKeywords);useEffect(()=>{c(o?.excludeKeywords);},[o?.excludeKeywords]);let[u,m]=useState(o?.filters);useEffect(()=>{m(o?.filters);},[o?.filters]);let p=useCallback(x=>{i(x),n?.(Po(e,x,a,l,u));},[e,a,l,u,n]),g=useCallback(x=>{d(x),n?.(Po(e,r,x,l,u));},[e,r,l,u,n]),f=useCallback(x=>{c(x),n?.(Po(e,r,a,x,u));},[e,r,a,u,n]),k=useCallback(x=>{m(x),n?.(Po(e,r,a,l,x));},[e,r,a,l,n]);return jsxs("div",{className:cn("flex flex-col gap-4",s),children:[e&&e.length>0&&jsxs(Fragment,{children:[jsx(Sa,{protocols:e,selectedProtocols:r,onSelectedProtocolsChange:p}),jsx("div",{style:{height:1,background:"var(--color-surface-strong)"}})]}),jsx(xa,{keywords:a,excludeKeywords:l,onKeywordsChange:g,onExcludeKeywordsChange:f}),jsx("div",{style:{height:1,background:"var(--color-surface-strong)"}}),jsx(Ua,{resolution:t,values:u,onValuesChange:k})]})}function Oa(e,t){let o=e?.find(n=>n.field==="launchedFromProtocolFamily");return o?o.operator==="in"?o.value:(console.warn("invalid token protocols filter",o),[...t||[]]):[...t||[]]}function Po(e,t,o,n,s){let r=s?[...s.filter(i=>i.field!=="launchedFromProtocolFamily")]:[];return e&&e.length>0&&(e.every(a=>t.includes(a))||r.push({field:"launchedFromProtocolFamily",operator:"in",value:t})),o===void 0&&n===void 0&&r.length===0?void 0:{keywords:o,excludeKeywords:n,filters:r.length>0?r:void 0}}function Va({protocols:e,resolution:t,filters:o,onFiltersChange:n,triggerVariant:s="default",badgePlacement:r="outer",className:i}){let{t:a}=useTranslation(),{isOpen:d,onOpen:l,onClose:c,onOpenChange:u}=useDisclosure(),[m,p]=useState(o),g=useCallback(()=>{p(void 0);},[]),f=useCallback(()=>{n?.(m),c();},[m,n,c]);useEffect(()=>{p(o);},[d,o]);let k=useMemo(()=>Object.values(o||{}).every(x=>x===void 0),[o]);return jsxs(Fragment,{children:[jsxs("button",{type:"button",className:i,onClick:l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:9999,border:s==="plain"?"none":"1px solid rgba(63,63,70,0.5)",background:s==="plain"?"transparent":"hsl(var(--heroui-content3) / 0.6)",width:32,height:32,minHeight:32,padding:0,cursor:"pointer",position:"relative"},children:[jsx(FilterIcon,{width:16,height:16,className:"text-text-secondary"}),!k&&jsx("span",{style:{position:"absolute",top:r==="icon"?6:-2,right:r==="icon"?6:-2,width:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),jsx(StyledModal,{isOpen:d,onOpenChange:u,size:"md",scrollBehavior:"inside",children:jsxs(ModalContent,{className:"w-full h-full",children:[jsx(ModalHeader,{className:"px-4 py-2",children:jsx("span",{className:"text-base font-semibold",children:a("tokens.filters.modal.title")})}),jsx(ModalBody,{className:"px-0 pt-0 pb-4",children:jsx(ScrollShadow,{children:jsx(Ro,{protocols:e,resolution:t,filters:m,onFiltersChange:p,className:"pb-4"})})}),jsx(ModalFooter,{className:"px-4",children:jsxs("div",{className:"w-full flex justify-between items-center",children:[jsx(Button,{variant:"light",color:"default",size:"sm",radius:"full",startContent:jsx(RefreshIcon,{width:16,height:16}),onPress:g,children:a("common.reset")}),jsx(Button,{color:"primary",size:"sm",radius:"full",onPress:f,children:a("common.apply")})]})})]})})]})}var $a={display:"inline-flex",alignItems:"center",gap:8,borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"hsl(var(--heroui-content3) / 0.6)",padding:"6px 12px",fontSize:14,fontWeight:700,color:"var(--color-text-primary)",cursor:"pointer",transition:"all 0.15s",height:32},Ag={position:"absolute",right:0,top:"100%",zIndex:20,marginTop:8,borderRadius:14,border:"1px solid var(--color-border-control)",background:"var(--color-surface-interactive)",boxShadow:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden"},Ig={height:1,background:"var(--color-surface-strong)",margin:0};function za({protocols:e,resolution:t,filters:o,onFiltersChange:n,iconOnly:s=false,className:r}){let{t:i}=useTranslation(),[a,d]=useState(false),l=useRef(null),[c,u]=useState(o),m=useCallback(()=>{u(void 0);},[]),p=useCallback(()=>{n?.(c),d(false);},[c,n]);useEffect(()=>{u(o);},[a,o]),useEffect(()=>{let f=k=>{l.current&&!l.current.contains(k.target)&&d(false);};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[]),useEffect(()=>{if(!a)return;let f=k=>{k.key==="Escape"&&d(false);};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[a]);let g=useMemo(()=>Object.values(o||{}).every(f=>f===void 0),[o]);return jsxs("div",{ref:l,style:{position:"relative"},children:[jsxs("div",{style:{position:"relative",display:"inline-flex"},children:[jsxs("button",{type:"button",className:r,style:s?{...$a,justifyContent:"center",gap:0,width:32,minWidth:32,padding:0}:$a,onMouseEnter:f=>{f.currentTarget.style.background="var(--color-surface-strong)";},onMouseLeave:f=>{f.currentTarget.style.background="hsl(var(--heroui-content3) / 0.6)";},onClick:()=>d(f=>!f),children:[jsx(FilterIcon,{width:16,height:16,className:"flex-none"}),!s&&jsxs(Fragment,{children:[jsx("span",{className:"hidden sm:block",children:i("tokens.listHeader.filter")}),jsx(Mg,{open:a})]})]}),!g&&jsx("span",{style:{position:"absolute",top:-4,right:-4,minWidth:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),a&&jsxs("div",{style:{...Ag,width:420},children:[jsx("div",{style:{padding:"16px 0"},children:jsx(ScrollShadow,{className:"w-full max-h-120 px-4",children:jsx(Ro,{protocols:e,resolution:t,filters:c,onFiltersChange:u})})}),jsx("div",{style:Ig}),jsxs("div",{style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Button,{variant:"light",size:"sm",color:"default",radius:"full",startContent:jsx(RefreshIcon,{width:16,height:16}),onPress:m,children:i("common.reset")}),jsx(Button,{variant:"solid",size:"sm",color:"primary",radius:"full",onPress:p,children:i("common.apply")})]})]})]})}function Mg({open:e}){return jsx("svg",{viewBox:"0 0 24 24",style:{width:14,height:14,color:"var(--color-text-muted)",transition:"transform 0.15s",transform:e?"rotate(180deg)":void 0},fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"m6 9 6 6 6-6"})})}function SR({popoverPlacement:e="bottom-end",iconOnly:t,className:o,desktopOverlay:n="popover",...s}){let{isMobile:r}=useScreen();return r||n==="modal"?jsx(Va,{className:o,...s}):jsx(za,{placement:e,iconOnly:t,className:o,...s})}function Xa({resolution:e,onResolutionChange:t,resolutionOptions:o=["1m","5m","1h","4h","24h"]}){let{t:n}=useTranslation(),s=useCallback(r=>{t?.(r);},[t]);return jsx(StyledPlainTabs,{color:"primary",radius:"lg",selectedKey:e,onSelectionChange:s,"aria-label":n("tokens.resolutionSelector.ariaLabel"),classNames:{tabList:"gap-0",tab:"px-2",tabContent:"!text-text-muted group-data-[hover=true]:!text-foreground group-data-[selected=true]:!text-primary"},children:o.map(r=>jsx(Tab,{title:n(`common.resolution.${r}`)},r))})}var zg={display:"inline-flex",alignItems:"center",gap:4,borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"hsl(var(--heroui-content3) / 0.6)",padding:"0 10px",fontSize:12,fontWeight:500,color:"var(--color-text-primary)",cursor:"pointer",height:32,minHeight:32},Qg={position:"absolute",left:0,top:"100%",zIndex:20,marginTop:6,borderRadius:14,border:"1px solid var(--color-border-control)",background:"var(--color-surface-interactive)",boxShadow:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden",padding:"6px",minWidth:"100%"};function Ya({resolution:e,onResolutionChange:t,resolutionOptions:o=["1m","5m","1h","4h","24h"]}){let{t:n}=useTranslation(),[s,r]=useState(false),i=useRef(null),a=useCallback(d=>{t?.(d),r(false);},[t]);return useEffect(()=>{if(!s)return;let d=c=>{i.current&&!i.current.contains(c.target)&&r(false);},l=c=>{c.key==="Escape"&&r(false);};return document.addEventListener("mousedown",d),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",l);}},[s]),jsxs("div",{ref:i,style:{position:"relative",zIndex:50},children:[jsxs("button",{type:"button",style:zg,onClick:()=>r(d=>!d),children:[jsx("span",{children:e?n(`common.resolution.${e}`):"\u2014"}),jsx(ChevronDownIcon,{width:14,height:14,className:"text-text-muted",style:{transition:"transform 0.15s",transform:s?"rotate(180deg)":void 0}})]}),s&&jsx("div",{style:Qg,children:o.map(d=>jsx("button",{type:"button",onClick:()=>a(d),className:cn("w-full text-left px-3 py-1.5 rounded-lg text-xs font-medium transition-colors cursor-pointer",d===e?"text-primary bg-primary/10":"text-text-secondary hover:text-foreground hover:bg-surface-interactive"),children:n(`common.resolution.${d}`)},d))})]})}function WR(e){let{isMobile:t}=useScreen();return t?jsx(Ya,{...e}):jsx(Xa,{...e})}var ja=memo(function({token:t}){let o=useMemo(()=>t.marketData?.athMarketCapInUsd,[t.marketData?.athMarketCapInUsd]);return jsx(Fragment,{children:formatMCapInUsd(o)})});var tl=memo(function({token:t}){let{t:o}=useTranslation(),n=useMemo(()=>t.marketData?.bluechipHoldingsRatio,[t.marketData?.bluechipHoldingsRatio]),s=useMemo(()=>n!==void 0&&new SafeBigNumber(n).gte(.1),[n]),r=useMemo(()=>n===void 0||new SafeBigNumber(n).lt(.05),[n]);return jsx(StyledTooltip,{content:o("tokens.bluechip.explained"),children:jsxs("div",{className:"flex items-center gap-2.5",children:[s&&jsx(HorsePowerHighIcon,{}),r&&jsx(HorsePowerLowIcon,{}),!s&&!r&&jsx(HorsePowerIcon,{}),jsx("span",{className:cn(s&&"text-positive",!s&&!r&&"text-negative",n===void 0&&"text-text-muted"),children:formatPercent(n)})]})})});function vk(e){return e.length<=10?e:`${e.slice(0,4)}...${e.slice(-4)}`}var ll=memo(function({token:t}){let o=useCopyToClipboard(),[n,s]=useState(false),[r,i]=useState(false),a=useRef(void 0),d=useRef(void 0),{t:l}=useTranslation(),{formatAge:c}=useLocalizedTimeFormatter(),u=useCallback(g=>{g.preventDefault(),g.stopPropagation(),o(t.name,()=>{toast.success(l("tokens.copied.name")),s(true),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{s(false);},2e3);});},[o,t.name,l]),m=useCallback(g=>{g.preventDefault(),g.stopPropagation(),o(t.address,()=>{toast.success(l("tokens.copied.address")),i(true),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{i(false);},2e3);});},[o,t.address,l]);useEffect(()=>()=>{a.current&&clearTimeout(a.current),d.current&&clearTimeout(d.current);},[]);let p=useTickAge(t.createdAt);return jsxs("div",{className:"w-full flex justify-start items-center gap-3",children:[jsx(he,{token:t,showProgress:false,className:"w-10 h-10 sm:w-16 sm:h-16 flex-none"}),jsxs("div",{className:"flex-auto flex flex-col gap-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"flex-none font-medium tracking-[-0.02em]",children:t.symbol}),jsx(StyledTooltip,{content:t.name,children:jsxs("div",{className:"flex-initial flex items-center gap-1 min-w-0 text-text-muted hover:text-primary-200 cursor-pointer",onClick:u,children:[jsx("div",{className:"flex-initial whitespace-nowrap truncate",children:t.name}),n?jsx(CheckIcon,{className:"flex-none w-3 h-3 sm:w-3.5 sm:h-3.5"}):jsx(CopyIcon,{className:"flex-none w-3 h-3 sm:w-3.5 sm:h-3.5"})]})})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-primary text-xs sm:text-sm font-medium",children:c(p)}),jsxs("button",{type:"button",className:"group flex items-center gap-1 min-w-0 max-w-28 sm:max-w-36 text-text-muted hover:text-primary-200 cursor-pointer",onClick:m,"aria-label":l("tokens.copied.address"),children:[jsx("span",{className:"min-w-0 truncate text-left text-xs font-mono text-text-muted/70 group-hover:text-primary-200",children:vk(t.address)}),r?jsx(CheckIcon,{className:"flex-none w-3 h-3"}):jsx(CopyIcon,{className:"flex-none w-3 h-3"})]}),t.socialMedias?.website&&jsx(Link,{href:t.socialMedias.website,className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.twitter&&jsx(Link,{href:t.socialMedias.twitter,className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(TwitterIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.telegram&&jsx(Link,{href:t.socialMedias.telegram,className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(TelegramIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.discord&&jsx(Link,{href:t.socialMedias.discord,className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(DiscordIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),jsx(Link,{href:searchTwitterUrl(`${t.symbol} OR ${t.address}`),className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",children:jsx(SearchIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})]})});var dl=memo(function({token:t}){let{t:o}=useTranslation(),n=t.marketData,s=useMemo(()=>new SafeBigNumber(n?.top10HoldingsRatio).gte(.1),[n?.top10HoldingsRatio]),r=useMemo(()=>new SafeBigNumber(n?.devHoldingsRatio).gte(.1),[n?.devHoldingsRatio]),i=useMemo(()=>new SafeBigNumber(n?.sniperHoldingsRatio).gte(.1),[n?.sniperHoldingsRatio]),a=useMemo(()=>new SafeBigNumber(n?.insiderHoldingsRatio).gte(.1),[n?.insiderHoldingsRatio]),d=useMemo(()=>new SafeBigNumber(n?.bundleHoldingsRatio).gte(.1),[n?.bundleHoldingsRatio]);return jsxs("div",{className:"w-full h-full flex flex-col gap-1 justify-center",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(PeopleIcon,{width:12,height:12}),value:formatAmount(n?.holders),tooltip:o("tokens.tokenInfo.holders"),warning:false,disable:!n?.holders}),jsx($,{icon:jsx(KlineCandlesIcon,{width:12,height:12}),value:formatAmount(n?.proHolders),tooltip:o("tokens.tokenInfo.proHolders"),warning:false,disable:!n?.proHolders}),jsx($,{icon:jsx(StarIcon,{width:12,height:12}),value:formatAmount(n?.kolHolders),tooltip:o("tokens.tokenInfo.kolHolders"),warning:false,disable:!n?.kolHolders}),jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(n?.top10HoldingsRatio),tooltip:o("tokens.tokenInfo.top10HoldingsRatio"),warning:s,disable:!n?.top10HoldingsRatio||n?.top10HoldingsRatio==="0"})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(n?.devHoldingsRatio),tooltip:o("tokens.tokenInfo.devHoldingsRatio"),warning:r,disable:!n?.devHoldingsRatio||n?.devHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(n?.sniperHoldingsRatio),tooltip:o("tokens.tokenInfo.sniperHoldingsRatio"),warning:i,disable:!n?.sniperHoldingsRatio||n?.sniperHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(n?.insiderHoldingsRatio),tooltip:o("tokens.tokenInfo.insiderHoldingsRatio"),warning:a,disable:!n?.insiderHoldingsRatio||n?.insiderHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(n?.bundleHoldingsRatio),tooltip:o("tokens.tokenInfo.bundleHoldingsRatio"),warning:d,disable:!n?.bundleHoldingsRatio||n?.bundleHoldingsRatio==="0",tooltipPlacement:"bottom"})]})]})});var cl=memo(function({token:t}){let o=useMemo(()=>t.marketData?.tvlInUsd,[t.marketData?.tvlInUsd]);return jsx(Fragment,{children:formatAmountInUsd(o)})});var ml=memo(function({token:t}){let o=useMemo(()=>t.marketData?.marketCapInUsd,[t.marketData?.marketCapInUsd]);return jsx(Fragment,{children:formatMCapInUsd(o)})});var fl=memo(function({token:t,resolution:o}){let n=useMemo(()=>t.marketData?.priceInUsd,[t.marketData?.priceInUsd]),s=useMemo(()=>t.stats?.[o]?.priceChange,[t,o]),r=useMemo(()=>s?new SafeBigNumber(s).abs().toString():void 0,[s]),i=useMemo(()=>s&&new SafeBigNumber(s).gte(0),[s]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatPriceInUsd(n)}),jsxs("span",{className:cn("inline-flex gap-1 items-center text-xs",i?"text-positive":"text-negative"),children:[i?jsx(TriangleUpIcon,{width:10,height:10}):jsx(TriangleDownIcon,{width:10,height:10}),jsx("span",{children:formatPercent(r)})]})]})});var kl=memo(function({token:t,resolution:o}){let n=t.stats?.[o],s=n?.traders,r=n?.buyers,i=n?.sellers;return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmount(s)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-positive",children:formatAmount(r)}),"/",jsx("span",{className:"text-negative",children:formatAmount(i)})]})]})});var Tl=memo(function({token:t,resolution:o}){let n=t.stats?.[o],s=n?.trades,r=n?.buys,i=n?.sells;return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmount(s)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-positive",children:formatAmount(r)}),"/",jsx("span",{className:"text-negative",children:formatAmount(i)})]})]})});var yl=memo(function({token:t,resolution:o}){let n=t.stats?.[o],s=n?.volumesInUsd,r=n?.buyVolumesInUsd,i=n?.sellVolumesInUsd;return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmountInUsd(s)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-positive",children:formatAmountInUsd(r)}),"/",jsx("span",{className:"text-negative",children:formatAmountInUsd(i)})]})]})});var Zk=`
22
22
  @keyframes tklShimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
23
- `,jk={background:"linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%)",backgroundSize:"200% 100%",animation:"tklShimmer 1.8s ease-in-out infinite",borderRadius:6};function K(e,t,o,n){return {...jk,animationDelay:`${e}ms`,width:t,height:o,...n}}var hl=10;function yl({rowHeight:e,hasActions:t,isMobile:o}){return jsxs(Fragment,{children:[jsx("style",{children:Zk}),Array.from({length:hl}).map((n,s)=>jsx(ex,{index:s,rowHeight:e,hasActions:t,isMobile:o,isLast:s===hl-1},s))]})}function ex({index:e,rowHeight:t,hasActions:o,isMobile:n,isLast:s}){let r=e*80,i=n?208:320,a=n?40:64,d=n?72:124,l=n?64:97;return jsxs("div",{className:s?void 0:"border-b border-border-subtle/30",style:{display:"flex",alignItems:"center",height:t,flexShrink:0},children:[jsxs("div",{style:{width:i,padding:n?"0 12px":"0 12px 0 24px",display:"flex",alignItems:"center",gap:12,flexShrink:0},children:[jsx("div",{style:K(r,a,a,{borderRadius:8,flexShrink:0})}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1},children:[jsx("div",{style:K(r+30,"60%",20)}),jsx("div",{style:K(r+60,"80%",16)})]})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:K(r+20,72,20)}),jsx("div",{style:K(r+40,52,16)})]}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:K(r+30,64,20)})}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:K(r+40,60,20)})}),jsxs("div",{style:{width:138,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:K(r+50,72,20)}),jsx("div",{style:K(r+70,100,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:K(r+60,48,20)}),jsx("div",{style:K(r+80,80,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:K(r+70,40,20)}),jsx("div",{style:K(r+90,72,16)})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",alignItems:"center",gap:10},children:[jsx("div",{style:K(r+80,20,20,{borderRadius:4})}),jsx("div",{style:K(r+90,52,20)})]}),jsxs("div",{style:{width:308,padding:"0 12px",display:"flex",alignItems:"center",gap:20},children:[jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:K(r+80,52,16)}),jsx("div",{style:K(r+100,40,16)}),jsx("div",{style:K(r+120,36,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:K(r+90,48,16)}),jsx("div",{style:K(r+110,40,16)}),jsx("div",{style:K(r+130,40,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:K(r+100,40,16)}),jsx("div",{style:K(r+120,36,16)})]})]}),o&&jsx("div",{style:{width:d,padding:n?"0 12px 0 0":"0 24px 0 12px",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:jsx("div",{style:K(r+100,l,32,{borderRadius:8})})})]})}var ax=200,lx=72,Nl=3;function kt({tokens:e,resolution:t="24h",isLoading:o,ActionsComponent:n,onSelectToken:s,sortDirections:r,onSortChange:i,onScrollingChange:a,onVisibleTokensChange:d,height:l=600,itemHeight:c=88,itemHeightMobile:u=72,className:m}){let{isMobile:p}=useScreen(),g=p?u:c,f=!!o,k=useRef(void 0),x=useRef(false),h=useRef(null),T=useRef(new Set),S=useRef([]),y=useRef(void 0),b=useRef(d),w=useRef(a);b.current=d,w.current=a;let{t:v}=useTranslation(),N=useCallback(A=>Z=>{Z.preventDefault(),Z.stopPropagation(),s?.(A);},[s]),[F,fe]=useState(r??{});useEffect(()=>{fe(r??{});},[r]);let Y=useCallback(A=>Z=>{let Ve={[A]:Z};fe(Ve),i?.(Ve);},[i]),R=useCallback(A=>{if(f||e.length===0)return [];let Z=A?.scrollTop??0,Ve=A?.clientHeight||l,Qn=Math.floor(Z/g),$l=Math.ceil(Ve/g),zl=Math.max(0,Qn-Nl),Ql=Math.min(e.length,Qn+$l+Nl);return e.slice(zl,Ql)},[g,l,f,e]),ae=useCallback(A=>{let Z=Array.from(new Set(A.map(Ve=>`${Ve.chain}:${Ve.address.trim()}`))).sort().join(",");Z!==y.current&&(y.current=Z,b.current?.(A));},[]),V=useRef(R);V.current=R;let Te=useCallback(A=>{let Z=A.target;Z instanceof HTMLElement&&(h.current=Z,S.current=V.current(Z)),x.current||(x.current=true,w.current?.(true)),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{x.current=false,ae(S.current),w.current?.(false);},180);},[ae]),G=useCallback(A=>{!A||T.current.has(A)||(T.current.add(A),A.addEventListener("scroll",Te,{passive:true}));},[Te]);useEffect(()=>{for(let A of [...T.current]){let Z=A.querySelector("table")?.parentElement;Z&&G(Z);}},[G,p,f,e.length]),useEffect(()=>{let A=R(h.current);S.current=A,x.current||ae(A);},[ae,R]),useEffect(()=>()=>{k.current&&clearTimeout(k.current),T.current.forEach(A=>{A.removeEventListener("scroll",Te);}),T.current.clear(),x.current&&w.current?.(false),b.current?.([]);},[Te]);let Kl=cn("h-full mx-auto",m??(n?"max-w-394 sm:max-w-435":"max-w-363 sm:max-w-404")),_l=n?"!w-[1582px] min-w-[1582px] max-w-[1582px]":"!w-[1510px] min-w-[1510px] max-w-[1510px]",_n=[jsx(TableColumn,{textValue:v("tokens.listHeader.token"),width:p?ax:320,className:cn("bg-surface-base sticky left-0 z-10",p&&"!w-[200px] min-w-[200px] max-w-[200px] overflow-hidden","shadow-[1px_0_0_0_rgba(39,39,42,0.6)]"),children:v("tokens.listHeader.token")},"token"),jsx(TableColumn,{textValue:v("tokens.listHeader.price"),width:128,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx(Sortable,{sort:F.price,onSortChange:Y("price"),children:v("tokens.listHeader.price")}),jsx("span",{children:"/"}),jsx(Sortable,{sort:F[`priceChange${t}`],onSortChange:Y(`priceChange${t}`),children:v("tokens.listHeader.priceChange",{resolution:t})})]})},"price"),jsx(TableColumn,{textValue:v("tokens.listHeader.marketCap"),width:106,children:jsx(Sortable,{sort:F.marketCap,onSortChange:Y("marketCap"),children:v("tokens.listHeader.marketCap")})},"marketCap"),jsx(TableColumn,{textValue:v("tokens.listHeader.athMarketCap"),width:144,children:jsx(Sortable,{sort:F.athMarketCap,onSortChange:Y("athMarketCap"),children:v("tokens.listHeader.athMarketCap")})},"athMarketCap"),jsx(TableColumn,{textValue:v("tokens.listHeader.liquidity"),width:106,children:jsx(Sortable,{sort:F.tvl,onSortChange:Y("tvl"),children:v("tokens.listHeader.liquidity")})},"liquidity"),jsx(TableColumn,{textValue:v("tokens.listHeader.volumes",{resolution:t}),width:138,children:jsx(Sortable,{sort:F[`volumes${t}`],onSortChange:Y(`volumes${t}`),children:v("tokens.listHeader.volumes",{resolution:t})})},"volumes"),jsx(TableColumn,{textValue:v("tokens.listHeader.txs",{resolution:t}),width:126,children:jsx(Sortable,{sort:F[`trades${t}`],onSortChange:Y(`trades${t}`),children:v("tokens.listHeader.txs",{resolution:t})})},"txs"),jsx(TableColumn,{textValue:v("tokens.listHeader.traders",{resolution:t}),width:126,children:jsx(Sortable,{sort:F[`traders${t}`],onSortChange:Y(`traders${t}`),children:v("tokens.listHeader.traders",{resolution:t})})},"traders"),jsx(TableColumn,{textValue:v("tokens.listHeader.bluechip"),width:128,children:v("tokens.listHeader.bluechip")},"bluechip"),jsx(TableColumn,{textValue:v("tokens.listHeader.tokenInfo"),width:308,children:v("tokens.listHeader.tokenInfo")},"tokenInfo"),n?jsx(TableColumn,{textValue:v("tokens.listHeader.actions"),width:p?lx:124,align:"end",className:cn("bg-surface-base sticky right-0 z-10",p&&"!w-[72px] min-w-[72px] max-w-[72px]","shadow-[-1px_0_0_0_rgba(39,39,42,0.6)]"),children:v("tokens.listHeader.actions")},"actions"):void 0].filter(Boolean),qn=jsx(yl,{rowHeight:g,hasActions:!!n,isMobile:p}),$n=jsxs("div",{children:[jsx(EmptyIcon,{className:"w-10 h-10 mx-auto text-text-muted"}),jsx("p",{className:"mt-2 text-sm text-text-muted text-center",children:v("common.empty")})]}),ql=A=>[jsx(TableCell,{className:cn("sticky left-0 z-10 bg-surface-base",p&&"!w-[200px] min-w-[200px] max-w-[200px] overflow-hidden","shadow-[1px_0_0_0_rgba(39,39,42,0.6)]","transition-colors duration-150","[tr:hover_&]:!bg-surface-raised"),children:jsx(il,{token:A,resolution:t})},"token"),jsx(TableCell,{children:jsx(ul,{token:A,resolution:t})},"price"),jsx(TableCell,{children:jsx(dl,{token:A,resolution:t})},"marketCap"),jsx(TableCell,{children:jsx(Ya,{token:A,resolution:t})},"athMarketCap"),jsx(TableCell,{children:jsx(ll,{token:A,resolution:t})},"liquidity"),jsx(TableCell,{children:jsx(Tl,{token:A,resolution:t})},"volumes"),jsx(TableCell,{children:jsx(kl,{token:A,resolution:t})},"trades"),jsx(TableCell,{children:jsx(fl,{token:A,resolution:t})},"traders"),jsx(TableCell,{children:jsx(ja,{token:A,resolution:t})},"bluechip"),jsx(TableCell,{children:jsx(al,{token:A,resolution:t})},"tokenInfo"),n?jsx(TableCell,{className:cn("sticky right-0 z-10 bg-surface-base",p&&"!w-[72px] min-w-[72px] max-w-[72px]","shadow-[-1px_0_0_0_rgba(39,39,42,0.6)]","transition-colors duration-150","[tr:hover_&]:!bg-surface-raised"),children:jsx("div",{className:cn("!absolute inset-y-0 right-3 z-1 w-fit","flex items-center justify-end"),children:jsx(n,{token:A,resolution:t})})},"actions"):void 0].filter(Boolean),zn=A=>jsx(TableRow,{onClick:s?N(A):void 0,children:ql(A)},A.address);return p?jsx("div",{"data-token-list-mobile-layout":true,className:cn("h-full min-h-0 w-full mx-auto",m??(n?"max-w-394 sm:max-w-435":"max-w-363 sm:max-w-404")),style:{height:l},children:jsxs(StyledTable,{isHeaderSticky:true,isVirtualized:true,radius:"none",classNames:{table:cn("table-fixed",_l),wrapper:"p-0 w-full overflow-auto overscroll-contain bg-transparent rounded-none shadow-none",loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},baseRef:G,maxTableHeight:l,rowHeight:g,"aria-label":v("tokens.table.ariaLabel"),children:[jsx(TableHeader,{children:_n}),jsx(TableBody,{items:e,isLoading:f,loadingContent:qn,emptyContent:$n,children:zn})]})}):jsxs(StyledTable,{isHeaderSticky:true,isVirtualized:true,radius:"lg",className:Kl,classNames:{loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},baseRef:G,maxTableHeight:l,rowHeight:g,"aria-label":v("tokens.table.ariaLabel"),children:[jsx(TableHeader,{children:_n}),jsx(TableBody,{items:e,isLoading:f,loadingContent:qn,emptyContent:$n,children:zn})]})}function Ll({token:e,resolution:t,renderAction:o,isLast:n=false,onSelectToken:s,className:r}){let{t:i}=useTranslation(),{formatAge:a}=useLocalizedTimeFormatter(),d=useCopyToClipboard(),l=useTickAge(e.createdAt),c=useCallback(()=>{s?.(e);},[s,e]),u=useCallback(G=>{G.stopPropagation(),d(e.address,()=>toast.success(i("tokens.copied.address")));},[d,e.address,i]),m=e.marketData,p=e.stats?.[t],g=useMemo(()=>m?.priceInUsd,[m?.priceInUsd]),f=useMemo(()=>p?.priceChange,[p?.priceChange]),k=useMemo(()=>f&&new SafeBigNumber(f).gte(0),[f]),x=useMemo(()=>f?new SafeBigNumber(f).abs().toString():void 0,[f]),h=useMemo(()=>p?.volumesInUsd,[p?.volumesInUsd]),T=useMemo(()=>p?.buyVolumesInUsd,[p?.buyVolumesInUsd]),S=useMemo(()=>p?.sellVolumesInUsd,[p?.sellVolumesInUsd]),y=useMemo(()=>p?.trades,[p?.trades]),b=useMemo(()=>m?.marketCapInUsd,[m?.marketCapInUsd]),w=useMemo(()=>m?.tvlInUsd,[m?.tvlInUsd]),v=useMemo(()=>new SafeBigNumber(m?.top10HoldingsRatio).gte(.1),[m?.top10HoldingsRatio]),N=useMemo(()=>new SafeBigNumber(m?.devHoldingsRatio).gte(.1),[m?.devHoldingsRatio]),F=useMemo(()=>new SafeBigNumber(m?.sniperHoldingsRatio).gte(.1),[m?.sniperHoldingsRatio]),fe=useMemo(()=>new SafeBigNumber(m?.insiderHoldingsRatio).gte(.1),[m?.insiderHoldingsRatio]),Y=useMemo(()=>new SafeBigNumber(m?.bundleHoldingsRatio).gte(.1),[m?.bundleHoldingsRatio]),R=m?.holders!==void 0&&m.holders>0,ae=m?.kolHolders!==void 0&&m.kolHolders>0,V=m?.bluechipHolders!==void 0&&m.bluechipHolders>0,Te=R||ae||V;return jsxs("div",{className:cn("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer",!n&&"border-b",r),style:n?void 0:{borderBottomColor:"hsl(var(--heroui-content3) / 0.6)"},onClick:s?c:void 0,children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx(he,{token:e,enableSearch:true,enablePreview:!!e.image,showProgress:false,className:"w-20 h-20"}),jsxs("button",{type:"button",className:"text-xs font-mono text-text-muted hover:text-foreground leading-none",onClick:u,"aria-label":i("tokens.copied.address"),title:i("tokens.copied.address"),children:[e.address.slice(0,4),"...",e.address.slice(-4)]})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 text-left",onClick:u,"aria-label":i("tokens.copied.address"),title:i("tokens.copied.address"),children:[jsx("span",{className:"flex-none text-sm font-semibold leading-none whitespace-nowrap overflow-hidden text-ellipsis max-w-24",children:e.symbol}),jsx(StyledTooltip,{content:e.name,children:jsx("span",{className:"text-[13px] leading-none text-text-muted truncate max-w-20",children:e.name})}),jsx(CopyIcon,{className:"flex-none w-3.5 h-3.5 text-text-muted"})]}),jsxs("div",{className:"flex items-center gap-2 leading-none",children:[jsx("span",{className:"text-[13px] font-mono font-medium text-text-muted",children:a(l)}),e.socialMedias?.website&&jsx(Link,{href:e.socialMedias.website,className:"text-text-muted hover:text-primary",target:"_blank",onClick:G=>G.stopPropagation(),children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.twitter&&jsx(Link,{href:e.socialMedias.twitter,className:"text-text-muted hover:text-primary",target:"_blank",onClick:G=>G.stopPropagation(),children:jsx(TwitterIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.telegram&&jsx(Link,{href:e.socialMedias.telegram,className:"text-text-muted hover:text-primary",target:"_blank",onClick:G=>G.stopPropagation(),children:jsx(TelegramIcon,{className:"w-3.5 h-3.5"})}),jsx(Link,{href:searchTwitterUrl(`${e.symbol} OR ${e.address}`),className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",onClick:G=>G.stopPropagation(),children:jsx(SearchIcon,{className:"w-3.5 h-3.5"})})]}),jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-foreground/80 leading-none",children:[jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-text-muted",children:"MC"}),jsx("span",{children:formatMCapInUsd(b)})]}),jsx("span",{className:"text-text-muted/30",children:"\xB7"}),jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-text-muted",children:i("tokens.listHeader.liqShort")}),jsx("span",{children:formatAmountInUsd(w)})]})]}),Te&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-text-muted leading-none",children:[R&&jsx(StyledTooltip,{content:i("tokens.tokenInfo.holders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(PeopleIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(m?.holders)]})}),ae&&jsx(StyledTooltip,{content:i("tokens.tokenInfo.kolHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(CrownIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(m?.kolHolders)]})}),V&&jsx(StyledTooltip,{content:i("tokens.listHeader.bluechip"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(ShiningStarIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(m?.bluechipHolders)]})})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5 leading-none font-mono",children:[jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("span",{className:"text-base font-bold text-foreground leading-none",children:formatPriceInUsd(g)}),jsxs("span",{className:cn("inline-flex items-center gap-0.5 text-[10px] leading-none",k?"text-positive":"text-negative"),children:[k?jsx(TriangleUpIcon,{width:8,height:8}):jsx(TriangleDownIcon,{width:8,height:8}),f===void 0?"--":formatPercent(x)]})]}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-text-muted",children:"V"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmountInUsd(h)})]}),jsxs("span",{className:"text-[10px] leading-none",children:[jsx("span",{className:"text-positive",children:formatAmountInUsd(T)}),jsx("span",{className:"text-text-muted/50 mx-0.5",children:"/"}),jsx("span",{className:"text-negative",children:formatAmountInUsd(S)})]})]}),jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-text-muted",children:"TX"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmount(y)})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-start gap-4 relative",children:[jsx(HorizontalScrollContainer,{className:"flex-auto min-w-0",forceShowArrows:true,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(m?.top10HoldingsRatio),tooltip:i("tokens.tokenInfo.top10HoldingsRatio"),warning:v,disable:!m?.top10HoldingsRatio||m?.top10HoldingsRatio==="0"}),jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(m?.devHoldingsRatio),tooltip:i("tokens.tokenInfo.devHoldingsRatio"),warning:N,disable:!m?.devHoldingsRatio||m?.devHoldingsRatio==="0"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(m?.sniperHoldingsRatio),tooltip:i("tokens.tokenInfo.sniperHoldingsRatio"),warning:F,disable:!m?.sniperHoldingsRatio||m?.sniperHoldingsRatio==="0"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(m?.insiderHoldingsRatio),tooltip:i("tokens.tokenInfo.insiderHoldingsRatio"),warning:fe,disable:!m?.insiderHoldingsRatio||m?.insiderHoldingsRatio==="0"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(m?.bundleHoldingsRatio),tooltip:i("tokens.tokenInfo.bundleHoldingsRatio"),warning:Y,disable:!m?.bundleHoldingsRatio||m?.bundleHoldingsRatio==="0"})]})}),o&&jsx("div",{className:"flex-none relative",onClick:G=>G.stopPropagation(),children:o(e)})]})]})}function Pl({isLast:e=false}){return jsxs("div",{className:cn("w-full h-full overflow-hidden px-4 py-3 animate-pulse",!e&&"border-b"),style:e?void 0:{borderBottomColor:"hsl(var(--heroui-content3) / 0.6)"},children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx("div",{className:"w-20 h-20 rounded-lg bg-content2"}),jsx("div",{className:"w-14 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"w-16 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-20 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-8 h-3 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-3",children:[jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-16 h-4 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-14 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1 overflow-hidden",children:[jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"})]}),jsx("div",{className:"w-16 h-7 rounded-md bg-content2 flex-none"})]})]})}var Ox=154,Rl=10;function Ex({index:e,style:t,tokens:o,skeletonCount:n,resolution:s,renderAction:r,onSelectToken:i}){return o?jsx("div",{style:t,children:jsx(Ll,{token:o[e],resolution:s,isLast:e===o.length-1,renderAction:r,onSelectToken:i})}):jsx("div",{style:t,children:jsx(Pl,{isLast:e===n-1})})}function FI({tokens:e,resolution:t="24h",isLoading:o,height:n=600,renderAction:s,onSelectToken:r,className:i}){let a=o||!e?void 0:e,d=a?a.length:Rl,l=useMemo(()=>({tokens:a,skeletonCount:Rl,resolution:t,renderAction:s,onSelectToken:r}),[a,t,s,r]);return jsx("div",{className:cn("w-full h-full overflow-hidden border rounded-lg",i),style:{background:"hsl(var(--heroui-content2) / 0.4)",borderColor:"hsl(var(--heroui-content3) / 0.6)"},children:jsx(List,{className:"h-full w-full",style:{height:n},rowCount:d,rowHeight:Ox,overscanCount:5,rowComponent:Ex,rowProps:l})})}var _x=80;function Dl(e){return {chain:e.chain,address:e.address,name:e.name??"",symbol:e.symbol??"",decimals:e.decimals??0,image:e.image,description:e.description,socialMedias:e.socialMedias,launchedFrom:e.launchedFrom,migratedTo:e.migratedTo,createdAt:e.createdAt}}function qx(e,t,o){return e===t?o:e===o?t:o||t}function Vn(e){let t=e.token?.address??e.tokenAAddress??"",o=e.token;return {...o,chain:e.chain,address:t,name:o?.name??"",symbol:o?.symbol??"",decimals:o?.decimals??0,createdAt:o?.createdAt??e.createdAt,liquidities:[{poolAddress:e.poolAddress,pairAddress:qx(t,e.tokenAAddress,e.tokenBAddress),image:e.dex?.image,programAddress:e.dex?.programAddress,protocolFamily:e.dex?.protocolFamily,protocolName:e.dex?.protocolName}]}}function $x(e){return {...Dl(Vn(e)),...e.token??{},liquidities:Vn(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function Hl(e){return e.sort((t,o)=>{let n=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-n}),e.slice(0,_x)}function zx(e){if(!(!e?.filters&&!e?.keywords&&!e?.excludeKeywords))return {filters:e.filters,keywords:e.keywords,excludeKeywords:e.excludeKeywords}}function Qx(e){if(!(!e?.sortBy||!e.sortDirection))return {[e.sortBy]:e.sortDirection}}function Fl({chain:e,options:t,subscriptionTokens:o=[],deferUpdates:n=false,updateFlushInterval:s}){let r=useMemo(()=>({chain:e}),[e]),i=useRef(r),[a,d]=useState(true),[l,c]=useState([]);useEffect(()=>{JSON.stringify(r)!==JSON.stringify(i.current)&&(d(true),c([]),i.current=r);},[r]);let{data:u,isPending:m}=useNewPoolsQuery(r);useEffect(()=>{u&&(c(T=>{let S=[...T];for(let y of u){let b=$x(y),w=S.findIndex(v=>v.address===b.address);w>=0?S[w]=oe(S[w],b):S.push(b);}return Hl(S)}),d(false));},[u]);let p=useCallback(T=>{c(S=>{let y=[...S],b=false;for(let w of T){let v=y.findIndex(N=>N.address===w.address);v>=0?(b=true,y[v]=oe(y[v],w)):(b=true,y.push(Dl(w)));}return b?Hl(y):S});},[]),{enqueueUpdates:g}=me({applyUpdates:p,paused:n,flushInterval:s}),f=useCallback(T=>{g(T.map(Vn));},[g]);useNewPoolsSubscription({chain:e},f),useNewTokensMetadataSubscription({chain:e},g),et({chain:e,tokens:o.filter(T=>T.chain===e),onUpdate:g});let k=useMemo(()=>!!(m||a),[m,a]),x=useMemo(()=>ce(l,zx(t)),[l,t]);return {tokens:useMemo(()=>rt(x,Qx(t)),[x,t]),isLoading:k}}function YI({chain:e,resolution:t,filters:o,ActionsComponent:n,onSelectToken:s,height:r,itemHeight:i,itemHeightMobile:a,className:d}){let[l,c]=useState(),[u,m]=useState(false),[p,g]=useState([]);useEffect(()=>{c(void 0),g([]);},[e,t]);let f=useMemo(()=>{let h=Object.keys(l??{})[0],T=l?.[h];return {...o,...h&&T?{sortBy:h,sortDirection:T}:void 0}},[o,l]),{tokens:k,isLoading:x}=Fl({chain:e,options:f,subscriptionTokens:p,deferUpdates:u});return jsx(kt,{tokens:k,isLoading:x,resolution:t,height:r,itemHeight:i,itemHeightMobile:a,ActionsComponent:n,onSelectToken:s,sortDirections:l,onSortChange:c,onScrollingChange:m,onVisibleTokensChange:g,className:d})}function El({chain:e,filters:t,sortDirections:o,refetchInterval:n=3e4,deferUpdates:s=false,updateFlushInterval:r}){let i=useMemo(()=>({chain:e}),[e]),a=useRef(i),[d,l]=useState(true);useEffect(()=>{JSON.stringify(i)!==JSON.stringify(a.current)&&(l(true),u([]),a.current=i);},[i]);let[c,u]=useState([]),{data:m,isPending:p}=useStockTokensQuery(i,{refetchInterval:n});useEffect(()=>{m&&(u(T=>Yt(T,m)),l(false));},[m]);let g=useCallback(T=>{u(S=>Me(S,T));},[]),{enqueueUpdates:f}=me({applyUpdates:g,paused:s,flushInterval:r});useStockTokensSubscription({chain:e},f);let k=useMemo(()=>!!(p||d),[p,d]),x=useMemo(()=>ce(c,t),[c,t]);return {tokens:useMemo(()=>rt(x,o),[x,o]),isLoading:k}}function uM({chain:e,resolution:t,filters:o,ActionsComponent:n,onSelectToken:s,height:r,itemHeight:i,itemHeightMobile:a,className:d}){let[l,c]=useState(),[u,m]=useState(false);useEffect(()=>{c(void 0);},[e,t]);let{tokens:p,isLoading:g}=El({chain:e,filters:o,sortDirections:l,deferUpdates:u});return jsx(kt,{tokens:p,isLoading:g,resolution:t,height:r,itemHeight:i,itemHeightMobile:a,ActionsComponent:n,onSelectToken:s,sortDirections:l,onSortChange:c,onScrollingChange:m,className:d})}function yM({chain:e,resolution:t,filters:o,ActionsComponent:n,onSelectToken:s,height:r,itemHeight:i,itemHeightMobile:a,className:d}){let[l,c]=useState(),[u,m]=useState(false);useEffect(()=>{c(void 0);},[e,t]);let{tokens:p,isLoading:g}=ao({chain:e,resolution:t,filters:o,sortDirections:l,deferUpdates:u});return jsx(kt,{tokens:p,isLoading:g,resolution:t,height:r,itemHeight:i,itemHeightMobile:a,ActionsComponent:n,onSelectToken:s,sortDirections:l,onSortChange:c,onScrollingChange:m,className:d})}var mT=15e3;function uT({chain:e,addresses:t,pollMs:o=mT}){let n=t.length>0,[s,r]=useState({}),i=useTokensQuery({chain:e,addresses:t},{enabled:n,refetchInterval:o});useEffect(()=>{i.data&&r(m=>{let p={};for(let g of i.data){let f=m[g.address];p[g.address]=f?oe(f,g):g;}return p});},[i.data]);let a=useTokenMarketRuntime(),d=Array.from(new Set(t.map(m=>m.trim()).filter(Boolean))).sort().join(","),l=useMemo(()=>d?d.split(","):[],[d]);useEffect(()=>{if(!n)return;let m=[];for(let p of l){let g=tokenMarketKey(e,p),f=a.subscribe(g,x=>{let h=x.token;h&&r(T=>{let S=T[h.address],y=S?oe(S,h):h;return y===S?T:{...T,[h.address]:y}});}),k=a.retain(g);m.push(()=>{f(),k();});}return ()=>{for(let p of m)p();}},[a,e,d,n,l]);let c=i.refetch,u=useCallback(async()=>{await c();},[c]);return {tokens:s,isPending:i.isPending,isFetching:i.isFetching,isError:i.isError,isSuccess:i.isSuccess,error:i.error,refetch:u}}export{wi as DEFAULT_FLIP_HOVER_RESOLUTIONS,od as HolderTagBadge,qt as HolderTagBadgeList,$ as HoldingRatioChip,YI as NewTokenListWidget,gy as PulseFinalStretchListWidget,Ze as PulseList,Xn as PulseListHeader,mr as PulseListItem,Ko as PulseListItemSkeleton,ty as PulseMigratedListWidget,Eh as PulseNewListWidget,en as SEARCH_MODAL_ID,Xr as SearchHistoryUI,Jr as SearchHistoryWidget,Yr as SearchInputUI,tv as SearchModal,to as SearchResultItemUI,oo as SearchResultListHeader,ro as SearchResultListSkeleton,ss as SearchResultListWidget,cv as SearchTokensButton,ms as SearchWidget,uM as StockTokenListWidget,Cc as TOKEN_SEARCH_HISTORY_KEY,_o as TRADER_TAG_META,gi as TokenAbout,rw as TokenAboutWidget,Js as TokenActivitiesList,DC as TokenActivitiesListWidget,he as TokenAvatar,bs as TokenBasicInfo,_s as TokenBasicInfoWidget,Ni as TokenCategories,jw as TokenCategoriesWidget,bi as TokenCexListing,Ow as TokenCexListingWidget,ra as TokenChartBanner,jP as TokenChartBannerWidget,Ts as TokenDetailHeader,_N as TokenDetailHeaderWidget,Qi as TokenDevTokensList,OP as TokenDevTokensListWidget,Gi as TokenDevTokensSummary,Ss as TokenHoldersCount,Cs as TokenHoldersCountWidget,zs as TokenHoldersList,mC as TokenHoldersListWidget,hi as TokenLiquidities,vw as TokenLiquiditiesWidget,kt as TokenList,Ro as TokenListFilter,Ba as TokenListFilterModal,qa as TokenListFilterPopover,vR as TokenListFilterWidget,Qa as TokenListResolutionSelectorDesktop,Xa as TokenListResolutionSelectorMobile,BR as TokenListResolutionSelectorWidget,Ls as TokenMarketCap,Rs as TokenMarketCapWidget,Fi as TokenOrdersList,eP as TokenOrdersListWidget,Ai as TokenPositionsList,FL as TokenPositionsListWidget,Ms as TokenPrice,Ds as TokenPriceWidget,da as TokenReusedImageList,A1 as TokenReusedImageListWidget,pi as TokenSecurity,_0 as TokenSecurityWidget,aa as TokenSimilarTokens,k1 as TokenSimilarTokensWidget,Fs as TokenSocialMedia,Os as TokenSocialMediaWidget,Li as TokenStatsFlipBase,Pi as TokenStatsFlipHover,kL as TokenStatsFlipWidget,Vi as TokenTopTradersList,yP as TokenTopTradersListWidget,ii as TokenTradersOverview,JC as TokenTradersOverviewWidget,li as TokenTransactionsOverview,u0 as TokenTransactionsOverviewWidget,Ws as TokenVolume,Ks as TokenVolumeWidget,ci as TokenVolumesOverview,P0 as TokenVolumesOverviewWidget,td as TraderTagBadge,jn as TraderTagBadgeList,Ll as TrendingTokenCard,FI as TrendingTokenCardList,Pl as TrendingTokenCardSkeleton,yM as TrendingTokenListWidget,bt as createTokenSearchHistoryStorage,Fl as useNewTokensScript,_r as usePulseFinalStretchListScript,Er as usePulseMigratedListScript,Ar as usePulseNewListScript,zr as useSearchHistory,os as useSearchResultListScript,kv as useSearchScript,El as useStockTokensScript,ki as useTokenAboutScript,ri as useTokenActivitiesListScript,rS as useTokenBasicInfoScript,Ci as useTokenCategoriesScript,vi as useTokenCexListingScript,ia as useTokenChartBannerScript,hs as useTokenDetailHeaderScript,ji as useTokenDevTokensListScript,Ns as useTokenHoldersCountScript,Xs as useTokenHoldersListScript,yi as useTokenLiquiditiesScript,Ps as useTokenMarketCapScript,Bi as useTokenOrdersListScript,Hi as useTokenPositionsListScript,Hs as useTokenPriceScript,ca as useTokenReusedImageListScript,fi as useTokenSecurityScript,la as useTokenSimilarTokensScript,Us as useTokenSocialMediaScript,Ri as useTokenStatsFlipScript,_i as useTokenTopTradersListScript,ai as useTokenTradersOverviewScript,di as useTokenTransactionsOverviewScript,Vs as useTokenVolumeScript,mi as useTokenVolumesOverviewScript,uT as useTokens,ao as useTrendingTokensScript};//# sourceMappingURL=index.mjs.map
23
+ `,jk={background:"linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%)",backgroundSize:"200% 100%",animation:"tklShimmer 1.8s ease-in-out infinite",borderRadius:6};function K(e,t,o,n){return {...jk,animationDelay:`${e}ms`,width:t,height:o,...n}}var bl=10;function vl({rowHeight:e,hasActions:t,isMobile:o}){return jsxs(Fragment,{children:[jsx("style",{children:Zk}),Array.from({length:bl}).map((n,s)=>jsx(ex,{index:s,rowHeight:e,hasActions:t,isMobile:o,isLast:s===bl-1},s))]})}function ex({index:e,rowHeight:t,hasActions:o,isMobile:n,isLast:s}){let r=e*80,i=n?208:320,a=n?40:64,d=n?72:124,l=n?64:97;return jsxs("div",{className:s?void 0:"border-b border-border-subtle/30",style:{display:"flex",alignItems:"center",height:t,flexShrink:0},children:[jsxs("div",{style:{width:i,padding:n?"0 12px":"0 12px 0 24px",display:"flex",alignItems:"center",gap:12,flexShrink:0},children:[jsx("div",{style:K(r,a,a,{borderRadius:8,flexShrink:0})}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1},children:[jsx("div",{style:K(r+30,"60%",20)}),jsx("div",{style:K(r+60,"80%",16)})]})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:K(r+20,72,20)}),jsx("div",{style:K(r+40,52,16)})]}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:K(r+30,64,20)})}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:K(r+40,60,20)})}),jsxs("div",{style:{width:138,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:K(r+50,72,20)}),jsx("div",{style:K(r+70,100,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:K(r+60,48,20)}),jsx("div",{style:K(r+80,80,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:K(r+70,40,20)}),jsx("div",{style:K(r+90,72,16)})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",alignItems:"center",gap:10},children:[jsx("div",{style:K(r+80,20,20,{borderRadius:4})}),jsx("div",{style:K(r+90,52,20)})]}),jsxs("div",{style:{width:308,padding:"0 12px",display:"flex",alignItems:"center",gap:20},children:[jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:K(r+80,52,16)}),jsx("div",{style:K(r+100,40,16)}),jsx("div",{style:K(r+120,36,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:K(r+90,48,16)}),jsx("div",{style:K(r+110,40,16)}),jsx("div",{style:K(r+130,40,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:K(r+100,40,16)}),jsx("div",{style:K(r+120,36,16)})]})]}),o&&jsx("div",{style:{width:d,padding:n?"0 12px 0 0":"0 24px 0 12px",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:jsx("div",{style:K(r+100,l,32,{borderRadius:8})})})]})}var ax=200,lx=72,wl=3;function kt({tokens:e,resolution:t="24h",isLoading:o,ActionsComponent:n,onSelectToken:s,sortDirections:r,onSortChange:i,onScrollingChange:a,onVisibleTokensChange:d,height:l=600,itemHeight:c=88,itemHeightMobile:u=72,className:m}){let{isMobile:p}=useScreen(),g=p?u:c,f=!!o,k=useRef(void 0),x=useRef(false),y=useRef(null),T=useRef(new Set),S=useRef([]),h=useRef(void 0),b=useRef(d),w=useRef(a);b.current=d,w.current=a;let{t:v}=useTranslation(),N=useCallback(A=>Z=>{Z.preventDefault(),Z.stopPropagation(),s?.(A);},[s]),[F,fe]=useState(r??{});useEffect(()=>{fe(r??{});},[r]);let Y=useCallback(A=>Z=>{let Ke={[A]:Z};fe(Ke),i?.(Ke);},[i]),R=useCallback(A=>{if(f||e.length===0)return [];let Z=A?.scrollTop??0,Ke=A?.clientHeight||l,Xn=Math.floor(Z/g),$l=Math.ceil(Ke/g),zl=Math.max(0,Xn-wl),Ql=Math.min(e.length,Xn+$l+wl);return e.slice(zl,Ql)},[g,l,f,e]),ae=useCallback(A=>{let Z=Array.from(new Set(A.map(Ke=>`${Ke.chain}:${Ke.address.trim()}`))).sort().join(",");Z!==h.current&&(h.current=Z,b.current?.(A));},[]),V=useRef(R);V.current=R;let Te=useCallback(A=>{let Z=A.target;Z instanceof HTMLElement&&(y.current=Z,S.current=V.current(Z)),x.current||(x.current=true,w.current?.(true)),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{x.current=false,ae(S.current),w.current?.(false);},180);},[ae]),G=useCallback(A=>{!A||T.current.has(A)||(T.current.add(A),A.addEventListener("scroll",Te,{passive:true}));},[Te]);useEffect(()=>{for(let A of [...T.current]){let Z=A.querySelector("table")?.parentElement;Z&&G(Z);}},[G,p,f,e.length]),useEffect(()=>{let A=R(y.current);S.current=A,x.current||ae(A);},[ae,R]),useEffect(()=>()=>{k.current&&clearTimeout(k.current),T.current.forEach(A=>{A.removeEventListener("scroll",Te);}),T.current.clear(),x.current&&w.current?.(false),b.current?.([]);},[Te]);let Kl=cn("h-full mx-auto",m??(n?"max-w-394 sm:max-w-435":"max-w-363 sm:max-w-404")),_l=n?"!w-[1582px] min-w-[1582px] max-w-[1582px]":"!w-[1510px] min-w-[1510px] max-w-[1510px]",$n=[jsx(TableColumn,{textValue:v("tokens.listHeader.token"),width:p?ax:320,className:cn("bg-surface-base sticky left-0 z-10",p&&"!w-[200px] min-w-[200px] max-w-[200px] overflow-hidden","shadow-[1px_0_0_0_rgba(39,39,42,0.6)]"),children:v("tokens.listHeader.token")},"token"),jsx(TableColumn,{textValue:v("tokens.listHeader.price"),width:128,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx(Sortable,{sort:F.price,onSortChange:Y("price"),children:v("tokens.listHeader.price")}),jsx("span",{children:"/"}),jsx(Sortable,{sort:F[`priceChange${t}`],onSortChange:Y(`priceChange${t}`),children:v("tokens.listHeader.priceChange",{resolution:t})})]})},"price"),jsx(TableColumn,{textValue:v("tokens.listHeader.marketCap"),width:106,children:jsx(Sortable,{sort:F.marketCap,onSortChange:Y("marketCap"),children:v("tokens.listHeader.marketCap")})},"marketCap"),jsx(TableColumn,{textValue:v("tokens.listHeader.athMarketCap"),width:144,children:jsx(Sortable,{sort:F.athMarketCap,onSortChange:Y("athMarketCap"),children:v("tokens.listHeader.athMarketCap")})},"athMarketCap"),jsx(TableColumn,{textValue:v("tokens.listHeader.liquidity"),width:106,children:jsx(Sortable,{sort:F.tvl,onSortChange:Y("tvl"),children:v("tokens.listHeader.liquidity")})},"liquidity"),jsx(TableColumn,{textValue:v("tokens.listHeader.volumes",{resolution:t}),width:138,children:jsx(Sortable,{sort:F[`volumes${t}`],onSortChange:Y(`volumes${t}`),children:v("tokens.listHeader.volumes",{resolution:t})})},"volumes"),jsx(TableColumn,{textValue:v("tokens.listHeader.txs",{resolution:t}),width:126,children:jsx(Sortable,{sort:F[`trades${t}`],onSortChange:Y(`trades${t}`),children:v("tokens.listHeader.txs",{resolution:t})})},"txs"),jsx(TableColumn,{textValue:v("tokens.listHeader.traders",{resolution:t}),width:126,children:jsx(Sortable,{sort:F[`traders${t}`],onSortChange:Y(`traders${t}`),children:v("tokens.listHeader.traders",{resolution:t})})},"traders"),jsx(TableColumn,{textValue:v("tokens.listHeader.bluechip"),width:128,children:v("tokens.listHeader.bluechip")},"bluechip"),jsx(TableColumn,{textValue:v("tokens.listHeader.tokenInfo"),width:308,children:v("tokens.listHeader.tokenInfo")},"tokenInfo"),n?jsx(TableColumn,{textValue:v("tokens.listHeader.actions"),width:p?lx:124,align:"end",className:cn("bg-surface-base sticky right-0 z-10",p&&"!w-[72px] min-w-[72px] max-w-[72px]","shadow-[-1px_0_0_0_rgba(39,39,42,0.6)]"),children:v("tokens.listHeader.actions")},"actions"):void 0].filter(Boolean),zn=jsx(vl,{rowHeight:g,hasActions:!!n,isMobile:p}),Qn=jsxs("div",{children:[jsx(EmptyIcon,{className:"w-10 h-10 mx-auto text-text-muted"}),jsx("p",{className:"mt-2 text-sm text-text-muted text-center",children:v("common.empty")})]}),ql=A=>[jsx(TableCell,{className:cn("sticky left-0 z-10 bg-surface-base",p&&"!w-[200px] min-w-[200px] max-w-[200px] overflow-hidden","shadow-[1px_0_0_0_rgba(39,39,42,0.6)]","transition-colors duration-150","[tr:hover_&]:!bg-surface-raised"),children:jsx(ll,{token:A,resolution:t})},"token"),jsx(TableCell,{children:jsx(fl,{token:A,resolution:t})},"price"),jsx(TableCell,{children:jsx(ml,{token:A,resolution:t})},"marketCap"),jsx(TableCell,{children:jsx(ja,{token:A,resolution:t})},"athMarketCap"),jsx(TableCell,{children:jsx(cl,{token:A,resolution:t})},"liquidity"),jsx(TableCell,{children:jsx(yl,{token:A,resolution:t})},"volumes"),jsx(TableCell,{children:jsx(Tl,{token:A,resolution:t})},"trades"),jsx(TableCell,{children:jsx(kl,{token:A,resolution:t})},"traders"),jsx(TableCell,{children:jsx(tl,{token:A,resolution:t})},"bluechip"),jsx(TableCell,{children:jsx(dl,{token:A,resolution:t})},"tokenInfo"),n?jsx(TableCell,{className:cn("sticky right-0 z-10 bg-surface-base",p&&"!w-[72px] min-w-[72px] max-w-[72px]","shadow-[-1px_0_0_0_rgba(39,39,42,0.6)]","transition-colors duration-150","[tr:hover_&]:!bg-surface-raised"),children:jsx("div",{className:cn("!absolute inset-y-0 right-3 z-1 w-fit","flex items-center justify-end"),children:jsx(n,{token:A,resolution:t})})},"actions"):void 0].filter(Boolean),Gn=A=>jsx(TableRow,{onClick:s?N(A):void 0,children:ql(A)},A.address);return p?jsx("div",{"data-token-list-mobile-layout":true,className:cn("h-full min-h-0 w-full mx-auto",m??(n?"max-w-394 sm:max-w-435":"max-w-363 sm:max-w-404")),style:{height:l},children:jsxs(StyledTable,{isHeaderSticky:true,isVirtualized:true,radius:"none",classNames:{table:cn("table-fixed",_l),wrapper:"p-0 w-full overflow-auto overscroll-contain bg-transparent rounded-none shadow-none",loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},baseRef:G,maxTableHeight:l,rowHeight:g,"aria-label":v("tokens.table.ariaLabel"),children:[jsx(TableHeader,{children:$n}),jsx(TableBody,{items:e,isLoading:f,loadingContent:zn,emptyContent:Qn,children:Gn})]})}):jsxs(StyledTable,{isHeaderSticky:true,isVirtualized:true,radius:"lg",className:Kl,classNames:{loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},baseRef:G,maxTableHeight:l,rowHeight:g,"aria-label":v("tokens.table.ariaLabel"),children:[jsx(TableHeader,{children:$n}),jsx(TableBody,{items:e,isLoading:f,loadingContent:zn,emptyContent:Qn,children:Gn})]})}function Rl({token:e,resolution:t,renderAction:o,isLast:n=false,onSelectToken:s,className:r}){let{t:i}=useTranslation(),{formatAge:a}=useLocalizedTimeFormatter(),d=useCopyToClipboard(),l=useTickAge(e.createdAt),c=useCallback(()=>{s?.(e);},[s,e]),u=useCallback(G=>{G.stopPropagation(),d(e.address,()=>toast.success(i("tokens.copied.address")));},[d,e.address,i]),m=e.marketData,p=e.stats?.[t],g=useMemo(()=>m?.priceInUsd,[m?.priceInUsd]),f=useMemo(()=>p?.priceChange,[p?.priceChange]),k=useMemo(()=>f&&new SafeBigNumber(f).gte(0),[f]),x=useMemo(()=>f?new SafeBigNumber(f).abs().toString():void 0,[f]),y=useMemo(()=>p?.volumesInUsd,[p?.volumesInUsd]),T=useMemo(()=>p?.buyVolumesInUsd,[p?.buyVolumesInUsd]),S=useMemo(()=>p?.sellVolumesInUsd,[p?.sellVolumesInUsd]),h=useMemo(()=>p?.trades,[p?.trades]),b=useMemo(()=>m?.marketCapInUsd,[m?.marketCapInUsd]),w=useMemo(()=>m?.tvlInUsd,[m?.tvlInUsd]),v=useMemo(()=>new SafeBigNumber(m?.top10HoldingsRatio).gte(.1),[m?.top10HoldingsRatio]),N=useMemo(()=>new SafeBigNumber(m?.devHoldingsRatio).gte(.1),[m?.devHoldingsRatio]),F=useMemo(()=>new SafeBigNumber(m?.sniperHoldingsRatio).gte(.1),[m?.sniperHoldingsRatio]),fe=useMemo(()=>new SafeBigNumber(m?.insiderHoldingsRatio).gte(.1),[m?.insiderHoldingsRatio]),Y=useMemo(()=>new SafeBigNumber(m?.bundleHoldingsRatio).gte(.1),[m?.bundleHoldingsRatio]),R=m?.holders!==void 0&&m.holders>0,ae=m?.kolHolders!==void 0&&m.kolHolders>0,V=m?.bluechipHolders!==void 0&&m.bluechipHolders>0,Te=R||ae||V;return jsxs("div",{className:cn("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer",!n&&"border-b",r),style:n?void 0:{borderBottomColor:"hsl(var(--heroui-content3) / 0.6)"},onClick:s?c:void 0,children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx(he,{token:e,enableSearch:true,enablePreview:!!e.image,showProgress:false,className:"w-20 h-20"}),jsxs("button",{type:"button",className:"text-xs font-mono text-text-muted hover:text-foreground leading-none",onClick:u,"aria-label":i("tokens.copied.address"),title:i("tokens.copied.address"),children:[e.address.slice(0,4),"...",e.address.slice(-4)]})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 text-left",onClick:u,"aria-label":i("tokens.copied.address"),title:i("tokens.copied.address"),children:[jsx("span",{className:"flex-none text-sm font-semibold leading-none whitespace-nowrap overflow-hidden text-ellipsis max-w-24",children:e.symbol}),jsx(StyledTooltip,{content:e.name,children:jsx("span",{className:"text-[13px] leading-none text-text-muted truncate max-w-20",children:e.name})}),jsx(CopyIcon,{className:"flex-none w-3.5 h-3.5 text-text-muted"})]}),jsxs("div",{className:"flex items-center gap-2 leading-none",children:[jsx("span",{className:"text-[13px] font-mono font-medium text-text-muted",children:a(l)}),e.socialMedias?.website&&jsx(Link,{href:e.socialMedias.website,className:"text-text-muted hover:text-primary",target:"_blank",onClick:G=>G.stopPropagation(),children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.twitter&&jsx(Link,{href:e.socialMedias.twitter,className:"text-text-muted hover:text-primary",target:"_blank",onClick:G=>G.stopPropagation(),children:jsx(TwitterIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.telegram&&jsx(Link,{href:e.socialMedias.telegram,className:"text-text-muted hover:text-primary",target:"_blank",onClick:G=>G.stopPropagation(),children:jsx(TelegramIcon,{className:"w-3.5 h-3.5"})}),jsx(Link,{href:searchTwitterUrl(`${e.symbol} OR ${e.address}`),className:"max-sm:hidden text-text-muted hover:text-primary",target:"_blank",onClick:G=>G.stopPropagation(),children:jsx(SearchIcon,{className:"w-3.5 h-3.5"})})]}),jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-foreground/80 leading-none",children:[jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-text-muted",children:"MC"}),jsx("span",{children:formatMCapInUsd(b)})]}),jsx("span",{className:"text-text-muted/30",children:"\xB7"}),jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-text-muted",children:i("tokens.listHeader.liqShort")}),jsx("span",{children:formatAmountInUsd(w)})]})]}),Te&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-text-muted leading-none",children:[R&&jsx(StyledTooltip,{content:i("tokens.tokenInfo.holders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(PeopleIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(m?.holders)]})}),ae&&jsx(StyledTooltip,{content:i("tokens.tokenInfo.kolHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(CrownIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(m?.kolHolders)]})}),V&&jsx(StyledTooltip,{content:i("tokens.listHeader.bluechip"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(ShiningStarIcon,{className:"w-3 h-3 text-text-muted"}),formatAmount(m?.bluechipHolders)]})})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5 leading-none font-mono",children:[jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("span",{className:"text-base font-bold text-foreground leading-none",children:formatPriceInUsd(g)}),jsxs("span",{className:cn("inline-flex items-center gap-0.5 text-[10px] leading-none",k?"text-positive":"text-negative"),children:[k?jsx(TriangleUpIcon,{width:8,height:8}):jsx(TriangleDownIcon,{width:8,height:8}),f===void 0?"--":formatPercent(x)]})]}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-text-muted",children:"V"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmountInUsd(y)})]}),jsxs("span",{className:"text-[10px] leading-none",children:[jsx("span",{className:"text-positive",children:formatAmountInUsd(T)}),jsx("span",{className:"text-text-muted/50 mx-0.5",children:"/"}),jsx("span",{className:"text-negative",children:formatAmountInUsd(S)})]})]}),jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-text-muted",children:"TX"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmount(h)})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-start gap-4 relative",children:[jsx(HorizontalScrollContainer,{className:"flex-auto min-w-0",forceShowArrows:true,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(m?.top10HoldingsRatio),tooltip:i("tokens.tokenInfo.top10HoldingsRatio"),warning:v,disable:!m?.top10HoldingsRatio||m?.top10HoldingsRatio==="0"}),jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(m?.devHoldingsRatio),tooltip:i("tokens.tokenInfo.devHoldingsRatio"),warning:N,disable:!m?.devHoldingsRatio||m?.devHoldingsRatio==="0"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(m?.sniperHoldingsRatio),tooltip:i("tokens.tokenInfo.sniperHoldingsRatio"),warning:F,disable:!m?.sniperHoldingsRatio||m?.sniperHoldingsRatio==="0"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(m?.insiderHoldingsRatio),tooltip:i("tokens.tokenInfo.insiderHoldingsRatio"),warning:fe,disable:!m?.insiderHoldingsRatio||m?.insiderHoldingsRatio==="0"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(m?.bundleHoldingsRatio),tooltip:i("tokens.tokenInfo.bundleHoldingsRatio"),warning:Y,disable:!m?.bundleHoldingsRatio||m?.bundleHoldingsRatio==="0"})]})}),o&&jsx("div",{className:"flex-none relative",onClick:G=>G.stopPropagation(),children:o(e)})]})]})}function Al({isLast:e=false}){return jsxs("div",{className:cn("w-full h-full overflow-hidden px-4 py-3 animate-pulse",!e&&"border-b"),style:e?void 0:{borderBottomColor:"hsl(var(--heroui-content3) / 0.6)"},children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx("div",{className:"w-20 h-20 rounded-lg bg-content2"}),jsx("div",{className:"w-14 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"w-16 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-20 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-8 h-3 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-3",children:[jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-16 h-4 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-14 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1 overflow-hidden",children:[jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"})]}),jsx("div",{className:"w-16 h-7 rounded-md bg-content2 flex-none"})]})]})}var Ox=154,Il=10;function Ex({index:e,style:t,tokens:o,skeletonCount:n,resolution:s,renderAction:r,onSelectToken:i}){return o?jsx("div",{style:t,children:jsx(Rl,{token:o[e],resolution:s,isLast:e===o.length-1,renderAction:r,onSelectToken:i})}):jsx("div",{style:t,children:jsx(Al,{isLast:e===n-1})})}function UI({tokens:e,resolution:t="24h",isLoading:o,height:n=600,renderAction:s,onSelectToken:r,className:i}){let a=o||!e?void 0:e,d=a?a.length:Il,l=useMemo(()=>({tokens:a,skeletonCount:Il,resolution:t,renderAction:s,onSelectToken:r}),[a,t,s,r]);return jsx("div",{className:cn("w-full h-full overflow-hidden border rounded-lg",i),style:{background:"hsl(var(--heroui-content2) / 0.4)",borderColor:"hsl(var(--heroui-content3) / 0.6)"},children:jsx(List,{className:"h-full w-full",style:{height:n},rowCount:d,rowHeight:Ox,overscanCount:5,rowComponent:Ex,rowProps:l})})}var _x=80;function Ul(e){return {chain:e.chain,address:e.address,name:e.name??"",symbol:e.symbol??"",decimals:e.decimals??0,image:e.image,description:e.description,socialMedias:e.socialMedias,launchedFrom:e.launchedFrom,migratedTo:e.migratedTo,createdAt:e.createdAt}}function qx(e,t,o){return e===t?o:e===o?t:o||t}function Vn(e){let t=e.token?.address??e.tokenAAddress??"",o=e.token;return {...o,chain:e.chain,address:t,name:o?.name??"",symbol:o?.symbol??"",decimals:o?.decimals??0,createdAt:o?.createdAt??e.createdAt,liquidities:[{poolAddress:e.poolAddress,pairAddress:qx(t,e.tokenAAddress,e.tokenBAddress),image:e.dex?.image,programAddress:e.dex?.programAddress,protocolFamily:e.dex?.protocolFamily,protocolName:e.dex?.protocolName}]}}function $x(e){return {...Ul(Vn(e)),...e.token??{},liquidities:Vn(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function Fl(e){return e.sort((t,o)=>{let n=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-n}),e.slice(0,_x)}function zx(e){if(!(!e?.filters&&!e?.keywords&&!e?.excludeKeywords))return {filters:e.filters,keywords:e.keywords,excludeKeywords:e.excludeKeywords}}function Qx(e){if(!(!e?.sortBy||!e.sortDirection))return {[e.sortBy]:e.sortDirection}}function Ol({chain:e,options:t,subscriptionTokens:o=[],deferUpdates:n=false,updateFlushInterval:s}){let r=useMemo(()=>({chain:e}),[e]),i=useRef(r),[a,d]=useState(true),[l,c]=useState([]);useEffect(()=>{JSON.stringify(r)!==JSON.stringify(i.current)&&(d(true),c([]),i.current=r);},[r]);let{data:u,isPending:m}=useNewPoolsQuery(r);useEffect(()=>{u&&(c(T=>{let S=[...T];for(let h of u){let b=$x(h),w=S.findIndex(v=>v.address===b.address);w>=0?S[w]=oe(S[w],b):S.push(b);}return Fl(S)}),d(false));},[u]);let p=useCallback(T=>{c(S=>{let h=[...S],b=false;for(let w of T){let v=h.findIndex(N=>N.address===w.address);v>=0?(b=true,h[v]=oe(h[v],w)):(b=true,h.push(Ul(w)));}return b?Fl(h):S});},[]),{enqueueUpdates:g}=me({applyUpdates:p,paused:n,flushInterval:s}),f=useCallback(T=>{g(T.map(Vn));},[g]);useNewPoolsSubscription({chain:e},f),useNewTokensMetadataSubscription({chain:e},g),be({chain:e,tokens:o.filter(T=>T.chain===e),onUpdate:g});let k=useMemo(()=>!!(m||a),[m,a]),x=useMemo(()=>ce(l,zx(t)),[l,t]);return {tokens:useMemo(()=>rt(x,Qx(t)),[x,t]),isLoading:k}}function ZI({chain:e,resolution:t,filters:o,ActionsComponent:n,onSelectToken:s,height:r,itemHeight:i,itemHeightMobile:a,className:d}){let[l,c]=useState(),[u,m]=useState(false),[p,g]=useState([]);useEffect(()=>{c(void 0);},[e,t]);let f=useMemo(()=>{let y=Object.keys(l??{})[0],T=l?.[y];return {...o,...y&&T?{sortBy:y,sortDirection:T}:void 0}},[o,l]),{tokens:k,isLoading:x}=Ol({chain:e,options:f,subscriptionTokens:p,deferUpdates:u});return jsx(kt,{tokens:k,isLoading:x,resolution:t,height:r,itemHeight:i,itemHeightMobile:a,ActionsComponent:n,onSelectToken:s,sortDirections:l,onSortChange:c,onScrollingChange:m,onVisibleTokensChange:g,className:d})}function Wl({chain:e,filters:t,sortDirections:o,subscriptionTokens:n=[],refetchInterval:s=3e4,deferUpdates:r=false,updateFlushInterval:i}){let a=useMemo(()=>({chain:e}),[e]),d=useRef(a),[l,c]=useState(true);useEffect(()=>{JSON.stringify(a)!==JSON.stringify(d.current)&&(c(true),m([]),d.current=a);},[a]);let[u,m]=useState([]),{data:p,isPending:g}=useStockTokensQuery(a,{refetchInterval:s});useEffect(()=>{p&&(m(S=>Yt(S,p)),c(false));},[p]);let f=useCallback(S=>{m(h=>He(h,S));},[]),{enqueueUpdates:k}=me({applyUpdates:f,paused:r,flushInterval:i});useStockTokensSubscription({chain:e},k),be({chain:e,tokens:n.filter(S=>S.chain===e),onUpdate:k});let x=useMemo(()=>!!(g||l),[g,l]),y=useMemo(()=>ce(u,t),[u,t]);return {tokens:useMemo(()=>rt(y,o),[y,o]),isLoading:x}}function fM({chain:e,resolution:t,filters:o,ActionsComponent:n,onSelectToken:s,height:r,itemHeight:i,itemHeightMobile:a,className:d}){let[l,c]=useState(),[u,m]=useState(false),[p,g]=useState([]);useEffect(()=>{c(void 0);},[e,t]);let{tokens:f,isLoading:k}=Wl({chain:e,filters:o,sortDirections:l,subscriptionTokens:p,deferUpdates:u});return jsx(kt,{tokens:f,isLoading:k,resolution:t,height:r,itemHeight:i,itemHeightMobile:a,ActionsComponent:n,onSelectToken:s,sortDirections:l,onSortChange:c,onScrollingChange:m,onVisibleTokensChange:g,className:d})}function vM({chain:e,resolution:t,filters:o,ActionsComponent:n,onSelectToken:s,height:r,itemHeight:i,itemHeightMobile:a,className:d}){let[l,c]=useState(),[u,m]=useState(false),[p,g]=useState([]);useEffect(()=>{c(void 0);},[e,t]);let{tokens:f,isLoading:k}=ao({chain:e,resolution:t,filters:o,sortDirections:l,subscriptionTokens:p,deferUpdates:u});return jsx(kt,{tokens:f,isLoading:k,resolution:t,height:r,itemHeight:i,itemHeightMobile:a,ActionsComponent:n,onSelectToken:s,sortDirections:l,onSortChange:c,onScrollingChange:m,onVisibleTokensChange:g,className:d})}var mT=15e3;function uT({chain:e,addresses:t,pollMs:o=mT}){let n=t.length>0,[s,r]=useState({}),i=useTokensQuery({chain:e,addresses:t},{enabled:n,refetchInterval:o});useEffect(()=>{i.data&&r(m=>{let p={};for(let g of i.data){let f=m[g.address];p[g.address]=f?oe(f,g):g;}return p});},[i.data]);let a=useTokenMarketRuntime(),d=Array.from(new Set(t.map(m=>m.trim()).filter(Boolean))).sort().join(","),l=useMemo(()=>d?d.split(","):[],[d]);useEffect(()=>{if(!n)return;let m=[];for(let p of l){let g=tokenMarketKey(e,p),f=a.subscribe(g,x=>{let y=x.token;y&&r(T=>{let S=T[y.address],h=S?oe(S,y):y;return h===S?T:{...T,[y.address]:h}});}),k=a.retain(g);m.push(()=>{f(),k();});}return ()=>{for(let p of m)p();}},[a,e,d,n,l]);let c=i.refetch,u=useCallback(async()=>{await c();},[c]);return {tokens:s,isPending:i.isPending,isFetching:i.isFetching,isError:i.isError,isSuccess:i.isSuccess,error:i.error,refetch:u}}export{Pi as DEFAULT_FLIP_HOVER_RESOLUTIONS,od as HolderTagBadge,qt as HolderTagBadgeList,$ as HoldingRatioChip,ZI as NewTokenListWidget,gy as PulseFinalStretchListWidget,je as PulseList,Yn as PulseListHeader,pr as PulseListItem,Ko as PulseListItemSkeleton,ty as PulseMigratedListWidget,Eh as PulseNewListWidget,en as SEARCH_MODAL_ID,Yr as SearchHistoryUI,Zr as SearchHistoryWidget,jr as SearchInputUI,ov as SearchModal,to as SearchResultItemUI,oo as SearchResultListHeader,ro as SearchResultListSkeleton,as as SearchResultListWidget,mv as SearchTokensButton,ps as SearchWidget,fM as StockTokenListWidget,Cc as TOKEN_SEARCH_HISTORY_KEY,_o as TRADER_TAG_META,xi as TokenAbout,sw as TokenAboutWidget,Zs as TokenActivitiesList,FC as TokenActivitiesListWidget,he as TokenAvatar,Ss as TokenBasicInfo,$s as TokenBasicInfoWidget,wi as TokenCategories,eL as TokenCategoriesWidget,Si as TokenCexListing,Ew as TokenCexListingWidget,ia as TokenChartBanner,e1 as TokenChartBannerWidget,ys as TokenDetailHeader,qN as TokenDetailHeaderWidget,Xi as TokenDevTokensList,EP as TokenDevTokensListWidget,Ji as TokenDevTokensSummary,Cs as TokenHoldersCount,Ls as TokenHoldersCountWidget,Gs as TokenHoldersList,uC as TokenHoldersListWidget,bi as TokenLiquidities,Sw as TokenLiquiditiesWidget,kt as TokenList,Ro as TokenListFilter,Va as TokenListFilterModal,za as TokenListFilterPopover,SR as TokenListFilterWidget,Xa as TokenListResolutionSelectorDesktop,Ya as TokenListResolutionSelectorMobile,WR as TokenListResolutionSelectorWidget,Rs as TokenMarketCap,Is as TokenMarketCapWidget,Oi as TokenOrdersList,tP as TokenOrdersListWidget,Mi as TokenPositionsList,UL as TokenPositionsListWidget,Ds as TokenPrice,Us as TokenPriceWidget,ma as TokenReusedImageList,I1 as TokenReusedImageListWidget,gi as TokenSecurity,q0 as TokenSecurityWidget,da as TokenSimilarTokens,x1 as TokenSimilarTokensWidget,Os as TokenSocialMedia,Bs as TokenSocialMediaWidget,Ri as TokenStatsFlipBase,Ai as TokenStatsFlipHover,xL as TokenStatsFlipWidget,_i as TokenTopTradersList,bP as TokenTopTradersListWidget,li as TokenTradersOverview,YC as TokenTradersOverviewWidget,ci as TokenTransactionsOverview,p0 as TokenTransactionsOverviewWidget,Ks as TokenVolume,qs as TokenVolumeWidget,ui as TokenVolumesOverview,R0 as TokenVolumesOverviewWidget,td as TraderTagBadge,tr as TraderTagBadgeList,Rl as TrendingTokenCard,UI as TrendingTokenCardList,Al as TrendingTokenCardSkeleton,vM as TrendingTokenListWidget,bt as createTokenSearchHistoryStorage,Ol as useNewTokensScript,$r as usePulseFinalStretchListScript,Wr as usePulseMigratedListScript,Mr as usePulseNewListScript,Gr as useSearchHistory,rs as useSearchResultListScript,xv as useSearchScript,Wl as useStockTokensScript,Ti as useTokenAboutScript,ii as useTokenActivitiesListScript,sS as useTokenBasicInfoScript,Li as useTokenCategoriesScript,Ni as useTokenCexListingScript,la as useTokenChartBannerScript,bs as useTokenDetailHeaderScript,ta as useTokenDevTokensListScript,ws as useTokenHoldersCountScript,Ys as useTokenHoldersListScript,vi as useTokenLiquiditiesScript,As as useTokenMarketCapScript,Vi as useTokenOrdersListScript,Fi as useTokenPositionsListScript,Fs as useTokenPriceScript,ua as useTokenReusedImageListScript,ki as useTokenSecurityScript,ca as useTokenSimilarTokensScript,Es as useTokenSocialMediaScript,Ii as useTokenStatsFlipScript,$i as useTokenTopTradersListScript,di as useTokenTradersOverviewScript,mi as useTokenTransactionsOverviewScript,_s as useTokenVolumeScript,pi as useTokenVolumesOverviewScript,uT as useTokens,ao as useTrendingTokensScript};//# sourceMappingURL=index.mjs.map
24
24
  //# sourceMappingURL=index.mjs.map