import"react";import{Box as d,Button as z,Flex as r,Text as o}from"@chakra-ui/react";import L from"@emotion/styled";import{jsx as s,jsxs as t}from"react/jsx-runtime";var W=L(o)`
  position: relative;
  width: fit-content;
  margin: 0 auto;

  &:after {
    content: '';
    border-top: 1px solid #2d3748;
    width: 100%;
    height: 1px;
    position: absolute;
    top: 50%;
    left: 0;
  }
`,k=({selected:e,onSelect:x,onUnSelect:a,domain:u,currency:i})=>{var g,c;let{name:h,availability:m,rate:A,discountedRate:f,discount:p}=u,{price:b,status:n}=m,{subTotal:{usdCents:l}}=b,w=S=>{S.stopPropagation(),a()},T=()=>{if(n==="NOT_AVAILABLE")return"Sold";if(e)return"Selected";if(!e)return"Select"},B=()=>{e?a():e||x()};return s(d,{position:"relative",paddingY:2,mb:3,zIndex:"1",border:"1px solid #cccccc",borderRadius:10,flexDir:"row",children:t(r,{paddingX:3,align:"center",justify:"space-between",flexDir:"row",children:[s(o,{fontSize:14,children:h}),t(r,{align:"center",children:[n==="AVAILABLE"&&t(d,{mr:4,children:[t(o,{textAlign:"center",fontSize:12,fontWeight:600,children:[(g=f[i])!=null?g:l/100," ",i," ",t("span",{style:{fontWeight:600},children:["($",f.USDT,")"]})]}),p>0&&t(r,{children:[t(W,{textAlign:"center",fontSize:10,fontWeight:500,lineHeight:1,children:[(c=A[i])!=null?c:l/100," ",i," ",t("span",{style:{fontWeight:400},children:["($",l/100,")"]})]}),t(o,{ml:1,textAlign:"center",fontSize:10,fontWeight:500,lineHeight:1,color:"green",children:["(",p,"% off)"]})]})]}),s(z,{size:"sm",variant:"outline",bg:e?"input":"initial",minWidth:"20",onClick:B,isDisabled:n==="NOT_AVAILABLE",children:T()})]})]})})},F=k;export{F as default};
