/*! fast-levenshtein 2014-12-17. Copyright Ramesh Nair <ram@hiddentao.com> (http://www.hiddentao.com/) */
!function(){"use strict";var a=function(a){for(var b=Array.prototype.slice.call(arguments,1),c=0;c<b.length;++c){var d=b[c];for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}return a},b={get:function(a,b){if(a===b)return 0;if(0===a.length)return b.length;if(0===b.length)return a.length;var c,d,e,f,g,h=new Array(b.length+1);for(e=0;e<h.length;++e)h[e]=e;for(e=0;e<a.length;++e){for(d=e+1,f=0;f<b.length;++f)c=d,d=h[f]+(a.charAt(e)===b.charAt(f)?0:1),g=c+1,d>g&&(d=g),g=h[f+1]+1,d>g&&(d=g),h[f]=c;h[f]=d}return d},getAsync:function(b,c,d,e){if(e=a({},{progress:null},e),b===c)return d(null,0);if(0===b.length)return d(null,c.length);if(0===c.length)return d(null,b.length);var f,g,h,i,j,k,l,m=new Array(c.length+1);for(h=0;h<m.length;++h)m[h]=h;g=1,h=0,i=-1;var n=function(){for(k=(new Date).valueOf(),l=k;1e3>l-k;){if(c.length<=++i){if(m[i]=g,b.length<=++h)return d(null,g);g=h+1,i=0}f=g,g=m[i]+(b.charAt(h)===c.charAt(i)?0:1),j=f+1,g>j&&(g=j),j=m[i+1]+1,g>j&&(g=j),m[i]=f,l=(new Date).valueOf()}if(null!==e.progress)try{e.progress.call(null,100*h/b.length)}catch(a){return d("Progress callback: "+a.toString())}setTimeout(n(),0)};n()}};"undefined"!=typeof define&&null!==define&&define.amd?define(function(){return b}):"undefined"!=typeof module&&null!==module?module.exports=b:"undefined"!=typeof self&&"function"==typeof self.postMessage&&"function"==typeof self.importScripts?self.Levenshtein=b:"undefined"!=typeof window&&null!==window&&(window.Levenshtein=b)}();