import{s as m,af as t,al as r,k as b,n as u}from"../../../../vendor-CdGQ_kNX.js";import{M as h}from"../../../../utils-D7d4_AgI.js";import{g as n}from"./helpers/getSize-DdGeSi1r.js";const $=({onClick:e,children:o,submit:a,...i})=>{const l=b.useRef(null),c=a?"submit":"button",d=s=>{typeof e=="function"&&e(s)};return u.jsx("button",{...i,type:c,ref:l,onClick:d,children:o})},y=m($)`
  position: relative;

  margin: 0;
  padding: ${({size:e})=>n(e).padding};

  height: fit-content;

  display: inline-flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;

  gap: 1.6rem;

  font-family: ${e=>e.theme.font.family.default};
  font-weight: ${e=>e.theme.font.weight.bold};

  font-size: ${({size:e})=>n(e).fontSize};
  line-height: ${({size:e})=>n(e).lineHeight};

  letter-spacing: normal;
  text-decoration: none;
  text-transform: ${({isuppercase:e})=>e==="true"?"uppercase":"none"};

  border: none;

  transition: all 0.3s ease-in;
  cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};

  overflow: hidden;
  outline: none;
  z-index: ${e=>e.theme.zIndex.minimal};

  &:disabled {
    opacity: ${e=>e.theme.opacity.opacity05};
  }

  ${e=>e.type==="default"&&t`
      color: ${o=>o.theme.color.btnText};
      background-color: ${o=>o.theme.color.button};
      border: 0.1rem solid ${o=>o.theme.color.black};
      border-radius: 1.2rem;
      &:disabled {
        opacity: ${o=>o.theme.opacity.opacity05};
      }
      &:hover:not([disabled]),
      &:focus:not([disabled]) {
        background-color: ${o=>o.theme.color.buttonHover};
      }
      &:active:not([disabled]) {
        background-color: ${o=>r(.05,o.theme.color.buttonHover)};
      }
    `}

  ${e=>e.type==="ghost"&&t`
      color: ${o=>o.theme.color.black};
      background-color: ${o=>o.theme.color.text};
      border-radius: 1.2rem;
      &:disabled {
        opacity: ${o=>o.theme.opacity.opacity05};
      }
      &:hover:not([disabled]),
      &:focus:not([disabled]) {
        color: ${o=>o.theme.color.text};
        background-color: ${o=>o.theme.color.black};
      }
      &:active:not([disabled]) {
        background-color: ${o=>r(.05,o.theme.color.black)};
      }
    `}

  ${e=>e.type==="outlined"&&t`
      color: ${o=>o.theme.color.default};
      background-color: ${o=>o.theme.color.transparent};
      border: 0.1rem solid ${o=>o.theme.color.default};
      border-radius: 1.2rem;
      &:disabled {
        opacity: ${o=>o.theme.opacity.opacity05};
      }
      &:hover:not([disabled]),
      &:focus:not([disabled]) {
        color: ${o=>o.theme.color.text};
        background-color: ${o=>o.theme.color.defaultSecondary};
        border-color: ${o=>o.theme.color.defaultSecondary};
      }
      &:active:not([disabled]) {
        background-color: ${o=>r(.05,o.theme.color.defaultSecondary)};
      }
    `}

  ${e=>e.type==="status"&&t`
      gap: 0.8rem;
      font-weight: ${o=>o.theme.font.weight.bold};
      color: ${o=>o.theme.color.text};
      background-color: ${o=>o.theme.color.button};
      border-radius: 5rem;
      &:disabled {
        opacity: ${o=>o.theme.opacity.opacity05};
      }
      &:hover:not([disabled]),
      &:focus:not([disabled]),
      &:active:not([disabled]) {
        background-color: ${o=>o.theme.color.buttonHover};
      }
    `}

  ${e=>e.type==="link"&&t`
      padding: 0;
      font-weight: ${o=>o.theme.font.weight.regular};
      color: ${o=>o.theme.color.button};
      background-color: ${o=>o.theme.color.transparent};
      border: none;
      border-radius: 0;
      &:disabled {
        opacity: ${o=>o.theme.opacity.opacity05};
      }
      &:hover:not([disabled]),
      &:focus:not([disabled]) {
        color: ${o=>o.theme.color.buttonHover};
      }
      &:active:not([disabled]) {
        color: ${o=>r(.05,o.theme.color.buttonHover)};
      }
    `}

  ${e=>e.type==="symbol"&&t`
      width: 4.4rem;
      height: 4.4rem;
      color: ${o=>o.theme.color.text};
      background-color: ${o=>o.theme.color.button};
      border: none;
      border-radius: 5rem;
      &:disabled {
        opacity: ${o=>o.theme.opacity.opacity05};
      }
      &:hover:not([disabled]),
      &:focus:not([disabled]) {
        color: ${o=>o.theme.color.text};
        background-color: ${o=>o.theme.color.defaultSecondary};
      }
      &:active:not([disabled]) {
        background-color: ${o=>r(.05,o.theme.color.defaultSecondary)};
      }
    `}

  ${e=>e.fullsize==="true"&&t`
      width: 100%;
    `}

  ${e=>e.isloading==="true"&&t`
      position: relative;
      overflow: hidden;
      pointer-events: none;
      user-select: none;
      &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        animation-duration: 1.2s;
        animation-name: ${h};
        background-clip: padding-box;
        background-attachment: fixed;
        animation-fill-mode: forwards;
        animation-iteration-count: infinite;
        animation-timing-function: linear;
        background: ${o=>e.type==="outlined"?o.theme.color.placeholderLoadingDark:o.theme.color.placeholderLoadingDefault};
        background-size: 200% 100%;
        z-index: ${o=>o.theme.zIndex.negative};
      }
    `}
`;export{y as S};
