"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = AsyncMediaViewer;
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _react = _interopRequireWildcard(require("react"));
var _modalSpinner = _interopRequireDefault(require("../viewers/modalSpinner"));
var _portal = require("./portal");
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" != (0, _typeof2.default)(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 MediaViewer = /*#__PURE__*/(0, _react.lazy)(function () {
  return Promise.resolve().then(function () {
    return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_media-viewer" */'./media-viewer-error-boundary'));
  }).then(function (_ref) {
    var MediaViewerWithErrorBoundary = _ref.MediaViewerWithErrorBoundary;
    return {
      default: MediaViewerWithErrorBoundary
    };
  });
});
function AsyncMediaViewer(props) {
  return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
    fallback: /*#__PURE__*/_react.default.createElement(_modalSpinner.default, null)
  }, /*#__PURE__*/_react.default.createElement(_portal.MediaViewerPortal, null, /*#__PURE__*/_react.default.createElement(MediaViewer, props)));
}