'use strict';

require('../../common/theme.js');
require('../../common/direction.js');
require('@transferwise/neptune-tokens');
require('../../common/propsValues/control.js');
require('../../common/propsValues/size.js');
require('../../common/propsValues/typography.js');
require('../../common/propsValues/width.js');
require('../../common/propsValues/type.js');
require('../../common/propsValues/dateMode.js');
require('../../common/propsValues/monthFormat.js');
require('../../common/propsValues/position.js');
require('../../common/propsValues/layouts.js');
require('../../common/propsValues/status.js');
var sentiment = require('../../common/propsValues/sentiment.js');
require('../../common/propsValues/profileType.js');
require('../../common/propsValues/variant.js');
require('../../common/propsValues/scroll.js');
require('../../common/propsValues/markdownNodeType.js');
require('../../common/fileType.js');
require('@transferwise/formatting');
var icons = require('@transferwise/icons');
var clsx = require('clsx');
require('react');
require('react-intl');
require('../../common/closeButton/CloseButton.messages.js');
var jsxRuntime = require('react/jsx-runtime');
var ProcessIndicator = require('../../processIndicator/ProcessIndicator.js');
var StatusIcon = require('../../statusIcon/StatusIcon.js');
var Body = require('../../body/Body.js');
var PrimitivePrompt = require('../PrimitivePrompt/PrimitivePrompt.js');

const InlinePrompt = ({
  sentiment: sentiment$1 = sentiment.Sentiment.POSITIVE,
  muted = false,
  loading = false,
  className,
  children,
  media = null,
  mediaLabel,
  width = 'auto',
  'data-testid': dataTestId,
  ...restProps
}) => {
  const surfaceSentiment = sentiment$1 === sentiment.Sentiment.POSITIVE ? 'success' : sentiment$1;
  const renderMedia = () => {
    if (muted) {
      return /*#__PURE__*/jsxRuntime.jsx(icons.BackslashCircle, {
        size: 16,
        "data-testid": "InlinePrompt_Muted",
        title: mediaLabel
      });
    }
    if (loading) {
      return /*#__PURE__*/jsxRuntime.jsx(ProcessIndicator.default, {
        "data-testid": "InlinePrompt_ProcessIndicator",
        size: "xxs",
        className: "wds-inline-prompt-process-indicator"
      });
    }
    if (sentiment$1 === 'proposition') {
      return media || /*#__PURE__*/jsxRuntime.jsx(icons.GiftBox, {
        title: mediaLabel
      });
    }
    return media || /*#__PURE__*/jsxRuntime.jsx(StatusIcon.default, {
      size: 16,
      sentiment: sentiment$1,
      iconLabel: mediaLabel
    });
  };
  return /*#__PURE__*/jsxRuntime.jsx(PrimitivePrompt.PrimitivePrompt, {
    sentiment: surfaceSentiment,
    media: renderMedia(),
    "data-testid": dataTestId,
    className: clsx.clsx('wds-inline-prompt', {
      'wds-inline-prompt--auto-width': width !== 'full',
      'wds-inline-prompt--muted': muted,
      'wds-inline-prompt--loading': loading
    }, className),
    ...restProps,
    children: /*#__PURE__*/jsxRuntime.jsx(Body.default, {
      children: children
    })
  });
};

exports.InlinePrompt = InlinePrompt;
//# sourceMappingURL=InlinePrompt.js.map
