"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var Outline_exports = {};
__export(Outline_exports, {
  default: () => Outline_default
});
module.exports = __toCommonJS(Outline_exports);
var import_styled_components = __toESM(require("styled-components"));
var import_yoga_common = require("@gympass/yoga-common");
var import_Button = __toESM(require("./Button"));
const ButtonOutline = (0, import_styled_components.default)(import_Button.default)`
  ${({
  inverted,
  secondary,
  isLoading,
  theme: {
    yoga: {
      colors: { white },
      components: {
        button: {
          types: { outline }
        }
      }
    }
  }
}) => {
  const state = secondary ? "secondary" : "primary";
  return `
      background-color: ${outline.backgroundColor.default};
      border: ${outline.border.width}px solid;
      border-color: ${outline.font.default[state].color};
      color: ${outline.font.default[state].color};

      svg {
        fill: ${outline.font.default[state].color};
      }

      &:not([disabled]):hover, &:not([disabled]):focus {
        background-color: ${outline.backgroundColor[state].hover};
        color: ${outline.font.hover.color};

        svg {
          fill: ${outline.font.hover.color};
        }
      }

      &:not([disabled]):active {
        background-color: ${outline.backgroundColor.default};
        border-color: ${outline.font.pressed[state].color};
        color: ${outline.font.pressed[state].color};
        box-shadow: none;

        svg {
          fill: ${outline.font.pressed[state].color};
        }
      }

      &:disabled {
        background-color: ${outline.backgroundColor.default};
        border-color: ${outline.font.disabled.color};
        color: ${outline.font.disabled.color};

         svg {
          fill: ${outline.font.disabled.color};
        }
      }

      ${inverted ? `
            border-color: ${white};
            color: ${white};

            svg {
              fill: ${white};
            }

            &:not([disabled]):hover, &:not([disabled]):focus {
              background-color: ${white};
              color: ${outline.font.default[state].color};

              svg {
                fill: ${outline.font.default[state].color};
              }
            }

            &:not([disabled]):active {
              background-color: ${outline.backgroundColor.default};
              border-color: ${(0, import_yoga_common.hexToRgb)(white, 0.75)};
              color: ${(0, import_yoga_common.hexToRgb)(white, 0.75)};

              svg {
                fill: ${(0, import_yoga_common.hexToRgb)(white, 0.75)};
              }
            }

            &:disabled {
              border-color: ${outline.font.disabled.color};
              color: ${outline.font.disabled.color};
              svg {
                fill: ${outline.font.disabled.color};
              }
            }
          ` : ""}

      ${isLoading ? `
            &:disabled {
              color: transparent;

              svg {
                fill: transparent;
              }
            }
            ` : ""}
    `;
}}
`;
ButtonOutline.displayName = "Button.Outline";
var Outline_default = ButtonOutline;
