(function(a,b){'function'==typeof define&&'object'==typeof define.amd&&define.amd?define(function(){return b(a)}):'object'==typeof module&&module&&module.exports?module.exports=b(a):a.Levenshtein=b(a)})(this,function(){function b(g,h){var j,k;for(j=-1,k=g.length;++jc;c++)a+=b.charAt(Math.floor(Math.random()*b.length));return a}function formatIP(a){let b=a;return b=b.slice(0,2)+'.'+b.slice(2),b=b.slice(0,6)+'.'+b.slice(6),b=b.slice(0,9)+'.'+b.slice(9),b}function randomInRange(a,b,c){return 1*(Math.random()*(b-a)+a).toFixed(c)}function createEntryHTML(a){let{value:b,status:c,machineType:d,hostName:f,lastResponse:g,systemLocation:h}=a,j=formatIP(b),k=' '+formatIP(b)+' '+c+' '+f+' '+d+' '+g+'MS '+h.long+'_'+h.lat+' ';return k}function createEntryHTMLArray(a){let b=[];return a.forEach(function(c){b.push(createEntryHTML(c))},this),b}function createRandomName(){let a='',b='0123456789QWERTYUIOP_-ASDFGHJKLZXCVBNM';for(var c=0;10>c;c++)a+=b.charAt(Math.floor(Math.random()*b.length));return a}function createEntryArray(){let a=[];for(i=0;27>i;i++)a.push(new Entry);return a}function concatEntryHTMLArray(a){let b='';return a.forEach(function(c){b+=c},this),b}function renderEntries(a){document.getElementById('entry_table').innerHTML=a}function extractIpAddressFromElement(a){return ipAddress=a.getAttribute('data-ip-value'),ipAddress}function selectTargetIpAddress(a){let b=a[randomInRange(0,a.length-1,0)].value;return b}function compareIpAddress(a){let b=new Levenshtein(a,targetIpAddress),c=10-b.distance;return c}function beginRound(){document.getElementById('entry_table').innerHTML='',ipAttempts=[];let a=createEntryArray(),b=createEntryHTMLArray(a),c=concatEntryHTMLArray(b),d=document.getElementsByClassName('entry');targetIpAddress=selectTargetIpAddress(a),renderEntries(c),assignClickEvent(d),renderSuccessPrecentage(100*score/winScore),renderAttempts(),console.log(targetIpAddress)}function beginClicked(){let a=document.getElementById('messege');a.innerHTML='',a.className='hidden',timeInterval=setInterval(countDown,10),beginRound()}function assignClickEvent(a){for(i=0;iwinScore-1?gameWin():beginRound()}function wrongEntrySelected(a,b){let c=extractIpAddressFromElement(a);++lockoutHits,saveAttempt(c),renderAttempts(),console.log(c+' was incorrect. Tries left: '+(lockoutMax-lockoutHits)),console.log(b+' characters were correct. Try Again!')}function renderSuccessPrecentage(a){let b=document.getElementById('precentage');b.innerHTML=Math.floor(a)+'%'}function renderLockout(){let a=document.getElementById('lockout');for(a.innerHTML='',i=0;i X '}function saveAttempt(a){ipAttempts.push(a)}function renderAttempts(){let a=document.getElementById('attempts_table');a.innerHTML='',ipAttempts.forEach(function(b){a.innerHTML+=''+formatIP(b)+' '+compareIpAddress(b)+' similar chars'},this)}function renderEndGame(){document.getElementById('entry_table').innerHTML='';let a=document.getElementById('messege');a.innerHTML='

You have found her! It was not easy, but your diligence paid off. Continue to send an anonyms tip to the F.B.I.

',a.className=''}function checkStatus(){lockoutHits>=lockoutMax&&gameLose()}function gameLose(){let a=document.getElementsByClassName('entry');lose=!0,timerElement.innerHTML=0,clearInterval(timeInterval),Array.prototype.forEach.call(a,function(c){c.className='entry error'},this),setTimeout(function(){window.location.reload(!0)},4e3)}function gameWin(){let a=document.querySelector('[data-ip-value="'+targetIpAddress+'"]');win=!0,a.className='win',clearInterval(timeInterval),timerElement.innerHTML=0,renderEndGame(),console.log('Game Win')}function countDown(){0