"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ExtensionSSRReactContextsProvider = ExtensionSSRReactContextsProvider;
var _react = _interopRequireDefault(require("react"));
var _reactIntl = require("react-intl");
var _isSsr = require("../core-utils/is-ssr");
var _isSsrStreaming = require("../core-utils/is-ssr-streaming");
function ExtensionSSRReactContextsProvider(_ref) {
  var children = _ref.children,
    intl = _ref.intl;
  if (!(0, _isSsr.isSSR)() || !(0, _isSsrStreaming.isSSRStreaming)()) {
    return children;
  }
  if (!intl) {
    return children;
  }
  return /*#__PURE__*/_react.default.createElement(_reactIntl.RawIntlProvider, {
    value: intl
  }, children);
}