"use strict";var e=require("react/jsx-runtime"),f=require("../containers/button.js");require("../containers/card.js");var p=require("@styled/css"),u=require("@styled/jsx");require("@styled/tokens"),require("../primitives/button.js"),require("../primitives/checkbox.js"),require("../primitives/dropdown-selector.js"),require("../primitives/popover.js"),require("../primitives/radio.js"),require("../primitives/segmented-control.js"),require("../primitives/switch.js");var h=require("../primitives/text.js"),d=require("react");require("../utils/client-asset-logo.js"),require("react-qrcode-logo"),require("../utils/secured-by-magic.js");var S=require("../logos/icon-generic-token.js");require("../containers/header.js"),require("../containers/menu.js"),require("../containers/modal.js"),require("../containers/overlay.js"),require("../feedback/callout.js"),require("../feedback/progress-bar.js");var g=require("../feedback/skeleton.js");require("../primitives/portal.js"),require("../../hooks/useToast.js"),require("../../recipes/toast.js"),require("../feedback/tooltip.js");var q=require("create-slots");const x=q.createSlot(({children:t,...r})=>e.jsx(u.Center,{children:d.Children.map(t,i=>d.cloneElement(i,r))})),k=({name:t,fiatBalanceWithSymbol:r,tokenBalanceWithSymbol:i,tokenIcon:n,logoUrl:s,tokenBalanceFirst:l,disabled:c=!1,isLoading:a=!1})=>{const o=l||!r;return e.jsxs(u.HStack,{w:"full",justify:"space-between",opacity:c?"0.5":"1",children:[e.jsxs(u.HStack,{gap:4,children:[n?{...n,props:{...n.props,width:40,height:40}}:s?e.jsx("img",{width:40,height:40,src:s,alt:`${t} logo`}):e.jsx(S.default,{width:40,height:40}),e.jsx(h.default,{fontWeight:"medium",styles:{textTransform:"capitalize"},children:t})]}),e.jsx(u.VStack,{gap:0,alignItems:"flex-end",children:a?e.jsxs(e.Fragment,{children:[e.jsx(g.Skeleton,{height:"1rem",width:"6rem"}),i&&r&&e.jsx("div",{style:{marginTop:"4px"},children:e.jsx(g.Skeleton,{height:"1rem",width:"4rem"})})]}):e.jsxs(e.Fragment,{children:[e.jsx(h.default,{size:"sm",styles:{lineHeight:"1.5rem",textAlign:"right"},children:o?i:r}),e.jsx(h.default,{size:"sm",fontColor:"text.secondary",styles:{lineHeight:"1.5rem",textAlign:"right"},children:o?r:i})]})})]})},v=t=>{const{name:r,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,logoUrl:s,onPress:l,tokenBalanceFirst:c,disabled:a,isLoading:o}=t,b=d.useRef(null),j=d.useCallback(()=>{l?.()},[l]);return q.createHost(t.children,y=>{const m=y.get(x);return l?e.jsx(f.ButtonContainer,{ref:b,className:p.css({_dark:{bg:"surface.tertiary"},_hover:{bg:"neutral.secondary"},bg:"neutral.quaternary",px:4,py:2,minH:16}),borderRadius:"0.5rem",expand:!0,onPress:a?void 0:j,disabled:a,children:e.jsx(k,{name:r,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,tokenIcon:m,logoUrl:s,tokenBalanceFirst:c,disabled:a,isLoading:o})}):e.jsx(k,{name:r,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,tokenIcon:m,logoUrl:s,tokenBalanceFirst:c,disabled:a,isLoading:o})})},B=Object.assign(v,{TokenIcon:x});exports.TokenListItem=B;
//# sourceMappingURL=token-list-item.js.map
