{"version":3,"file":"constants-C5ansLMW.js","sources":["../../../client/node_modules/react-addons-css-transition-group/index.js","../../../client/node_modules/fuzzyset.js/dist/fuzzyset.esm.js","../../../client/node_modules/redux-persist/es/constants.js"],"sourcesContent":["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nmodule.exports = require('react-transition-group/CSSTransitionGroup');\n","const FuzzySet = function(arr, useLevenshtein, gramSizeLower, gramSizeUpper) {\n var fuzzyset = {\n\n };\n\n // default options\n arr = arr || [];\n fuzzyset.gramSizeLower = gramSizeLower || 2;\n fuzzyset.gramSizeUpper = gramSizeUpper || 3;\n fuzzyset.useLevenshtein = (typeof useLevenshtein !== 'boolean') ? true : useLevenshtein;\n\n // define all the object functions and attributes\n fuzzyset.exactSet = {};\n fuzzyset.matchDict = {};\n fuzzyset.items = {};\n\n // helper functions\n var levenshtein = function(str1, str2) {\n var current = [], prev, value;\n\n for (var i = 0; i <= str2.length; i++)\n for (var j = 0; j <= str1.length; j++) {\n if (i && j)\n if (str1.charAt(j - 1) === str2.charAt(i - 1))\n value = prev;\n else\n value = Math.min(current[j], current[j - 1], prev) + 1;\n else\n value = i + j;\n\n prev = current[j];\n current[j] = value;\n }\n\n return current.pop();\n };\n\n // return an edit distance from 0 to 1\n var _distance = function(str1, str2) {\n if (str1 === null && str2 === null) throw 'Trying to compare two null values';\n if (str1 === null || str2 === null) return 0;\n str1 = String(str1); str2 = String(str2);\n\n var distance = levenshtein(str1, str2);\n if (str1.length > str2.length) {\n return 1 - distance / str1.length;\n } else {\n return 1 - distance / str2.length;\n }\n };\n\n // u00C0-u00FF is latin characters\n // u0621-u064a is arabic letters\n // u0660-u0669 is arabic numerals\n // TODO: figure out way to do this for more languages\n var _nonWordRe = /[^a-zA-Z0-9\\u00C0-\\u00FF\\u0621-\\u064A\\u0660-\\u0669, ]+/g;\n\n var _iterateGrams = function(value, gramSize) {\n gramSize = gramSize || 2;\n var simplified = '-' + value.toLowerCase().replace(_nonWordRe, '') + '-',\n lenDiff = gramSize - simplified.length,\n results = [];\n if (lenDiff > 0) {\n for (var i = 0; i < lenDiff; ++i) {\n simplified += '-';\n }\n }\n for (var i = 0; i < simplified.length - gramSize + 1; ++i) {\n results.push(simplified.slice(i, i + gramSize));\n }\n return results;\n };\n\n var _gramCounter = function(value, gramSize) {\n // return an object where key=gram, value=number of occurrences\n gramSize = gramSize || 2;\n var result = {},\n grams = _iterateGrams(value, gramSize),\n i = 0;\n for (i; i < grams.length; ++i) {\n if (grams[i] in result) {\n result[grams[i]] += 1;\n } else {\n result[grams[i]] = 1;\n }\n }\n return result;\n };\n\n // the main functions\n fuzzyset.get = function(value, defaultValue, minMatchScore) {\n // check for value in set, returning defaultValue or null if none found\n if (minMatchScore === undefined) {\n minMatchScore = .33;\n }\n var result = this._get(value, minMatchScore);\n if (!result && typeof defaultValue !== 'undefined') {\n return defaultValue;\n }\n return result;\n };\n\n fuzzyset._get = function(value, minMatchScore) {\n var results = [];\n // start with high gram size and if there are no results, go to lower gram sizes\n for (var gramSize = this.gramSizeUpper; gramSize >= this.gramSizeLower; --gramSize) {\n results = this.__get(value, gramSize, minMatchScore);\n if (results && results.length > 0) {\n return results;\n }\n }\n return null;\n };\n\n fuzzyset.__get = function(value, gramSize, minMatchScore) {\n var normalizedValue = this._normalizeStr(value),\n matches = {},\n gramCounts = _gramCounter(normalizedValue, gramSize),\n items = this.items[gramSize],\n sumOfSquareGramCounts = 0,\n gram,\n gramCount,\n i,\n index,\n otherGramCount;\n\n for (gram in gramCounts) {\n gramCount = gramCounts[gram];\n sumOfSquareGramCounts += Math.pow(gramCount, 2);\n if (gram in this.matchDict) {\n for (i = 0; i < this.matchDict[gram].length; ++i) {\n index = this.matchDict[gram][i][0];\n otherGramCount = this.matchDict[gram][i][1];\n if (index in matches) {\n matches[index] += gramCount * otherGramCount;\n } else {\n matches[index] = gramCount * otherGramCount;\n }\n }\n }\n }\n\n function isEmptyObject(obj) {\n for(var prop in obj) {\n if(obj.hasOwnProperty(prop))\n return false;\n }\n return true;\n }\n\n if (isEmptyObject(matches)) {\n return null;\n }\n\n var vectorNormal = Math.sqrt(sumOfSquareGramCounts),\n results = [],\n matchScore;\n // build a results list of [score, str]\n for (var matchIndex in matches) {\n matchScore = matches[matchIndex];\n results.push([matchScore / (vectorNormal * items[matchIndex][0]), items[matchIndex][1]]);\n }\n var sortDescending = function(a, b) {\n if (a[0] < b[0]) {\n return 1;\n } else if (a[0] > b[0]) {\n return -1;\n } else {\n return 0;\n }\n };\n results.sort(sortDescending);\n if (this.useLevenshtein) {\n var newResults = [],\n endIndex = Math.min(50, results.length);\n // truncate somewhat arbitrarily to 50\n for (var i = 0; i < endIndex; ++i) {\n newResults.push([_distance(results[i][1], normalizedValue), results[i][1]]);\n }\n results = newResults;\n results.sort(sortDescending);\n }\n newResults = [];\n results.forEach(function(scoreWordPair) {\n if (scoreWordPair[0] >= minMatchScore) {\n newResults.push([scoreWordPair[0], this.exactSet[scoreWordPair[1]]]);\n }\n }.bind(this));\n return newResults;\n };\n\n fuzzyset.add = function(value) {\n var normalizedValue = this._normalizeStr(value);\n if (normalizedValue in this.exactSet) {\n return false;\n }\n\n var i = this.gramSizeLower;\n for (i; i < this.gramSizeUpper + 1; ++i) {\n this._add(value, i);\n }\n };\n\n fuzzyset._add = function(value, gramSize) {\n var normalizedValue = this._normalizeStr(value),\n items = this.items[gramSize] || [],\n index = items.length;\n\n items.push(0);\n var gramCounts = _gramCounter(normalizedValue, gramSize),\n sumOfSquareGramCounts = 0,\n gram, gramCount;\n for (gram in gramCounts) {\n gramCount = gramCounts[gram];\n sumOfSquareGramCounts += Math.pow(gramCount, 2);\n if (gram in this.matchDict) {\n this.matchDict[gram].push([index, gramCount]);\n } else {\n this.matchDict[gram] = [[index, gramCount]];\n }\n }\n var vectorNormal = Math.sqrt(sumOfSquareGramCounts);\n items[index] = [vectorNormal, normalizedValue];\n this.items[gramSize] = items;\n this.exactSet[normalizedValue] = value;\n };\n\n fuzzyset._normalizeStr = function(str) {\n if (Object.prototype.toString.call(str) !== '[object String]') throw 'Must use a string as argument to FuzzySet functions';\n return str.toLowerCase();\n };\n\n // return length of items in set\n fuzzyset.length = function() {\n var count = 0,\n prop;\n for (prop in this.exactSet) {\n if (this.exactSet.hasOwnProperty(prop)) {\n count += 1;\n }\n }\n return count;\n };\n\n // return is set is empty\n fuzzyset.isEmpty = function() {\n for (var prop in this.exactSet) {\n if (this.exactSet.hasOwnProperty(prop)) {\n return false;\n }\n }\n return true;\n };\n\n // return list of values loaded into set\n fuzzyset.values = function() {\n var values = [],\n prop;\n for (prop in this.exactSet) {\n if (this.exactSet.hasOwnProperty(prop)) {\n values.push(this.exactSet[prop]);\n }\n }\n return values;\n };\n\n\n // initialization\n var i = fuzzyset.gramSizeLower;\n for (i; i < fuzzyset.gramSizeUpper + 1; ++i) {\n fuzzyset.items[i] = [];\n }\n // add all the items to the set\n for (i = 0; i < arr.length; ++i) {\n fuzzyset.add(arr[i]);\n }\n\n return fuzzyset;\n};\n\nexport default FuzzySet;\n","export var KEY_PREFIX = 'reduxPersist:';\nexport var REHYDRATE = 'persist/REHYDRATE';"],"names":["reactAddonsCssTransitionGroup","require$$0","FuzzySet","arr","useLevenshtein","gramSizeLower","gramSizeUpper","fuzzyset","levenshtein","str1","str2","current","prev","value","i","j","_distance","distance","_nonWordRe","_iterateGrams","gramSize","simplified","lenDiff","results","_gramCounter","result","grams","defaultValue","minMatchScore","normalizedValue","matches","gramCounts","items","sumOfSquareGramCounts","gram","gramCount","index","otherGramCount","isEmptyObject","obj","prop","vectorNormal","matchScore","matchIndex","sortDescending","a","b","newResults","endIndex","scoreWordPair","str","count","values","REHYDRATE"],"mappings":"w5BASA,IAAAA,GAAiBC,o4bCTXC,GAAW,SAASC,EAAKC,EAAgBC,EAAeC,EAAe,CACzE,IAAIC,EAAW,CAAA,EAKfJ,EAAMA,GAAO,GACbI,EAAS,cAAiC,EA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