{"version":3,"sources":["webpack:///./node_modules/react-localize-redux/es/utils.js","webpack:///./node_modules/react-localize-redux/es/localize.js","webpack:///./node_modules/react-localize-redux/es/LocalizeContext.js","webpack:///./node_modules/react-localize-redux/es/withLocalize.js","webpack:///./node_modules/react-localize-redux/es/Translate.js","webpack:///./node_modules/react-localize-redux/es/LocalizeProvider.js","webpack:///./node_modules/react-localize-redux/es/index.js","webpack:///./node_modules/react-localize-redux/node_modules/reselect/lib/index.js"],"names":["options","translation","data","renderInnerHtml","translatedValueOrArray","hasHtmlTags","createElement","dangerouslySetInnerHTML","__html","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","Symbol","iterator","next","done","portion","value","warning","err","return","apply","concat","arr","Array","isArray","i","arr2","length","from","_toConsumableArray","search","strings","arguments","genericPlaceholderPattern","splitStrings","split","RegExp","filter","str","map","templatePortion","matched","prop","test","some","isValidElement","reduce","translated","objectValuesToString","Object","values","toString","keys","key","validateOptions","onMissingTranslation","Error","renderToStaticMarkup","language","languages","translations","languageIndex","code","indexOf","getIndexForLanguageCode","totalKeys","translationsForLanguage","getSingleToMultilanguageTranslation","languageCodes","flattenedTranslations","existingTranslations","singleLanguageTranslations","_loop","translationValues","index","existingValues","get","obj","path","defaultValue","pathArr","Boolean","ret","message","console","error","e","_typeof","constructor","prototype","_extends","assign","target","source","hasOwnProperty","call","_defineProperty","defineProperty","enumerable","configurable","writable","_objectWithoutProperties","INITIALIZE","state","action","type","_options","payload","isActive","defaultLanguage","active","languageCode","translationWithTransform","flat","safe","_options2","firstLanguage","_defaultLanguage","isMultiLanguageTranslation","item","newTranslation","translationOptions","translationTransform","defaultTranslateOptions","_options3","_defaultLanguage2","ignoreTranslateChildren","_ref","translationId","localizeReducer","languagesState","getTranslations","getLanguages","getOptions","getActiveLanguage","translationsEqualSelector","prev","cur","prevKeys","curKeys","prevValues","curValues","getTranslationsForActiveLanguage","getTranslationsForSpecificLanguage","getTranslate","translationsForActiveLanguage","getTranslationsForLanguage","activeLanguage","initializeOptions","translateOptions","defaultOptions","overrideLanguage","defaultTranslations","mergedOptions","getTranslation","hasValidTranslation","defaultTranslation","dispatch","addTranslation","addTranslationForLanguage","setActiveLanguage","translate","initialize","defaultLocalizeState","defaultContext","LocalizeContext","defineProperties","props","descriptor","Constructor","protoProps","staticProps","instance","TypeError","self","ReferenceError","_React$Component","WrappedTranslate","this","__proto__","getPrototypeOf","subClass","superClass","create","setPrototypeOf","addDefaultTranslation","prevProps","idChanged","id","noDefaultLanguage","incomingLanguage","_props","context","children","_props$options","hasId","hasDefaultLanguage","hasChildren","hasFunctionAsChild","_props2","_props2$id","renderChildren","Consumer","_Component","LocalizeProvider","_this","store","bind","getContextPropsSelector","initialState","localize","initExternalStore","subscribeToExternalStore","unsubscribeFromStore","onChange","currentState","handleChange","nextState","getState","unsubscribe","subscribe","storeDidChange","onStateDidChange","prevState","prevLocalizeState","curLocalizeState","prevActiveLanguage","curActiveLanguage","prevOptions","curOptions","prevTranslations","curTranslations","setState","contextProps","Provider","defaultEqualityCheck","a","b","areArgumentsShallowlyEqual","equalityCheck","defaultMemoize","func","lastArgs","lastResult","getDependencies","funcs","dependencies","every","dep","dependencyTypes","join","createSelectorCreator","memoize","_len","memoizeOptions","_key","_len2","_key2","recomputations","resultFunc","pop","memoizedResultFunc","selector","params","push","resetRecomputations","exports","__esModule","createStructuredSelector","selectors","selectorCreator","createSelector","objectKeys","_len3","_key3","composition"],"mappings":"sIAMO,IAAI,EAAsB,SAA6BA,GAC5D,IAAIC,EAAcD,EAAQC,YACtBC,EAAOF,EAAQE,KACfC,EAAkBH,EAAQG,gBAG1BC,EAAyB,EAAUH,EAAaC,GAGpD,GAAsC,iBAA3BE,EACT,OAA2B,IAApBD,GAA4BE,EAAYD,GAA0B,IAAME,cAAc,OAAQ,CACnGC,wBAAyB,CAAEC,OAAQJ,KAChCA,EAKP,IAAIK,GAA4B,EAC5BC,GAAoB,EACpBC,OAAiBC,EAErB,IACE,IAAK,IAA2DC,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,OAAOwN,EAAUxN,OACf,WACF,IAAK,IAAI4N,EAAQjP,UAAUL,OAAQuB,EAAS3B,MAAM0P,GAAQC,EAAQ,EAAGA,EAAQD,EAAOC,IAClFhO,EAAOgO,GAASlP,UAAUkP,GAG5B,OAAOhO,EAAOJ,QAAO,SAAUqO,EAAanQ,EAAO0D,GAEjD,OADAyM,EAAYH,EAAWtM,IAAU1D,EAC1BmQ,IACN,QAnBP,IAAIJ,EAAiBL,EAAQK,eAAiBpB,EAAsBX","file":"npm.react-localize-redux.c920b4ddeb9b68365139.js","sourcesContent":["function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nimport React from 'react';\nimport { defaultTranslateOptions } from './localize';\n\n\nexport var getLocalizedElement = function getLocalizedElement(options) {\n var translation = options.translation,\n data = options.data,\n renderInnerHtml = options.renderInnerHtml;\n\n\n var translatedValueOrArray = templater(translation, data);\n\n // if result of templater is string, do the usual stuff\n if (typeof translatedValueOrArray === 'string') {\n return renderInnerHtml === true && hasHtmlTags(translatedValueOrArray) ? React.createElement('span', {\n dangerouslySetInnerHTML: { __html: translatedValueOrArray }\n }) : translatedValueOrArray;\n }\n\n // at this point we know we have react components;\n // check if there are HTMLTags in the translation (not allowed)\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = translatedValueOrArray[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var portion = _step.value;\n\n if (typeof portion === 'string' && hasHtmlTags(portion)) {\n warning('HTML tags in the translation string are not supported when passing React components as arguments to the translation.');\n return '';\n }\n }\n\n // return as Element\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return React.createElement.apply(React, ['span', null].concat(_toConsumableArray(translatedValueOrArray)));\n};\n\nexport var hasHtmlTags = function hasHtmlTags(value) {\n var pattern = /(&[^\\s]*;|<\\/?\\w+((\\s+\\w+(\\s*=\\s*(?:\".*?\"|'.*?'|[\\^'\">\\s]+))?)+\\s*|\\s*)\\/?>)/;\n return value.search(pattern) >= 0;\n};\n\n/**\n * @func templater\n * @desc A poor mans template parser\n * @param {string} strings The template string\n * @param {object} data The data that should be inserted in template\n * @return {string} The template string with the data merged in\n */\nexport var templater = function templater(strings) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!strings) return '';\n\n // ${**}\n // brackets to include it in the result of .split()\n var genericPlaceholderPattern = '(\\\\${\\\\s*[^\\\\s}]+\\\\s*})';\n\n // split: from 'Hey ${name}' -> ['Hey', '${name}']\n // filter: clean empty strings\n // map: replace ${prop} with data[prop]\n var splitStrings = strings.split(new RegExp(genericPlaceholderPattern, 'gmi')).filter(function (str) {\n return !!str;\n }).map(function (templatePortion) {\n var matched = void 0;\n for (var prop in data) {\n if (matched) break;\n var pattern = '\\\\${\\\\s*' + prop + '\\\\s*}';\n var regex = new RegExp(pattern, 'gmi');\n if (regex.test(templatePortion)) matched = data[prop];\n }\n if (typeof matched === 'undefined') return templatePortion;\n return matched;\n });\n\n // if there is a React element, return as array\n if (splitStrings.some(function (portion) {\n return React.isValidElement(portion);\n })) {\n return splitStrings;\n }\n\n // otherwise concatenate all portions into the translated value\n return splitStrings.reduce(function (translated, portion) {\n return translated + ('' + portion);\n }, '');\n};\n\nexport var getIndexForLanguageCode = function getIndexForLanguageCode(code, languages) {\n return languages.map(function (language) {\n return language.code;\n }).indexOf(code);\n};\n\nexport var objectValuesToString = function objectValuesToString(data) {\n return !Object.values ? Object.keys(data).map(function (key) {\n return data[key].toString();\n }).toString() : Object.values(data).toString();\n};\n\nexport var validateOptions = function validateOptions(options) {\n if (options.onMissingTranslation !== undefined && typeof options.onMissingTranslation !== 'function') {\n throw new Error('react-localize-redux: an invalid onMissingTranslation function was provided.');\n }\n\n if (options.renderToStaticMarkup !== false && typeof options.renderToStaticMarkup !== 'function') {\n throw new Error('\\n react-localize-redux: initialize option renderToStaticMarkup is invalid.\\n Please see https://ryandrewjohnson.github.io/react-localize-redux-docs/#initialize.\\n ');\n }\n\n return options;\n};\n\nexport var getTranslationsForLanguage = function getTranslationsForLanguage(language, languages, translations) {\n // no language! return no translations\n if (!language) {\n return {};\n }\n\n var languageCode = language.code;\n\n var languageIndex = getIndexForLanguageCode(languageCode, languages);\n var keys = Object.keys(translations);\n var totalKeys = keys.length;\n var translationsForLanguage = {};\n\n for (var i = 0; i < totalKeys; i++) {\n var key = keys[i];\n translationsForLanguage[key] = translations[key][languageIndex];\n }\n\n return translationsForLanguage;\n};\n\nexport var storeDidChange = function storeDidChange(store, onChange) {\n var currentState = void 0;\n\n function handleChange() {\n var nextState = store.getState();\n if (nextState !== currentState) {\n onChange(currentState);\n currentState = nextState;\n }\n }\n\n var unsubscribe = store.subscribe(handleChange);\n handleChange();\n return unsubscribe;\n};\n\nexport var getSingleToMultilanguageTranslation = function getSingleToMultilanguageTranslation(language, languageCodes, flattenedTranslations, existingTranslations) {\n var languageIndex = languageCodes.indexOf(language);\n var translations = languageIndex >= 0 ? flattenedTranslations : {};\n var keys = Object.keys(translations);\n var totalKeys = keys.length;\n var singleLanguageTranslations = {};\n\n var _loop = function _loop(i) {\n var key = keys[i];\n // loop through each language, and for languages that don't match languageIndex\n // keep existing translation data, and for languageIndex store new translation data\n var translationValues = languageCodes.map(function (code, index) {\n var existingValues = existingTranslations[key] || [];\n\n return index === languageIndex ? flattenedTranslations[key] : existingValues[index];\n });\n\n singleLanguageTranslations[key] = translationValues;\n };\n\n for (var i = 0; i < totalKeys; i++) {\n _loop(i);\n }\n\n return singleLanguageTranslations;\n};\n\nexport var get = function get(obj, path) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n\n var pathArr = path.split('.').filter(Boolean);\n return pathArr.reduce(function (ret, key) {\n return ret && ret[key] ? ret[key] : defaultValue;\n }, obj);\n};\n\n// Thanks react-redux for utility function\n// https://github.com/reactjs/react-redux/blob/master/src/utils/warning.js\nexport var warning = function warning(message) {\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {}\n};","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nimport * as React from 'react';\nimport { flatten } from 'flat';\nimport { createSelector, createSelectorCreator, defaultMemoize } from 'reselect';\nimport { getLocalizedElement, getIndexForLanguageCode, objectValuesToString, validateOptions, getTranslationsForLanguage, warning, getSingleToMultilanguageTranslation } from './utils';\n\n/**\n * TYPES\n */\n\n\n// This is to get around the whole default options issue with Flow\n// I tried using the $Diff approach, but with no luck so for now stuck with this terd.\n// Because sometimes you just want flow to shut up!\n\n\n/**\n * ACTIONS\n */\nexport var INITIALIZE = '@@localize/INITIALIZE';\nexport var ADD_TRANSLATION = '@@localize/ADD_TRANSLATION';\nexport var ADD_TRANSLATION_FOR_LANGUAGE = '@@localize/ADD_TRANSLATION_FOR_LANGUAGE';\nexport var SET_ACTIVE_LANGUAGE = '@@localize/SET_ACTIVE_LANGUAGE';\nexport var TRANSLATE = '@@localize/TRANSLATE';\n\n/**\n * REDUCERS\n */\nexport function languages() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var action = arguments[1];\n\n switch (action.type) {\n case INITIALIZE:\n var _options = action.payload.options || {};\n return action.payload.languages.map(function (language, index) {\n var isActive = function isActive(code) {\n return _options.defaultLanguage !== undefined ? code === _options.defaultLanguage : index === 0;\n };\n // check if it's using array of Language objects, or array of language codes\n return typeof language === 'string' ? { code: language, active: isActive(language) // language codes\n } : _extends({}, language, { active: isActive(language.code) }); // language objects\n });\n case SET_ACTIVE_LANGUAGE:\n return state.map(function (language) {\n return language.code === action.payload.languageCode ? _extends({}, language, { active: true }) : _extends({}, language, { active: false });\n });\n default:\n return state;\n }\n}\n\nexport function translations() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n var flattenedTranslations = void 0;\n var translationWithTransform = void 0;\n\n switch (action.type) {\n case INITIALIZE:\n if (!action.payload.translation) {\n return state;\n }\n\n flattenedTranslations = flatten(action.payload.translation, {\n safe: true\n });\n var _options2 = action.payload.options || {};\n var firstLanguage = typeof action.payload.languages[0] === 'string' ? action.payload.languages[0] : action.payload.languages[0].code;\n var _defaultLanguage = _options2.defaultLanguage || firstLanguage;\n var isMultiLanguageTranslation = Object.keys(flattenedTranslations).some(function (item) {\n return Array.isArray(flattenedTranslations[item]);\n });\n\n // add translation based on whether it is single vs multi language translation data\n var newTranslation = isMultiLanguageTranslation ? flattenedTranslations : getSingleToMultilanguageTranslation(_defaultLanguage, action.languageCodes, flattenedTranslations, state);\n\n return _extends({}, state, newTranslation);\n case ADD_TRANSLATION:\n translationWithTransform = action.payload.translationOptions && action.payload.translationOptions.translationTransform !== undefined ? action.payload.translationOptions.translationTransform(action.payload.translation || {}, action.languageCodes) : action.payload.translation;\n return _extends({}, state, flatten(translationWithTransform, { safe: true }));\n case ADD_TRANSLATION_FOR_LANGUAGE:\n flattenedTranslations = flatten(action.payload.translation, {\n safe: true\n });\n return _extends({}, state, getSingleToMultilanguageTranslation(action.payload.language, action.languageCodes, flattenedTranslations, state));\n default:\n return state;\n }\n}\n\nexport function options() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultTranslateOptions;\n var action = arguments[1];\n\n switch (action.type) {\n case INITIALIZE:\n var _options3 = action.payload.options || {};\n var _defaultLanguage2 = _options3.defaultLanguage || action.languageCodes[0];\n return _extends({}, state, validateOptions(_options3), { defaultLanguage: _defaultLanguage2 });\n default:\n return state;\n }\n}\n\nexport var defaultTranslateOptions = {\n renderToStaticMarkup: false,\n renderInnerHtml: false,\n ignoreTranslateChildren: false,\n defaultLanguage: '',\n onMissingTranslation: function onMissingTranslation(_ref) {\n var translationId = _ref.translationId,\n languageCode = _ref.languageCode;\n return 'Missing translationId: ${ translationId } for language: ${ languageCode }';\n }\n};\n\nvar initialState = {\n languages: [],\n translations: {},\n options: defaultTranslateOptions\n};\n\nexport var localizeReducer = function localizeReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n // execute the languages reducer first as we need access to those values for other reducers\n var languagesState = languages(state.languages, action);\n var languageCodes = languagesState.map(function (language) {\n return language.code;\n });\n\n return {\n languages: languagesState,\n translations: translations(state.translations, _extends({}, action, {\n languageCodes: languageCodes\n })),\n options: options(state.options, _extends({}, action, { languageCodes: languageCodes }))\n };\n};\n\n/**\n * ACTION CREATORS\n */\nexport var initialize = function initialize(payload) {\n return {\n type: INITIALIZE,\n payload: payload\n };\n};\n\nexport var addTranslation = function addTranslation(translation, options) {\n return {\n type: ADD_TRANSLATION,\n payload: {\n translation: translation,\n translationOptions: options\n }\n };\n};\n\nexport var addTranslationForLanguage = function addTranslationForLanguage(translation, language) {\n return {\n type: ADD_TRANSLATION_FOR_LANGUAGE,\n payload: { translation: translation, language: language }\n };\n};\n\nexport var setActiveLanguage = function setActiveLanguage(languageCode) {\n return {\n type: SET_ACTIVE_LANGUAGE,\n payload: { languageCode: languageCode }\n };\n};\n\n/**\n * SELECTORS\n */\nexport var getTranslations = function getTranslations(state) {\n return state.translations;\n};\n\nexport var getLanguages = function getLanguages(state) {\n return state.languages;\n};\n\nexport var getOptions = function getOptions(state) {\n return state.options;\n};\n\nexport var getActiveLanguage = function getActiveLanguage(state) {\n var languages = getLanguages(state);\n return languages.filter(function (language) {\n return language.active === true;\n })[0];\n};\n\n/**\n * A custom equality checker that checker that compares an objects keys and values instead of === comparison\n * e.g. {name: 'Ted', sport: 'hockey'} would result in 'name,sport - Ted,hocker' which would be used for comparison\n *\n * NOTE: This works with activeLanguage, languages, and translations data types.\n * If a new data type is added to selector this would need to be updated to accomodate\n */\nexport var translationsEqualSelector = createSelectorCreator(defaultMemoize, function (prev, cur) {\n var prevKeys = (typeof prev === 'undefined' ? 'undefined' : _typeof(prev)) === 'object' ? Object.keys(prev).toString() : undefined;\n var curKeys = (typeof cur === 'undefined' ? 'undefined' : _typeof(cur)) === 'object' ? Object.keys(cur).toString() : undefined;\n\n var prevValues = (typeof prev === 'undefined' ? 'undefined' : _typeof(prev)) === 'object' ? objectValuesToString(prev) : undefined;\n var curValues = (typeof cur === 'undefined' ? 'undefined' : _typeof(cur)) === 'object' ? objectValuesToString(cur) : undefined;\n\n var prevCacheValue = prevKeys !== undefined && prevValues !== undefined ? prevKeys + ' - ' + prevValues : prev;\n\n var curCacheValue = curKeys !== undefined && curValues !== undefined ? curKeys + ' - ' + curValues : cur;\n\n return prevCacheValue === curCacheValue;\n});\n\nexport var getTranslationsForActiveLanguage = translationsEqualSelector(getActiveLanguage, getLanguages, getTranslations, getTranslationsForLanguage);\n\nexport var getTranslationsForSpecificLanguage = translationsEqualSelector(getLanguages, getTranslations, function (languages, translations) {\n return defaultMemoize(function (languageCode) {\n return getTranslationsForLanguage({ code: languageCode, active: false }, languages, translations);\n });\n});\n\nvar getTranslate = createSelector(getTranslationsForActiveLanguage, getTranslationsForSpecificLanguage, getActiveLanguage, getOptions, function (translationsForActiveLanguage, getTranslationsForLanguage, activeLanguage, initializeOptions) {\n return function (value) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var translateOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var defaultLanguage = initializeOptions.defaultLanguage,\n defaultOptions = _objectWithoutProperties(initializeOptions, ['defaultLanguage']);\n\n var overrideLanguage = translateOptions.language;\n\n var translations = overrideLanguage !== undefined ? getTranslationsForLanguage(overrideLanguage) : translationsForActiveLanguage;\n\n var defaultTranslations = activeLanguage && activeLanguage.code === defaultLanguage ? translationsForActiveLanguage : getTranslationsForLanguage(defaultLanguage);\n\n var languageCode = overrideLanguage !== undefined ? overrideLanguage : activeLanguage && activeLanguage.code;\n\n var mergedOptions = _extends({}, defaultOptions, translateOptions);\n\n var getTranslation = function getTranslation(translationId) {\n var hasValidTranslation = translations[translationId] !== undefined;\n var hasValidDefaultTranslation = defaultTranslations[translationId] !== undefined;\n\n var defaultTranslation = hasValidDefaultTranslation ? getLocalizedElement({\n translation: defaultTranslations[translationId],\n data: data,\n renderInnerHtml: mergedOptions.renderInnerHtml\n }) : \"No default translation found! Ensure you've added translations for your default langauge.\";\n\n // if translation is not valid then generate the on missing translation message in it's place\n var translation = hasValidTranslation ? translations[translationId] : mergedOptions.onMissingTranslation({\n translationId: translationId,\n languageCode: languageCode,\n defaultTranslation: defaultTranslation\n });\n\n // if translations are missing than ovrride data to include translationId, languageCode\n // as these will be needed to render missing translations message\n var translationData = hasValidTranslation ? data : { translationId: translationId, languageCode: languageCode };\n\n return getLocalizedElement({\n translation: translation,\n data: translationData,\n languageCode: languageCode,\n renderInnerHtml: mergedOptions.renderInnerHtml\n });\n };\n\n if (typeof value === 'string') {\n return getTranslation(value);\n } else if (Array.isArray(value)) {\n return value.reduce(function (prev, cur) {\n return _extends({}, prev, _defineProperty({}, cur, getTranslation(cur)));\n }, {});\n } else {\n throw new Error('react-localize-redux: Invalid key passed to getTranslate.');\n }\n };\n});\nexport { getTranslate };","import React from 'react';\nimport createReactContext from 'create-react-context';\nimport { createSelector } from 'reselect';\nimport { defaultTranslateOptions } from './localize';\nimport { localizeReducer, getTranslate, initialize, addTranslation, addTranslationForLanguage, setActiveLanguage, getLanguages, getActiveLanguage, getOptions } from './localize';\n\nvar dispatchInitialize = function dispatchInitialize(dispatch) {\n return function (payload) {\n return dispatch(initialize(payload));\n };\n};\n\nvar dispatchAddTranslation = function dispatchAddTranslation(dispatch) {\n return function (translation) {\n return dispatch(addTranslation(translation));\n };\n};\n\nvar dispatchAddTranslationForLanguage = function dispatchAddTranslationForLanguage(dispatch) {\n return function (translation, language) {\n return dispatch(addTranslationForLanguage(translation, language));\n };\n};\n\nvar dispatchSetActiveLanguage = function dispatchSetActiveLanguage(dispatch) {\n return function (languageCode) {\n return dispatch(setActiveLanguage(languageCode));\n };\n};\n\nexport var getContextPropsFromState = function getContextPropsFromState(dispatch) {\n return createSelector(getTranslate, getLanguages, getActiveLanguage, getOptions, function (translate, languages, activeLanguage, options) {\n var defaultLanguage = options.defaultLanguage || languages[0] && languages[0].code;\n var renderToStaticMarkup = options.renderToStaticMarkup;\n var ignoreTranslateChildren = options.ignoreTranslateChildren !== undefined ? options.ignoreTranslateChildren : defaultTranslateOptions.ignoreTranslateChildren;\n\n return {\n translate: translate,\n languages: languages,\n defaultLanguage: defaultLanguage,\n activeLanguage: activeLanguage,\n initialize: dispatchInitialize(dispatch),\n addTranslation: dispatchAddTranslation(dispatch),\n addTranslationForLanguage: dispatchAddTranslationForLanguage(dispatch),\n setActiveLanguage: dispatchSetActiveLanguage(dispatch),\n renderToStaticMarkup: renderToStaticMarkup,\n ignoreTranslateChildren: ignoreTranslateChildren\n };\n });\n};\n\nvar defaultLocalizeState = localizeReducer(undefined, {});\nvar defaultContext = getContextPropsFromState(function () {})(defaultLocalizeState);\n\nexport var LocalizeContext = createReactContext(defaultContext);","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React, { Component } from 'react';\nimport hoistNonReactStatic from 'hoist-non-react-statics';\nimport { LocalizeContext } from './LocalizeContext';\n\nexport function withLocalize(WrappedComponent) {\n var LocalizedComponent = function (_Component) {\n _inherits(LocalizedComponent, _Component);\n\n function LocalizedComponent() {\n _classCallCheck(this, LocalizedComponent);\n\n return _possibleConstructorReturn(this, (LocalizedComponent.__proto__ || Object.getPrototypeOf(LocalizedComponent)).apply(this, arguments));\n }\n\n _createClass(LocalizedComponent, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n return React.createElement(\n LocalizeContext.Consumer,\n null,\n function (context) {\n return React.createElement(WrappedComponent, _extends({}, context, _this2.props));\n }\n );\n }\n }]);\n\n return LocalizedComponent;\n }(Component);\n\n hoistNonReactStatic(LocalizedComponent, WrappedComponent);\n return LocalizedComponent;\n}","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { getTranslate, addTranslationForLanguage, getLanguages, getOptions, getActiveLanguage, getTranslationsForActiveLanguage } from './localize';\nimport { get, storeDidChange } from './utils';\nimport { LocalizeContext } from './LocalizeContext';\nimport { withLocalize } from './withLocalize';\n\nvar WrappedTranslate = function (_React$Component) {\n _inherits(WrappedTranslate, _React$Component);\n\n function WrappedTranslate() {\n _classCallCheck(this, WrappedTranslate);\n\n return _possibleConstructorReturn(this, (WrappedTranslate.__proto__ || Object.getPrototypeOf(WrappedTranslate)).apply(this, arguments));\n }\n\n _createClass(WrappedTranslate, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.addDefaultTranslation();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n var idChanged = this.props.id && prevProps.id !== this.props.id;\n\n var noDefaultLanguage = !get(prevProps, 'context.defaultLanguage') && !get(prevProps, 'options.language');\n var incomingLanguage = get(this.props, 'context.defaultLanguage') || get(this.props, 'options.language');\n\n var defaultLanguageSet = noDefaultLanguage && incomingLanguage;\n\n if (idChanged || defaultLanguageSet) {\n this.addDefaultTranslation();\n }\n }\n }, {\n key: 'addDefaultTranslation',\n value: function addDefaultTranslation() {\n var _props = this.props,\n context = _props.context,\n id = _props.id,\n children = _props.children,\n _props$options = _props.options,\n options = _props$options === undefined ? {} : _props$options;\n\n var defaultLanguage = options.language || context.defaultLanguage;\n var fallbackRenderToStaticMarkup = function fallbackRenderToStaticMarkup(value) {\n return value;\n };\n var renderToStaticMarkup = context.renderToStaticMarkup || fallbackRenderToStaticMarkup;\n var hasId = id !== undefined;\n var hasDefaultLanguage = defaultLanguage !== undefined;\n var hasChildren = children !== undefined;\n var hasFunctionAsChild = typeof children === 'function';\n\n var ignoreTranslateChildren = options.ignoreTranslateChildren !== undefined ? options.ignoreTranslateChildren : context.ignoreTranslateChildren;\n\n var isValidDefaultTranslation = hasChildren && hasId && hasDefaultLanguage;\n\n var shouldAddDefaultTranslation = isValidDefaultTranslation && !hasFunctionAsChild && !ignoreTranslateChildren;\n\n if (shouldAddDefaultTranslation) {\n var translation = renderToStaticMarkup(children);\n context.addTranslationForLanguage && context.addTranslationForLanguage(_defineProperty({}, id, translation), defaultLanguage);\n }\n }\n }, {\n key: 'renderChildren',\n value: function renderChildren() {\n var _props2 = this.props,\n context = _props2.context,\n _props2$id = _props2.id,\n id = _props2$id === undefined ? '' : _props2$id,\n options = _props2.options,\n data = _props2.data;\n\n\n return typeof this.props.children === 'function' ? this.props.children(context) : context.translate && context.translate(id, data, options);\n }\n }, {\n key: 'render',\n value: function render() {\n return this.renderChildren();\n }\n }]);\n\n return WrappedTranslate;\n}(React.Component);\n\nexport var Translate = function Translate(props) {\n return React.createElement(\n LocalizeContext.Consumer,\n null,\n function (context) {\n return React.createElement(WrappedTranslate, _extends({}, props, { context: context }));\n }\n );\n};","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React, { Component } from 'react';\nimport { localizeReducer, getActiveLanguage, getOptions, getTranslationsForActiveLanguage, initialize as initializeAC, INITIALIZE, InitializePayload } from './localize';\nimport { LocalizeContext, getContextPropsFromState } from './LocalizeContext';\nimport { storeDidChange } from './utils';\n\nexport var LocalizeProvider = function (_Component) {\n _inherits(LocalizeProvider, _Component);\n\n function LocalizeProvider(props) {\n _classCallCheck(this, LocalizeProvider);\n\n var _this = _possibleConstructorReturn(this, (LocalizeProvider.__proto__ || Object.getPrototypeOf(LocalizeProvider)).call(this, props));\n\n var dispatch = _this.props.store ? _this.props.store.dispatch : _this.dispatch.bind(_this);\n\n _this.getContextPropsSelector = getContextPropsFromState(dispatch);\n\n var initialState = _this.props.initialize !== undefined ? localizeReducer(undefined, {\n type: INITIALIZE,\n payload: _this.props.initialize\n }) : localizeReducer(undefined, {});\n\n _this.state = {\n localize: initialState\n };\n return _this;\n }\n\n _createClass(LocalizeProvider, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.initExternalStore();\n this.subscribeToExternalStore();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.unsubscribeFromStore && this.unsubscribeFromStore();\n }\n }, {\n key: 'initExternalStore',\n value: function initExternalStore() {\n var _props = this.props,\n store = _props.store,\n initialize = _props.initialize;\n\n if (store && initialize) {\n store.dispatch(initializeAC(initialize));\n }\n }\n }, {\n key: 'subscribeToExternalStore',\n value: function subscribeToExternalStore() {\n var store = this.props.store;\n\n if (store) {\n this.unsubscribeFromStore = storeDidChange(store, this.onStateDidChange.bind(this));\n }\n }\n }, {\n key: 'onStateDidChange',\n value: function onStateDidChange(prevState) {\n if (!this.props.store) {\n return;\n }\n var getState = this.props.getState || function (state) {\n return state.localize;\n };\n\n var prevLocalizeState = prevState && getState(prevState);\n var curLocalizeState = getState(this.props.store.getState());\n\n var prevActiveLanguage = prevState && getActiveLanguage(prevLocalizeState);\n var curActiveLanguage = getActiveLanguage(curLocalizeState);\n\n var prevOptions = prevState && getOptions(prevLocalizeState);\n var curOptions = getOptions(curLocalizeState);\n\n var prevTranslations = prevState && getTranslationsForActiveLanguage(prevLocalizeState);\n var curTranslations = getTranslationsForActiveLanguage(curLocalizeState);\n\n var hasActiveLangaugeChanged = (prevActiveLanguage && prevActiveLanguage.code) !== (curActiveLanguage && curActiveLanguage.code);\n var hasOptionsChanged = prevOptions !== curOptions;\n var hasTranslationsChanged = prevTranslations !== curTranslations;\n\n if (hasActiveLangaugeChanged || hasOptionsChanged || hasTranslationsChanged) {\n this.setState({ localize: curLocalizeState });\n }\n }\n }, {\n key: 'dispatch',\n value: function dispatch(action) {\n this.setState(function (prevState) {\n return {\n localize: localizeReducer(prevState.localize, action)\n };\n });\n }\n }, {\n key: 'render',\n value: function render() {\n this.contextProps = this.getContextPropsSelector(this.state.localize);\n\n return React.createElement(\n LocalizeContext.Provider,\n { value: this.contextProps },\n this.props.children\n );\n }\n }]);\n\n return LocalizeProvider;\n}(Component);","export { Translate } from './Translate';\nexport { withLocalize } from './withLocalize';\nexport { LocalizeProvider } from './LocalizeProvider';\nexport { LocalizeContext } from './LocalizeContext';\n\nexport { localizeReducer, initialize, addTranslation, addTranslationForLanguage, setActiveLanguage, getTranslate, getActiveLanguage, getLanguages, getTranslations, getOptions } from './localize';","'use strict';\n\nexports.__esModule = true;\nexports.defaultMemoize = defaultMemoize;\nexports.createSelectorCreator = createSelectorCreator;\nexports.createStructuredSelector = createStructuredSelector;\nfunction defaultEqualityCheck(a, b) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(equalityCheck, prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n var length = prev.length;\n for (var i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction defaultMemoize(func) {\n var equalityCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultEqualityCheck;\n\n var lastArgs = null;\n var lastResult = null;\n // we reference arguments instead of spreading them for performance reasons\n return function () {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = func.apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n };\n}\n\nfunction getDependencies(funcs) {\n var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;\n\n if (!dependencies.every(function (dep) {\n return typeof dep === 'function';\n })) {\n var dependencyTypes = dependencies.map(function (dep) {\n return typeof dep;\n }).join(', ');\n throw new Error('Selector creators expect all input-selectors to be functions, ' + ('instead received the following types: [' + dependencyTypes + ']'));\n }\n\n return dependencies;\n}\n\nfunction createSelectorCreator(memoize) {\n for (var _len = arguments.length, memoizeOptions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n memoizeOptions[_key - 1] = arguments[_key];\n }\n\n return function () {\n for (var _len2 = arguments.length, funcs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n funcs[_key2] = arguments[_key2];\n }\n\n var recomputations = 0;\n var resultFunc = funcs.pop();\n var dependencies = getDependencies(funcs);\n\n var memoizedResultFunc = memoize.apply(undefined, [function () {\n recomputations++;\n // apply arguments instead of spreading for performance.\n return resultFunc.apply(null, arguments);\n }].concat(memoizeOptions));\n\n // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.\n var selector = defaultMemoize(function () {\n var params = [];\n var length = dependencies.length;\n\n for (var i = 0; i < length; i++) {\n // apply arguments instead of spreading and mutate a local list of params for performance.\n params.push(dependencies[i].apply(null, arguments));\n }\n\n // apply arguments instead of spreading for performance.\n return memoizedResultFunc.apply(null, params);\n });\n\n selector.resultFunc = resultFunc;\n selector.recomputations = function () {\n return recomputations;\n };\n selector.resetRecomputations = function () {\n return recomputations = 0;\n };\n return selector;\n };\n}\n\nvar createSelector = exports.createSelector = createSelectorCreator(defaultMemoize);\n\nfunction createStructuredSelector(selectors) {\n var selectorCreator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createSelector;\n\n if (typeof selectors !== 'object') {\n throw new Error('createStructuredSelector expects first argument to be an object ' + ('where each property is a selector, instead received a ' + typeof selectors));\n }\n var objectKeys = Object.keys(selectors);\n return selectorCreator(objectKeys.map(function (key) {\n return selectors[key];\n }), function () {\n for (var _len3 = arguments.length, values = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n values[_key3] = arguments[_key3];\n }\n\n return values.reduce(function (composition, value, index) {\n composition[objectKeys[index]] = value;\n return composition;\n }, {});\n });\n}"],"sourceRoot":""}