'use strict';

var React = require('react');
require('../theme.js');
require('../direction.js');
require('../propsValues/control.js');
require('../propsValues/breakpoint.js');
require('../propsValues/size.js');
require('../propsValues/typography.js');
require('../propsValues/width.js');
require('../propsValues/type.js');
require('../propsValues/dateMode.js');
require('../propsValues/monthFormat.js');
var position = require('../propsValues/position.js');
require('../propsValues/layouts.js');
require('../propsValues/status.js');
require('../propsValues/sentiment.js');
require('../propsValues/profileType.js');
require('../propsValues/variant.js');
require('../propsValues/scroll.js');
require('../propsValues/markdownNodeType.js');
require('../fileType.js');
require('@transferwise/icons');
require('clsx');
require('react-intl');
require('../closeButton/CloseButton.messages.js');
var jsxRuntime = require('react/jsx-runtime');
var BottomSheet = require('../bottomSheet/BottomSheet.js');
require('@transferwise/neptune-validation');
require('../../provider/direction/DirectionProvider.js');
var useLayout = require('../hooks/useLayout/useLayout.js');
var Panel = require('../panel/Panel.js');

const ResponsivePanel = /*#__PURE__*/React.forwardRef(function ResponsivePanel({
  anchorRef,
  arrow = false,
  flip = true,
  children,
  className = undefined,
  onClose,
  open = false,
  position: position$1 = position.Position.BOTTOM,
  anchorWidth = false,
  'aria-label': ariaLabel,
  'aria-labelledby': ariaLabelledBy
}, reference) {
  const {
    isMobile
  } = useLayout.useLayout();
  if (isMobile) {
    return /*#__PURE__*/jsxRuntime.jsx(BottomSheet, {
      "aria-label": ariaLabel,
      "aria-labelledby": ariaLabelledBy,
      open: open,
      className: className,
      onClose: onClose,
      children: children
    }, "bottomSheet");
  }
  return /*#__PURE__*/jsxRuntime.jsx(Panel, {
    ref: reference,
    flip: flip,
    arrow: arrow,
    open: open,
    position: position$1,
    anchorWidth: anchorWidth,
    anchorRef: anchorRef,
    "aria-label": ariaLabel,
    "aria-labelledby": ariaLabelledBy,
    className: className,
    onClose: onClose,
    children: children
  }, "panel");
});

module.exports = ResponsivePanel;
//# sourceMappingURL=ResponsivePanel.js.map
