text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.supplant = supplant;
  exports.translateKey = translateKey;
  exports.createHTMLMarkup = createHTMLMarkup;
  exports.translate = translate;
  exports.translateUtil = translateUtil;
  
  var _react = require('react');
  
  var _react2 = _interopRequireDefault(_react);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function supplant(s, d) {
    for (var p in d) {
      s = s.replace(new RegExp('{' + p + '}', 'g'), d[p]);
    }
    return s;
  }
  
  function translateKey(path, obj, safe) {
    return path.split('.').reduce(function (prev, curr) {
      return !safe ? prev[curr] : prev ? prev[curr] : undefined;
    }, obj);
  }
  
  function createHTMLMarkup(html) {
    return { __html: html };
  }
  
  function translate(translateFn, translations, locale, key, placeholders, isHTML) {
    var options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
  
    var result = translateFn(key, translations[locale]['messages']);
    var tagName = options.tagName || 'div';
    if (typeof placeholders === 'undefined') {
      return result;
    }
    var finalResult = supplant(result, placeholders);
    return isHTML ? _react2.default.createElement(tagName, { dangerouslySetInnerHTML: createHTMLMarkup(finalResult) }, null) : finalResult;
  }
  
  function translateUtil(translations, locale, key, placeholders, isHTML) {
    var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  
    return translate(translateKey, translations, locale, key, placeholders, isHTML, options);
  }