let m_root=self.location.pathname.split("/").slice(0,-1).join("/");importScripts(m_root+"/r2.js");var howManyBytes,nbCols,configurationDone=!1;function hexPairToASCII(o){o=parseInt(o,16);return 33<=o&&o<=126?String.fromCharCode(o):"."}function getChunk(t,i,r){var f;return i<0?{offset:0,hex:[],ascii:[],flags:[],modified:[]}:(r2.cmd("p8 "+t+" @"+i,function(o){f={offset:i,hex:[],ascii:[],flags:[],modified:[]};for(var a=[],s="",n=0;n<t;n++){var e=o[2*n]+o[2*n+1];a.push(e),s+=hexPairToASCII(e),n%r==r-1&&(f.hex.push(a),f.ascii.push(s),a=[],s="")}}),r2.cmdj("fij "+i+" "+(i+t),function(o){for(var a in f.flags=o,f.flags)f.flags[a].size=parseInt(f.flags[a].size)}),f)}self.onmessage=function(o){var a;!configurationDone||o.data.reset?(howManyBytes=o.data.howManyBytes,nbCols=o.data.nbCols,configurationDone=!0):((a=getChunk(howManyBytes,o.data.offset,nbCols)).dir=o.data.dir,self.postMessage(a))};