"use strict";

var _define = require("../preactement/define");
var _Button = _interopRequireDefault(require("../../Button/Button"));
var _analytics = require("../shared-attributes/analytics");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const attributes = ['class-name', 'disabled', 'href', 'is-alternate', 'is-on-dark', 'size', 'type', 'variation', 'target', ..._analytics.analyticsAttrs];

// Mapping `onDark` to `isOnDark` because props starting with "on" indicate an event handler and tests fail due to this expectation

const Wrapper = _ref => {
  let {
    isAlternate,
    isOnDark,
    analytics,
    ...otherProps
  } = _ref;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
    ...otherProps,
    isAlternate: isAlternate && Boolean(JSON.parse(isAlternate)),
    onDark: isOnDark && Boolean(JSON.parse(isOnDark)),
    analytics: analytics && Boolean(JSON.parse(analytics))
  });
};
(0, _define.define)('ds-button', () => Wrapper, {
  attributes,
  events: ['onClick', 'onAnalyticsEvent']
});