"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.renderIntoDiv = renderIntoDiv;
Object.defineProperty(exports, "renderSidebarIntoDiv", {
  enumerable: true,
  get: function get() {
    return _root2.renderIntoDiv;
  }
});

var _normalizeLocale = _interopRequireDefault(require("./rce/normalizeLocale"));

var _root = require("./rce/root");

require("tinymce");

var _root2 = require("./sidebar/root");

/*
 * Copyright (C) 2018 - present Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */
function renderIntoDiv(editorEl, props, cb) {
  var language = (0, _normalizeLocale.default)(props.language);

  if (undefined || language === "en") {
    (0, _root.renderIntoDiv)(editorEl, props, cb);
  } else {
    // unlike the pretranslated builds, in the default, non-pretranslated build,
    // this will cause a new network round trip to get all the locale info we
    // and tinymce need.
    import("./locales/".concat(language)).then(function () {
      return (0, _root.renderIntoDiv)(editorEl, props, cb);
    });
  }
}