UNPKG

react-period-of-stay-input

Version:

React.js component for entering a period of stay in a hotel: check-in + check-out date

1 lines 56.9 kB
{"id":"../node_modules/react-intl/lib/index.es.js","dependencies":[{"name":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-intl/package.json","includedInParent":true,"mtime":1533713806755},{"name":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/package.json","includedInParent":true,"mtime":1534141269544},{"name":"../locale-data/index.js","loc":{"line":7,"column":26},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-intl/lib/index.es.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/parcel-bundler/src/builtins/_empty.js"},{"name":"intl-messageformat","loc":{"line":8,"column":30},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-intl/lib/index.es.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/intl-messageformat/index.js"},{"name":"intl-relativeformat","loc":{"line":9,"column":31},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-intl/lib/index.es.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/intl-relativeformat/index.js"},{"name":"prop-types","loc":{"line":10,"column":22},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-intl/lib/index.es.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/prop-types/index.js"},{"name":"react","loc":{"line":11,"column":74},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-intl/lib/index.es.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react/index.js"},{"name":"invariant","loc":{"line":12,"column":22},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-intl/lib/index.es.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/invariant/browser.js"},{"name":"intl-format-cache","loc":{"line":13,"column":35},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-intl/lib/index.es.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/intl-format-cache/index.js"}],"generated":{"js":"'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.FormattedHTMLMessage = exports.FormattedMessage = exports.FormattedPlural = exports.FormattedNumber = exports.FormattedRelative = exports.FormattedTime = exports.FormattedDate = exports.IntlProvider = exports.defineMessages = exports.injectIntl = exports.intlShape = exports.addLocaleData = undefined;\n\nvar _index = require('../locale-data/index.js');\n\nvar _index2 = _interopRequireDefault(_index);\n\nvar _intlMessageformat = require('intl-messageformat');\n\nvar _intlMessageformat2 = _interopRequireDefault(_intlMessageformat);\n\nvar _intlRelativeformat = require('intl-relativeformat');\n\nvar _intlRelativeformat2 = _interopRequireDefault(_intlRelativeformat);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _invariant = require('invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _intlFormatCache = require('intl-format-cache');\n\nvar _intlFormatCache2 = _interopRequireDefault(_intlFormatCache);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// GENERATED FILE\nvar defaultLocaleData = { \"locale\": \"en\", \"pluralRuleFunction\": function pluralRuleFunction(n, ord) {\n    var s = String(n).split(\".\"),\n        v0 = !s[1],\n        t0 = Number(s[0]) == n,\n        n10 = t0 && s[0].slice(-1),\n        n100 = t0 && s[0].slice(-2);if (ord) return n10 == 1 && n100 != 11 ? \"one\" : n10 == 2 && n100 != 12 ? \"two\" : n10 == 3 && n100 != 13 ? \"few\" : \"other\";return n == 1 && v0 ? \"one\" : \"other\";\n  }, \"fields\": { \"year\": { \"displayName\": \"year\", \"relative\": { \"0\": \"this year\", \"1\": \"next year\", \"-1\": \"last year\" }, \"relativeTime\": { \"future\": { \"one\": \"in {0} year\", \"other\": \"in {0} years\" }, \"past\": { \"one\": \"{0} year ago\", \"other\": \"{0} years ago\" } } }, \"month\": { \"displayName\": \"month\", \"relative\": { \"0\": \"this month\", \"1\": \"next month\", \"-1\": \"last month\" }, \"relativeTime\": { \"future\": { \"one\": \"in {0} month\", \"other\": \"in {0} months\" }, \"past\": { \"one\": \"{0} month ago\", \"other\": \"{0} months ago\" } } }, \"day\": { \"displayName\": \"day\", \"relative\": { \"0\": \"today\", \"1\": \"tomorrow\", \"-1\": \"yesterday\" }, \"relativeTime\": { \"future\": { \"one\": \"in {0} day\", \"other\": \"in {0} days\" }, \"past\": { \"one\": \"{0} day ago\", \"other\": \"{0} days ago\" } } }, \"hour\": { \"displayName\": \"hour\", \"relative\": { \"0\": \"this hour\" }, \"relativeTime\": { \"future\": { \"one\": \"in {0} hour\", \"other\": \"in {0} hours\" }, \"past\": { \"one\": \"{0} hour ago\", \"other\": \"{0} hours ago\" } } }, \"minute\": { \"displayName\": \"minute\", \"relative\": { \"0\": \"this minute\" }, \"relativeTime\": { \"future\": { \"one\": \"in {0} minute\", \"other\": \"in {0} minutes\" }, \"past\": { \"one\": \"{0} minute ago\", \"other\": \"{0} minutes ago\" } } }, \"second\": { \"displayName\": \"second\", \"relative\": { \"0\": \"now\" }, \"relativeTime\": { \"future\": { \"one\": \"in {0} second\", \"other\": \"in {0} seconds\" }, \"past\": { \"one\": \"{0} second ago\", \"other\": \"{0} seconds ago\" } } } } };\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\n/*\n * Copyright 2017, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nfunction addLocaleData() {\n  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n  var locales = Array.isArray(data) ? data : [data];\n\n  locales.forEach(function (localeData) {\n    if (localeData && localeData.locale) {\n      _intlMessageformat2.default.__addLocaleData(localeData);\n      _intlRelativeformat2.default.__addLocaleData(localeData);\n    }\n  });\n}\n\nfunction hasLocaleData(locale) {\n  var localeParts = (locale || '').split('-');\n\n  while (localeParts.length > 0) {\n    if (hasIMFAndIRFLocaleData(localeParts.join('-'))) {\n      return true;\n    }\n\n    localeParts.pop();\n  }\n\n  return false;\n}\n\nfunction hasIMFAndIRFLocaleData(locale) {\n  var normalizedLocale = locale && locale.toLowerCase();\n\n  return !!(_intlMessageformat2.default.__localeData__[normalizedLocale] && _intlRelativeformat2.default.__localeData__[normalizedLocale]);\n}\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n  return typeof obj;\n} : function (obj) {\n  return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar classCallCheck = function (instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n};\n\nvar createClass = function () {\n  function defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if (\"value\" in descriptor) descriptor.writable = true;\n      Object.defineProperty(target, descriptor.key, descriptor);\n    }\n  }\n\n  return function (Constructor, protoProps, staticProps) {\n    if (protoProps) defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) defineProperties(Constructor, staticProps);\n    return Constructor;\n  };\n}();\n\nvar defineProperty = function (obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i];\n\n    for (var key in source) {\n      if (Object.prototype.hasOwnProperty.call(source, key)) {\n        target[key] = source[key];\n      }\n    }\n  }\n\n  return target;\n};\n\nvar inherits = function (subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n  }\n\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      enumerable: false,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\nvar objectWithoutProperties = function (obj, keys) {\n  var target = {};\n\n  for (var i in obj) {\n    if (keys.indexOf(i) >= 0) continue;\n    if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n    target[i] = obj[i];\n  }\n\n  return target;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n  if (!self) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\nvar toConsumableArray = function (arr) {\n  if (Array.isArray(arr)) {\n    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n    return arr2;\n  } else {\n    return Array.from(arr);\n  }\n};\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar bool = _propTypes2.default.bool;\nvar number = _propTypes2.default.number;\nvar string = _propTypes2.default.string;\nvar func = _propTypes2.default.func;\nvar object = _propTypes2.default.object;\nvar oneOf = _propTypes2.default.oneOf;\nvar shape = _propTypes2.default.shape;\nvar any = _propTypes2.default.any;\nvar oneOfType = _propTypes2.default.oneOfType;\n\nvar localeMatcher = oneOf(['best fit', 'lookup']);\nvar narrowShortLong = oneOf(['narrow', 'short', 'long']);\nvar numeric2digit = oneOf(['numeric', '2-digit']);\nvar funcReq = func.isRequired;\n\nvar intlConfigPropTypes = {\n  locale: string,\n  formats: object,\n  messages: object,\n  textComponent: any,\n\n  defaultLocale: string,\n  defaultFormats: object\n};\n\nvar intlFormatPropTypes = {\n  formatDate: funcReq,\n  formatTime: funcReq,\n  formatRelative: funcReq,\n  formatNumber: funcReq,\n  formatPlural: funcReq,\n  formatMessage: funcReq,\n  formatHTMLMessage: funcReq\n};\n\nvar intlShape = shape(_extends({}, intlConfigPropTypes, intlFormatPropTypes, {\n  formatters: object,\n  now: funcReq\n}));\n\nvar messageDescriptorPropTypes = {\n  id: string.isRequired,\n  description: oneOfType([string, object]),\n  defaultMessage: string\n};\n\nvar dateTimeFormatPropTypes = {\n  localeMatcher: localeMatcher,\n  formatMatcher: oneOf(['basic', 'best fit']),\n\n  timeZone: string,\n  hour12: bool,\n\n  weekday: narrowShortLong,\n  era: narrowShortLong,\n  year: numeric2digit,\n  month: oneOf(['numeric', '2-digit', 'narrow', 'short', 'long']),\n  day: numeric2digit,\n  hour: numeric2digit,\n  minute: numeric2digit,\n  second: numeric2digit,\n  timeZoneName: oneOf(['short', 'long'])\n};\n\nvar numberFormatPropTypes = {\n  localeMatcher: localeMatcher,\n\n  style: oneOf(['decimal', 'currency', 'percent']),\n  currency: string,\n  currencyDisplay: oneOf(['symbol', 'code', 'name']),\n  useGrouping: bool,\n\n  minimumIntegerDigits: number,\n  minimumFractionDigits: number,\n  maximumFractionDigits: number,\n  minimumSignificantDigits: number,\n  maximumSignificantDigits: number\n};\n\nvar relativeFormatPropTypes = {\n  style: oneOf(['best fit', 'numeric']),\n  units: oneOf(['second', 'minute', 'hour', 'day', 'month', 'year'])\n};\n\nvar pluralFormatPropTypes = {\n  style: oneOf(['cardinal', 'ordinal'])\n};\n\n/*\nHTML escaping and shallow-equals implementations are the same as React's\n(on purpose.) Therefore, it has the following Copyright and Licensing:\n\nCopyright 2013-2014, Facebook, Inc.\nAll rights reserved.\n\nThis source code is licensed under the BSD-style license found in the LICENSE\nfile in the root directory of React's source tree.\n*/\n\nvar intlConfigPropNames = Object.keys(intlConfigPropTypes);\n\nvar ESCAPED_CHARS = {\n  '&': '&amp;',\n  '>': '&gt;',\n  '<': '&lt;',\n  '\"': '&quot;',\n  \"'\": '&#x27;'\n};\n\nvar UNSAFE_CHARS_REGEX = /[&><\"']/g;\n\nfunction escape(str) {\n  return ('' + str).replace(UNSAFE_CHARS_REGEX, function (match) {\n    return ESCAPED_CHARS[match];\n  });\n}\n\nfunction filterProps(props, whitelist) {\n  var defaults$$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n  return whitelist.reduce(function (filtered, name) {\n    if (props.hasOwnProperty(name)) {\n      filtered[name] = props[name];\n    } else if (defaults$$1.hasOwnProperty(name)) {\n      filtered[name] = defaults$$1[name];\n    }\n\n    return filtered;\n  }, {});\n}\n\nfunction invariantIntlContext() {\n  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n      intl = _ref.intl;\n\n  (0, _invariant2.default)(intl, '[React Intl] Could not find required `intl` object. ' + '<IntlProvider> needs to exist in the component ancestry.');\n}\n\nfunction shallowEquals(objA, objB) {\n  if (objA === objB) {\n    return true;\n  }\n\n  if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {\n    return false;\n  }\n\n  var keysA = Object.keys(objA);\n  var keysB = Object.keys(objB);\n\n  if (keysA.length !== keysB.length) {\n    return false;\n  }\n\n  // Test for A's keys different from B.\n  var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n  for (var i = 0; i < keysA.length; i++) {\n    if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nfunction shouldIntlComponentUpdate(_ref2, nextProps, nextState) {\n  var props = _ref2.props,\n      state = _ref2.state,\n      _ref2$context = _ref2.context,\n      context = _ref2$context === undefined ? {} : _ref2$context;\n  var nextContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  var _context$intl = context.intl,\n      intl = _context$intl === undefined ? {} : _context$intl;\n  var _nextContext$intl = nextContext.intl,\n      nextIntl = _nextContext$intl === undefined ? {} : _nextContext$intl;\n\n  return !shallowEquals(nextProps, props) || !shallowEquals(nextState, state) || !(nextIntl === intl || shallowEquals(filterProps(nextIntl, intlConfigPropNames), filterProps(intl, intlConfigPropNames)));\n}\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\n// Inspired by react-redux's `connect()` HOC factory function implementation:\n// https://github.com/rackt/react-redux\n\nfunction getDisplayName(Component$$1) {\n  return Component$$1.displayName || Component$$1.name || 'Component';\n}\n\nfunction injectIntl(WrappedComponent) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var _options$intlPropName = options.intlPropName,\n      intlPropName = _options$intlPropName === undefined ? 'intl' : _options$intlPropName,\n      _options$withRef = options.withRef,\n      withRef = _options$withRef === undefined ? false : _options$withRef;\n\n  var InjectIntl = function (_Component) {\n    inherits(InjectIntl, _Component);\n\n    function InjectIntl(props, context) {\n      classCallCheck(this, InjectIntl);\n\n      var _this = possibleConstructorReturn(this, (InjectIntl.__proto__ || Object.getPrototypeOf(InjectIntl)).call(this, props, context));\n\n      invariantIntlContext(context);\n      return _this;\n    }\n\n    createClass(InjectIntl, [{\n      key: 'getWrappedInstance',\n      value: function getWrappedInstance() {\n        (0, _invariant2.default)(withRef, '[React Intl] To access the wrapped instance, ' + 'the `{withRef: true}` option must be set when calling: ' + '`injectIntl()`');\n\n        return this.refs.wrappedInstance;\n      }\n    }, {\n      key: 'render',\n      value: function render() {\n        return _react2.default.createElement(WrappedComponent, _extends({}, this.props, defineProperty({}, intlPropName, this.context.intl), {\n          ref: withRef ? 'wrappedInstance' : null\n        }));\n      }\n    }]);\n    return InjectIntl;\n  }(_react.Component);\n\n  InjectIntl.displayName = 'InjectIntl(' + getDisplayName(WrappedComponent) + ')';\n  InjectIntl.contextTypes = {\n    intl: intlShape\n  };\n  InjectIntl.WrappedComponent = WrappedComponent;\n\n  return InjectIntl;\n}\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nfunction defineMessages(messageDescriptors) {\n  // This simply returns what's passed-in because it's meant to be a hook for\n  // babel-plugin-react-intl.\n  return messageDescriptors;\n}\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\n// This is a \"hack\" until a proper `intl-pluralformat` package is created.\n\nfunction resolveLocale(locales) {\n  // IntlMessageFormat#_resolveLocale() does not depend on `this`.\n  return _intlMessageformat2.default.prototype._resolveLocale(locales);\n}\n\nfunction findPluralFunction(locale) {\n  // IntlMessageFormat#_findPluralFunction() does not depend on `this`.\n  return _intlMessageformat2.default.prototype._findPluralRuleFunction(locale);\n}\n\nvar IntlPluralFormat = function IntlPluralFormat(locales) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  classCallCheck(this, IntlPluralFormat);\n\n  var useOrdinal = options.style === 'ordinal';\n  var pluralFn = findPluralFunction(resolveLocale(locales));\n\n  this.format = function (value) {\n    return pluralFn(value, useOrdinal);\n  };\n};\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar DATE_TIME_FORMAT_OPTIONS = Object.keys(dateTimeFormatPropTypes);\nvar NUMBER_FORMAT_OPTIONS = Object.keys(numberFormatPropTypes);\nvar RELATIVE_FORMAT_OPTIONS = Object.keys(relativeFormatPropTypes);\nvar PLURAL_FORMAT_OPTIONS = Object.keys(pluralFormatPropTypes);\n\nvar RELATIVE_FORMAT_THRESHOLDS = {\n  second: 60, // seconds to minute\n  minute: 60, // minutes to hour\n  hour: 24, // hours to day\n  day: 30, // days to month\n  month: 12 // months to year\n};\n\nfunction updateRelativeFormatThresholds(newThresholds) {\n  var thresholds = _intlRelativeformat2.default.thresholds;\n  thresholds.second = newThresholds.second;\n  thresholds.minute = newThresholds.minute;\n  thresholds.hour = newThresholds.hour;\n  thresholds.day = newThresholds.day;\n  thresholds.month = newThresholds.month;\n}\n\nfunction getNamedFormat(formats, type, name) {\n  var format = formats && formats[type] && formats[type][name];\n  if (format) {\n    return format;\n  }\n\n  if ('development' !== 'production') {\n    console.error('[React Intl] No ' + type + ' format named: ' + name);\n  }\n}\n\nfunction formatDate(config, state, value) {\n  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  var locale = config.locale,\n      formats = config.formats;\n  var format = options.format;\n\n  var date = new Date(value);\n  var defaults$$1 = format && getNamedFormat(formats, 'date', format);\n  var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults$$1);\n\n  try {\n    return state.getDateTimeFormat(locale, filteredOptions).format(date);\n  } catch (e) {\n    if ('development' !== 'production') {\n      console.error('[React Intl] Error formatting date.\\n' + e);\n    }\n  }\n\n  return String(date);\n}\n\nfunction formatTime(config, state, value) {\n  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  var locale = config.locale,\n      formats = config.formats;\n  var format = options.format;\n\n  var date = new Date(value);\n  var defaults$$1 = format && getNamedFormat(formats, 'time', format);\n  var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults$$1);\n\n  if (!filteredOptions.hour && !filteredOptions.minute && !filteredOptions.second) {\n    // Add default formatting options if hour, minute, or second isn't defined.\n    filteredOptions = _extends({}, filteredOptions, { hour: 'numeric', minute: 'numeric' });\n  }\n\n  try {\n    return state.getDateTimeFormat(locale, filteredOptions).format(date);\n  } catch (e) {\n    if ('development' !== 'production') {\n      console.error('[React Intl] Error formatting time.\\n' + e);\n    }\n  }\n\n  return String(date);\n}\n\nfunction formatRelative(config, state, value) {\n  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  var locale = config.locale,\n      formats = config.formats;\n  var format = options.format;\n\n  var date = new Date(value);\n  var now = new Date(options.now);\n  var defaults$$1 = format && getNamedFormat(formats, 'relative', format);\n  var filteredOptions = filterProps(options, RELATIVE_FORMAT_OPTIONS, defaults$$1);\n\n  // Capture the current threshold values, then temporarily override them with\n  // specific values just for this render.\n  var oldThresholds = _extends({}, _intlRelativeformat2.default.thresholds);\n  updateRelativeFormatThresholds(RELATIVE_FORMAT_THRESHOLDS);\n\n  try {\n    return state.getRelativeFormat(locale, filteredOptions).format(date, {\n      now: isFinite(now) ? now : state.now()\n    });\n  } catch (e) {\n    if ('development' !== 'production') {\n      console.error('[React Intl] Error formatting relative time.\\n' + e);\n    }\n  } finally {\n    updateRelativeFormatThresholds(oldThresholds);\n  }\n\n  return String(date);\n}\n\nfunction formatNumber(config, state, value) {\n  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  var locale = config.locale,\n      formats = config.formats;\n  var format = options.format;\n\n  var defaults$$1 = format && getNamedFormat(formats, 'number', format);\n  var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults$$1);\n\n  try {\n    return state.getNumberFormat(locale, filteredOptions).format(value);\n  } catch (e) {\n    if ('development' !== 'production') {\n      console.error('[React Intl] Error formatting number.\\n' + e);\n    }\n  }\n\n  return String(value);\n}\n\nfunction formatPlural(config, state, value) {\n  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  var locale = config.locale;\n\n  var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);\n\n  try {\n    return state.getPluralFormat(locale, filteredOptions).format(value);\n  } catch (e) {\n    if ('development' !== 'production') {\n      console.error('[React Intl] Error formatting plural.\\n' + e);\n    }\n  }\n\n  return 'other';\n}\n\nfunction formatMessage(config, state) {\n  var messageDescriptor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  var values = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  var locale = config.locale,\n      formats = config.formats,\n      messages = config.messages,\n      defaultLocale = config.defaultLocale,\n      defaultFormats = config.defaultFormats;\n  var id = messageDescriptor.id,\n      defaultMessage = messageDescriptor.defaultMessage;\n\n  // `id` is a required field of a Message Descriptor.\n\n  (0, _invariant2.default)(id, '[React Intl] An `id` must be provided to format a message.');\n\n  var message = messages && messages[id];\n  var hasValues = Object.keys(values).length > 0;\n\n  // Avoid expensive message formatting for simple messages without values. In\n  // development messages will always be formatted in case of missing values.\n  if (!hasValues && 'development' === 'production') {\n    return message || defaultMessage || id;\n  }\n\n  var formattedMessage = void 0;\n\n  if (message) {\n    try {\n      var formatter = state.getMessageFormat(message, locale, formats);\n\n      formattedMessage = formatter.format(values);\n    } catch (e) {\n      if ('development' !== 'production') {\n        console.error('[React Intl] Error formatting message: \"' + id + '\" for locale: \"' + locale + '\"' + (defaultMessage ? ', using default message as fallback.' : '') + ('\\n' + e));\n      }\n    }\n  } else {\n    if ('development' !== 'production') {\n      // This prevents warnings from littering the console in development\n      // when no `messages` are passed into the <IntlProvider> for the\n      // default locale, and a default message is in the source.\n      if (!defaultMessage || locale && locale.toLowerCase() !== defaultLocale.toLowerCase()) {\n        console.error('[React Intl] Missing message: \"' + id + '\" for locale: \"' + locale + '\"' + (defaultMessage ? ', using default message as fallback.' : ''));\n      }\n    }\n  }\n\n  if (!formattedMessage && defaultMessage) {\n    try {\n      var _formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats);\n\n      formattedMessage = _formatter.format(values);\n    } catch (e) {\n      if ('development' !== 'production') {\n        console.error('[React Intl] Error formatting the default message for: \"' + id + '\"' + ('\\n' + e));\n      }\n    }\n  }\n\n  if (!formattedMessage) {\n    if ('development' !== 'production') {\n      console.error('[React Intl] Cannot format message: \"' + id + '\", ' + ('using message ' + (message || defaultMessage ? 'source' : 'id') + ' as fallback.'));\n    }\n  }\n\n  return formattedMessage || message || defaultMessage || id;\n}\n\nfunction formatHTMLMessage(config, state, messageDescriptor) {\n  var rawValues = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n  // Process all the values before they are used when formatting the ICU\n  // Message string. Since the formatted message might be injected via\n  // `innerHTML`, all String-based values need to be HTML-escaped.\n  var escapedValues = Object.keys(rawValues).reduce(function (escaped, name) {\n    var value = rawValues[name];\n    escaped[name] = typeof value === 'string' ? escape(value) : value;\n    return escaped;\n  }, {});\n\n  return formatMessage(config, state, messageDescriptor, escapedValues);\n}\n\nvar format = Object.freeze({\n  formatDate: formatDate,\n  formatTime: formatTime,\n  formatRelative: formatRelative,\n  formatNumber: formatNumber,\n  formatPlural: formatPlural,\n  formatMessage: formatMessage,\n  formatHTMLMessage: formatHTMLMessage\n});\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar intlConfigPropNames$1 = Object.keys(intlConfigPropTypes);\nvar intlFormatPropNames = Object.keys(intlFormatPropTypes);\n\n// These are not a static property on the `IntlProvider` class so the intl\n// config values can be inherited from an <IntlProvider> ancestor.\nvar defaultProps = {\n  formats: {},\n  messages: {},\n  textComponent: 'span',\n\n  defaultLocale: 'en',\n  defaultFormats: {}\n};\n\nvar IntlProvider = function (_Component) {\n  inherits(IntlProvider, _Component);\n\n  function IntlProvider(props) {\n    var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    classCallCheck(this, IntlProvider);\n\n    var _this = possibleConstructorReturn(this, (IntlProvider.__proto__ || Object.getPrototypeOf(IntlProvider)).call(this, props, context));\n\n    (0, _invariant2.default)(typeof Intl !== 'undefined', '[React Intl] The `Intl` APIs must be available in the runtime, ' + 'and do not appear to be built-in. An `Intl` polyfill should be loaded.\\n' + 'See: http://formatjs.io/guides/runtime-environments/');\n\n    var intlContext = context.intl;\n\n    // Used to stabilize time when performing an initial rendering so that\n    // all relative times use the same reference \"now\" time.\n\n    var initialNow = void 0;\n    if (isFinite(props.initialNow)) {\n      initialNow = Number(props.initialNow);\n    } else {\n      // When an `initialNow` isn't provided via `props`, look to see an\n      // <IntlProvider> exists in the ancestry and call its `now()`\n      // function to propagate its value for \"now\".\n      initialNow = intlContext ? intlContext.now() : Date.now();\n    }\n\n    // Creating `Intl*` formatters is expensive. If there's a parent\n    // `<IntlProvider>`, then its formatters will be used. Otherwise, this\n    // memoize the `Intl*` constructors and cache them for the lifecycle of\n    // this IntlProvider instance.\n\n    var _ref = intlContext || {},\n        _ref$formatters = _ref.formatters,\n        formatters = _ref$formatters === undefined ? {\n      getDateTimeFormat: (0, _intlFormatCache2.default)(Intl.DateTimeFormat),\n      getNumberFormat: (0, _intlFormatCache2.default)(Intl.NumberFormat),\n      getMessageFormat: (0, _intlFormatCache2.default)(_intlMessageformat2.default),\n      getRelativeFormat: (0, _intlFormatCache2.default)(_intlRelativeformat2.default),\n      getPluralFormat: (0, _intlFormatCache2.default)(IntlPluralFormat)\n    } : _ref$formatters;\n\n    _this.state = _extends({}, formatters, {\n\n      // Wrapper to provide stable \"now\" time for initial render.\n      now: function now() {\n        return _this._didDisplay ? Date.now() : initialNow;\n      }\n    });\n    return _this;\n  }\n\n  createClass(IntlProvider, [{\n    key: 'getConfig',\n    value: function getConfig() {\n      var intlContext = this.context.intl;\n\n      // Build a whitelisted config object from `props`, defaults, and\n      // `context.intl`, if an <IntlProvider> exists in the ancestry.\n\n      var config = filterProps(this.props, intlConfigPropNames$1, intlContext);\n\n      // Apply default props. This must be applied last after the props have\n      // been resolved and inherited from any <IntlProvider> in the ancestry.\n      // This matches how React resolves `defaultProps`.\n      for (var propName in defaultProps) {\n        if (config[propName] === undefined) {\n          config[propName] = defaultProps[propName];\n        }\n      }\n\n      if (!hasLocaleData(config.locale)) {\n        var _config = config,\n            locale = _config.locale,\n            defaultLocale = _config.defaultLocale,\n            defaultFormats = _config.defaultFormats;\n\n        if ('development' !== 'production') {\n          console.error('[React Intl] Missing locale data for locale: \"' + locale + '\". ' + ('Using default locale: \"' + defaultLocale + '\" as fallback.'));\n        }\n\n        // Since there's no registered locale data for `locale`, this will\n        // fallback to the `defaultLocale` to make sure things can render.\n        // The `messages` are overridden to the `defaultProps` empty object\n        // to maintain referential equality across re-renders. It's assumed\n        // each <FormattedMessage> contains a `defaultMessage` prop.\n        config = _extends({}, config, {\n          locale: defaultLocale,\n          formats: defaultFormats,\n          messages: defaultProps.messages\n        });\n      }\n\n      return config;\n    }\n  }, {\n    key: 'getBoundFormatFns',\n    value: function getBoundFormatFns(config, state) {\n      return intlFormatPropNames.reduce(function (boundFormatFns, name) {\n        boundFormatFns[name] = format[name].bind(null, config, state);\n        return boundFormatFns;\n      }, {});\n    }\n  }, {\n    key: 'getChildContext',\n    value: function getChildContext() {\n      var config = this.getConfig();\n\n      // Bind intl factories and current config to the format functions.\n      var boundFormatFns = this.getBoundFormatFns(config, this.state);\n\n      var _state = this.state,\n          now = _state.now,\n          formatters = objectWithoutProperties(_state, ['now']);\n\n      return {\n        intl: _extends({}, config, boundFormatFns, {\n          formatters: formatters,\n          now: now\n        })\n      };\n    }\n  }, {\n    key: 'shouldComponentUpdate',\n    value: function shouldComponentUpdate() {\n      for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {\n        next[_key] = arguments[_key];\n      }\n\n      return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));\n    }\n  }, {\n    key: 'componentDidMount',\n    value: function componentDidMount() {\n      this._didDisplay = true;\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      return _react.Children.only(this.props.children);\n    }\n  }]);\n  return IntlProvider;\n}(_react.Component);\n\nIntlProvider.displayName = 'IntlProvider';\nIntlProvider.contextTypes = {\n  intl: intlShape\n};\nIntlProvider.childContextTypes = {\n  intl: intlShape.isRequired\n};\n'development' !== \"production\" ? IntlProvider.propTypes = _extends({}, intlConfigPropTypes, {\n  children: _propTypes2.default.element.isRequired,\n  initialNow: _propTypes2.default.any\n}) : void 0;\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar FormattedDate = function (_Component) {\n  inherits(FormattedDate, _Component);\n\n  function FormattedDate(props, context) {\n    classCallCheck(this, FormattedDate);\n\n    var _this = possibleConstructorReturn(this, (FormattedDate.__proto__ || Object.getPrototypeOf(FormattedDate)).call(this, props, context));\n\n    invariantIntlContext(context);\n    return _this;\n  }\n\n  createClass(FormattedDate, [{\n    key: 'shouldComponentUpdate',\n    value: function shouldComponentUpdate() {\n      for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {\n        next[_key] = arguments[_key];\n      }\n\n      return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _context$intl = this.context.intl,\n          formatDate = _context$intl.formatDate,\n          Text = _context$intl.textComponent;\n      var _props = this.props,\n          value = _props.value,\n          children = _props.children;\n\n      var formattedDate = formatDate(value, this.props);\n\n      if (typeof children === 'function') {\n        return children(formattedDate);\n      }\n\n      return _react2.default.createElement(Text, null, formattedDate);\n    }\n  }]);\n  return FormattedDate;\n}(_react.Component);\n\nFormattedDate.displayName = 'FormattedDate';\nFormattedDate.contextTypes = {\n  intl: intlShape\n};\n'development' !== \"production\" ? FormattedDate.propTypes = _extends({}, dateTimeFormatPropTypes, {\n  value: _propTypes2.default.any.isRequired,\n  format: _propTypes2.default.string,\n  children: _propTypes2.default.func\n}) : void 0;\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar FormattedTime = function (_Component) {\n  inherits(FormattedTime, _Component);\n\n  function FormattedTime(props, context) {\n    classCallCheck(this, FormattedTime);\n\n    var _this = possibleConstructorReturn(this, (FormattedTime.__proto__ || Object.getPrototypeOf(FormattedTime)).call(this, props, context));\n\n    invariantIntlContext(context);\n    return _this;\n  }\n\n  createClass(FormattedTime, [{\n    key: 'shouldComponentUpdate',\n    value: function shouldComponentUpdate() {\n      for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {\n        next[_key] = arguments[_key];\n      }\n\n      return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _context$intl = this.context.intl,\n          formatTime = _context$intl.formatTime,\n          Text = _context$intl.textComponent;\n      var _props = this.props,\n          value = _props.value,\n          children = _props.children;\n\n      var formattedTime = formatTime(value, this.props);\n\n      if (typeof children === 'function') {\n        return children(formattedTime);\n      }\n\n      return _react2.default.createElement(Text, null, formattedTime);\n    }\n  }]);\n  return FormattedTime;\n}(_react.Component);\n\nFormattedTime.displayName = 'FormattedTime';\nFormattedTime.contextTypes = {\n  intl: intlShape\n};\n'development' !== \"production\" ? FormattedTime.propTypes = _extends({}, dateTimeFormatPropTypes, {\n  value: _propTypes2.default.any.isRequired,\n  format: _propTypes2.default.string,\n  children: _propTypes2.default.func\n}) : void 0;\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar SECOND = 1000;\nvar MINUTE = 1000 * 60;\nvar HOUR = 1000 * 60 * 60;\nvar DAY = 1000 * 60 * 60 * 24;\n\n// The maximum timer delay value is a 32-bit signed integer.\n// See: https://mdn.io/setTimeout\nvar MAX_TIMER_DELAY = 2147483647;\n\nfunction selectUnits(delta) {\n  var absDelta = Math.abs(delta);\n\n  if (absDelta < MINUTE) {\n    return 'second';\n  }\n\n  if (absDelta < HOUR) {\n    return 'minute';\n  }\n\n  if (absDelta < DAY) {\n    return 'hour';\n  }\n\n  // The maximum scheduled delay will be measured in days since the maximum\n  // timer delay is less than the number of milliseconds in 25 days.\n  return 'day';\n}\n\nfunction getUnitDelay(units) {\n  switch (units) {\n    case 'second':\n      return SECOND;\n    case 'minute':\n      return MINUTE;\n    case 'hour':\n      return HOUR;\n    case 'day':\n      return DAY;\n    default:\n      return MAX_TIMER_DELAY;\n  }\n}\n\nfunction isSameDate(a, b) {\n  if (a === b) {\n    return true;\n  }\n\n  var aTime = new Date(a).getTime();\n  var bTime = new Date(b).getTime();\n\n  return isFinite(aTime) && isFinite(bTime) && aTime === bTime;\n}\n\nvar FormattedRelative = function (_Component) {\n  inherits(FormattedRelative, _Component);\n\n  function FormattedRelative(props, context) {\n    classCallCheck(this, FormattedRelative);\n\n    var _this = possibleConstructorReturn(this, (FormattedRelative.__proto__ || Object.getPrototypeOf(FormattedRelative)).call(this, props, context));\n\n    invariantIntlContext(context);\n\n    var now = isFinite(props.initialNow) ? Number(props.initialNow) : context.intl.now();\n\n    // `now` is stored as state so that `render()` remains a function of\n    // props + state, instead of accessing `Date.now()` inside `render()`.\n    _this.state = { now: now };\n    return _this;\n  }\n\n  createClass(FormattedRelative, [{\n    key: 'scheduleNextUpdate',\n    value: function scheduleNextUpdate(props, state) {\n      var _this2 = this;\n\n      // Cancel and pending update because we're scheduling a new update.\n      clearTimeout(this._timer);\n\n      var value = props.value,\n          units = props.units,\n          updateInterval = props.updateInterval;\n\n      var time = new Date(value).getTime();\n\n      // If the `updateInterval` is falsy, including `0` or we don't have a\n      // valid date, then auto updates have been turned off, so we bail and\n      // skip scheduling an update.\n      if (!updateInterval || !isFinite(time)) {\n        return;\n      }\n\n      var delta = time - state.now;\n      var unitDelay = getUnitDelay(units || selectUnits(delta));\n      var unitRemainder = Math.abs(delta % unitDelay);\n\n      // We want the largest possible timer delay which will still display\n      // accurate information while reducing unnecessary re-renders. The delay\n      // should be until the next \"interesting\" moment, like a tick from\n      // \"1 minute ago\" to \"2 minutes ago\" when the delta is 120,000ms.\n      var delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder);\n\n      this._timer = setTimeout(function () {\n        _this2.setState({ now: _this2.context.intl.now() });\n      }, delay);\n    }\n  }, {\n    key: 'componentDidMount',\n    value: function componentDidMount() {\n      this.scheduleNextUpdate(this.props, this.state);\n    }\n  }, {\n    key: 'componentWillReceiveProps',\n    value: function componentWillReceiveProps(_ref) {\n      var nextValue = _ref.value;\n\n      // When the `props.value` date changes, `state.now` needs to be updated,\n      // and the next update can be rescheduled.\n      if (!isSameDate(nextValue, this.props.value)) {\n        this.setState({ now: this.context.intl.now() });\n      }\n    }\n  }, {\n    key: 'shouldComponentUpdate',\n    value: function shouldComponentUpdate() {\n      for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {\n        next[_key] = arguments[_key];\n      }\n\n      return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));\n    }\n  }, {\n    key: 'componentWillUpdate',\n    value: function componentWillUpdate(nextProps, nextState) {\n      this.scheduleNextUpdate(nextProps, nextState);\n    }\n  }, {\n    key: 'componentWillUnmount',\n    value: function componentWillUnmount() {\n      clearTimeout(this._timer);\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _context$intl = this.context.intl,\n          formatRelative = _context$intl.formatRelative,\n          Text = _context$intl.textComponent;\n      var _props = this.props,\n          value = _props.value,\n          children = _props.children;\n\n      var formattedRelative = formatRelative(value, _extends({}, this.props, this.state));\n\n      if (typeof children === 'function') {\n        return children(formattedRelative);\n      }\n\n      return _react2.default.createElement(Text, null, formattedRelative);\n    }\n  }]);\n  return FormattedRelative;\n}(_react.Component);\n\nFormattedRelative.displayName = 'FormattedRelative';\nFormattedRelative.contextTypes = {\n  intl: intlShape\n};\nFormattedRelative.defaultProps = {\n  updateInterval: 1000 * 10\n};\n'development' !== \"production\" ? FormattedRelative.propTypes = _extends({}, relativeFormatPropTypes, {\n  value: _propTypes2.default.any.isRequired,\n  format: _propTypes2.default.string,\n  updateInterval: _propTypes2.default.number,\n  initialNow: _propTypes2.default.any,\n  children: _propTypes2.default.func\n}) : void 0;\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar FormattedNumber = function (_Component) {\n  inherits(FormattedNumber, _Component);\n\n  function FormattedNumber(props, context) {\n    classCallCheck(this, FormattedNumber);\n\n    var _this = possibleConstructorReturn(this, (FormattedNumber.__proto__ || Object.getPrototypeOf(FormattedNumber)).call(this, props, context));\n\n    invariantIntlContext(context);\n    return _this;\n  }\n\n  createClass(FormattedNumber, [{\n    key: 'shouldComponentUpdate',\n    value: function shouldComponentUpdate() {\n      for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {\n        next[_key] = arguments[_key];\n      }\n\n      return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _context$intl = this.context.intl,\n          formatNumber = _context$intl.formatNumber,\n          Text = _context$intl.textComponent;\n      var _props = this.props,\n          value = _props.value,\n          children = _props.children;\n\n      var formattedNumber = formatNumber(value, this.props);\n\n      if (typeof children === 'function') {\n        return children(formattedNumber);\n      }\n\n      return _react2.default.createElement(Text, null, formattedNumber);\n    }\n  }]);\n  return FormattedNumber;\n}(_react.Component);\n\nFormattedNumber.displayName = 'FormattedNumber';\nFormattedNumber.contextTypes = {\n  intl: intlShape\n};\n'development' !== \"production\" ? FormattedNumber.propTypes = _extends({}, numberFormatPropTypes, {\n  value: _propTypes2.default.any.isRequired,\n  format: _propTypes2.default.string,\n  children: _propTypes2.default.func\n}) : void 0;\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar FormattedPlural = function (_Component) {\n  inherits(FormattedPlural, _Component);\n\n  function FormattedPlural(props, context) {\n    classCallCheck(this, FormattedPlural);\n\n    var _this = possibleConstructorReturn(this, (FormattedPlural.__proto__ || Object.getPrototypeOf(FormattedPlural)).call(this, props, context));\n\n    invariantIntlContext(context);\n    return _this;\n  }\n\n  createClass(FormattedPlural, [{\n    key: 'shouldComponentUpdate',\n    value: function shouldComponentUpdate() {\n      for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {\n        next[_key] = arguments[_key];\n      }\n\n      return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _context$intl = this.context.intl,\n          formatPlural = _context$intl.formatPlural,\n          Text = _context$intl.textComponent;\n      var _props = this.props,\n          value = _props.value,\n          other = _props.other,\n          children = _props.children;\n\n      var pluralCategory = formatPlural(value, this.props);\n      var formattedPlural = this.props[pluralCategory] || other;\n\n      if (typeof children === 'function') {\n        return children(formattedPlural);\n      }\n\n      return _react2.default.createElement(Text, null, formattedPlural);\n    }\n  }]);\n  return FormattedPlural;\n}(_react.Component);\n\nFormattedPlural.displayName = 'FormattedPlural';\nFormattedPlural.contextTypes = {\n  intl: intlShape\n};\nFormattedPlural.defaultProps = {\n  style: 'cardinal'\n};\n'development' !== \"production\" ? FormattedPlural.propTypes = _extends({}, pluralFormatPropTypes, {\n  value: _propTypes2.default.any.isRequired,\n\n  other: _propTypes2.default.node.isRequired,\n  zero: _propTypes2.default.node,\n  one: _propTypes2.default.node,\n  two: _propTypes2.default.node,\n  few: _propTypes2.default.node,\n  many: _propTypes2.default.node,\n\n  children: _propTypes2.default.func\n}) : void 0;\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar FormattedMessage = function (_Component) {\n  inherits(FormattedMessage, _Component);\n\n  function FormattedMessage(props, context) {\n    classCallCheck(this, FormattedMessage);\n\n    var _this = possibleConstructorReturn(this, (FormattedMessage.__proto__ || Object.getPrototypeOf(FormattedMessage)).call(this, props, context));\n\n    invariantIntlContext(context);\n    return _this;\n  }\n\n  createClass(FormattedMessage, [{\n    key: 'shouldComponentUpdate',\n    value: function shouldComponentUpdate(nextProps) {\n      var values = this.props.values;\n      var nextValues = nextProps.values;\n\n      if (!shallowEquals(nextValues, values)) {\n        return true;\n      }\n\n      // Since `values` has already been checked, we know they're not\n      // different, so the current `values` are carried over so the shallow\n      // equals comparison on the other props isn't affected by the `values`.\n      var nextPropsToCheck = _extends({}, nextProps, {\n        values: values\n      });\n\n      for (var _len = arguments.length, next = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        next[_key - 1] = arguments[_key];\n      }\n\n      return shouldIntlComponentUpdate.apply(undefined, [this, nextPropsToCheck].concat(next));\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _context$intl = this.context.intl,\n          formatMessage = _context$intl.formatMessage,\n          Text = _context$intl.textComponent;\n      var _props = this.props,\n          id = _props.id,\n          description = _props.description,\n          defaultMessage = _props.defaultMessage,\n          values = _props.values,\n          _props$tagName = _props.tagName,\n          Component$$1 = _props$tagName === undefined ? Text : _props$tagName,\n          children = _props.children;\n\n      var tokenDelimiter = void 0;\n      var tokenizedValues = void 0;\n      var elements = void 0;\n\n      var hasValues = values && Object.keys(values).length > 0;\n      if (hasValues) {\n        // Creates a token with a random UID that should not be guessable or\n        // conflict with other parts of the `message` string.\n        var uid = Math.floor(Math.random() * 0x10000000000).toString(16);\n\n        var generateToken = function () {\n          var counter = 0;\n          return function () {\n            return 'ELEMENT-' + uid + '-' + (counter += 1);\n          };\n        }();\n\n        // Splitting with a delimiter to support IE8. When using a regex\n        // with a capture group IE8 does not include the capture group in\n        // the resulting array.\n        tokenDelimiter = '@__' + uid + '__@';\n        tokenizedValues = {};\n        elements = {};\n\n        // Iterates over the `props` to keep track of any React Element\n        // values so they can be represented by the `token` as a placeholder\n        // when the `message` is formatted. This allows the formatted\n        // message to then be broken-up into parts with references to the\n        // React Elements inserted back in.\n        Object.keys(values).forEach(function (name) {\n          var value = values[name];\n\n          if ((0, _react.isValidElement)(value)) {\n            var token = generateToken();\n            tokenizedValues[name] = tokenDelimiter + token + tokenDelimiter;\n            elements[token] = value;\n          } else {\n            tokenizedValues[name] = value;\n          }\n        });\n      }\n\n      var descriptor = { id: id, description: description, defaultMessage: defaultMessage };\n      var formattedMessage = formatMessage(descriptor, tokenizedValues || values);\n\n      var nodes = void 0;\n\n      var hasElements = elements && Object.keys(elements).length > 0;\n      if (hasElements) {\n        // Split the message into parts so the React Element values captured\n        // above can be inserted back into the rendered message. This\n        // approach allows messages to render with React Elements while\n        // keeping React's virtual diffing working properly.\n        nodes = formattedMessage.split(tokenDelimiter).filter(function (part) {\n          return !!part;\n        }).map(function (part) {\n          return elements[part] || part;\n        });\n      } else {\n        nodes = [formattedMessage];\n      }\n\n      if (typeof children === 'function') {\n        return children.apply(undefined, toConsumableArray(nodes));\n      }\n\n      // Needs to use `createElement()` instead of JSX, otherwise React will\n      // warn about a missing `key` prop with rich-text message formatting.\n      return _react.createElement.apply(undefined, [Component$$1, null].concat(toConsumableArray(nodes)));\n    }\n  }]);\n  return FormattedMessage;\n}(_react.Component);\n\nFormattedMessage.displayName = 'FormattedMessage';\nFormattedMessage.contextTypes = {\n  intl: intlShape\n};\nFormattedMessage.defaultProps = {\n  values: {}\n};\n'development' !== \"production\" ? FormattedMessage.propTypes = _extends({}, messageDescriptorPropTypes, {\n  values: _propTypes2.default.object,\n  tagName: _propTypes2.default.string,\n  children: _propTypes2.default.func\n}) : void 0;\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nvar FormattedHTMLMessage = function (_Component) {\n  inherits(FormattedHTMLMessage, _Component);\n\n  function FormattedHTMLMessage(props, context) {\n    classCallCheck(this, FormattedHTMLMessage);\n\n    var _this = possibleConstructorReturn(this, (FormattedHTMLMessage.__proto__ || Object.getPrototypeOf(FormattedHTMLMessage)).call(this, props, context));\n\n    invariantIntlContext(context);\n    return _this;\n  }\n\n  createClass(FormattedHTMLMessage, [{\n    key: 'shouldComponentUpdate',\n    value: function shouldComponentUpdate(nextProps) {\n      var values = this.props.values;\n      var nextValues = nextProps.values;\n\n      if (!shallowEquals(nextValues, values)) {\n        return true;\n      }\n\n      // Since `values` has already been checked, we know they're not\n      // different, so the current `values` are carried over so the shallow\n      // equals comparison on the other props isn't affected by the `values`.\n      var nextPropsToCheck = _extends({}, nextProps, {\n        values: values\n      });\n\n      for (var _len = arguments.length, next = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        next[_key - 1] = arguments[_key];\n      }\n\n      return shouldIntlComponentUpdate.apply(undefined, [this, nextPropsToCheck].concat(next));\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _context$intl = this.context.intl,\n          formatHTMLMessage = _context$intl.formatHTMLMessage,\n          Text = _context$intl.textComponent;\n      var _props = this.props,\n          id = _props.id,\n          description = _props.description,\n          defaultMessage = _props.defaultMessage,\n          rawValues = _props.values,\n          _props$tagName = _props.tagName,\n          Component$$1 = _props$tagName === undefined ? Text : _props$tagName,\n          children = _props.children;\n\n      var descriptor = { id: id, description: description, defaultMessage: defaultMessage };\n      var formattedHTMLMessage = formatHTMLMessage(descriptor, rawValues);\n\n      if (typeof children === 'function') {\n        return children(formattedHTMLMessage);\n      }\n\n      // Since the message presumably has HTML in it, we need to set\n      // `innerHTML` in order for it to be rendered and not escaped by React.\n      // To be safe, all string prop values were escaped when formatting the\n      // message. It is assumed that the message is not UGC, and came from the\n      // developer making it more like a template.\n      //\n      // Note: There's a perf impact of using this component since there's no\n      // way for React to do its virtual DOM diffing.\n      var html = { __html: formattedHTMLMessage };\n      return _react2.default.createElement(Component$$1, { dangerouslySetInnerHTML: html });\n    }\n  }]);\n  return FormattedHTMLMessage;\n}(_react.Component);\n\nFormattedHTMLMessage.displayName = 'FormattedHTMLMessage';\nFormattedHTMLMessage.contextTypes = {\n  intl: intlShape\n};\nFormattedHTMLMessage.defaultProps = {\n  values: {}\n};\n'development' !== \"production\" ? FormattedHTMLMessage.propTypes = _extends({}, messageDescriptorPropTypes, {\n  values: _propTypes2.default.object,\n  tagName: _propTypes2.default.string,\n  children: _propTypes2.default.func\n}) : void 0;\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\naddLocaleData(defaultLocaleData);\n\n/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\naddLocaleData(_index2.default);\n\nexports.addLocaleData = addLocaleData;\nexports.intlShape = intlShape;\nexports.injectIntl = injectIntl;\nexports.defineMessages = defineMessages;\nexports.IntlProvider = IntlProvider;\nexports.FormattedDate = FormattedDate;\nexports.FormattedTime = FormattedTime;\nexports.FormattedRelative = FormattedRelative;\nexports.FormattedNumber = FormattedNumber;\nexports.FormattedPlural = FormattedPlural;\nexports.FormattedMessage = FormattedMessage;\nexports.FormattedHTMLMessage = FormattedHTMLMessage;","map":null},"hash":"ce1c0eb11d6a9bd68e37b57aec287173","cacheData":{"env":{"NODE_ENV":"development"}}}