/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ActionButton = void 0;
require("./index.compiled.css");
var _react = _interopRequireWildcard(require("react"));
var React = _react;
var _runtime = require("@compiled/react/runtime");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
var _compiled = require("@atlaskit/primitives/compiled");
var _excluded = ["children", "isDisabled", "viewType", "isSlimDesign"],
  _excluded2 = ["onClick"];
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var styles = {
  button: "_1e0c1bgi",
  innerContainer: "_1e0c1nu9 _1y1m1u8q _16d9qvcn _k48p1wq8 _19bv12x7 _ca0qv77o _n3tdv77o _u5f312x7 _y3gn18uv _o5721btx _1nmz9jpi",
  innerContainerSocialProofConnect: "_2rko12b0 _syaz15cr _80omtlke _bfhkjmqp _2hwxv77o _1e0c1nu9 _4cvr1h6o _1wybtjj4 _1y1m1u8q _16d9qvcn _19bv12x7 _ca0qv77o _n3tdv77o _u5f312x7 _y3gn18uv _s7n4t94y _o5721btx _1nmz9jpi _irr31q28 _1di612kk",
  enabled: "_syazi7uo _80omtlke _bfhki8nm _irr3plhp _1di61gdz",
  disabled: "_syaz1gmx _80om13gf _bfhk187o",
  unauthorised: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _13lilb4i _mrkblb4i _ca0qt94y _n3tdt94y _2hwxt94y _k48pi7a9 _irr31q28 _1di612kk"
};

/* eslint-enable @compiled/shorthand-property-sorting */

/**
 * Action button has to be a span for the overflow to work correctly
 */
var ActionButton = exports.ActionButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
  var children = _ref.children,
    isDisabled = _ref.isDisabled,
    _ref$viewType = _ref.viewType,
    viewType = _ref$viewType === void 0 ? 'default' : _ref$viewType,
    _ref$isSlimDesign = _ref.isSlimDesign,
    isSlimDesign = _ref$isSlimDesign === void 0 ? false : _ref$isSlimDesign,
    props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var shouldUseUnauthorisedSlimStyle = viewType === 'unauthorised' && isSlimDesign && (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_soc_proof_inline_killswitch');
  if (shouldUseUnauthorisedSlimStyle && !isDisabled) {
    var onClick = props.onClick,
      boxProps = (0, _objectWithoutProperties2.default)(props, _excluded2);
    return /*#__PURE__*/React.createElement(_compiled.Box, (0, _extends2.default)({}, boxProps, {
      ref: ref,
      style: {
        font: "inherit"
      },
      xcss: styles.button
    }), /*#__PURE__*/React.createElement("span", {
      className: (0, _runtime.ax)([styles.innerContainerSocialProofConnect])
    }, children));
  }
  return /*#__PURE__*/React.createElement(_compiled.Pressable, (0, _extends2.default)({}, props, {
    isDisabled: isDisabled,
    ref: ref
    // We need to reset Pressable fixed font size to allow inline card to inherit the font size
    // from parent component such as paragraph and heading
    ,
    style: {
      font: "inherit"
    },
    xcss: styles.button
  }), /*#__PURE__*/React.createElement("span", {
    tabIndex: isDisabled ? undefined : 0,
    className: (0, _runtime.ax)([styles.innerContainer, isDisabled ? styles.disabled : viewType === 'unauthorised' ? styles.unauthorised : styles.enabled])
  }, children));
});