See espterm.github.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
espterm-demo-website/js/app.310033b.js.map

1 lines
380 KiB

{"version":3,"sources":["webpack:///app.310033b.js","webpack:///webpack/bootstrap 21d3956fd434cbda121b","webpack:///./js/utils.js","webpack:///./js/lib/chibi.js","webpack:///./js/modal.js","webpack:///./js/notif.js","webpack:///./js/term/themes.js","webpack:///./node_modules/events/events.js","webpack:///./js/term/demo.js","webpack:///./js/index.js","webpack:///./js/lib/polyfills.js","webpack:///./js/appcommon.js","webpack:///./js/wifi.js","webpack:///./js/lang.js","webpack:///./js/term/index.js","webpack:///./js/term/screen.js","webpack:///./js/term/screen_parser.js","webpack:///./js/term/screen_renderer.js","webpack:///./js/term/connection.js","webpack:///./js/term/input.js","webpack:///./js/term/upload.js","webpack:///./js/term/soft_keyboard.js","webpack:///./js/term/debug_screen.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","mk","a","document","createElement","qs","querySelector","qsa","querySelectorAll","cr","b","which","bool","parse2B","arguments","length","charCodeAt","parse3B","encode2B","String","fromCharCode","encode3B","e","_typeof","Symbol","iterator","constructor","q","replace","charAt","toUpperCase","f","currentStyle","getComputedStyle","getPropertyValue","g","encodeURIComponent","h","style","display","j","Array","nodeName","elements","disabled","type","value","selected","checked","substring","k","split","classList","remove","add","toggle","contains","r","innerHTML","lastChild","parentNode","insertBefore","nextSibling","appendChild","firstChild","nodeType","each","apply","first","shift","last","pop","odd","push","even","hide","show","removeChild","css","getClass","className","setClass","addClass","removeClass","toggleClass","hasClass","html","htmlBefore","htmlAfter","htmlAppend","htmlPrepend","attr","toLowerCase","cssText","setAttribute","getAttribute","data","val","on","addEventListener","attachEvent","off","removeEventListener","detachEvent","window","onload","ajax","assign","method","nocache","timeout","loader","callback","_loader","url","indexOf","XMLHttpRequest","Date","toString","open","setTimeout","console","error","abort","onreadystatechange","readyState","responseText","status","clearTimeout","setRequestHeader","send","post","ready","loaded","t","&","<",">","\"","'","/","`","=","htmlEscape","$","modal","curCloseCb","init","this","stopImmediatePropagation","$balloon","timerHideBegin","timerHideEnd","nt","canCancel","stopTimeouts","themes","fgbgThemes","colorTable256","buildColorTable","fill","SELECTION_FG","SELECTION_BG","themePreview","forEach","dataset","fg","color","bg","backgroundColor","EventEmitter","_events","_maxListeners","undefined","isFunction","arg","isNumber","isObject","isUndefined","defaultMaxListeners","setMaxListeners","isNaN","TypeError","emit","er","handler","len","args","listeners","Error","err","context","slice","addListener","listener","newListener","warned","trace","once","removeListener","fired","list","position","splice","removeAllListeners","key","listenerCount","evlistener","emitter","_toConsumableArray","isArray","from","_possibleConstructorReturn","ReferenceError","_inherits","create","writable","setPrototypeOf","__proto__","_classCallCheck","_get","Function","getOwnPropertyDescriptor","getPrototypeOf","_createClass","_require","_require2","ANSIParser","reset","joinChunks","currentSequence","sequence","map","next","done","codePointAt","match","parseSequence","return","getRainbowColor","Math","PI","floor","sin","ScrollingTerminal","width","height","termScreen","parser","handleParsed","_lastLoad","now","load","serialize","showPage","min","max","cursor","x","y","visible","trackMouse","theme","rainbow","clear","screen","scroll","newLine","moveBack","writeChar","deleteForward","insertBlanks","clampCursor","write","scheduleLoad","fromCodePoint","_scheduledLoad","clearInterval","_rainbowTimer","setInterval","Process","demoData","buttons","1","2","3","4","5","child","destroy","substr","mouseReceiver","demoshIndex","screenfetch","location","hostname","devicePixelRatio","filter","trim","local-echo","includes","info","showSplash","then","printText"," ",".","-","*","#","repeat","abs","Promise","join","colors","ls","shell","Number","isFinite","terminal","drawnScreenFG","rainbowTimer","mouse","randomData","highlighted","random","scrollOffset","render","sudo","index","run","make","pwd","cd","whoami","navigator","userAgent","uname","mkdir","rm","cp","mv","ln","touch","exit","github","DemoShell","history","historyIndex","cursorPos","prompt","unshift","copyFromHistoryIndex","warn","moveForward","parse","spawn","demoInterface","input","mouseMove","mouseDown","mouseUp","didInit","termInit","RangeError","pageShown","notify","keyCode","ctrlKey","submit","wheelDelta","createEvent","initEvent","dispatchEvent","fireEvent","preventDefault","search","childNodes","textContent","innerWidth","removeAttribute","href","noAutoShow","id","tr","round","JSON","log","result","inProgress","APs","sort","rssi","enc","parseInt","essid","rssi_perc","_demo","_demo_aps","_root","sta_ssid","sta_password","sta_active_ip","sta_active_ssid","startScanning","WiFi","_tr","Notify","TermScreen","TermConnection","TermInput","TermUpload","initSoftKeyboard","attachDebugScreen","termUpload","statusScreen","title","loading","screenFG","screenBG","screenAttrs","onerror","canvas","labels","fitIntoWidth","fitIntoHeight","innerHeight","Element","requestFullscreen","webkitRequestFullscreen","updateSize","conn","termUpl","ScreenParser","ScreenRenderer","ctx","getContext","renderer","_debug","audioCtx","AudioContext","webkitAudioContext","Proxy","blinking","hanging","_window","fontFamily","fontSize","gridScaleX","gridScaleY","debug","graphics","_windowScale","windowState","selection","selectable","start","end","mouseMode","clicks","movement","set","scheduleSizeUpdate","scheduleDraw","bracketedPaste","blinkingCellCount","reverseVideo","screenToGrid","getNormalizedSelection","altKey","button","offsetX","offsetY","onMouseDown","concat","getBoundingClientRect","clientX","left","clientY","top","touches","gridToScreen","transform","copySelectionToClipboard","onMouseMove","onMouseUp","onMouseWheel","deltaY","_scheduledSizeUpdate","weight","getCellSize","font","getFont","measureText","ceil","getCharSize","resetDrawn","draw","isInSelection","getSelectedText","body","select","execCommand","Notification","permission","focus","requestPermission","pow","_lastBeep","_convolver","createConvolver","sampleRate","createBuffer","getChannelData","buffer","connect","destination","createOscillator","createGain","gain","frequency","currentTime","stop","requestAnimationFrame","contentLoaded","resetCursorBlink","setAlts","setMouseMode","u","v","w","z","A","B","C","D","E","opacity","defaultFg","defaultBg","setDefaultColors","palette","loadContent","loadLabels","beep","showNotification","stringify","frakturExceptions","_palette","defaultBgNum","defaultFgNum","blinkStyleOn","blinkInterval","cursorBlinkOn","cursorBlinkInterval","resetBlink","drawnScreen","drawnScreenBG","drawnScreenAttrs","drawnCursor","_scheduledDraw","cellWidth","cellHeight","fillStyle","getColor","clearRect","fillRect","charSize","text","attrs","globalAlpha","alphaToFraktur","beginPath","rect","fillText","strokeStyle","lineWidth","lineCap","moveTo","lineTo","F","G","stroke","drawStatus","startDrawLoop","stopDrawLoop","setTransform","drawStart","textAlign","textBaseline","Map","ha","ia","ja","ka","la","ma","na","oa","pa","qa","ra","sa","has","cell","isCursor","inSelection","keys","getAdjacentCells","save","ta","ua","va","wa","xa","clipRect","clip","ya","H","I","J","za","K","L","M","N","O","drawBackground","Aa","setCell","P","Q","R","S","T","Ba","Ca","U","V","W","X","Y","Da","Z","_","aa","ba","ca","da","ea","fa","drawCharacter","ga","restore","drawEnd","translate","rotate","_drawTimerThread","drawTimerLoop","demo","ws","heartbeatTimeout","pingInterval","xoff","autoXoffTimeout","reconnTimeout","forceClosing","hidden","closeSocket","heartbeat","code","close","alert","WebSocket","onWSOpen","onWSClose","onWSMessage","onHeartbeatFail","allFn","metaKey","clipboardData","setData","getData","setContent","all_fn","6","8","9","12","13","16","17","18","19","20","27","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","58","59","60","61","62","63","64","91","92","93","106","107","109","110","111","144","145","160","161","162","163","164","165","166","167","168","169","170","171","172","173","174","175","176","186","187","188","189","190","192","194","219","220","221","222","224","np_alt","cu_alt","fn_alt","mt_click","mt_move","no_keys","crlf_mode","Backspace","Tab","Enter","Control+Enter","Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","Insert","Delete","End","PageUp","PageDown","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","Shift+F1","Shift+F2","Shift+F3","Shift+F4","Shift+F5","Shift+F6","Shift+F7","Shift+F8","Shift+F9","Shift+F10","Shift+F11","Shift+F12","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","Numpad*","Numpad+","Numpad-","Numpad.","Numpad/","Control+]","Control+\\","Control+[","Control+^","Control+_","Control+ArrowLeft","Control+ArrowRight","Control+ArrowUp","Control+ArrowDown","Control+Home","Control+End","Shift+ArrowLeft","Shift+ArrowRight","Shift+ArrowUp","Shift+ArrowDown","Shift+Home","Shift+End","Alt+ArrowLeft","Alt+ArrowRight","Meta+ArrowLeft","Meta+ArrowRight","Alt+Backspace","Meta+Backspace","Control+Shift+C","Control+Insert","Control+F12","activeElement","HTMLTextAreaElement","shiftKey","sendString","blockKeys","handleKeyDown","CR","LF","CRLF","canSend","FileReader","target","files","confirm","readAsText","_slicedToArray","startsWith","stopPropagation","isComposing","inputType","←","↓","↑","→","^C","pointerEvents","createPattern","strokeRect"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,KDMM,SAAUtB,EAAQD,EAASH,GAEjC,YEpEAG,GAAQwB,GAAK,SAAAC,GACX,MAAOC,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,EAAAlhB,EAAA,aAAAiQ,GAAAmR,EAAAxS,QAAAwS,EAAAxS,SAAA,WAAAqS,EAAA,KAAAC,IAQvBriB,EAAIokB,UAAJrkB,EACAC,EAAIiL,OAGc,GAAhBrI,IACFlC,GAAA,EACA6B,KAIJ1C,GAAe,WAAYa,IAEzBT,IACA+C,IACAtC,GAAA,EACAN,KAIF,IAAMY,GAAUE,EAAG,MACnBF,GAAQqD,UAAUE,IAAI,gBACtB,IAAI3B,IAAA,EAEE8B,EAAgB,WACpBvD,EAAOoa,OAAO1W,WAAWG,YAAzBhE,IAEIC,EAAgB,WACpBD,EAAQ6D,WAAWiB,YAAnB9E,GAGFG,GAAOgG,GAAG,sBAAuB,SAAAhG,GAC3BA,IAAAyB,IACFA,EAAAzB,EAFsCA,EAG3BuD,IACNzD,OAITE,EAAOgG,GAAG,OAAQ,WAChB,GAAAvE,EAAA,CACA,GAAIjB,GAAaR,EAAO+P,OAAOE,EAAIjQ,EAAOsG,OAAO6I,MAAQnP,EAAO+P,OAAOC,EACnEnR,EAASmB,EAAOga,SAAPxZ,GACT1B,EAASkB,EAAOia,SAAPzZ,GACTY,GAAYpB,EAAOuQ,OAAP/P,IAA6B,IAAIiO,YAAY,GACzD5M,EAAY7B,EAAOka,YAAP1Z,GACZyB,EAAUb,EAASgG,SAAS,IAAIxF,aACf,GAAjBK,EAAQpB,SAAYoB,GAAU,OAAAA,GAAiB+P,QAAQ,IAC3D/P,EAAA,KAAAA,EACApC,EAAQ2X,YAAR,gBAAAhX,EAAA,MAAAyB,EAAA,QAAApD,EAAA,QAAAC,EAAA,WAAoG+C,EAAUuF,SAAS","file":"app.310033b.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 7);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nexports.mk=function(a){return document.createElement(a)},exports.qs=function(a){return document.querySelector(a)},exports.qsa=function(a){return document.querySelectorAll(a)},exports.cr=function(a){return function(b){(10===b.which||13===b.which||32===b.which)&&a()}},exports.bool=function(a){return 1===a||'1'===a||!0===a||'true'===a},exports.parse2B=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0;return a.charCodeAt(b++)-1+127*(a.charCodeAt(b)-1)},exports.parse3B=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0;return a.charCodeAt(b)-1+127*(a.charCodeAt(b+1)-1)+127*(127*(a.charCodeAt(b+2)-1))},exports.encode2B=function(a){var b=String.fromCharCode;var c,d;return c=a%127,a=(a-c)/127,c+=1,d=a+1,b(c)+b(d)},exports.encode3B=function(a){var b=String.fromCharCode;var c,d,e;return c=a%127,a=(a-c)/127,c+=1,d=a%127,a=(a-d)/127,d+=1,e=a+1,b(c)+b(d)+b(e)};\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _typeof='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&'function'==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?'symbol':typeof a};(function(){'use strict';function a(){var a;for(p=!0,a=0;a<n.length;a+=1)n[a]();n=[]}function b(){var b;for(q=!0,p||a(),b=0;b<o.length;b+=1)o[b]();o=[]}function c(a,b){var c;for(c=b.length-1;0<=c;c-=1)a(b[c])}function e(a){return a.replace(/-\\w/g,function(a){return a.charAt(1).toUpperCase()})}function f(a,b){return a.currentStyle?a.currentStyle[e(b)]:d.getComputedStyle?d.getComputedStyle(a,null).getPropertyValue(b):null}function g(a,b){return encodeURIComponent(a).replace(/%20/g,'+')+'='+encodeURIComponent(b).replace(/%20/g,'+')}function h(a,b,c){try{a.style[e(b)]=c}catch(a){}}function i(a){a.style.display='','none'===f(a,'display')&&(a.style.display='block')}function j(a){var b,d,e,f='';if(a.constructor===Object){for(b in a)if(a.hasOwnProperty(b))if(a[b].constructor===Array)for(d=0;d<a[b].length;d+=1)f+='&'+g(b,a[b][d]);else f+='&'+g(b,a[b]);}else c(function(a){if('FORM'===a.nodeName)for(d=0;d<a.elements.length;d+=1)if(b=a.elements[d],!b.disabled)switch(b.type){case'button':case'image':case'file':case'submit':case'reset':break;case'select-one':0<b.length&&(f+='&'+g(b.name,b.value));break;case'select-multiple':for(e=0;e<b.length;e+=1)b[e].selected&&(f+='&'+g(b.name,b[e].value));break;case'checkbox':case'radio':b.checked&&(f+='&'+g(b.name,b.value));break;default:f+='&'+g(b.name,b.value);}},a);return 0<f.length?f.substring(1):''}function k(a,b,d){var e,f,g=!1;return a&&(e=a.split(/\\s+/),c(function(a){for(f=0;f<e.length;f+=1){var c=e[f];if('remove'===b)a.classList.remove(c);else if('add'===b)a.classList.add(c);else if('toggle'===b)a.classList.toggle(c);else if('has'===b&&a.classList.contains(c)){g=!0;break}}},d)),g}function l(a,b,d){var e,f;a&&c(function(c){for(e=r.createElement('div'),e.innerHTML=a;null!==(f=e.lastChild);)try{'before'===b?c.parentNode.insertBefore(f,c):'after'===b?c.parentNode.insertBefore(f,c.nextSibling):'append'===b?c.appendChild(f):'prepend'===b&&c.insertBefore(f,c.firstChild)}catch(a){break}},d)}function m(a){var b,g,j,n=[],o=!1;if(a)if(a.nodeType&&1===a.nodeType)n=[a];else if('object'===('undefined'==typeof a?'undefined':_typeof(a)))o='number'!=typeof a.length,n=a;else if('string'==typeof a)for(g=r.querySelectorAll(a),j=0;j<g.length;j+=1)n[j]=g[j];return b=o?{}:n,b.each=function(a){return'function'==typeof a&&c(function(b){return a.apply(b,arguments)},n),b},b.first=function(){return m(n.shift())},b.last=function(){return m(n.pop())},b.odd=function(){var a,b=[];for(a=0;a<n.length;a+=2)b.push(n[a]);return m(b)},b.even=function(){var a,b=[];for(a=1;a<n.length;a+=2)b.push(n[a]);return m(b)},b.hide=function(){return c(function(a){a.style.display='none'},n),b},b.show=function(){return c(function(a){i(a)},n),b},b.toggle=function(a){return'undefined'==typeof a?c(function(a){'none'===f(a,'display')?i(a):a.style.display='none'},n):a?b.show():b.hide(),b},b.remove=function(){return c(function(a){try{a.parentNode.removeChild(a)}catch(a){}},n),m()},b.css=function(a,d){if(a){if(d||''===d)return c(function(b){h(b,a,d)},n),b;if(n[0]){if(n[0].style[e(a)])return n[0].style[e(a)];if(f(n[0],a))return f(n[0],a)}}},b.getClass=function(){if(n[0]&&0<n[0].className.length)return n[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,'').replace(/\\s+/,' ')},b.setClass=function(a){return(a||''===a)&&c(function(b){b.className=a},n),b},b.addClass=function(a){return k(a,'add',n),b},b.removeClass=function(a){return k(a,'remove',n),b},b.toggleClass=function(a,c){var d='undefined'==typeof c?'toggle':+c?'add':'remove';return k(a,d,n),b},b.hasClass=function(a){return k(a,'has',n)},b.html=function(a){return a||''===a?(c(function(b){b.innerHTML=a},n),b):n[0]?n[0].innerHTML:void 0},b.htmlBefore=function(a){return l(a,'before',n),b},b.htmlAfter=function(a){return l(a,'after',n),b},b.htmlAppend=function(a){return l(a,'append',n),b},b.htmlPrepend=function(a){return l(a,'prepend',n),b},b.attr=function(a,d){if(a){if(a=a.toLowerCase(),'undefined'!=typeof d)return c(function(b){'style'===a?b.style.cssText=d:'class'===a?b.className=d:b.setAttribute(a,d)},n),b;if(n[0])if('style'===a){if(n[0].style.cssText)return n[0].style.cssText;}else if('class'===a){if(n[0].className)return n[0].className;}else if(n[0].getAttribute(a))return n[0].getAttribute(a)}},b.data=function(a,c){if(a)return b.attr('data-'+a,c)},b.val=function(a){var d,e,f;if('undefined'!=typeof a)return c(function(b){switch(b.nodeName){case'SELECT':for(('string'==typeof a||'number'==typeof a)&&(a=[a]),e=0;e<b.length;e+=1)for(f=0;f<a.length;f+=1)if(b[e].selected='',b[e].value===''+a[f]){b[e].selected='selected';break}break;case'INPUT':case'TEXTAREA':case'BUTTON':b.value=a;}},n),b;if(n[0])switch(n[0].nodeName){case'SELECT':for(d=[],e=0;e<n[0].length;e+=1)n[0][e].selected&&d.push(n[0][e].value);return 1<d.length?d:d[0];case'INPUT':case'TEXTAREA':case'BUTTON':return n[0].value;}},b.checked=function(a){return'boolean'==typeof a?(c(function(b){'INPUT'===b.nodeName&&('checkbox'===b.type||'radio'===b.type)&&(b.checked=a)},n),b):n[0]&&'INPUT'===n[0].nodeName&&('checkbox'===n[0].type||'radio'===n[0].type)?!!n[0].checked:void 0},b.on=function(e,f){return(a===d||a===r)&&(n=[a]),c(function(a){r.addEventListener?a.addEventListener(e,f,!1):r.attachEvent&&(a[e+f]=function(){return f.apply(a,arguments)},a.attachEvent('on'+e,a[e+f]))},n),b},b.off=function(e,f){return(a===d||a===r)&&(n=[a]),c(function(a){r.addEventListener?a.removeEventListener(e,f,!1):r.attachEvent&&(a.detachEvent('on'+e,a[e+f]),a[e+f]=null)},n),b},b}var n=[],o=[],p=!1,q=!1,r=document,d=window;r.addEventListener?(r.addEventListener('DOMContentLoaded',a,!1),d.addEventListener('load',b,!1)):r.attachEvent?(r.attachEvent('onreadystatechange',a),d.attachEvent('onload',b)):d.onload=b,m.ajax=function(a){var b=Object.assign({method:'GET',nocache:!0,timeout:5e3,loader:!0,callback:null},a);b.method=b.method.toUpperCase();var c=b.loader?m._loader:function(){};var d=b.url;var e=b.method;var f=null;b.data&&(f=j(b.data)),f&&'GET'===e&&(d+=-1===d.indexOf('?')?'?'+f:'&'+f,f=null);var g=new XMLHttpRequest;if(b.nocache){var h=(+new Date).toString(36);d+=(-1===d.indexOf('?')?'?':'&')+'_='+h}c(!0),g.open(e,d,!0),g.timeout=b.timeout;var i=setTimeout(function(){console.error('XHR timed out.'),g.abort(),c(!1)},b.timeout+10);return g.onreadystatechange=function(){4===g.readyState&&(c(!1),b.callback&&b.callback(g.responseText,g.status),clearTimeout(i))},g.setRequestHeader('X-Requested-With','XMLHttpRequest'),'POST'===e&&g.setRequestHeader('Content-Type','application/x-www-form-urlencoded'),g.send(f),g},m._loader=function(){},m.get=function(a,b,c){return c=c||{},c.url=a,c.callback=b,c.method='GET',m.ajax(c)},m.post=function(a,b,c){return c=c||{},c.url=a,c.callback=b,c.method='POST',m.ajax(c)},m.ready=function(a){if(a){if(p)return a(),m;n.push(a)}},m.loaded=function(a){if(a){if(q)return a(),m;o.push(a)}};var t={\"&\":'&amp;',\"<\":'&lt;',\">\":'&gt;','\"':'&quot;',\"'\":'&#39;',\"/\":'&#x2F;',\"`\":'&#x60;',\"=\":'&#x3D;'};m.htmlEscape=function(a){return(a+'').replace(/[&<>\"'`=\\/]/g,function(a){return t[a]})},module.exports=m})();\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar $=__webpack_require__(1);var modal={};var curCloseCb=null;modal.show=function(a,b){var c=$(a);c.removeClass('hidden visible'),setTimeout(function(){c.addClass('visible')},1),curCloseCb=b},modal.hide=function(a){var b=$(a);b.removeClass('visible'),setTimeout(function(){b.addClass('hidden'),curCloseCb&&curCloseCb()},500)},modal.init=function(){$('.Modal').on('click',function(){$(this).hasClass('no-close')||modal.hide(this)}),$('.Dialog').on('click',function(a){a.stopImmediatePropagation()}),$(window).on('keydown',function(a){27===a.which&&modal.hide('.Modal')})},module.exports=modal;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar $=__webpack_require__(1);var modal=__webpack_require__(2);var nt={};var sel='#notif';var $balloon;var timerHideBegin;var timerHideEnd;var canCancel=!1;var stopTimeouts=function(){clearTimeout(timerHideBegin),clearTimeout(timerHideEnd)};nt.show=function(a,b,c){$balloon.toggleClass('error',!0===c),$balloon.html(a),modal.show($balloon),stopTimeouts(),(!b||0>=b)&&(b=2500),timerHideBegin=setTimeout(nt.hide,b),canCancel=!1,setTimeout(function(){canCancel=!0},500)},nt.hide=function(){var a=$(sel);a.removeClass('visible'),timerHideEnd=setTimeout(function(){a.addClass('hidden')},250)},nt.init=function(){$balloon=$(sel),$(document).on('click',function(){canCancel&&nt.hide(this)}),$balloon.on('click',function(a){return a.stopImmediatePropagation(),!1}),$balloon.on('mouseenter',function(){stopTimeouts(),$balloon.removeClass('hidden').addClass('visible')})},module.exports=nt;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar themes=exports.themes=[['#111213','#CC0000','#4E9A06','#C4A000','#3465A4','#75507B','#06989A','#D3D7CF','#555753','#EF2929','#8AE234','#FCE94F','#729FCF','#AD7FA8','#34E2E2','#EEEEEC'],['#000000','#aa0000','#00aa00','#aa5500','#0000aa','#aa00aa','#00aaaa','#aaaaaa','#555555','#ff5555','#55ff55','#ffff55','#5555ff','#ff55ff','#55ffff','#ffffff'],['#000000','#cd0000','#00cd00','#cdcd00','#0000ee','#cd00cd','#00cdcd','#e5e5e5','#7f7f7f','#ff0000','#00ff00','#ffff00','#5c5cff','#ff00ff','#00ffff','#ffffff'],['#000000','#cd0000','#00cd00','#cdcd00','#0000cd','#cd00cd','#00cdcd','#faebd7','#404040','#ff0000','#00ff00','#ffff00','#0000ff','#ff00ff','#00ffff','#ffffff'],['#2e3436','#cc0000','#4e9a06','#c4a000','#3465a4','#75507b','#06989a','#d3d7cf','#555753','#ef2929','#8ae234','#fce94f','#729fcf','#ad7fa8','#34e2e2','#eeeeec'],['#073642','#dc322f','#859900','#b58900','#268bd2','#d33682','#2aa198','#eee8d5','#002b36','#cb4b16','#586e75','#657b83','#839496','#6c71c4','#93a1a1','#fdf6e3'],['#073642','#dc322f','#859900','#b58900','#268bd2','#d33682','#2aa198','#eee8d5','#002b36','#cb4b16','#586e75','#657b83','#839496','#6c71c4','#93a1a1','#fdf6e3'],['#000000','#69001A','#117800','#769100','#1A00A6','#8019AB','#289E76','#A4A4A4','#484848','#C54E76','#6DD441','#D2ED46','#765BFF','#DC75FF','#84FAD2','#FFFFFF'],['#000000','#aa0000','#00aa00','#aaaa00','#0000aa','#aa00aa','#00aaaa','#aaaaaa','#000000','#ff0000','#00FF00','#ffff00','#0000ff','#ff00ff','#00ffff','#ffffff'],['#000000','#722640','#0E5940','#808080','#40337F','#E434FE','#1B9AFE','#BFB3FF','#404C00','#E46501','#1BCB01','#BFCC80','#808080','#F1A6BF','#8DD9BF','#ffffff'],['#000000','#8D3E37','#55A049','#AAB95D','#40318D','#80348B','#72C1C8','#D59F74','#8B5429','#B86962','#94E089','#FFFFB2','#8071CC','#AA5FB6','#87D6DD','#ffffff']];exports.fgbgThemes=[['#aaaaaa','#000000'],['#000000','#ffffdd'],['#000000','#ffffff'],['#ffffff','#000000'],['#00ff00','#000000'],['#e53c00','#000000'],['#ffffff','#300a24'],['#657b83','#fdf6e3'],['#839496','#002b36']];var colorTable256=null;exports.buildColorTable=function(){if(null!=colorTable256)return colorTable256;colorTable256=Array(16).fill('rgba(0, 0, 0, 0)');for(var a=0;6>a;a++)for(var b=0;6>b;b++)for(var c=0;6>c;c++){var d=40*a+(a?55:0);var e=40*b+(b?55:0);var f=40*c+(c?55:0);colorTable256.push('rgb('+d+', '+e+', '+f+')')}for(var g=0;24>g;g++){var h=10*g+8;colorTable256.push('rgb('+h+', '+h+', '+h+')')}return colorTable256},exports.SELECTION_FG='#333',exports.SELECTION_BG='#b2d7fe',exports.themePreview=function(a){document.querySelectorAll('[data-fg]').forEach(function(b){var c=+b.dataset.fg;b.style.color=themes[a][c]}),document.querySelectorAll('[data-bg]').forEach(function(b){var c=+b.dataset.bg;b.style.backgroundColor=themes[a][c]})};\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _get=function a(b,c,d){null===b&&(b=Function.prototype);var e=Object.getOwnPropertyDescriptor(b,c);if(e===void 0){var f=Object.getPrototypeOf(b);return null===f?void 0:a(f,c,d)}if('value'in e)return e.value;var g=e.get;return void 0===g?void 0:g.call(d)};var _createClass=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,'value'in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();function _toConsumableArray(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError('this hasn\\'t been initialised - super() hasn\\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function _inherits(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}var EventEmitter=__webpack_require__(5);var _require=__webpack_require__(0),parse2B=_require.parse2B;var _require2=__webpack_require__(4),themes=_require2.themes;var ANSIParser=function(){function a(b){_classCallCheck(this,a),this.reset(),this.handler=b,this.joinChunks=!0}return _createClass(a,[{key:'reset',value:function reset(){this.currentSequence=0,this.sequence=''}},{key:'parseSequence',value:function parseSequence(a){if('['===a[0]){var b=a[a.length-1];var c=a.substring(1,a.length-1);var d=c?c.split(';').map(function(a){return+a.replace(/\\D/g,'')}):[];var e=d.length?d[0]:1;if('H'===b)this.handler('set-cursor',(0|d[0])-1,(0|d[1])-1);else if('A'<=b&&'D'>=b)this.handler('move-cursor-'+('B'>=b?'y':'x'),('B'===b||'C'===b?1:-1)*e);else if('E'===b||'F'===b)this.handler('move-cursor-line',('E'===b?1:-1)*e);else if('G'===b)this.handler('set-cursor-x',e-1);else if('J'===b){var f=d.length?d[0]:2;2===f&&this.handler('clear')}else if('P'===b)this.handler('delete',e);else if('@'===b)this.handler('insert-blanks',e);else if('q'===b)this.handler('set-cursor-style',e);else if('m'===b){if(!d.length||0===d[0])return void this.handler('reset-style');var g=d[0];if(1===g)this.handler('add-attrs',1);else if(2===g)this.handler('add-attrs',2);else if(3===g)this.handler('add-attrs',4);else if(4===g)this.handler('add-attrs',8);else if(5===g||6===g)this.handler('add-attrs',16);else if(7===g)this.handler('add-attrs',-1);else if(9===g)this.handler('add-attrs',64);else if(20===g)this.handler('add-attrs',32);else if(30<=g&&37>=g)this.handler('set-color-fg',g%10);else if(40<=g&&47>=g)this.handler('set-color-bg',g%10);else if(39===g)this.handler('reset-color-fg');else if(49===g)this.handler('reset-color-bg');else if(90<=g&&98>=g)this.handler('set-color-fg',g%10+8);else if(100<=g&&108>=g)this.handler('set-color-bg',g%10+8);else if((38===g||48===g)&&5===d[1]){var h=255&(0|d[2]);38===g&&this.handler('set-color-fg',h),48===g&&this.handler('set-color-bg',h)}}else('h'===b||'l'===b)&&'?25'===c&&('h'===b?this.handler('show-cursor'):'l'===b&&this.handler('hide-cursor'))}}},{key:'write',value:function write(a){var b=!0;var c=!1;var d=void 0;try{for(var e,f=a.toString()[Symbol.iterator]();!(b=(e=f.next()).done);b=!0){var g=e.value;var h=g.codePointAt(0);27===h?this.currentSequence=1:1===this.currentSequence&&'['===g?(this.currentSequence=2,this.sequence+='['):this.currentSequence&&g.match(/[\\x40-\\x7e]/)?(this.parseSequence(this.sequence+g),this.currentSequence=0,this.sequence=''):1<this.currentSequence?this.sequence+=g:1===this.currentSequence?(this.currentSequence=0,this.handler('write',g)):3>h?this.handler('_null'):3===h?this.handler('sigint'):6>=h?this.handler('_null'):7===h?this.handler('bell'):8===h?this.handler('back'):9===h?this.handler('tab'):10===h?this.handler('new-line'):13===h?this.handler('return'):21===h?this.handler('delete-line'):23===h?this.handler('delete-word'):this.handler('write',g)}}catch(a){c=!0,d=a}finally{try{!b&&f.return&&f.return()}finally{if(c)throw d}}this.joinChunks||this.reset()}}]),a}();var TERM_DEFAULT_STYLE=0;var TERM_MIN_DRAW_DELAY=10;var getRainbowColor=function(a){var c=Math.PI;var d=Math.floor;var e=Math.sin;var f=d(2.5*e(a)+2.5);var h=d(2.5*e(a+2/3*c)+2.5);var g=d(2.5*e(a+4/3*c)+2.5);return 16+36*f+6*h+g};var ScrollingTerminal=function(){function a(b){var c=this;_classCallCheck(this,a),this.width=80,this.height=25,this.termScreen=b,this.parser=new ANSIParser(function(){return c.handleParsed.apply(c,arguments)}),this.reset(),this._lastLoad=Date.now(),this.termScreen.load(this.serialize()),window.showPage()}var b=Math.min;var c=Math.max;return _createClass(a,[{key:'reset',value:function reset(){this.style=TERM_DEFAULT_STYLE,this.cursor={x:0,y:0,style:1,visible:!0},this.trackMouse=!1,this.theme=-1,this.rainbow=!1,this.parser.reset(),this.clear()}},{key:'clear',value:function clear(){this.screen=[];for(var a=0;a<this.width*this.height;a++)this.screen.push([' ',this.style])}},{key:'scroll',value:function scroll(){this.screen.splice(0,this.width);for(var a=0;a<this.width;a++)this.screen.push([' ',TERM_DEFAULT_STYLE]);this.cursor.y--}},{key:'newLine',value:function newLine(){this.cursor.y++,this.cursor.y>=this.height&&this.scroll()}},{key:'writeChar',value:function writeChar(a){this.screen[this.cursor.y*this.width+this.cursor.x]=[a,this.style],this.cursor.x++,this.cursor.x>=this.width&&(this.cursor.x=0,this.newLine())}},{key:'moveBack',value:function moveBack(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;for(var b=0;b<a;b++)this.cursor.x--,0>this.cursor.x&&(this.cursor.x=0<this.cursor.y?this.width-1:0,this.cursor.y=c(0,this.cursor.y-1))}},{key:'moveForward',value:function moveForward(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;for(var b=0;b<a;b++)this.cursor.x++,this.cursor.x>=this.width&&(this.cursor.x=0,this.cursor.y++,this.cursor.y>=this.height&&this.scroll())}},{key:'deleteChar',value:function deleteChar(){this.moveBack(),this.screen.splice((this.cursor.y+1)*this.width,0,[' ',TERM_DEFAULT_STYLE]),this.screen.splice(this.cursor.y*this.width+this.cursor.x,1)}},{key:'deleteForward',value:function deleteForward(a){a=b(this.width,a);for(var c=0;c<a;c++)this.screen.splice((this.cursor.y+1)*this.width,0,[' ',TERM_DEFAULT_STYLE]);this.screen.splice(this.cursor.y*this.width+this.cursor.x,a)}},{key:'clampCursor',value:function clampCursor(){0>this.cursor.x&&(this.cursor.x=0),0>this.cursor.y&&(this.cursor.y=0),this.cursor.x>this.width-1&&(this.cursor.x=this.width-1),this.cursor.y>this.height-1&&(this.cursor.y=this.height-1)}},{key:'handleParsed',value:function handleParsed(a){'write'===a?this.writeChar(1>=arguments.length?void 0:arguments[1]):'delete'===a?this.deleteForward(1>=arguments.length?void 0:arguments[1]):'insert-blanks'===a?this.insertBlanks(1>=arguments.length?void 0:arguments[1]):'clear'===a?this.clear():'bell'===a?this.termScreen.load('B'):'back'===a?this.moveBack():'new-line'===a?this.newLine():'return'===a?this.cursor.x=0:'set-cursor'===a?(this.cursor.x=2>=arguments.length?void 0:arguments[2],this.cursor.y=1>=arguments.length?void 0:arguments[1],this.clampCursor()):'move-cursor-y'===a?(this.cursor.y+=1>=arguments.length?void 0:arguments[1],this.clampCursor()):'move-cursor-x'===a?(this.cursor.x+=1>=arguments.length?void 0:arguments[1],this.clampCursor()):'move-cursor-line'===a?(this.cursor.x=0,this.cursor.y+=1>=arguments.length?void 0:arguments[1],this.clampCursor()):'set-cursor-x'===a?this.cursor.x=1>=arguments.length?void 0:arguments[1]:'set-cursor-style'===a?this.cursor.style=c(0,b(6,1>=arguments.length?void 0:arguments[1])):'reset-style'===a?this.style=TERM_DEFAULT_STYLE:'add-attrs'===a?this.style|=(1>=arguments.length?void 0:arguments[1])<<16:'set-color-fg'===a?this.style=16777216|4294967040&this.style|(1>=arguments.length?void 0:arguments[1]):'set-color-bg'===a?this.style=33554432|4294902015&this.style|(1>=arguments.length?void 0:arguments[1])<<8:'reset-color-fg'===a?this.style&=4294901504:'reset-color-bg'===a?this.style&=4294770943:'hide-cursor'===a?this.cursor.visible=!1:'show-cursor'===a&&(this.cursor.visible=!0)}},{key:'write',value:function write(a){this.parser.write(a),this.scheduleLoad()}},{key:'serialize',value:function serialize(){var a=String.fromCodePoint;var b='S';b+=a(this.height+1)+a(this.width+1),b+=a(this.cursor.y+1)+a(this.cursor.x+1);var c=+this.cursor.visible;c|=96*+this.trackMouse,c|=384,c|=this.cursor.style<<9,b+=a(c+1);var d=null;var e=0;var f=!0;var g=!1;var h=void 0;try{for(var i,j=this.screen[Symbol.iterator]();!(f=(i=j.next()).done);f=!0){var k=i.value;var l=k[1];if(this.rainbow){var m=e%this.width;var n=Math.floor(e/this.width);l=16777216|4294705152&l|getRainbowColor((m+n)/10+Date.now()/1e3),e++}if(l!==d){var o=255&l;var p=255&l>>8;var q=65535&l>>16;var r=o!=(255&d);var s=p!=(255&d>>8);var t=q!=(65535&d>>16);r&&s?b+='\\x03'+a((65535&l)+1):r?b+='\\x05'+a(o+1):s&&(b+='\\x06'+a(p+1)),t&&(b+='\\x04'+a(q+1)),d=l}b+=k[0]}}catch(a){g=!0,h=a}finally{try{!f&&j.return&&j.return()}finally{if(g)throw h}}return b}},{key:'scheduleLoad',value:function scheduleLoad(){var a=this;clearTimeout(this._scheduledLoad),this._lastLoad<Date.now()-TERM_MIN_DRAW_DELAY?(this.termScreen.load(this.serialize(),{theme:this.theme}),this.theme=-1):this._scheduledLoad=setTimeout(function(){a.termScreen.load(a.serialize())},TERM_MIN_DRAW_DELAY-this._lastLoad)}},{key:'rainbowTimer',value:function rainbowTimer(){var a=this;this.rainbow&&(clearInterval(this._rainbowTimer),this._rainbowTimer=setInterval(function(){a.rainbow&&a.scheduleLoad()},50))}}]),a}();var Process=function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'write',value:function write(a){this.emit('in',a)}},{key:'destroy',value:function destroy(){this.emit('exit',0)}},{key:'run',value:function run(){}}]),b}(EventEmitter);var demoData={buttons:{1:'',2:'',3:'',4:'',5:function _(a,b){b.child&&b.child.destroy();var c='info\\r';var d=function(){b.write(c[0]),c=c.substr(1),c&&setTimeout(d,100)};setTimeout(d,200)}},mouseReceiver:null};var demoshIndex={clear:function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){this.emit('write','\\x1B[2J\\x1B[1;1H'),this.destroy()}}]),b}(Process),screenfetch:function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){var a=this;var b=('\\n ###. ESPTerm Demo\\n \\'###. Hostname: '+window.location.hostname+'\\n \\'###. Shell: ESPTerm Demo Shell\\n \\'###. Resolution: 80x25@'+window.devicePixelRatio+'x\\n :###-\\n .###\\'\\n .###\\'\\n .###\\' ###############\\n ###\\' ###############\\n ').split('\\n').filter(function(a){return a.trim()});var c='';for(var e=0;e<b.length;e++)for(var f=0;80>f;f++)c+=b[e][f]?'\\x1B[38;5;'+getRainbowColor((f+e)/10)+'m'+b[e][f]:' ';this.emit('write','\\r\\n\\x1B[?25l');var d=function(){a.emit('write',c.substr(0,80)),c=c.substr(80),c.length?setTimeout(d,50):(a.emit('write','\\r\\n\\x1B[?25h'),a.destroy())};d()}}]),b}(Process),\"local-echo\":function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];b.includes('--suppress-note')||this.emit('write','\\x1B[38;5;239mNote: not all terminal features are supported or and may not work as expected in this demo\\x1B[0m\\r\\n')}},{key:'write',value:function write(a){this.emit('write',a)}}]),b}(Process),info:function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){var a=this;for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];var e=c.includes('--fast');this.showSplash().then(function(){a.printText(e)})}},{key:'showSplash',value:function showSplash(){var a=this;var b=['',' -#####- -###*..#####- ######-',' -#* -#- .## .##. *#-',' -##### .-###*..#####- *#- -*##*- #*-#--#**#-*##-',' -#* -#-.##. *#- *##@#* ##. -#* *# .#*',' -#####--####- .##. *#- -*#@@- ##. -#* *# .#*',' '].filter(function(a){return a.trim()});var c={\" \":-231,\".\":4,\"-\":8,\"*\":17,\"#\":24};var d={\" \":' ',\".\":'\\u2591',\"-\":'\\u2592',\"*\":'\\u2593',\"#\":'\\u2588'};for(var j in b)79>b[j].length&&(b[j]+=' '.repeat(79-b[j].length));this.emit('write','\\r\\n'.repeat(b.length+1)),this.emit('write','\\x1B[A'.repeat(b.length)),this.emit('write','\\x1B[?25l');var e=0;var f=0;var g=function(b,c){var d=Math.abs;var g=b-e;var h=c-f;a.emit('write','\\x1B['+d(g)+(0<g?'C':'D')),a.emit('write','\\x1B['+d(h)+(0<h?'B':'A')),e=b,f=c};var h=function(e,f){if(g(e,f),'@'===b[f][e])a.emit('write','\\x1B[48;5;238m\\x1B[38;5;255m\\u2584\\b');else{var h=231+c[b[f][e]];var i=d[b[f][e]];a.emit('write','\\x1B[48;5;'+h+'m\\x1B[38;5;'+h+'m'+i+'\\b')}};return new Promise(function(c){var d=14;var e=0;var f=function(){for(var i=0;i<b.length;i++){var j=d-i;0<j&&h(j,i)}69>++d?3<=++e?(setTimeout(f,20),e=0):f():(g(0,b.length),a.emit('write','\\x1B[m\\x1B[?25h'),c())};f()})}},{key:'printText',value:function printText(){var a=0<arguments.length&&void 0!==arguments[0]&&arguments[0];var b=['',' ESPTerm is a VT100-like terminal emulator running on the ESP8266 WiFi chip.','',' \\x1B[93mThis is an online demo of the web user interface, simulating a simple ',' terminal in your browser.\\x1B[m','',' Type \\x1B[92mls\\x1B[m to list available commands.',' Use the \\x1B[94mlinks\\x1B[m below this screen for a demo of the options and more info.',''];if(a)this.emit('write',b.join('\\r\\n')+'\\r\\n'),this.destroy();else{var c=this;var d=function(){c.emit('write',b.shift()+'\\r\\n'),b.length?setTimeout(d,17):c.destroy()};d()}}}]),b}(Process),colors:function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){this.emit('write','\\r\\n');this.emit('write',' ');for(var a=0;16>a;a++)this.emit('write','\\x1B['+(8>a?'3'+a:'9'+(a-8))+'m'),this.emit('write','foreground-color'[a]+' ');this.emit('write','\\r\\n ');for(var c=0;16>c;c++)this.emit('write','\\x1B['+(8>c?'4'+c:'10'+(c-8))+'m ');this.emit('write','\\x1B[m\\r\\n');for(var d=0;6>d;d++){this.emit('write',' ');for(var e=0;6>e;e++){for(var f=0;6>f;f++)this.emit('write','\\x1B[48;5;'+(16+36*d+6*e+f)+'m ');this.emit('write','\\x1B[m')}this.emit('write','\\r\\n')}this.emit('write',' ');for(var b=0;24>b;b++)this.emit('write','\\x1B[48;5;'+(232+b)+'m ');this.emit('write','\\x1B[m\\r\\n\\n'),this.destroy()}}]),b}(Process),ls:function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){for(var a in this.emit('write','\\x1B[92mList of demo commands\\x1B[m\\r\\n'),demoshIndex)'string'!=typeof demoshIndex[a]&&this.emit('write',a+'\\r\\n');this.destroy()}}]),b}(Process),theme:function(a){function b(a){_classCallCheck(this,b);var c=_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));return c.shell=a,c}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){var a=0|+(0>=arguments.length?void 0:arguments[0]);var b=themes.length;return!arguments.length||!Number.isFinite(a)||0>a||a>=b?(this.emit('write','\\x1B[31mUsage: theme [0\\u2013'+(b-1)+']\\r\\n'),void this.destroy()):void(this.shell.terminal.theme=a,this.shell.terminal.termScreen.drawnScreenFG=[],this.emit('write',''),this.destroy())}}]),b}(Process),cursor:function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];var d=b.includes('--steady');b.includes('block')?this.emit('write','\\x1B['+2*d+' q'):b.includes('line')?this.emit('write','\\x1B['+(3+d)+' q'):b.includes('bar')||b.includes('beam')?this.emit('write','\\x1B['+(5+d)+' q'):this.emit('write','\\x1B[31mUsage: cursor [block|line|bar] [--steady]\\r\\n'),this.destroy()}}]),b}(Process),rainbow:function(a){function b(a){_classCallCheck(this,b);var c=_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));return c.shell=a,c}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){this.shell.terminal.rainbow=!this.shell.terminal.rainbow,this.shell.terminal.rainbowTimer(),this.emit('write',''),this.destroy()}}]),b}(Process),mouse:function(a){function b(a){_classCallCheck(this,b);var c=_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));return c.shell=a,c}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){this.shell.terminal.trackMouse=!0,demoData.mouseReceiver=this,this.randomData=[],this.highlighted={};var a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';for(var b=0;23>b;b++){var c='';for(var d=0;79>d;d++)c+=a[Math.floor(a.length*Math.random())];this.randomData.push(c)}this.scrollOffset=0,this.render()}},{key:'render',value:function render(){this.emit('write','\\x1B[m\\x1B[2J\\x1B[1;1H'),this.emit('write','\\x1B[97m\\x1B[1mMouse Demo\\r\\n\\x1B[mMouse movement, clicking and scrolling!');for(var a=0;23>a;a++){var b=a+this.scrollOffset;b=(b%this.randomData.length+this.randomData.length)%this.randomData.length;var c=this.randomData[b];var d='\\x1B['+(3+a)+';1H\\x1B[38;5;239m';for(var e in c)this.highlighted[80*(a+2)+ +e]&&(d+='\\x1B[97m'),d+=c[e],this.highlighted[80*(a+2)+ +e]&&(d+='\\x1B[38;5;239m');this.emit('write',d)}this.mouse&&this.emit('write','\\x1B['+(this.mouse.y+1)+';'+(this.mouse.x+1)+'H')}},{key:'mouseMove',value:function mouseMove(a,b){this.mouse={x:a,y:b},this.render()}},{key:'mouseDown',value:function mouseDown(a,b,c){4===c?this.scrollOffset--:5===c?this.scrollOffset++:this.highlighted[80*b+a]=!this.highlighted[80*b+a],this.render()}},{key:'mouseUp',value:function mouseUp(){}},{key:'destroy',value:function destroy(){this.shell.terminal.write('\\x1B[2J\\x1B[1;1H'),this.shell.terminal.trackMouse=!1,demoData.mouseReceiver===this&&(demoData.mouseReceiver=null),_get(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),'destroy',this).call(this)}}]),b}(Process),sudo:function(a){function b(a){_classCallCheck(this,b);var c=_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));return c.shell=a,c}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){var a=this;for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];if(0===e.length)this.emit('write','\\x1B[31mUsage: sudo <command>\\x1B[m\\r\\n'),this.destroy();else if(4===e.length&&'make me a sandwich'===e.join(' ').toLowerCase()){var g='\\x1B[33m';var b='\\x1B[32m';var i='\\x1B[38;5;229m';var c='\\x1B[38;5;225m';this.emit('write',' '+g+'_.---._\\r\\n _.-~ ~-._\\r\\n _.-~ ~-._\\r\\n _.-~ ~---._\\r\\n _.-~ ~\\\\\\r\\n .-~ _.;\\r\\n :-._ _.-~ ./\\r\\n `-._~-._ _..__.-~ _.-~\\r\\n'+(' '+i+'/ '+g+'~-._~-._ / .__..--'+i+'~-'+b+'---._\\r\\n')+(i+' \\\\_____(_'+g+';-._\\\\. _.-~_/'+i+' ~)'+b+'.. . \\\\\\r\\n')+(b+' /(_____ '+g+'\\\\`--...--~_.-~'+i+'______..-+'+b+'_______)\\r\\n')+(b+' .(_________/'+g+'`--...--~/'+b+' _/ '+c+' '+g+'/\\\\\\r\\n')+(g+' /-._'+c+' \\\\_ '+b+'(___./_..-~'+c+'__.....'+g+'__..-~./\\r\\n')+(g+' `-._~-._'+c+' ~\\\\--------~ .-~'+g+'_..__.-~ _.-~\\r\\n')+(g+' ~-._~-._ '+c+'~---------` '+g+'/ .__..--~\\r\\n')+(g+' ~-._\\\\. _.-~_/\\r\\n')+(g+' \\\\`--...--~_.-~\\r\\n')+(g+' `--...--~'+'\\x1B[0m'+'\\r\\n')),this.destroy()}else{var h=e.shift();if(this.shell.index[h]){var j=this.shell.index[h];if(j instanceof Function){var k=new j(this);var l=function(b){return a.emit('write',b)};k.on('write',l),k.on('exit',function(){k.removeListener('write',l),a.destroy()}),k.run.apply(k,e)}else this.emit('write',j),this.destroy()}else this.emit('write','sudo: '+h+': command not found\\r\\n'),this.destroy()}}}]),b}(Process),make:function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];0===b.length?this.emit('write','\\x1B[31mmake: *** No targets specified. Stop.\\x1B[0m\\r\\n'):3===b.length&&'me a sandwich'===b.join(' ').toLowerCase()?this.emit('write','\\x1B[31mmake: me a sandwich : Permission denied\\x1B[0m\\r\\n'):this.emit('write','\\x1B[31mmake: *** No rule to make target \\''+b.join(' ').toLowerCase()+'\\'. Stop.\\x1B[0m\\r\\n'),this.destroy()}}]),b}(Process),pwd:'/this/is/a/demo\\r\\n',cd:'\\x1B[38;5;239mNo directories to change to\\r\\n',whoami:window.navigator.userAgent+'\\r\\n',hostname:''+window.location.hostname,uname:'ESPTerm Demo\\r\\n',mkdir:'\\x1B[38;5;239mDid not create a directory because this is a demo.\\r\\n',rm:'\\x1B[38;5;239mDid not delete anything because this is a demo.\\r\\n',cp:'\\x1B[38;5;239mNothing to copy because this is a demo.\\r\\n',mv:'\\x1B[38;5;239mNothing to move because this is a demo.\\r\\n',ln:'\\x1B[38;5;239mNothing to link because this is a demo.\\r\\n',touch:'\\x1B[38;5;239mNothing to touch\\r\\n',exit:'\\x1B[38;5;239mNowhere to go\\r\\n',github:function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,[{key:'run',value:function run(){window.open('https://github.com/espterm/espterm-firmware'),this.destroy()}}]),b}(Process)};var DemoShell=function(){function a(b,c){var d=this;_classCallCheck(this,a),this.terminal=b,this.terminal.reset(),this.parser=new ANSIParser(function(){return d.handleParsed.apply(d,arguments)}),this.history=[],this.historyIndex=0,this.cursorPos=0,this.child=null,this.index=demoshIndex,c?this.run('info'):this.prompt()}return _createClass(a,[{key:'write',value:function write(a){this.child?3===a.codePointAt(0)?this.child.destroy():this.child.write(a):this.parser.write(a)}},{key:'prompt',value:function prompt(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!0;0!==this.terminal.cursor.x&&this.terminal.write('\\x1B[m\\x1B[38;5;238m\\u23CE\\r\\n'),this.terminal.write('\\x1B[34;1mdemosh \\x1B[m'),a||this.terminal.write('\\x1B[31m'),this.terminal.write('$ \\x1B[m'),this.history.unshift(''),this.cursorPos=0}},{key:'copyFromHistoryIndex',value:function copyFromHistoryIndex(){if(this.historyIndex){var a=this.history[this.historyIndex];this.history[0]=a,this.historyIndex=0}}},{key:'handleParsed',value:function handleParsed(a){if(this.terminal.write('\\b\\x1B[P'.repeat(this.cursorPos)),'write'===a)this.copyFromHistoryIndex(),this.history[0]=this.history[0].substr(0,this.cursorPos)+(1>=arguments.length?void 0:arguments[1])+this.history[0].substr(this.cursorPos),this.cursorPos++;else if('back'===a)this.copyFromHistoryIndex(),this.history[0]=this.history[0].substr(0,this.cursorPos-1)+this.history[0].substr(this.cursorPos),this.cursorPos--,0>this.cursorPos&&(this.cursorPos=0);else if('tab'===a)console.warn('TAB not implemented');else if('move-cursor-x'===a)this.cursorPos=Math.max(0,Math.min(this.history[this.historyIndex].length,this.cursorPos+(1>=arguments.length?void 0:arguments[1])));else if('delete-line'===a)this.copyFromHistoryIndex(),this.history[0]='',this.cursorPos=0;else if('delete-word'===a){this.copyFromHistoryIndex();var b=this.history[0].substr(0,this.cursorPos).split(' ');b.pop(),this.history[0]=b.join(' ')+this.history[0].substr(this.cursorPos),this.cursorPos=b.join(' ').length}else'move-cursor-y'===a&&(this.historyIndex-=1>=arguments.length?void 0:arguments[1],0>this.historyIndex&&(this.historyIndex=0),this.historyIndex>=this.history.length&&(this.historyIndex=this.history.length-1),this.cursorPos=this.history[this.historyIndex].length);this.terminal.write(this.history[this.historyIndex]),this.terminal.write('\\b'.repeat(this.history[this.historyIndex].length)),this.terminal.moveForward(this.cursorPos),this.terminal.write(''),'return'===a&&(this.terminal.write('\\r\\n'),this.parse(this.history[this.historyIndex]))}},{key:'parse',value:function parse(a){'help'===a&&(a='info'),this.run(a)}},{key:'run',value:function run(a){var b=[''];var c=!1;var d=!0;var e=!1;var f=void 0;try{for(var g,h=a.trim()[Symbol.iterator]();!(d=(g=h.next()).done);d=!0){var j=g.value;c&&j!==c?b[b.length-1]+=j:c?c=!1:'\"'===j||'\\''===j?c=j:j.match(/\\s/)?b[b.length-1]&&b.push(''):b[b.length-1]+=j}}catch(a){e=!0,f=a}finally{try{!d&&h.return&&h.return()}finally{if(e)throw f}}var i=b.shift();i in this.index?this.spawn(i,b):(this.terminal.write('demosh: Unknown command: '+i+'\\r\\n'),this.prompt(!1))}},{key:'spawn',value:function spawn(a){var b=this;var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];var d=this.index[a];if(d instanceof Function){var e;this.child=new d(this);var f=function(a){return b.terminal.write(a)};this.child.on('write',f),this.child.on('exit',function(a){b.child&&b.child.removeListener('write',f),b.child=null,b.prompt(!a)}),(e=this.child).run.apply(e,_toConsumableArray(c))}else this.terminal.write(d),this.prompt()}}]),a}();window.demoInterface=module.exports={input:function input(a){var b=a[0];var c=a.substr(1);if('s'===b)this.shell.write(c);else if('b'===b){var d=c.charCodeAt(0);var e=demoData.buttons[d];e&&('string'==typeof e?this.shell.write(e):e instanceof Function&&e(this.terminal,this.shell))}else if('m'===b||'p'===b||'r'===b){var f=parse2B(c,0);var g=parse2B(c,2);var h=parse2B(c,4);var i=parse2B(c,6);demoData.mouseReceiver&&('m'===b?demoData.mouseReceiver.mouseMove(g,f,h,i):'p'===b?demoData.mouseReceiver.mouseDown(g,f,h,i):'r'===b&&demoData.mouseReceiver.mouseUp(g,f,h,i))}},didInit:!1,init:function init(a){this.didInit||(this.didInit=!0,this.terminal=new ScrollingTerminal(a),this.shell=new DemoShell(this.terminal,!0))}};\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__(8),__webpack_require__(2),__webpack_require__(3),__webpack_require__(9);try{__webpack_require__(6)}catch(a){}__webpack_require__(10);var $=__webpack_require__(1);var _require=__webpack_require__(0),qs=_require.qs;window.termInit=__webpack_require__(12),window.$=$,window.qs=qs,window.themes=__webpack_require__(4);\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nString.fromCodePoint||function(){var a=function(){try{var a={};var b=Object.defineProperty;var c=b(a,a,a)&&b}catch(a){}return c}();var b=String.fromCharCode;var c=Math.floor;var d=function(){var a=[];var d;var e;var f=-1;var g=arguments.length;if(!g)return'';for(var h='';++f<g;){var i=+arguments[f];if(!isFinite(i)||0>i||1114111<i||c(i)!=i)throw RangeError('Invalid code point: '+i);65535>=i?a.push(i):(i-=65536,d=(i>>10)+55296,e=i%1024+56320,a.push(d,e)),(f+1==g||a.length>16384)&&(h+=b.apply(null,a),a.length=0)}return h};a?a(String,'fromCodePoint',{value:d,configurable:!0,writable:!0}):String.fromCodePoint=d}();\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar $=__webpack_require__(1);var _require=__webpack_require__(0),mk=_require.mk,qs=_require.qs,qsa=_require.qsa,cr=_require.cr;var modal=__webpack_require__(2);var notify=__webpack_require__(3);$.ready(function(){function a(){$('#menu').toggleClass('expanded')}$('#brand').on('click',a).on('keypress',cr(a)),$('.Row.checkbox').forEach(function(a){var b=a.querySelector('input');var c=a.querySelector('.box');$(c).toggleClass('checked',b.value);var d=function(){b.value=1-b.value,$(c).toggleClass('checked',b.value)};$(a).on('click',d).on('keypress',cr(d))}),$('.Box.mobcol,.Box.fold').forEach(function(a){var b=a.querySelector('h2');var c=function(){$(a).toggleClass('expanded')};$(b).on('click',c).on('keypress',cr(c))}),$('form').forEach(function(a){$(a).on('keypress',function(b){(10===b.keyCode||13===b.keyCode)&&b.ctrlKey&&a.submit()})}),setInterval(function(){$('.anim-dots').each(function(a){var b=$(a);var c=b.html()+'.';5===c.length&&(c='.'),b.html(c)})},1e3),$('input[type=number]').on('mousewheel',function(a){var b=Number.isFinite;var c=$(this);var d=+c.val();isNaN(d)&&(d=1);var e=+(c.attr('step')||1);var f=+c.attr('min');var g=+c.attr('max');if(0<a.wheelDelta?d+=e:d-=e,b(f)||(d=Math.max(d,+f)),b(g)||(d=Math.min(d,+g)),c.val(d),'createEvent'in document){var h=document.createEvent('HTMLEvents');h.initEvent('change',!1,!0),c[0].dispatchEvent(h)}else c[0].fireEvent('onchange');a.preventDefault()});var b=window.location.search.indexOf('err=');if(-1!==b&&qs('.Box.errors')){var c=window.location.search.substr(b+4).split(',');var d=[];c.forEach(function(a){var b=qsa('label[for=\"'+a+'\"]');for(var c=0;c<b.length;c++){var e=b[c];e.classList.add('error'),0===c&&d.push(e.childNodes[0].textContent.trim().replace(/: ?$/,''))}}),qs('.Box.errors .list').innerHTML=d.join(', '),qs('.Box.errors').classList.remove('hidden')}if(modal.init(),notify.init(),550<window.innerWidth){$('.Box h2').forEach(function(a){a.removeAttribute('tabindex')});var e=qs('#brand');e&&e.addEventListener('click',function(){window.location.href='/'})}}),$._loader=function(a){$('#loader').toggleClass('show',a)};var pageShown=!1;function showPage(){pageShown=!0,$('#content').addClass('load')}window.showPage=showPage,$.ready(function(){!0===window.noAutoShow?setTimeout(function(){if(!pageShown){var a=mk('P');a.id='load-failed',a.innerHTML='Server connection failed! Trying again<span class=\"anim-dots\" style=\"width:1.5em;text-align:left;display:inline-block\">.</span>',qs('#screen').appendChild(a),showPage()}},2e3):setTimeout(function(){showPage()},1)});\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar $=__webpack_require__(1);var _require=__webpack_require__(0),mk=_require.mk,bool=_require.bool;var tr=__webpack_require__(11);(function(a){function b(a){return Math.round(100*(a.value/a.max))+'%'}function c(a,b,c){$('#sta_ssid').val(a),$('#sta_password').val(b),$('#sta-nw').toggleClass('hidden',0===a.length),$('#sta-nw-nil').toggleClass('hidden',0<a.length),$('#sta-nw .essid').html($.htmlEscape(a));var d=!b||0===b.length;$('#sta-nw .passwd').toggleClass('hidden',d),$('#sta-nw .nopasswd').toggleClass('hidden',!d),$('#sta-nw .ip').html(0<c.length?tr('wifi.connected_ip_is')+c:tr('wifi.not_conn'))}function d(a,b){if(200!==b)return void f(5e3);try{a=JSON.parse(a)}catch(a){return console.log(a),void f(5e3)}var d=!bool(a.result.inProgress)&&0<a.result.APs.length;if(f(d?15000:1e3),!!d){var e=$('#ap-list');$('#ap-list .AP').remove(),e.toggleClass('hidden',!d),$('#ap-loader').toggleClass('hidden',d),a.result.APs.sort(function(c,a){return a.rssi-c.rssi}).forEach(function(a){if(a.enc=parseInt(a.enc),!(4<a.enc)){var b=mk('div');var d=$(b).data('ssid',a.essid).data('pwd',a.enc).attr('tabindex',0).addClass('AP');a.essid===h&&d.addClass('selected');var f=mk('div');var i=$.htmlEscape(a.essid);$(f).addClass('inner').htmlAppend('<div class=\"rssi\">'+a.rssi_perc+'</div>').htmlAppend('<div class=\"essid\" title=\"'+i+'\">'+i+'</div>').htmlAppend('<div class=\"auth\">'+g[a.enc]+'</div>'),d.on('click',function(){var a=$(this);var b=a.data('ssid');var d='';+a.data('pwd')&&(d=window.prompt(tr('wifi.enter_passwd').replace(':ssid:',b)),!d)||($('#sta_password').val(d),$('#sta_ssid').val(b),c(b,d,''))}),b.appendChild(f),e[0].appendChild(b)}})}}function e(){window._demo?d(window._demo_aps,200):$.get('http://'+window._root+'/cfg/wifi/scan',d)}function f(a){setTimeout(e,a)}var g=['Open','WEP','WPA','WPA2','WPA/WPA2'];var h;a.init=function(a){$('.Row.range').forEach(function(a){var c=a.querySelector('input');var d=a.querySelector('.x-disp1');var e=a.querySelector('.x-disp2');var f=b(c);$(d).html(f),$(e).html(f),$(c).on('input',function(){f=b(c),$(d).html(f),$(e).html(f)})}),$('#forget-sta').on('click',function(){return c('','',''),!1}),c(a.sta_ssid,a.sta_password,a.sta_active_ip),h=a.sta_active_ssid},a.startScanning=function(){$('#ap-loader').removeClass('hidden'),$('#ap-scan').addClass('hidden'),$('#ap-loader .anim-dots').html('.'),e()}})(window.WiFi={});\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _tr={\"wifi.connected_ip_is\":\"Connected, IP is \",\"wifi.not_conn\":\"Not connected.\",\"wifi.enter_passwd\":\"Enter password for \\\":ssid:\\\"\"};module.exports=function(a){return _tr[a]||\"?\"+a+\"?\"};\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _require=__webpack_require__(0),qs=_require.qs,mk=_require.mk;var Notify=__webpack_require__(3);var TermScreen=__webpack_require__(13);var TermConnection=__webpack_require__(16);var TermInput=__webpack_require__(17);var TermUpload=__webpack_require__(18);var initSoftKeyboard=__webpack_require__(19);var attachDebugScreen=__webpack_require__(20);module.exports=function(a){var b=new TermScreen;var c=new TermConnection(b);var d=TermInput(c,b);var e=TermUpload(c,d,b);b.input=d,d.termUpload=e;var f=-1;c.on('open',function(){f=setTimeout(function(){b.window.statusScreen={title:'Connecting',loading:!0}},250)}),c.on('connect',function(){clearTimeout(f),b.window.statusScreen={title:'Waiting for content',loading:!0}}),c.on('load',function(){b.window.statusScreen&&(b.window.statusScreen=null)}),c.on('disconnect',function(){clearTimeout(f),b.window.statusScreen={title:'Disconnected'},b.screen=[],b.screenFG=[],b.screenBG=[],b.screenAttrs=[]}),c.on('silence',function(){b.window.statusScreen={title:'Waiting for server',loading:!0}}),c.on('ping-success',function(){b.window.statusScreen={title:'Re-connecting',loading:!0}}),c.init(),d.init(a),e.init(),Notify.init(),window.onerror=function(a,b,c,d){return Notify.show('<b>JS ERROR!</b><br>'+a+'<br>at '+b+':'+c+':'+d,1e4,!0),!1},qs('#screen').appendChild(b.canvas),b.load(a.labels,a),initSoftKeyboard(b,d),attachDebugScreen&&attachDebugScreen(b);var g=!1;var h=!1;var i=function(){g?(b.window.fitIntoWidth=window.screen.width,b.window.fitIntoHeight=window.screen.height):(b.window.fitIntoWidth=h?window.innerWidth-20:0,b.window.fitIntoHeight=h?window.innerHeight:0)};i(),window.addEventListener('resize',i);var j=function(){h=!h;var a=qs('#resize-button-icon');h?(a.classList.remove('icn-resize-small'),a.classList.add('icn-resize-full')):(a.classList.remove('icn-resize-full'),a.classList.add('icn-resize-small')),i()};if(qs('#term-fit-screen').addEventListener('click',function(){return j(),!1}),window.Element.prototype.requestFullscreen||window.Element.prototype.webkitRequestFullscreen){setInterval(function checkForFullscreen(){g&&(window.innerWidth!==window.screen.width||window.innerHeight!==window.screen.height)&&(g=!1,i())},500);var k=mk('a');k.href='#',k.addEventListener('click',function(a){a.preventDefault(),g=!0,i(),b.updateSize(),b.canvas.requestFullscreen?b.canvas.requestFullscreen():b.canvas.webkitRequestFullscreen()});var l=mk('i');l.classList.add('icn-resize-full'),k.appendChild(l);var m=mk('span');m.textContent='Fullscreen',k.appendChild(m),qs('#term-nav').insertBefore(k,qs('#term-nav').firstChild)}window.termScreen=b,window.conn=c,window.input=d,window.termUpl=e};\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _createClass=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,'value'in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();function _toConsumableArray(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError('this hasn\\'t been initialised - super() hasn\\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function _inherits(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var EventEmitter=__webpack_require__(5);var $=__webpack_require__(1);var _require=__webpack_require__(0),mk=_require.mk,qs=_require.qs;var notify=__webpack_require__(3);var ScreenParser=__webpack_require__(14);var ScreenRenderer=__webpack_require__(15);module.exports=function(a){function b(){_classCallCheck(this,b);var a=_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.canvas=mk('canvas'),a.ctx=a.canvas.getContext('2d'),a.parser=new ScreenParser(a),a.renderer=new ScreenRenderer(a),a._debug=null,'AudioContext'in window||'webkitAudioContext'in window?a.audioCtx=new(window.AudioContext||window.webkitAudioContext):console.warn('No AudioContext!'),a.input=new Proxy({},{get:function get(){return function(){return console.warn('TermScreen#input not set!')}}}),a.cursor={x:0,y:0,blinking:!0,visible:!0,hanging:!1,style:'block'},a._window={width:0,height:0,devicePixelRatio:1,fontFamily:'\"DejaVu Sans Mono\", \"Liberation Mono\", \"Inconsolata\", \"Menlo\", monospace',fontSize:20,gridScaleX:1,gridScaleY:1.2,fitIntoWidth:0,fitIntoHeight:0,debug:!1,graphics:0,statusScreen:null},a._windowScale=1,a.windowState={width:0,height:0,devicePixelRatio:0,gridScaleX:0,gridScaleY:0,fontFamily:'',fontSize:0,fitIntoWidth:0,fitIntoHeight:0},a.selection={selectable:!0,start:[0,0],end:[0,0]},a.mouseMode={clicks:!1,movement:!1};var c=a;a.window=new Proxy(a._window,{set:function set(a,b,d){return a[b]=d,c.scheduleSizeUpdate(),c.renderer.scheduleDraw('window:'+b+'='+d),c.emit('update-window:'+b,d),!0}}),a.bracketedPaste=!1,a.blinkingCellCount=0,a.reverseVideo=!1,a.screen=[],a.screenFG=[],a.screenBG=[],a.screenAttrs=[];var d=!1;var f=function(b,c){d||(d=!0,a.selection.start=a.selection.end=a.screenToGrid(b,c,!0),a.renderer.scheduleDraw('select-start'))};var g=function(b,c){d&&(a.selection.end=a.screenToGrid(b,c,!0),a.renderer.scheduleDraw('select-move'))};var h=function(b,c){d&&(d=!1,a.selection.end=a.screenToGrid(b,c,!0),a.renderer.scheduleDraw('select-end'),Object.assign(a.selection,a.getNormalizedSelection()))};a.canvas.addEventListener('mousedown',function(b){if((a.selection.selectable||b.altKey)&&0===b.button)f(b.offsetX,b.offsetY);else{var c;(c=a.input).onMouseDown.apply(c,_toConsumableArray(a.screenToGrid(b.offsetX,b.offsetY)).concat([b.button+1]))}}),window.addEventListener('mousemove',function(a){g(a.offsetX,a.offsetY)}),window.addEventListener('mouseup',function(a){h(a.offsetX,a.offsetY)});var i=null;var j=0;var k=!1;var l=function(b){var c=a.canvas.getBoundingClientRect();return[b.clientX-c.left,b.clientY-c.top]};return a.canvas.addEventListener('touchstart',function(a){i=l(a.touches[0]),k=!1,j=Date.now()}),a.canvas.addEventListener('touchmove',function(a){i=l(a.touches[0]),d||!1!=k?d&&(a.preventDefault(),g.apply(void 0,_toConsumableArray(i))):j<Date.now()-500&&f.apply(void 0,_toConsumableArray(i)),k=!0}),a.canvas.addEventListener('touchend',function(b){if(b.touches[0]&&(i=l(b.touches[0])),d){b.preventDefault(),h.apply(void 0,_toConsumableArray(i));var c=qs('#touch-select-menu');c.classList.add('open');var e=c.getBoundingClientRect();var f=a.gridToScreen((a.selection.start[0]+a.selection.end[0])/2,a.selection.start[1]-1);f[0]-=e.width/2,f[1]-=e.height/2,c.style.transform='translate('+f[0]+'px, '+f[1]+'px)'}k||a.emit('tap',Object.assign(b,{x:i[0],y:i[1]})),i=null}),a.on('tap',function(b){a.selection.start[0]!==a.selection.end[0]||a.selection.start[1]!==a.selection.end[1]?(a.selection.start=a.selection.end=[0,0],qs('#touch-select-menu').classList.remove('open'),a.renderer.scheduleDraw('select-reset')):(b.preventDefault(),a.emit('open-soft-keyboard'))}),$.ready(function(){var b=qs('#touch-select-copy-btn');b&&b.addEventListener('click',function(){a.copySelectionToClipboard()})}),a.canvas.addEventListener('mousemove',function(b){if(!d){var c;(c=a.input).onMouseMove.apply(c,_toConsumableArray(a.screenToGrid(b.offsetX,b.offsetY)))}}),a.canvas.addEventListener('mouseup',function(b){if(!d){var c;(c=a.input).onMouseUp.apply(c,_toConsumableArray(a.screenToGrid(b.offsetX,b.offsetY)).concat([b.button+1]))}}),a.canvas.addEventListener('wheel',function(b){if(a.mouseMode.clicks){var c;(c=a.input).onMouseWheel.apply(c,_toConsumableArray(a.screenToGrid(b.offsetX,b.offsetY)).concat([0<b.deltaY?1:-1])),b.preventDefault()}}),a.canvas.addEventListener('contextmenu',function(b){a.mouseMode.clicks&&b.preventDefault(),h(b.offsetX,b.offsetY)}),a}var c=Math.floor;return _inherits(b,a),_createClass(b,[{key:'scheduleSizeUpdate',value:function scheduleSizeUpdate(){var a=this;clearTimeout(this._scheduledSizeUpdate),this._scheduledSizeUpdate=setTimeout(function(){return a.updateSize()},1)}},{key:'getFont',value:function getFont(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};var b=a.style||'normal';var c=a.weight||'normal';return b+' normal '+c+' '+this.window.fontSize+'px '+this.window.fontFamily}},{key:'screenToGrid',value:function screenToGrid(a,b){var d=2<arguments.length&&void 0!==arguments[2]&&arguments[2];var e=this.getCellSize();return[c((a+(d?e.width/2:0))/e.width),c(b/e.height)]}},{key:'gridToScreen',value:function gridToScreen(a,b){var c=this;var d=2<arguments.length&&void 0!==arguments[2]&&arguments[2];var e=this.getCellSize();return[a*e.width,b*e.height].map(function(a){return d?a*c._windowScale:a})}},{key:'getCharSize',value:function getCharSize(){return this.ctx.font=this.getFont(),{width:c(this.ctx.measureText(' ').width),height:this.window.fontSize}}},{key:'getCellSize',value:function getCellSize(){var a=Math.ceil;var b=this.getCharSize();return{width:a(b.width*this.window.gridScaleX),height:a(b.height*this.window.gridScaleY)}}},{key:'updateSize',value:function updateSize(){var a=Math.round;this._window.devicePixelRatio=a(2*(this._windowScale*(window.devicePixelRatio||1)))/2;var b=!1;for(var h in this.windowState)this.windowState.hasOwnProperty(h)&&this.windowState[h]!==this.window[h]&&(b=!0,this.windowState[h]=this.window[h]);if(b){var c=this.window,d=c.width,e=c.height,f=c.fitIntoWidth,g=c.fitIntoHeight;var i=this.getCellSize();var j=d*i.width;var k=e*i.height;if(f&&g){var l=j/k;l<f/g?(k=g,j=k*l):(j=f,k=j/l)}else f?(k=f/(j/k),j=f):g&&(j=g*(j/k),k=g);this._windowScale=j/(d*i.width);var m=this._window.devicePixelRatio=a(2*(this._windowScale*(window.devicePixelRatio||1)))/2;this.canvas.width=d*m*i.width,this.canvas.style.width=j+'px',this.canvas.height=e*m*i.height,this.canvas.style.height=k+'px',this.renderer.resetDrawn(),this.renderer.draw('update-size')}}},{key:'getNormalizedSelection',value:function getNormalizedSelection(){var a=this.selection,b=a.start,c=a.end;if(b[1]>c[1]||b[1]===c[1]&&b[0]>c[0]){var d=[c,b];b=d[0],c=d[1]}return{start:b,end:c}}},{key:'isInSelection',value:function isInSelection(a,b){var c=this.getNormalizedSelection(),d=c.start,e=c.end;var f=d[0]<=a;var g=a<e[0];var h=b===d[1];var i=b===e[1];return h&&i?f&&g:h?f:i?g:d[1]<b&&b<e[1]}},{key:'getSelectedText',value:function getSelectedText(){var a=this.window.width*this.window.height;var b=[];var d=-1;for(var e=0;e<a;e++){var f=e%this.window.width;var g=c(e/this.window.width);this.isInSelection(f,g)&&(d!==g&&(d=g,b.push('')),b[b.length-1]+=this.screen[e])}return b.join('\\n')}},{key:'copySelectionToClipboard',value:function copySelectionToClipboard(){var a=this.getSelectedText();if(a){var b=mk('textarea');document.body.appendChild(b),b.value=a,b.select(),document.execCommand('copy')?notify.show('Copied to clipboard'):notify.show('Failed to copy'),document.body.removeChild(b)}}},{key:'showNotification',value:function showNotification(a){if(console.info('Notification: '+a),window.Notification&&'granted'===window.Notification.permission){var b=new window.Notification('ESPTerm',{body:a});b.addEventListener('click',function(){return window.focus()})}else window.Notification&&'denied'!==window.Notification.permission?window.Notification.requestPermission():notify.show(a)}},{key:'beep',value:function beep(){var a=Math.pow;var b=this.audioCtx;if(b&&!(this._lastBeep&&this._lastBeep>Date.now()-50)){if(this._lastBeep=Date.now(),!this._convolver){this._convolver=b.createConvolver();var j=0.8*b.sampleRate;var k=b.createBuffer(2,j,b.sampleRate);for(var l=0;l<j;l++)k.getChannelData(0)[l]=a(1-l/j,7+Math.random()),k.getChannelData(1)[l]=a(1-l/j,7+Math.random());this._convolver.buffer=k,this._convolver.connect(b.destination)}var c=b.createOscillator();var d=b.createGain();c.connect(d),d.gain.value=6,c.frequency.value=750,c.type='sine';var e=b.createOscillator();var f=b.createGain();e.connect(f),f.gain.value=4,e.frequency.value=400,e.type='sine',d.connect(this._convolver),f.connect(this._convolver);var g=b.currentTime;c.start(),c.stop(g+0.5),e.start(g+0.05),e.stop(g+0.8);var h=function(){b.currentTime<g+0.8&&window.requestAnimationFrame(h),d.gain.value*=0.8,f.gain.value*=0.8};h()}}},{key:'load',value:function load(){var a;(a=this.parser).load.apply(a,arguments)}}]),b}(EventEmitter);\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _createClass=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,'value'in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}var $=__webpack_require__(1);var _require=__webpack_require__(0),qs=_require.qs;var _require2=__webpack_require__(4),themes=_require2.themes;var SEQ_REPEAT=2;var SEQ_SET_COLORS=3;var SEQ_SET_ATTRS=4;var SEQ_SET_FG=5;var SEQ_SET_BG=6;module.exports=function(){function a(b){_classCallCheck(this,a),this.screen=b,this.contentLoaded=!1}return _createClass(a,[{key:'loadContent',value:function loadContent(a){var b=this;var c=0;var d=Array.from?Array.from(a):a.split('');if(!this.contentLoaded){var y=qs('#load-failed');y&&y.parentNode.removeChild(y),this.contentLoaded=!0}var e=d[c++].codePointAt(0)-1;var f=d[c++].codePointAt(0)-1;var g=this.screen.window.height!==e||this.screen.window.width!==f;this.screen.window.height=e,this.screen.window.width=f;var h=d[c++].codePointAt(0)-1,i=d[c++].codePointAt(0)-1;var k=i!==this.screen.cursor.x||h!==this.screen.cursor.y;this.screen.cursor.x=i,this.screen.cursor.y=h,k&&(this.screen.renderer.resetCursorBlink(),this.screen.emit('cursor-moved'));var l=d[c++].codePointAt(0)-1;this.screen.cursor.visible=!!(1&l),this.screen.cursor.hanging=!!(2&l),this.screen.input.setAlts(!!(4&l),!!(8&l),!!(16&l),!!(4096&l));var m=!!(32&l);var n=!!(64&l);var o=7&l>>9;0<o&&o--;var p=o>>1;var q=!(1&o);0==p?this.screen.cursor.style='block':1==p?this.screen.cursor.style='line':2==p&&(this.screen.cursor.style='bar'),this.screen.cursor.blinking!==q&&(this.screen.cursor.blinking=q,this.screen.renderer.resetCursorBlink()),this.screen.input.setMouseMode(m,n),this.screen.selection.selectable=!m&&!n,$(this.screen.canvas).toggleClass('selectable',this.screen.selection.selectable),this.screen.mouseMode={clicks:m,movement:n};$('.x-term-conf-btn').toggleClass('hidden',!!!(256&l)),$('#action-buttons').toggleClass('hidden',!!!(128&l)),this.screen.bracketedPaste=!!(8192&l),this.screen.reverseVideo=!!(16384&l);var r=7;var s=0;var t=0;var u=0;var v=' ';var w=this.screen.window.width*this.screen.window.height;g&&(this.screen.updateSize(),this.screen.blinkingCellCount=0,this.screen.screen=Array(w).fill(' '),this.screen.screenFG=Array(w).fill(' '),this.screen.screenBG=Array(w).fill(' '),this.screen.screenAttrs=Array(w).fill(0));var x=16;for(var z=function(){var a=t;var c=256&t;var d=512&t;0!=(a&x)&&(' '==v&&0==(a&200)||r==s&&c&&d)&&(a^=x),(b.screen.screenAttrs[u]&x)!=(a&x)&&(a&x?b.screen.blinkingCellCount++:b.screen.blinkingCellCount--),b.screen.screen[u]=v,b.screen.screenFG[u]=r,b.screen.screenBG[u]=s,b.screen.screenAttrs[u]=a};c<d.length&&u<w;){var A=d[c++];var B=A.codePointAt(0);var C=void 0;switch(B){case SEQ_REPEAT:var D=d[c++].codePointAt(0)-1;for(var E=0;E<D&&(z(),!(++u>w));E++);break;case SEQ_SET_COLORS:C=d[c++].codePointAt(0)-1,r=255&C,s=255&C>>8;break;case SEQ_SET_ATTRS:C=d[c++].codePointAt(0)-1,t=65535&C;break;case SEQ_SET_FG:C=d[c++].codePointAt(0)-1,r=255&C;break;case SEQ_SET_BG:C=d[c++].codePointAt(0)-1,s=255&C;break;default:32>B&&(A='\\uFFFD'),v=A,z(),u++;}}this.screen.window.debug&&console.log('Blinky cells: '+this.screen.blinkingCellCount),this.screen.renderer.scheduleDraw('load',16),this.screen.emit('load')}},{key:'loadLabels',value:function loadLabels(a){var b=a.split('\\x01');var c=b[0];qs('#screen-title').textContent=c,0===c.length&&(c='Terminal'),qs('title').textContent=c+' :: ESPTerm',$('#action-buttons button').forEach(function(a,c){var d=b[c+1].trim();a.innerHTML=d?$.htmlEscape(d):'&nbsp;',a.style.opacity=d?1:0.2})}},{key:'load',value:function load(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;var c=a.substr(1);switch(b&&('undefined'!=typeof b.defaultFg&&'undefined'!=typeof b.defaultBg&&this.screen.renderer.setDefaultColors(b.defaultFg,b.defaultBg),'undefined'!=typeof b.theme&&0<=b.theme&&b.theme<themes.length&&(this.screen.renderer.palette=themes[b.theme])),a[0]){case'S':this.loadContent(c);break;case'T':this.loadLabels(c);break;case'B':this.screen.beep();break;case'G':this.screen.showNotification(c);break;default:console.warn('Bad data message type; ignoring.\\n'+JSON.stringify(a));}}}]),a}();\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _createClass=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,'value'in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}var _require=__webpack_require__(4),themes=_require.themes,buildColorTable=_require.buildColorTable,SELECTION_FG=_require.SELECTION_FG,SELECTION_BG=_require.SELECTION_BG;var frakturExceptions={C:'\\u212D',H:'\\u210C',I:'\\u2111',R:'\\u211C',Z:'\\u2128'};module.exports=function(){function a(b){_classCallCheck(this,a),this.screen=b,this.ctx=b.ctx,this._palette=null,this.defaultBgNum=0,this.defaultFgNum=7,this.colorTable256=buildColorTable(),this.resetDrawn(),this.blinkStyleOn=!1,this.blinkInterval=null,this.cursorBlinkOn=!1,this.cursorBlinkInterval=null,this.resetBlink(),this.resetCursorBlink()}return _createClass(a,[{key:'resetDrawn',value:function resetDrawn(){this.drawnScreen=[],this.drawnScreenFG=[],this.drawnScreenBG=[],this.drawnScreenAttrs=[],this.drawnCursor=[-1,-1,'']}},{key:'setDefaultColors',value:function setDefaultColors(a,b){this.defaultFgNum=a,this.defaultBgNum=b,this.resetDrawn(),this.scheduleDraw('defaultColors')}},{key:'scheduleDraw',value:function scheduleDraw(a){var b=this;var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;clearTimeout(this._scheduledDraw),this._scheduledDraw=setTimeout(function(){return b.draw(a)},c)}},{key:'getColor',value:function getColor(a){if(16>a&&a in this.palette)return this.palette[a];if(-1===a)return SELECTION_FG;if(-2===a)return SELECTION_BG;if(15<a&&256>a)return this.colorTable256[a];if(255<a){a-=256;var b=255&a>>16;var c=255&a>>8;var d=255&a;return'rgb('+b+', '+c+', '+d+')'}return 0==Date.now()/1e3%2?'#f0f':'#0f0'}},{key:'resetCursorBlink',value:function resetCursorBlink(){var a=this;this.cursorBlinkOn=!0,clearInterval(this.cursorBlinkInterval),this.cursorBlinkInterval=setInterval(function(){a.cursorBlinkOn=!a.screen.cursor.blinking||!a.cursorBlinkOn,a.screen.cursor.blinking&&a.scheduleDraw('cursor-blink')},500)}},{key:'resetBlink',value:function resetBlink(){var a=this;this.blinkStyleOn=!0,clearInterval(this.blinkInterval);var b=0;this.blinkInterval=setInterval(function(){0>=a.screen.blinkingCellCount||(b++,4<=b&&a.blinkStyleOn?(a.blinkStyleOn=!1,b=0,a.scheduleDraw('blink-style')):1<=b&&!a.blinkStyleOn&&(a.blinkStyleOn=!0,b=0,a.scheduleDraw('blink-style')))},200)}},{key:'drawBackground',value:function drawBackground(a){var b=a.x,c=a.y,d=a.cellWidth,e=a.cellHeight,f=a.bg;var g=this.ctx;g.fillStyle=this.getColor(f),g.clearRect(b*d,c*e,d,e),g.fillRect(b*d,c*e,d,e)}},{key:'drawCharacter',value:function drawCharacter(b){var c=Math.round;var d=b.x,e=b.y,f=b.charSize,g=b.cellWidth,h=b.cellHeight,i=b.text,j=b.fg,k=b.attrs;if(i){var l=this.ctx;var m=!1;var n=!1;var o=!1;2&k&&(l.globalAlpha=0.5),8&k&&(m=!0),32&k&&(i=a.alphaToFraktur(i)),64&k&&(n=!0),128&k&&(o=!0),l.fillStyle=this.getColor(j);var p=i.codePointAt(0);if(9600<=p&&9631>=p){l.beginPath();var q=d*g;var r=e*h;var s=g;var t=h;var u=g/2;var v=h/2;if(9600===p)l.rect(q,r,s,v);else if(9608>=p){var w=(1-(p-9600)/8)*t;l.rect(q,r+w,s,t-w)}else if(9615>=p){l.rect(q,r,s-(p-9608)/8*s,t)}else if(9616===p)l.rect(q+u,r,u,t);else if(9619>=p){var x,y,z;9617===p?(x=s/4,y=t/10,z=1):9618===p?(x=s/6,y=s/10,z=1):9619===p&&(x=s/4,y=s/7,z=2);var A=!1;for(var B=0;B<t;B+=y){for(var C=0;C<s;C+=x){var D=Math.min(z,t-B);l.rect(d*s+(A?s-C-z:C),e*t+B,z,D)}A=!A}}else 9620===p?l.rect(d*s,e*t,s,t/8):9621===p?l.rect((d+7/8)*s,e*t,s/8,t):9622===p?l.rect(q,r+v,u,v):9623===p?l.rect(q+u,r+v,u,v):9624===p?l.rect(q,r,u,v):9625===p?(l.rect(q,r,u,t),l.rect(q+u,r+v,u,v)):9626===p?(l.rect(q,r,u,v),l.rect(q+u,r+v,u,v)):9627===p?(l.rect(q,r,u,t),l.rect(q+u,r,u,v)):9628===p?(l.rect(q,r,s,v),l.rect(q+u,r+v,u,v)):9629===p?l.rect(q+u,r,u,v):9630===p?(l.rect(q,r+v,u,v),l.rect(q+u,r,u,v)):9631===p&&(l.rect(q,r+v,u,v),l.rect(q+u,r,u,t));l.fill()}else l.fillText(i,(d+0.5)*g,(e+0.5)*h);if(m||n||o){if(l.strokeStyle=this.getColor(j),l.lineWidth=1,l.lineCap='round',l.beginPath(),m){var E=c(e*h+f.height)+0.5;l.moveTo(d*g,E),l.lineTo((d+1)*g,E)}if(n){var F=c((e+0.5)*h)+0.5;l.moveTo(d*g,F),l.lineTo((d+1)*g,F)}if(o){var G=c(e*h)+0.5;l.moveTo(d*g,G),l.lineTo((d+1)*g,G)}l.stroke()}l.globalAlpha=1}}},{key:'getAdjacentCells',value:function getAdjacentCells(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;var c=this.screen.window,d=c.width,e=c.height;var f=[];for(var g=-b;g<=b;g++)for(var h=-b;h<=b;h++)(0!==g||0!==h)&&f.push(a+g+h*d);return f.filter(function(a){return 0<=a&&a<d*e})}},{key:'draw',value:function draw(a){var b=this;var c=this.ctx;var d=this.screen.window,e=d.width,f=d.height,g=d.devicePixelRatio,h=d.statusScreen;if(h)return this.drawStatus(h),void this.startDrawLoop();this.stopDrawLoop();var i=this.screen.getCharSize();var j=this.screen.getCellSize(),k=j.width,l=j.height;c.setTransform(g,0,0,g,0,0),this.screen.window.debug&&this.screen._debug&&this.screen._debug.drawStart(a),c.font=this.screen.getFont(),c.textAlign='center',c.textBaseline='middle';var m=new Map;var n=new Map;for(var ha=0;ha<e*f;ha++){var ia=ha%e;var ja=Math.floor(ha/e);var ka=!this.screen.cursor.hanging&&this.screen.cursor.x===ia&&this.screen.cursor.y===ja&&this.screen.cursor.visible&&this.cursorBlinkOn;var la=ia===this.drawnCursor[0]&&ja===this.drawnCursor[1];var ma=this.screen.isInSelection(ia,ja);var na=this.screen.screen[ha];var oa=0|this.screen.screenFG[ha];var pa=0|this.screen.screenBG[ha];var qa=0|this.screen.screenAttrs[ha];if(256&qa||(oa=this.defaultFgNum),512&qa||(pa=this.defaultBgNum),1024&qa){var o=[pa,oa];oa=o[0],pa=o[1]}if(this.screen.reverseVideo){var p=[pa,oa];oa=p[0],pa=p[1]}16&qa&&!this.blinkStyleOn&&(na=''),ma&&(oa=-1,pa=-2);var ra=na!==this.drawnScreen[ha]||oa!==this.drawnScreenFG[ha]||pa!==this.drawnScreenBG[ha]||qa!==this.drawnScreenAttrs[ha]||ka!==la||ka&&this.screen.cursor.style!==this.drawnCursor[2];var sa=qa&5;m.has(sa)||m.set(sa,[]),m.get(sa).push({cell:ha,x:ia,y:ja,text:na,fg:oa,bg:pa,attrs:qa,isCursor:ka,inSelection:ma}),n.set(ha,ra)}var q=new Map;var r=function(a){return' '!==a&&c.measureText(a).width>=k+0.05};var s=function(a){var c=n.get(a)||q.get(a)||!1;var d=b.screen.screen[a];var e=r(d);var f=e?2:1;if(!c){var l=!1;var g=!0;var h=!1;var i=void 0;try{for(var j,k=b.getAdjacentCells(a,f)[Symbol.iterator]();!(g=(j=k.next()).done);g=!0){var m=j.value;if(n.get(m)&&(2>b.screen.window.graphics||e||r(b.screen.screen[m]))){l=!0;break}}}catch(a){h=!0,i=a}finally{try{!g&&k.return&&k.return()}finally{if(h)throw i}}l&&(c=!0)}q.set(a,c)};var t=!0;var u=!1;var v=void 0;try{for(var w,z=n.keys()[Symbol.iterator]();!(t=(w=z.next()).done);t=!0){var x=w.value;s(x)}}catch(a){u=!0,v=a}finally{try{!t&&z.return&&z.return()}finally{if(u)throw v}}if(1<=this.screen.window.graphics){var y=this.screen.window.debug&&this.screen._debug;c.save(),c.beginPath();for(var ta=0;ta<f;ta++){var ua=null;for(var va=0;va<e;va++){var wa=ta*e+va;var xa=q.get(wa);xa&&null==ua&&(ua=va),xa||null===ua||(c.rect(ua*k,ta*l,(va-ua)*k,l),y&&this.screen._debug.clipRect(ua*k,ta*l,(va-ua)*k,l),ua=null)}null!==ua&&(c.rect(ua*k,ta*l,(e-ua)*k,l),y&&this.screen._debug.clipRect(ua*k,ta*l,(e-ua)*k,l))}c.clip()}var A=!0;var B=!1;var C=void 0;try{for(var D,E=m.keys()[Symbol.iterator]();!(A=(D=E.next()).done);A=!0){var ya=D.value;var F=!0;var G=!1;var H=void 0;try{for(var I,J=m.get(ya)[Symbol.iterator]();!(F=(I=J.next()).done);F=!0){var za=I.value;var K=za.cell,L=za.x,M=za.y,N=za.text,O=za.bg;if(q.get(K)&&(this.drawBackground({x:L,y:M,cellWidth:k,cellHeight:l,bg:O}),this.screen.window.debug&&this.screen._debug)){var Aa=+q.get(K);Aa|=+n.get(K)<<1,Aa|=+r(N)<<2,this.screen._debug.setCell(K,Aa)}}}catch(a){G=!0,H=a}finally{try{!F&&J.return&&J.return()}finally{if(G)throw H}}}}catch(a){B=!0,C=a}finally{try{!A&&E.return&&E.return()}finally{if(B)throw C}}this.drawnCursor=[-1,-1,-1];var P=!0;var Q=!1;var R=void 0;try{for(var S,T=m.keys()[Symbol.iterator]();!(P=(S=T.next()).done);P=!0){var Ba=S.value;var Ca={};1&Ba&&(Ca.weight='bold'),4&Ba&&(Ca.style='italic'),c.font=this.screen.getFont(Ca);var U=!0;var V=!1;var W=void 0;try{for(var X,Y=m.get(Ba)[Symbol.iterator]();!(U=(X=Y.next()).done);U=!0){var Da=X.value;var Z=Da.cell,$=Da.x,_=Da.y,aa=Da.text,ba=Da.fg,ca=Da.bg,da=Da.attrs,ea=Da.isCursor,fa=Da.inSelection;if(q.get(Z)&&(this.drawCharacter({x:$,y:_,charSize:i,cellWidth:k,cellHeight:l,text:aa,fg:ba,attrs:da}),this.drawnScreen[Z]=aa,this.drawnScreenFG[Z]=ba,this.drawnScreenBG[Z]=ca,this.drawnScreenAttrs[Z]=da,ea&&(this.drawnCursor=[$,_,this.screen.cursor.style]),ea&&!fa)){if(c.save(),c.beginPath(),'block'===this.screen.cursor.style)c.rect($*k,_*l,k,l);else if('bar'===this.screen.cursor.style){c.rect($*k,_*l,2,l)}else if('line'===this.screen.cursor.style){c.rect($*k,_*l+i.height,k,2)}c.clip();var ga=[ca,ba];ba=ga[0],ca=ga[1],ba===ca&&(ca=0===ba?7:0),this.drawBackground({x:$,y:_,cellWidth:k,cellHeight:l,bg:ca}),this.drawCharacter({x:$,y:_,charSize:i,cellWidth:k,cellHeight:l,text:aa,fg:ba,attrs:da}),c.restore()}}}catch(a){V=!0,W=a}finally{try{!U&&Y.return&&Y.return()}finally{if(V)throw W}}}}catch(a){Q=!0,R=a}finally{try{!P&&T.return&&T.return()}finally{if(Q)throw R}}1<=this.screen.window.graphics&&c.restore(),this.screen.window.debug&&this.screen._debug&&this.screen._debug.drawEnd(),this.screen.emit('draw')}},{key:'drawStatus',value:function drawStatus(a){var b=this.ctx;var c=this.screen.window,d=c.fontFamily,e=c.width,f=c.height,g=c.devicePixelRatio;this.drawnScreen=[];var h=this.screen.getCellSize();var j=e*h.width;var k=f*h.height;if(b.setTransform(g,0,0,g,0,0),b.clearRect(0,0,j,k),b.font='24px '+d,b.fillStyle='#fff',b.textAlign='center',b.textBaseline='middle',b.fillText(a.title||'',j/2,k/2-50),a.loading){b.save(),b.translate(j/2,k/2+20),b.strokeStyle='#fff',b.lineWidth=5,b.lineCap='round';var l=Date.now()/1e3;for(var m=0;12>m;m++){b.rotate(Math.PI/6);var i=(12*l-m)%12;b.globalAlpha=Math.max(0.2,1-i/3),b.beginPath(),b.moveTo(0,15),b.lineTo(0,30),b.stroke()}b.restore()}}},{key:'startDrawLoop',value:function startDrawLoop(){if(!this._drawTimerThread){var a=Math.random().toString(36);this._drawTimerThread=a,this.drawTimerLoop(a)}}},{key:'stopDrawLoop',value:function stopDrawLoop(){this._drawTimerThread=null}},{key:'drawTimerLoop',value:function drawTimerLoop(a){var b=this;a&&a===this._drawTimerThread&&(window.requestAnimationFrame(function(){return b.drawTimerLoop(a)}),this.draw('draw-loop'))}},{key:'palette',get:function get(){return this._palette||themes[0]},set:function set(a){this._palette!==a&&(this._palette=a,this.resetDrawn(),this.scheduleDraw('palette'))}}],[{key:'alphaToFraktur',value:function alphaToFraktur(a){var b=String.fromCodePoint;return'a'<=a&&'z'>=a?a=b(119997+a.charCodeAt(0)):'A'<=a&&'Z'>=a&&(a=frakturExceptions[a]||b(120003+a.charCodeAt(0))),a}}]),a}();\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _createClass=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,'value'in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError('this hasn\\'t been initialised - super() hasn\\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function _inherits(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var EventEmitter=__webpack_require__(5);var $=__webpack_require__(1);var demo;try{demo=__webpack_require__(6)}catch(a){}module.exports=function(a){function b(a){_classCallCheck(this,b);var c=_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));return c.screen=a,c.ws=null,c.heartbeatTimeout=null,c.pingInterval=null,c.xoff=!1,c.autoXoffTimeout=null,c.reconnTimeout=null,c.forceClosing=!1,c.pageShown=!1,document.addEventListener('visibilitychange',function(){!0===document.hidden?(console.info('Window lost focus, freeing socket'),c.closeSocket(),clearTimeout(c.heartbeatTimeout)):(console.info('Window got focus, re-connecting'),c.init())},!1),c}return _inherits(b,a),_createClass(b,[{key:'onWSOpen',value:function onWSOpen(){console.log('CONNECTED'),this.heartbeat(),this.send('i'),this.forceClosing=!1,this.emit('connect')}},{key:'onWSClose',value:function onWSClose(a){var b=this;return this.forceClosing?void(this.forceClosing=!1):void(console.warn('SOCKET CLOSED, code '+a.code+'. Reconnecting...'),1e3>a.code&&console.error('Bad code from socket!'),clearTimeout(this.reconnTimeout),this.reconnTimeout=setTimeout(function(){return b.init()},2e3),this.emit('disconnect',a.code))}},{key:'onWSMessage',value:function onWSMessage(a){var b=this;try{switch(a.data.charAt(0)){case'.':break;case'-':this.xoff=!0,this.autoXoffTimeout=setTimeout(function(){b.xoff=!1},250);break;case'+':this.xoff=!1,clearTimeout(this.autoXoffTimeout);break;default:this.emit('load'),this.screen.load(a.data),this.pageShown||(window.showPage(),this.pageShown=!0);}this.heartbeat()}catch(a){console.error(a)}}},{key:'canSend',value:function canSend(){return!this.xoff}},{key:'send',value:function send(a){return window._demo?('undefined'==typeof window.demoInterface?console.log('TX: '+JSON.stringify(a)):demo.input(a),!0):this.xoff?(console.log('Can\\'t send, flood control.'),!1):!!this.ws&&(1===this.ws.readyState?('string'!=typeof a&&(a=JSON.stringify(a)),this.ws.send(a),!0):(console.error('Socket not ready'),!1))}},{key:'closeSocket',value:function closeSocket(){this.ws&&(this.forceClosing=!0,this.ws.close(),this.ws=null)}},{key:'init',value:function init(){var a=this;return window._demo?void('undefined'==typeof window.demoInterface?window.alert('Demoing non-demo build!'):demo.init(this.screen)):void(clearTimeout(this.reconnTimeout),clearTimeout(this.heartbeatTimeout),this.closeSocket(),this.ws=new window.WebSocket('ws://'+window._root+'/term/update.ws'),this.ws.addEventListener('open',function(){return a.onWSOpen.apply(a,arguments)}),this.ws.addEventListener('close',function(){return a.onWSClose.apply(a,arguments)}),this.ws.addEventListener('message',function(){return a.onWSMessage.apply(a,arguments)}),console.log('Opening socket.'),this.heartbeat(),this.emit('open'))}},{key:'heartbeat',value:function heartbeat(){var a=this;clearTimeout(this.heartbeatTimeout),this.heartbeatTimeout=setTimeout(function(){return a.onHeartbeatFail()},2e3)}},{key:'onHeartbeatFail',value:function onHeartbeatFail(){var a=this;this.closeSocket(),this.emit('silence'),console.error('Heartbeat lost, probing server...'),clearInterval(this.pingInterval),this.pingInterval=setInterval(function(){console.log('> ping'),a.emit('ping'),$.get('http://'+window._root+'/system/ping',function(b,c){200===c?(clearInterval(a.pingInterval),console.info('Server ready, opening socket\\u2026'),a.emit('ping-success'),a.init()):a.emit('ping-fail',c)},{timeout:100,loader:!1})},1e3)}}]),b}(EventEmitter);\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar $=__webpack_require__(1);var _require=__webpack_require__(0),encode2B=_require.encode2B;module.exports=function(a,b){function c(b){return a.send('s'+b)}function d(b){a.send('b'+g(b))}function e(a){var d=a.allFn;window.addEventListener('keypress',function(a){if(p()&&!(a.ctrlKey||a.metaKey)){var b='';a.key&&1===a.key.length?b=a.key:a.which&&229!==a.which&&(b=String.fromCodePoint(a.which)),0<b.length&&32<=b.charCodeAt(0)&&(32===a.which&&a.preventDefault(),c(b))}}),window.addEventListener('keydown',r),window.addEventListener('copy',function(a){if(p()){var c=b.getSelectedText();c&&(a.preventDefault(),a.clipboardData.setData('text/plain',c))}}),window.addEventListener('paste',function(a){if(p()){a.preventDefault();var d=a.clipboardData.getData('text/plain');d.includes('\\n')||90<d.length?(!h.termUpload&&console.error('input.termUpload is undefined'),h.termUpload.setContent(d),h.termUpload.open()):(b.bracketedPaste&&(d='\\x1B[200~'+d+'\\x1B[201~'),c(d))}}),k.all_fn=d}function f(){return v}var g=String.fromCharCode;var h;var j={3:'Cancel',6:'Help',8:'Backspace',9:'Tab',12:'Clear',13:'Enter',16:'Shift',17:'Control',18:'Alt',19:'Pause',20:'CapsLock',27:'Escape',32:' ',33:'PageUp',34:'PageDown',35:'End',36:'Home',37:'ArrowLeft',38:'ArrowUp',39:'ArrowRight',40:'ArrowDown',41:'Select',42:'Print',43:'Execute',44:'PrintScreen',45:'Insert',46:'Delete',58:':',59:';',60:'<',61:'=',62:'>',63:'?',64:'@',91:'Meta',92:'Meta',93:'ContextMenu',106:'Numpad*',107:'Numpad+',109:'Numpad-',110:'Numpad.',111:'Numpad/',144:'NumLock',145:'ScrollLock',160:'^',161:'!',162:'\"',163:'#',164:'$',165:'%',166:'&',167:'_',168:'(',169:')',170:'*',171:'+',172:'|',173:'-',174:'{',175:'}',176:'~',186:';',187:'=',188:'Numpad,',189:'-',190:'Numpad,',192:'`',194:'Numpad,',219:'[',220:'\\\\',221:']',222:'\\'',224:'Meta'};for(var w=48;57>=w;w++)j[w]=g(w);for(var i=65;90>=i;i++)j[i]=g(i);for(var x=112;131>=x;x++)j[x]='F'+(x-112+1);for(var y=96;105>=y;y++)j[y]='Numpad'+(y-96);var k={np_alt:!1,cu_alt:!1,fn_alt:!1,mt_click:!1,mt_move:!1,no_keys:!1,crlf_mode:!1,all_fn:!1};var l=function(a,b){return k.fn_alt?a:b};var m=function(a,b){return k.cu_alt?a:b};var n=function(a,b){return k.np_alt?a:b};var o={Backspace:'\\b',Tab:'\\t',Enter:function Enter(){return k.crlf_mode?'\\r\\n':'\\r'},\"Control+Enter\":'\\n',Escape:'\\x1B',ArrowUp:function ArrowUp(){return m('\\x1BOA','\\x1B[A')},ArrowDown:function ArrowDown(){return m('\\x1BOB','\\x1B[B')},ArrowRight:function ArrowRight(){return m('\\x1BOC','\\x1B[C')},ArrowLeft:function ArrowLeft(){return m('\\x1BOD','\\x1B[D')},Home:function Home(){return m('\\x1BOH',l('\\x1B[H','\\x1B[1~'))},Insert:'\\x1B[2~',Delete:'\\x1B[3~',End:function End(){return m('\\x1BOF',l('\\x1B[F','\\x1B[4~'))},PageUp:'\\x1B[5~',PageDown:'\\x1B[6~',F1:function F1(){return l('\\x1BOP','\\x1B[11~')},F2:function F2(){return l('\\x1BOQ','\\x1B[12~')},F3:function F3(){return l('\\x1BOR','\\x1B[13~')},F4:function F4(){return l('\\x1BOS','\\x1B[14~')},F5:'\\x1B[15~',F6:'\\x1B[17~',F7:'\\x1B[18~',F8:'\\x1B[19~',F9:'\\x1B[20~',F10:'\\x1B[21~',F11:'\\x1B[23~',F12:'\\x1B[24~',\"Shift+F1\":function ShiftF1(){return l('\\x1BO1;2P','\\x1B[25~')},\"Shift+F2\":function ShiftF2(){return l('\\x1BO1;2Q','\\x1B[26~')},\"Shift+F3\":function ShiftF3(){return l('\\x1BO1;2R','\\x1B[28~')},\"Shift+F4\":function ShiftF4(){return l('\\x1BO1;2S','\\x1B[29~')},\"Shift+F5\":function ShiftF5(){return l('\\x1B[15;2~','\\x1B[31~')},\"Shift+F6\":function ShiftF6(){return l('\\x1B[17;2~','\\x1B[32~')},\"Shift+F7\":function ShiftF7(){return l('\\x1B[18;2~','\\x1B[33~')},\"Shift+F8\":function ShiftF8(){return l('\\x1B[19;2~','\\x1B[34~')},\"Shift+F9\":function ShiftF9(){return l('\\x1B[20;2~','\\x1B[35~')},\"Shift+F10\":function ShiftF10(){return l('\\x1B[21;2~','\\x1B[36~')},\"Shift+F11\":function ShiftF11(){return l('\\x1B[22;2~','\\x1B[37~')},\"Shift+F12\":function ShiftF12(){return l('\\x1B[23;2~','\\x1B[38~')},Numpad0:function Numpad0(){return n('\\x1BOp','0')},Numpad1:function Numpad1(){return n('\\x1BOq','1')},Numpad2:function Numpad2(){return n('\\x1BOr','2')},Numpad3:function Numpad3(){return n('\\x1BOs','3')},Numpad4:function Numpad4(){return n('\\x1BOt','4')},Numpad5:function Numpad5(){return n('\\x1BOu','5')},Numpad6:function Numpad6(){return n('\\x1BOv','6')},Numpad7:function Numpad7(){return n('\\x1BOw','7')},Numpad8:function Numpad8(){return n('\\x1BOx','8')},Numpad9:function Numpad9(){return n('\\x1BOy','9')},\"Numpad*\":function Numpad(){return n('\\x1BOR','*')},\"Numpad+\":function Numpad(){return n('\\x1BOl','+')},\"Numpad-\":function Numpad(){return n('\\x1BOS','-')},\"Numpad.\":function Numpad(){return n('\\x1BOn','.')},\"Numpad/\":function Numpad(){return n('\\x1BOQ','/')},\"Control+]\":'\\x1B',\"Control+\\\\\":'\\x1C',\"Control+[\":'\\x1D',\"Control+^\":'\\x1E',\"Control+_\":'\\x1F',\"Control+ArrowLeft\":'\\x1F[1;5D',\"Control+ArrowRight\":'\\x1F[1;5C',\"Control+ArrowUp\":'\\x1F[1;5A',\"Control+ArrowDown\":'\\x1F[1;5B',\"Control+Home\":'\\x1F[1;5H',\"Control+End\":'\\x1F[1;5F',\"Shift+ArrowLeft\":'\\x1F[1;2D',\"Shift+ArrowRight\":'\\x1F[1;2C',\"Shift+ArrowUp\":'\\x1F[1;2A',\"Shift+ArrowDown\":'\\x1F[1;2B',\"Shift+Home\":'\\x1F[1;2H',\"Shift+End\":'\\x1F[1;2F',\"Alt+ArrowLeft\":'\\x1Bb',\"Alt+ArrowRight\":'\\x1Bf',\"Meta+ArrowLeft\":'\\x01',\"Meta+ArrowRight\":'\\x05',\"Alt+Backspace\":'\\x17',\"Meta+Backspace\":'\\x15',\"Control+Shift+C\":function ControlShiftC(){b.copySelectionToClipboard()},\"Control+Insert\":function ControlInsert(){b.copySelectionToClipboard()},\"Control+F12\":function ControlF12(){b.window.debug^=1}};for(var z=1;26>=z;z++)o['Control+'+g(64+z)]=g(z);var p=function(){return!k.no_keys&&!(document.activeElement instanceof window.HTMLTextAreaElement)};var q=['F5','F11','F12','Shift+F5'];var r=function(a){if(p()&&!k.no_keys){var b=[];a.altKey&&b.push('Alt'),a.ctrlKey&&b.push('Control'),a.metaKey&&b.push('Meta'),a.shiftKey&&b.push('Shift');var d=j[a.which]||a.key;if(!((a.ctrlKey||a.metaKey)&&'V'===d)){var e=null;for(var f in o){var g=f.split('+');var h=g.pop();if(h===d&&g.sort().join()===b.join()){if(q.includes(f)&&!k.all_fn)continue;e=o[f];break}}e&&(e instanceof Function&&(e=e()),a.preventDefault(),'string'==typeof e&&c(e))}}};var s=0;var t=0;var u=0;var v=0;return window.addEventListener('keydown',function(a){a.ctrlKey&&(v|=1),a.shiftKey&&(v|=2),a.altKey&&(v|=4),a.metaKey&&(v|=8)}),window.addEventListener('keyup',function(a){v=0,a.ctrlKey&&(v|=1),a.shiftKey&&(v|=2),a.altKey&&(v|=4),a.metaKey&&(v|=8)}),h={init:function(a){e(a),$('#action-buttons button').forEach(function(a){a.addEventListener('click',function(){d(+this.dataset.n)})}),window.addEventListener('mousedown',function(a){0===a.button&&(s=1),1===a.button&&(t=1),2===a.button&&(u=1)}),window.addEventListener('mouseup',function(a){0===a.button&&(s=0),1===a.button&&(t=0),2===a.button&&(u=0)})},sendString:c,setAlts:function setAlts(a,b,c,d){(k.cu_alt!==a||k.np_alt!==b||k.fn_alt!==c||k.crlf_mode!==d)&&(k.cu_alt=a,k.np_alt=b,k.fn_alt=c,k.crlf_mode=d)},setMouseMode:function setMouseMode(a,b){k.mt_click=a,k.mt_move=b},onMouseMove:function onMouseMove(c,d){if(k.mt_move){var e=s?1:t?2:u?3:0;var b=f();a.send('m'+encode2B(d)+encode2B(c)+encode2B(e)+encode2B(b))}},onMouseDown:function onMouseDown(c,d,e){if(k.mt_click&&!(3<e||1>e)){var b=f();a.send('p'+encode2B(d)+encode2B(c)+encode2B(e)+encode2B(b))}},onMouseUp:function onMouseUp(c,d,e){if(k.mt_click&&!(3<e||1>e)){var b=f();a.send('r'+encode2B(d)+encode2B(c)+encode2B(e)+encode2B(b))}},onMouseWheel:function onMouseWheel(c,d,e){if(k.mt_click){var g=f();var h=0>e?4:5;a.send('p'+encode2B(d)+encode2B(c)+encode2B(h)+encode2B(g))}},blockKeys:function blockKeys(a){k.no_keys=a},handleKeyDown:r},h};\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar $=__webpack_require__(1);var _require=__webpack_require__(0),qs=_require.qs;var modal=__webpack_require__(2);module.exports=function(a,b,c){function d(){f('Ready...'),modal.show('#fu_modal',e),$('#fu_form').toggleClass('busy',!1),b.blockKeys(!0)}function e(){console.log('Upload modal closed.'),clearTimeout(m),l=0,b.blockKeys(!1)}function f(a){qs('#fu_prog').textContent=a}function g(){var a=qs('#fu_text').value;return a.length?void(k=a.split('\\n'),l=0,q=0,n=qs('#fu_delay').value,0>n&&(n=0,qs('#fu_delay').value=n),o={CR:'\\r',LF:'\\n',CRLF:'\\r\\n'}[qs('#fu_crlf').value],$('#fu_form').toggleClass('busy',!0),f('Starting...'),h()):void j()}function h(){if($('#fu_modal').hasClass('visible')){if(!a.canSend())return void(m=setTimeout(h,1));0===q&&(p='',0===l&&c.bracketedPaste&&(p='\\x1B[200~'),p+=k[l++]+o,l===k.length&&c.bracketedPaste&&(p+='\\x1B[201~'));var d;if(p.length-q<=r?(d=p.substr(q,r),q=0):(d=p.substr(q,r),q+=r),!b.sendString(d))return void f('FAILED!');var e=Math.round(1e3*(l/k.length))/10;f(l+' / '+k.length+' ('+e+'%)'),k.length>l||0<q?m=setTimeout(h,n):i()}}function i(){a.canSend()?(f('Done.'),j()):(f('Waiting for Tx buffer...'),setTimeout(i,100))}function j(){modal.hide('#fu_modal')}var k,l,m,n,o,p,q;var r=128;return{init:function init(){qs('#fu_file').addEventListener('change',function(a){var b=new window.FileReader;var c=a.target.files[0];var d=c.type||'application/octet-stream';return console.log('Selected file type: '+d),d.match(/text\\/.*|application\\/(json|csv|.*xml.*|.*script.*|x-php)/)||window.confirm('This does not look like a text file: '+d+'\\nReally load?')?void(b.onload=function(a){var b=a.target.result.replace(/[\\r\\n]+/,'\\n');qs('#fu_text').value=b},console.log('Loading file...'),b.readAsText(c)):void(qs('#fu_file').value='')},!1),qs('#term-fu-open').addEventListener('click',function(){return d(),!1}),qs('#term-fu-start').addEventListener('click',function(){return g(),!1}),qs('#term-fu-close').addEventListener('click',function(){return j(),!1})},open:d,setContent:function setContent(a){qs('#fu_text').value=a}}};\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _slicedToArray=function(){function a(a,b){var c=[];var d=!0;var e=!1;var f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{!d&&h['return']&&h['return']()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError('Invalid attempt to destructure non-iterable instance')}}();var _require=__webpack_require__(0),qs=_require.qs;module.exports=function(a,b){var c=qs('#softkb-input');if(c){var d=document.createElement('div');d.id='keyboard-shortcut-bar',navigator.userAgent.match(/iPad|iPhone|iPod/)&&qs('#screen').appendChild(d);var e=!1;var f=function(){if(e){var b=a.gridToScreen(a.cursor.x,a.cursor.y,!0),d=_slicedToArray(b,2),f=d[0],g=d[1];c.style.transform='translate('+f+'px, '+g+'px)'}};c.addEventListener('focus',function(){e=!0,f(),d.classList.add('open')}),c.addEventListener('blur',function(){e=!1,d.classList.remove('open')}),a.on('cursor-moved',f),qs('#term-kb-open').addEventListener('click',function(a){a.preventDefault(),c.focus()});var g='';var h=function(a){var c=!1;a.length>g.length?a.startsWith(g)?b.sendString(a.substr(g.length)):c=!0:a.length<g.length?g.startsWith(a)?b.sendString('\\b'.repeat(g.length-a.length)):c=!0:a!==g&&(c=!0),c&&b.sendString('\\b'.repeat(g.length)+a),g=a};c.addEventListener('keydown',function(a){'Unidentified'===a.key||(c.value='',a.stopPropagation(),b.handleKeyDown(a))}),c.addEventListener('keypress',function(a){a.stopPropagation()}),c.addEventListener('input',function(a){a.stopPropagation(),a.isComposing&&'data'in a?h(a.data):a.isComposing?h(c.value):'insertCompositionText'===a.inputType?b.sendString(a.data):'deleteContentBackward'===a.inputType?(g='',h('')):'insertText'===a.inputType&&b.sendString(a.data)}),c.addEventListener('compositionstart',function(){g=''}),c.addEventListener('compositionend',function(){g='',c.value=''}),a.on('open-soft-keyboard',function(){return c.focus()});var i={Tab:9,\"←\":37,\"↓\":40,\"↑\":38,\"→\":39,\"^C\":{which:67,ctrlKey:!0}};var j=function(a){var c=document.createElement('button');c.classList.add('shortcut-button'),c.textContent=a,d.appendChild(c);var f=i[a];c.addEventListener('click',function(a){a.preventDefault();var c=f;'number'==typeof f&&(c={which:f}),c.preventDefault=function(){},b.handleKeyDown(c)})};for(var k in i)j(k)}};\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\nvar _slicedToArray=function(){function a(a,b){var c=[];var d=!0;var e=!1;var f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{!d&&h['return']&&h['return']()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError('Invalid attempt to destructure non-iterable instance')}}();function _toConsumableArray(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}var _require=__webpack_require__(0),mk=_require.mk;module.exports=function(a){var b=mk('canvas');var c=b.getContext('2d');b.style.position='absolute',b.style.top='6px',b.style.left='6px',b.style.pointerEvents='none';var d=function(){b.parentNode||a.canvas.parentNode.appendChild(b)};var e=function(){b.parentNode&&b.parentNode.removeChild(b)};var f=function(){var c=a.window,d=c.width,e=c.height,f=c.devicePixelRatio;var g=a.getCellSize();b.width=d*g.width*f,b.height=e*g.height*f,b.style.width=d*g.width+'px',b.style.height=e*g.height+'px'};var g,h,i;var j=new Map;var k=[];var l;a._debug={drawStart:function drawStart(a){i=a,g=Date.now(),k=[]},drawEnd:function drawEnd(){h=Date.now(),console.log('Draw: '+i+' ('+(h-g)+' ms) with fancy graphics: '+a.window.graphics),l()},setCell:function setCell(a,b){j.set(a,[b,Date.now()])},clipRect:function clipRect(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];k.push(b)}};var m;{var t=document.createElement('canvas');t.width=t.height=12;var u=t.getContext('2d');u.lineWidth=1,u.strokeStyle='#00f',u.beginPath(),u.moveTo(0,0),u.lineTo(-4,12),u.moveTo(4,0),u.lineTo(0,12),u.moveTo(8,0),u.lineTo(4,12),u.moveTo(12,0),u.lineTo(8,12),u.moveTo(16,0),u.lineTo(12,12),u.stroke(),m=c.createPattern(t,'repeat')}var n=!1;var o=function(){n&&window.requestAnimationFrame(o);var b=a.window,d=b.devicePixelRatio,f=b.width,g=b.height;var h=a.getCellSize(),i=h.width,l=h.height;var p=Date.now();c.setTransform(d,0,0,d,0,0),c.clearRect(0,0,f*i,g*l);var q=0;for(var D=0;D<f*g;D++)if(j.has(D)&&0!==j.get(D)[0]){var r=j.get(D),s=_slicedToArray(r,2),t=s[0],u=s[1];var v=(p-u)/1e3;if(!(1<v)){q++,c.globalAlpha=0.5*Math.max(0,1-v);var w=D%f;var x=Math.floor(D/f);1&t&&(c.fillStyle='#f0f'),2&t&&(c.fillStyle='#0f0'),c.fillRect(w*i,x*l,i,l),4&t&&(c.lineWidth=2,c.strokeStyle='#f00',c.strokeRect(w*i,x*l,i,l))}}if(k.length){c.globalAlpha=0.5,c.beginPath();var y=!0;var z=!1;var A=void 0;try{for(var B,C=k[Symbol.iterator]();!(y=(B=C.next()).done);y=!0){var E=B.value;c.rect.apply(c,_toConsumableArray(E))}}catch(a){z=!0,A=a}finally{try{!y&&C.return&&C.return()}finally{if(z)throw A}}c.fillStyle=m,c.fill()}0==q&&(n=!1,e())};l=function(){n||(d(),f(),n=!0,o())};var p=mk('div');p.classList.add('debug-toolbar');var q=!1;var r=function(){a.canvas.parentNode.appendChild(p)};var s=function(){p.parentNode.removeChild(p)};a.on('update-window:debug',function(a){a!==q&&(q=a,a?r():s())}),a.on('draw',function(){if(q){var b=a.cursor.y*a.window.width+a.cursor.x;var c=a.screenFG[b];var d=a.screenBG[b];var e=(a.screen[b]||'').codePointAt(0);var f=a.screenAttrs[b];var g=e.toString(16).toUpperCase();4>g.length&&(g=('0000'+g).substr(-4)),g='U+'+g,p.textContent='Cursor cell ('+b+'): '+g+' FG: '+c+' BG: '+d+' Attrs: '+f.toString(2)}})};\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// app.310033b.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 21d3956fd434cbda121b","/** Make a node */\nexports.mk = function mk (e) {\n return document.createElement(e)\n}\n\n/** Find one by query */\nexports.qs = function qs (s) {\n return document.querySelector(s)\n}\n\n/** Find all by query */\nexports.qsa = function qsa (s) {\n return document.querySelectorAll(s)\n}\n\n/**\n * Filter 'spacebar' and 'return' from keypress handler,\n * and when they're pressed, fire the callback.\n * use $(...).on('keypress', cr(handler))\n */\nexports.cr = function cr (hdl) {\n return function (e) {\n if (e.which === 10 || e.which === 13 || e.which === 32) {\n hdl()\n }\n }\n}\n\n/** Convert any to bool safely */\nexports.bool = function bool (x) {\n return (x === 1 || x === '1' || x === true || x === 'true')\n}\n\n/** Decode number from 2B encoding */\nexports.parse2B = function parse2B (s, i = 0) {\n return (s.charCodeAt(i++) - 1) + (s.charCodeAt(i) - 1) * 127\n}\n\n/** Decode number from 3B encoding */\nexports.parse3B = function parse3B (s, i = 0) {\n return (s.charCodeAt(i) - 1) + (s.charCodeAt(i + 1) - 1) * 127 + (s.charCodeAt(i + 2) - 1) * 127 * 127\n}\n\n/** Encode using 2B encoding, returns string. */\nexports.encode2B = function encode2B (n) {\n let lsb, msb\n lsb = (n % 127)\n n = ((n - lsb) / 127)\n lsb += 1\n msb = (n + 1)\n return String.fromCharCode(lsb) + String.fromCharCode(msb)\n}\n\n/** Encode using 3B encoding, returns string. */\nexports.encode3B = function encode3B (n) {\n let lsb, msb, xsb\n lsb = (n % 127)\n n = (n - lsb) / 127\n lsb += 1\n msb = (n % 127)\n n = (n - msb) / 127\n msb += 1\n xsb = (n + 1)\n return String.fromCharCode(lsb) + String.fromCharCode(msb) + String.fromCharCode(xsb)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/utils.js","/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n\n// MODIFIED VERSION.\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {\n\t\t\treturn result.charAt(1).toUpperCase();\n\t\t});\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {\n\t\t}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, replace, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tvar clz = classarray[i];\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.classList.remove(clz);\n\t\t\t\t\t}\n\t\t\t\t\telse if (action === 'add') {\n\t\t\t\t\t\telm.classList.add(clz);\n\t\t\t\t\t}\n\t\t\t\t\telse if (action === 'toggle') {\n\t\t\t\t\t\telm.classList.toggle(clz);\n\t\t\t\t\t}\n\t\t\t\t\telse if (action === 'has') {\n\t\t\t\t\t\tif (elm.classList.contains(clz)) {\n\t\t\t\t\t\t\thas = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// search = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\t// replace = new RegExp(' *' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\t// if (action === 'remove') {\n\t\t\t\t\t// \telm.className = elm.className.replace(search, '');\n\t\t\t\t\t// } else if (action === 'toggle') {\n\t\t\t\t\t// \telm.className = (elm.className.match(search)) ? elm.className.replace(replace, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t// } else if (action === 'has') {\n\t\t\t\t\t// \tif (elm.className.match(search)) {\n\t\t\t\t\t// \t\thas = true;\n\t\t\t\t\t// \t\tbreak;\n\t\t\t\t\t// \t}\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif (state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/, ' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tclassHelper(classes, 'add', nodes);\n\t\t\t// if (classes) {\n\t\t\t// \tnodeLoop(function (elm) {\n\t\t\t// \t\telm.className += ' ' + classes;\n\t\t\t// \t}, nodes);\n\t\t\t// }\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes, set) {\n\t\t\tvar method = ((typeof set === 'undefined') ? 'toggle' : (+set ? 'add' : 'remove'));\n\t\t\tclassHelper(classes, method, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-' + key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (typeof value != 'undefined') { // FIXED A BUG HERE\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\t\tif (elm[i].value === \"\"+value[j]) {\n\t\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tvalues = [];\n\t\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () {\n\t\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t\t};\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\treturn cb;\n\t}\n\n\t// Basic XHR\n\tchibi.ajax = function (options) { // if options is a number, it's timeout in ms\n\t\tvar opts = Object.assign({\n\t\t\tmethod: 'GET',\n\t\t\tnocache: true,\n\t\t\ttimeout: 5000,\n\t\t\tloader: true,\n\t\t\tcallback: null\n\t\t}, options);\n\t\topts.method = opts.method.toUpperCase();\n\n\t\tvar loaderFn = opts.loader ? chibi._loader : function(){};\n\t\tvar url = opts.url;\n\t\tvar method = opts.method;\n\t\tvar query = null;\n\n\t\tif (opts.data) {\n\t\t\tquery = serializeData(opts.data);\n\t\t}\n\n\t\tif (query && (method === 'GET')) {\n\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\tquery = null;\n\t\t}\n\n\t\tvar xhr = new XMLHttpRequest();\n\n\t\t// prevent caching\n\t\tif (opts.nocache) {\n\t\t\tvar ts = (+(new Date())).toString(36);\n\t\t\turl += ((url.indexOf('?') === -1) ? '?' : '&') + '_=' + ts;\n\t\t}\n\n\t\tloaderFn(true);\n\n\t\txhr.open(method, url, true);\n\t\txhr.timeout = opts.timeout;\n\n\t\t// Abort after given timeout\n\t\tvar abortTmeo = setTimeout(function () {\n\t\t\tconsole.error(\"XHR timed out.\");\n\t\t\txhr.abort();\n\t\t\tloaderFn(false);\n\t\t}, opts.timeout + 10);\n\n\t\txhr.onreadystatechange = function () {\n\t\t\tif (xhr.readyState === 4) {\n\t\t\t\tloaderFn(false);\n\n\t\t\t\topts.callback && opts.callback(xhr.responseText, xhr.status);\n\n\t\t\t\tclearTimeout(abortTmeo);\n\t\t\t}\n\t\t};\n\n\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t\tif (method === 'POST') {\n\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t}\n\n\t\txhr.send(query);\n\t\treturn xhr;\n\t};\n\n\tchibi._loader = function(){};\n\n\t// Alias to cb.ajax(url, 'get', callback)\n\tchibi.get = function (url, callback, opts) {\n\t\topts = opts || {};\n\t\topts.url = url;\n\t\topts.callback = callback;\n\t\topts.method = 'GET';\n\t\treturn chibi.ajax(opts);\n\t};\n\n\t// Alias to cb.ajax(url, 'post', callback)\n\tchibi.post = function (url, callback, opts) {\n\t\topts = opts || {};\n\t\topts.url = url;\n\t\topts.callback = callback;\n\t\topts.method = 'POST';\n\t\treturn chibi.ajax(opts);\n\t};\n\n\t// Fire on DOM ready\n\tchibi.ready = function (fn) {\n\t\tif (fn) {\n\t\t\tif (domready) {\n\t\t\t\tfn();\n\t\t\t\treturn chibi;\n\t\t\t} else {\n\t\t\t\treadyfn.push(fn);\n\t\t\t}\n\t\t}\n\t};\n\n\t// Fire on page loaded\n\tchibi.loaded = function (fn) {\n\t\tif (fn) {\n\t\t\tif (pageloaded) {\n\t\t\t\tfn();\n\t\t\t\treturn chibi;\n\t\t\t} else {\n\t\t\t\tloadedfn.push(fn);\n\t\t\t}\n\t\t}\n\t};\n\n\tvar entityMap = {\n\t\t'&': '&amp;',\n\t\t'<': '&lt;',\n\t\t'>': '&gt;',\n\t\t'\"': '&quot;',\n\t\t\"'\": '&#39;',\n\t\t'/': '&#x2F;',\n\t\t'`': '&#x60;',\n\t\t'=': '&#x3D;'\n\t};\n\n\tchibi.htmlEscape = function(string) {\n\t\treturn String(string).replace(/[&<>\"'`=\\/]/g, function (s) {\n\t\t\treturn entityMap[s];\n\t\t});\n\t};\n\n\t// Set Chibi's global namespace here ($)\n\tmodule.exports = chibi;\n}());\n\n\n\n// WEBPACK FOOTER //\n// ./js/lib/chibi.js","const $ = require('./lib/chibi')\n\n/** Module for toggling a modal overlay */\nlet modal = {}\nlet curCloseCb = null\n\nmodal.show = function (sel, closeCb) {\n let $m = $(sel)\n $m.removeClass('hidden visible')\n setTimeout(function () {\n $m.addClass('visible')\n }, 1)\n curCloseCb = closeCb\n}\n\nmodal.hide = function (sel) {\n let $m = $(sel)\n $m.removeClass('visible')\n setTimeout(function () {\n $m.addClass('hidden')\n if (curCloseCb) curCloseCb()\n }, 500) // transition time\n}\n\nmodal.init = function () {\n // close modal by click outside the dialog\n $('.Modal').on('click', function () {\n if ($(this).hasClass('no-close')) return // this is a no-close modal\n modal.hide(this)\n })\n\n $('.Dialog').on('click', function (e) {\n e.stopImmediatePropagation()\n })\n\n // Hide all modals on esc\n $(window).on('keydown', function (e) {\n if (e.which === 27) {\n modal.hide('.Modal')\n }\n })\n}\n\nmodule.exports = modal\n\n\n\n// WEBPACK FOOTER //\n// ./js/modal.js","const $ = require('./lib/chibi')\nconst modal = require('./modal')\n\nlet nt = {}\nconst sel = '#notif'\nlet $balloon\n\nlet timerHideBegin // timeout to start hiding (transition)\nlet timerHideEnd // timeout to add the hidden class\nlet canCancel = false\n\nlet stopTimeouts = function () {\n clearTimeout(timerHideBegin)\n clearTimeout(timerHideEnd)\n}\n\nnt.show = function (message, timeout, isError) {\n $balloon.toggleClass('error', isError === true)\n $balloon.html(message)\n modal.show($balloon)\n stopTimeouts()\n\n if (!timeout || timeout <= 0) {\n timeout = 2500\n }\n\n timerHideBegin = setTimeout(nt.hide, timeout)\n\n canCancel = false\n setTimeout(() => {\n canCancel = true\n }, 500)\n}\n\nnt.hide = function () {\n let $m = $(sel)\n $m.removeClass('visible')\n timerHideEnd = setTimeout(function () {\n $m.addClass('hidden')\n }, 250) // transition time\n}\n\nnt.init = function () {\n $balloon = $(sel)\n\n // close by click outside\n $(document).on('click', function () {\n if (!canCancel) return\n nt.hide(this)\n })\n\n // click caused by selecting, prevent it from bubbling\n $balloon.on('click', function (e) {\n e.stopImmediatePropagation()\n return false\n })\n\n // stop fading if moused\n $balloon.on('mouseenter', function () {\n stopTimeouts()\n $balloon.removeClass('hidden').addClass('visible')\n })\n}\n\nmodule.exports = nt\n\n\n\n// WEBPACK FOOTER //\n// ./js/notif.js","\nconst themes = exports.themes = [\n [ // Tango\n '#111213', '#CC0000', '#4E9A06', '#C4A000', '#3465A4', '#75507B', '#06989A', '#D3D7CF',\n '#555753', '#EF2929', '#8AE234', '#FCE94F', '#729FCF', '#AD7FA8', '#34E2E2', '#EEEEEC'\n ],\n [ // Linux (CGA)\n '#000000', '#aa0000', '#00aa00', '#aa5500', '#0000aa', '#aa00aa', '#00aaaa', '#aaaaaa',\n '#555555', '#ff5555', '#55ff55', '#ffff55', '#5555ff', '#ff55ff', '#55ffff', '#ffffff'\n ],\n [ // xterm\n '#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5',\n '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff'\n ],\n [ // rxvt\n '#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000cd', '#cd00cd', '#00cdcd', '#faebd7',\n '#404040', '#ff0000', '#00ff00', '#ffff00', '#0000ff', '#ff00ff', '#00ffff', '#ffffff'\n ],\n [ // Ambience\n '#2e3436', '#cc0000', '#4e9a06', '#c4a000', '#3465a4', '#75507b', '#06989a', '#d3d7cf',\n '#555753', '#ef2929', '#8ae234', '#fce94f', '#729fcf', '#ad7fa8', '#34e2e2', '#eeeeec'\n ],\n [ // Solarized light\n '#073642', '#dc322f', '#859900', '#b58900', '#268bd2', '#d33682', '#2aa198', '#eee8d5',\n '#002b36', '#cb4b16', '#586e75', '#657b83', '#839496', '#6c71c4', '#93a1a1', '#fdf6e3'\n ],\n [ // Solarized dark\n '#073642', '#dc322f', '#859900', '#b58900', '#268bd2', '#d33682', '#2aa198', '#eee8d5',\n '#002b36', '#cb4b16', '#586e75', '#657b83', '#839496', '#6c71c4', '#93a1a1', '#fdf6e3'\n ],\n [ // CGA NTSC\n '#000000', '#69001A', '#117800', '#769100', '#1A00A6', '#8019AB', '#289E76', '#A4A4A4',\n '#484848', '#C54E76', '#6DD441', '#D2ED46', '#765BFF', '#DC75FF', '#84FAD2', '#FFFFFF'\n ],\n [ // ZX Spectrum\n '#000000', '#aa0000', '#00aa00', '#aaaa00', '#0000aa', '#aa00aa', '#00aaaa', '#aaaaaa',\n '#000000', '#ff0000', '#00FF00', '#ffff00', '#0000ff', '#ff00ff', '#00ffff', '#ffffff'\n ],\n [ // Apple II\n '#000000', '#722640', '#0E5940', '#808080', '#40337F', '#E434FE', '#1B9AFE', '#BFB3FF',\n '#404C00', '#E46501', '#1BCB01', '#BFCC80', '#808080', '#F1A6BF', '#8DD9BF', '#ffffff'\n ],\n [ // Commodore\n '#000000', '#8D3E37', '#55A049', '#AAB95D', '#40318D', '#80348B', '#72C1C8', '#D59F74',\n '#8B5429', '#B86962', '#94E089', '#FFFFB2', '#8071CC', '#AA5FB6', '#87D6DD', '#ffffff'\n ]\n]\n\nexports.fgbgThemes = [\n ['#aaaaaa', '#000000'], // grey_on_black\n ['#000000', '#ffffdd'], // black_on_yellow\n ['#000000', '#ffffff'], // black_on_white\n ['#ffffff', '#000000'], // white_on_black\n ['#00ff00', '#000000'], // green_on_black\n ['#e53c00', '#000000'], // orange_on_black\n ['#ffffff', '#300a24'], // ambience\n ['#657b83', '#fdf6e3'], // solarized_light\n ['#839496', '#002b36'] // solarized_dark\n]\n\nlet colorTable256 = null\n\nexports.buildColorTable = function () {\n if (colorTable256 !== null) return colorTable256\n\n // 256color lookup table\n // should not be used to look up 0-15 (will return transparent)\n colorTable256 = new Array(16).fill('rgba(0, 0, 0, 0)')\n\n // fill color table\n // colors 16-231 are a 6x6x6 color cube\n for (let red = 0; red < 6; red++) {\n for (let green = 0; green < 6; green++) {\n for (let blue = 0; blue < 6; blue++) {\n let redValue = red * 40 + (red ? 55 : 0)\n let greenValue = green * 40 + (green ? 55 : 0)\n let blueValue = blue * 40 + (blue ? 55 : 0)\n colorTable256.push(`rgb(${redValue}, ${greenValue}, ${blueValue})`)\n }\n }\n }\n // colors 232-255 are a grayscale ramp, sans black and white\n for (let gray = 0; gray < 24; gray++) {\n let value = gray * 10 + 8\n colorTable256.push(`rgb(${value}, ${value}, ${value})`)\n }\n\n return colorTable256\n}\n\nexports.SELECTION_FG = '#333'\nexports.SELECTION_BG = '#b2d7fe'\n\nexports.themePreview = function (n) {\n document.querySelectorAll('[data-fg]').forEach((elem) => {\n let shade = +elem.dataset.fg\n elem.style.color = themes[n][shade]\n })\n document.querySelectorAll('[data-bg]').forEach((elem) => {\n let shade = +elem.dataset.bg\n elem.style.backgroundColor = themes[n][shade]\n })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/themes.js","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/events/events.js\n// module id = 5\n// module chunks = 0","const EventEmitter = require('events')\nconst { parse2B } = require('../utils')\nconst { themes } = require('./themes')\n\nclass ANSIParser {\n constructor (handler) {\n this.reset()\n this.handler = handler\n this.joinChunks = true\n }\n reset () {\n this.currentSequence = 0\n this.sequence = ''\n }\n parseSequence (sequence) {\n if (sequence[0] === '[') {\n let type = sequence[sequence.length - 1]\n let content = sequence.substring(1, sequence.length - 1)\n\n let numbers = content ? content.split(';').map(i => +i.replace(/\\D/g, '')) : []\n let numOr1 = numbers.length ? numbers[0] : 1\n if (type === 'H') {\n this.handler('set-cursor', (numbers[0] | 0) - 1, (numbers[1] | 0) - 1)\n } else if (type >= 'A' && type <= 'D') {\n this.handler(`move-cursor-${type <= 'B' ? 'y' : 'x'}`, ((type === 'B' || type === 'C') ? 1 : -1) * numOr1)\n } else if (type === 'E' || type === 'F') {\n this.handler('move-cursor-line', (type === 'E' ? 1 : -1) * numOr1)\n } else if (type === 'G') {\n this.handler('set-cursor-x', numOr1 - 1)\n } else if (type === 'J') {\n let number = numbers.length ? numbers[0] : 2\n if (number === 2) this.handler('clear')\n } else if (type === 'P') {\n this.handler('delete', numOr1)\n } else if (type === '@') {\n this.handler('insert-blanks', numOr1)\n } else if (type === 'q') this.handler('set-cursor-style', numOr1)\n else if (type === 'm') {\n if (!numbers.length || numbers[0] === 0) {\n this.handler('reset-style')\n return\n }\n let type = numbers[0]\n if (type === 1) this.handler('add-attrs', 1) // bold\n else if (type === 2) this.handler('add-attrs', 1 << 1) // faint\n else if (type === 3) this.handler('add-attrs', 1 << 2) // italic\n else if (type === 4) this.handler('add-attrs', 1 << 3) // underline\n else if (type === 5 || type === 6) this.handler('add-attrs', 1 << 4) // blink\n else if (type === 7) this.handler('add-attrs', -1) // invert\n else if (type === 9) this.handler('add-attrs', 1 << 6) // strike\n else if (type === 20) this.handler('add-attrs', 1 << 5) // fraktur\n else if (type >= 30 && type <= 37) this.handler('set-color-fg', type % 10)\n else if (type >= 40 && type <= 47) this.handler('set-color-bg', type % 10)\n else if (type === 39) this.handler('reset-color-fg')\n else if (type === 49) this.handler('reset-color-bg')\n else if (type >= 90 && type <= 98) this.handler('set-color-fg', (type % 10) + 8)\n else if (type >= 100 && type <= 108) this.handler('set-color-bg', (type % 10) + 8)\n else if (type === 38 || type === 48) {\n if (numbers[1] === 5) {\n let color = (numbers[2] | 0) & 0xFF\n if (type === 38) this.handler('set-color-fg', color)\n if (type === 48) this.handler('set-color-bg', color)\n }\n }\n } else if (type === 'h' || type === 'l') {\n if (content === '?25') {\n if (type === 'h') this.handler('show-cursor')\n else if (type === 'l') this.handler('hide-cursor')\n }\n }\n }\n }\n write (text) {\n for (let character of text.toString()) {\n let code = character.codePointAt(0)\n if (code === 0x1b) this.currentSequence = 1\n else if (this.currentSequence === 1 && character === '[') {\n this.currentSequence = 2\n this.sequence += '['\n } else if (this.currentSequence && character.match(/[\\x40-\\x7e]/)) {\n this.parseSequence(this.sequence + character)\n this.currentSequence = 0\n this.sequence = ''\n } else if (this.currentSequence > 1) this.sequence += character\n else if (this.currentSequence === 1) {\n // something something nothing\n this.currentSequence = 0\n this.handler('write', character)\n } else if (code < 0x03) this.handler('_null')\n else if (code === 0x03) this.handler('sigint')\n else if (code <= 0x06) this.handler('_null')\n else if (code === 0x07) this.handler('bell')\n else if (code === 0x08) this.handler('back')\n else if (code === 0x09) this.handler('tab')\n else if (code === 0x0a) this.handler('new-line')\n else if (code === 0x0d) this.handler('return')\n else if (code === 0x15) this.handler('delete-line')\n else if (code === 0x17) this.handler('delete-word')\n else this.handler('write', character)\n }\n if (!this.joinChunks) this.reset()\n }\n}\nconst TERM_DEFAULT_STYLE = 0\nconst TERM_MIN_DRAW_DELAY = 10\n\nlet getRainbowColor = t => {\n let r = Math.floor(Math.sin(t) * 2.5 + 2.5)\n let g = Math.floor(Math.sin(t + 2 / 3 * Math.PI) * 2.5 + 2.5)\n let b = Math.floor(Math.sin(t + 4 / 3 * Math.PI) * 2.5 + 2.5)\n return 16 + 36 * r + 6 * g + b\n}\n\nclass ScrollingTerminal {\n constructor (screen) {\n this.width = 80\n this.height = 25\n this.termScreen = screen\n this.parser = new ANSIParser((...args) => this.handleParsed(...args))\n\n this.reset()\n\n this._lastLoad = Date.now()\n this.termScreen.load(this.serialize())\n\n window.showPage()\n }\n reset () {\n this.style = TERM_DEFAULT_STYLE\n this.cursor = { x: 0, y: 0, style: 1, visible: true }\n this.trackMouse = false\n this.theme = -1\n this.rainbow = false\n this.parser.reset()\n this.clear()\n }\n clear () {\n this.screen = []\n for (let i = 0; i < this.width * this.height; i++) {\n this.screen.push([' ', this.style])\n }\n }\n scroll () {\n this.screen.splice(0, this.width)\n for (let i = 0; i < this.width; i++) {\n this.screen.push([' ', TERM_DEFAULT_STYLE])\n }\n this.cursor.y--\n }\n newLine () {\n this.cursor.y++\n if (this.cursor.y >= this.height) this.scroll()\n }\n writeChar (character) {\n this.screen[this.cursor.y * this.width + this.cursor.x] = [character, this.style]\n this.cursor.x++\n if (this.cursor.x >= this.width) {\n this.cursor.x = 0\n this.newLine()\n }\n }\n moveBack (n = 1) {\n for (let i = 0; i < n; i++) {\n this.cursor.x--\n if (this.cursor.x < 0) {\n if (this.cursor.y > 0) this.cursor.x = this.width - 1\n else this.cursor.x = 0\n this.cursor.y = Math.max(0, this.cursor.y - 1)\n }\n }\n }\n moveForward (n = 1) {\n for (let i = 0; i < n; i++) {\n this.cursor.x++\n if (this.cursor.x >= this.width) {\n this.cursor.x = 0\n this.cursor.y++\n if (this.cursor.y >= this.height) this.scroll()\n }\n }\n }\n deleteChar () { // FIXME unused?\n this.moveBack()\n this.screen.splice((this.cursor.y + 1) * this.width, 0, [' ', TERM_DEFAULT_STYLE])\n this.screen.splice(this.cursor.y * this.width + this.cursor.x, 1)\n }\n deleteForward (n) {\n n = Math.min(this.width, n)\n for (let i = 0; i < n; i++) this.screen.splice((this.cursor.y + 1) * this.width, 0, [' ', TERM_DEFAULT_STYLE])\n this.screen.splice(this.cursor.y * this.width + this.cursor.x, n)\n }\n clampCursor () {\n if (this.cursor.x < 0) this.cursor.x = 0\n if (this.cursor.y < 0) this.cursor.y = 0\n if (this.cursor.x > this.width - 1) this.cursor.x = this.width - 1\n if (this.cursor.y > this.height - 1) this.cursor.y = this.height - 1\n }\n handleParsed (action, ...args) {\n if (action === 'write') {\n this.writeChar(args[0])\n } else if (action === 'delete') {\n this.deleteForward(args[0])\n } else if (action === 'insert-blanks') {\n this.insertBlanks(args[0]) // FIXME undefined?\n } else if (action === 'clear') {\n this.clear()\n } else if (action === 'bell') {\n this.termScreen.load('B')\n } else if (action === 'back') {\n this.moveBack()\n } else if (action === 'new-line') {\n this.newLine()\n } else if (action === 'return') {\n this.cursor.x = 0\n } else if (action === 'set-cursor') {\n this.cursor.x = args[1]\n this.cursor.y = args[0]\n this.clampCursor()\n } else if (action === 'move-cursor-y') {\n this.cursor.y += args[0]\n this.clampCursor()\n } else if (action === 'move-cursor-x') {\n this.cursor.x += args[0]\n this.clampCursor()\n } else if (action === 'move-cursor-line') {\n this.cursor.x = 0\n this.cursor.y += args[0]\n this.clampCursor()\n } else if (action === 'set-cursor-x') {\n this.cursor.x = args[0]\n } else if (action === 'set-cursor-style') {\n this.cursor.style = Math.max(0, Math.min(6, args[0]))\n } else if (action === 'reset-style') {\n this.style = TERM_DEFAULT_STYLE\n } else if (action === 'add-attrs') {\n this.style |= (args[0] << 16)\n } else if (action === 'set-color-fg') {\n this.style = (this.style & 0xFFFFFF00) | (1 << 8 << 16) | args[0]\n } else if (action === 'set-color-bg') {\n this.style = (this.style & 0xFFFF00FF) | (1 << 9 << 16) | (args[0] << 8)\n } else if (action === 'reset-color-fg') {\n this.style = this.style & 0xFFFEFF00\n } else if (action === 'reset-color-bg') {\n this.style = this.style & 0xFFFD00FF\n } else if (action === 'hide-cursor') {\n this.cursor.visible = false\n } else if (action === 'show-cursor') {\n this.cursor.visible = true\n }\n }\n write (text) {\n this.parser.write(text)\n this.scheduleLoad()\n }\n serialize () {\n let serialized = 'S'\n serialized += String.fromCodePoint(this.height + 1) + String.fromCodePoint(this.width + 1)\n serialized += String.fromCodePoint(this.cursor.y + 1) + String.fromCodePoint(this.cursor.x + 1)\n\n let attributes = +this.cursor.visible\n attributes |= (3 << 5) * +this.trackMouse // track mouse controls both\n attributes |= 3 << 7 // buttons/links always visible\n attributes |= (this.cursor.style << 9)\n serialized += String.fromCodePoint(attributes + 1)\n\n let lastStyle = null\n let index = 0\n for (let cell of this.screen) {\n let style = cell[1]\n if (this.rainbow) {\n let x = index % this.width\n let y = Math.floor(index / this.width)\n // C instead of F in mask and 1 << 8 in attrs to change attr bits 8 and 9\n style = (style & 0xFFFC0000) | (1 << 8 << 16) | getRainbowColor((x + y) / 10 + Date.now() / 1000)\n index++\n }\n if (style !== lastStyle) {\n let foreground = style & 0xFF\n let background = (style >> 8) & 0xFF\n let attributes = (style >> 16) & 0xFFFF\n let setForeground = foreground !== (lastStyle & 0xFF)\n let setBackground = background !== ((lastStyle >> 8) & 0xFF)\n let setAttributes = attributes !== ((lastStyle >> 16) & 0xFFFF)\n\n if (setForeground && setBackground) serialized += '\\x03' + String.fromCodePoint((style & 0xFFFF) + 1)\n else if (setForeground) serialized += '\\x05' + String.fromCodePoint(foreground + 1)\n else if (setBackground) serialized += '\\x06' + String.fromCodePoint(background + 1)\n if (setAttributes) serialized += '\\x04' + String.fromCodePoint(attributes + 1)\n lastStyle = style\n }\n serialized += cell[0]\n }\n return serialized\n }\n scheduleLoad () {\n clearTimeout(this._scheduledLoad)\n if (this._lastLoad < Date.now() - TERM_MIN_DRAW_DELAY) {\n this.termScreen.load(this.serialize(), { theme: this.theme })\n this.theme = -1 // prevent useless theme setting next time\n } else {\n this._scheduledLoad = setTimeout(() => {\n this.termScreen.load(this.serialize())\n }, TERM_MIN_DRAW_DELAY - this._lastLoad)\n }\n }\n rainbowTimer () {\n if (!this.rainbow) return\n clearInterval(this._rainbowTimer)\n this._rainbowTimer = setInterval(() => {\n if (this.rainbow) this.scheduleLoad()\n }, 50)\n }\n}\n\nclass Process extends EventEmitter {\n write (data) {\n this.emit('in', data)\n }\n destroy () {\n // death.\n this.emit('exit', 0)\n }\n run () {\n // noop\n }\n}\n\nlet demoData = {\n buttons: {\n 1: '',\n 2: '',\n 3: '',\n 4: '',\n 5: function (terminal, shell) {\n if (shell.child) shell.child.destroy()\n let chars = 'info\\r'\n let loop = function () {\n shell.write(chars[0])\n chars = chars.substr(1)\n if (chars) setTimeout(loop, 100)\n }\n setTimeout(loop, 200)\n }\n },\n mouseReceiver: null\n}\n\nlet demoshIndex = {\n clear: class Clear extends Process {\n run () {\n this.emit('write', '\\x1b[2J\\x1b[1;1H')\n this.destroy()\n }\n },\n screenfetch: class Screenfetch extends Process {\n run () {\n let image = `\n ###. ESPTerm Demo\n '###. Hostname: ${window.location.hostname}\n '###. Shell: ESPTerm Demo Shell\n '###. Resolution: 80x25@${window.devicePixelRatio}x\n :###-\n .###'\n .###'\n .###' ###############\n ###' ###############\n `.split('\\n').filter(line => line.trim())\n\n let chars = ''\n for (let y = 0; y < image.length; y++) {\n for (let x = 0; x < 80; x++) {\n if (image[y][x]) {\n chars += `\\x1b[38;5;${getRainbowColor((x + y) / 10)}m${image[y][x]}`\n } else chars += ' '\n }\n }\n\n this.emit('write', '\\r\\n\\x1b[?25l')\n let loop = () => {\n this.emit('write', chars.substr(0, 80))\n chars = chars.substr(80)\n if (chars.length) setTimeout(loop, 50)\n else {\n this.emit('write', '\\r\\n\\x1b[?25h')\n this.destroy()\n }\n }\n loop()\n }\n },\n 'local-echo': class LocalEcho extends Process {\n run (...args) {\n if (!args.includes('--suppress-note')) {\n this.emit('write', '\\x1b[38;5;239mNote: not all terminal features are supported or and may not work as expected in this demo\\x1b[0m\\r\\n')\n }\n }\n write (data) {\n this.emit('write', data)\n }\n },\n 'info': class Info extends Process {\n run (...args) {\n let fast = args.includes('--fast')\n this.showSplash().then(() => {\n this.printText(fast)\n })\n }\n showSplash () {\n let splash = `\n -#####- -###*..#####- ######-\n -#* -#- .## .##. *#-\n -##### .-###*..#####- *#- -*##*- #*-#--#**#-*##-\n -#* -#-.##. *#- *##@#* ##. -#* *# .#*\n -#####--####- .##. *#- -*#@@- ##. -#* *# .#*\n `.split('\\n').filter(line => line.trim())\n let levels = {\n ' ': -231,\n '.': 4,\n '-': 8,\n '*': 17,\n '#': 24\n }\n let characters = {\n ' ': ' ',\n '.': '░',\n '-': '▒',\n '*': '▓',\n '#': '█'\n }\n for (let i in splash) {\n if (splash[i].length < 79) splash[i] += ' '.repeat(79 - splash[i].length)\n }\n this.emit('write', '\\r\\n'.repeat(splash.length + 1))\n this.emit('write', '\\x1b[A'.repeat(splash.length))\n this.emit('write', '\\x1b[?25l')\n\n let cursorX = 0\n let cursorY = 0\n let moveTo = (x, y) => {\n let moveX = x - cursorX\n let moveY = y - cursorY\n this.emit('write', `\\x1b[${Math.abs(moveX)}${moveX > 0 ? 'C' : 'D'}`)\n this.emit('write', `\\x1b[${Math.abs(moveY)}${moveY > 0 ? 'B' : 'A'}`)\n cursorX = x\n cursorY = y\n }\n let drawCell = (x, y) => {\n moveTo(x, y)\n if (splash[y][x] === '@') {\n this.emit('write', '\\x1b[48;5;238m\\x1b[38;5;255m▄\\b')\n } else {\n let level = 231 + levels[splash[y][x]]\n let character = characters[splash[y][x]]\n this.emit('write', `\\x1b[48;5;${level}m\\x1b[38;5;${level}m${character}\\b`)\n }\n }\n return new Promise((resolve, reject) => {\n const self = this\n let x = 14\n let cycles = 0\n let loop = function () {\n for (let y = 0; y < splash.length; y++) {\n let dx = x - y\n if (dx > 0) drawCell(dx, y)\n }\n\n if (++x < 69) {\n if (++cycles >= 3) {\n setTimeout(loop, 20)\n cycles = 0\n } else loop()\n } else {\n moveTo(0, splash.length)\n self.emit('write', '\\x1b[m\\x1b[?25h')\n resolve()\n }\n }\n loop()\n })\n }\n printText (fast = false) {\n // lots of printing\n let parts = [\n '',\n ' ESPTerm is a VT100-like terminal emulator running on the ESP8266 WiFi chip.',\n '',\n ' \\x1b[93mThis is an online demo of the web user interface, simulating a simple ',\n ' terminal in your browser.\\x1b[m',\n '',\n ' Type \\x1b[92mls\\x1b[m to list available commands.',\n ' Use the \\x1b[94mlinks\\x1b[m below this screen for a demo of the options and more info.',\n ''\n ]\n\n if (fast) {\n this.emit('write', parts.join('\\r\\n') + '\\r\\n')\n this.destroy()\n } else {\n const self = this\n let loop = function () {\n self.emit('write', parts.shift() + '\\r\\n')\n if (parts.length) setTimeout(loop, 17)\n else self.destroy()\n }\n loop()\n }\n }\n },\n colors: class PrintColors extends Process {\n run () {\n this.emit('write', '\\r\\n')\n let fgtext = 'foreground-color'\n this.emit('write', ' ')\n for (let i = 0; i < 16; i++) {\n this.emit('write', '\\x1b[' + (i < 8 ? `3${i}` : `9${i - 8}`) + 'm')\n this.emit('write', fgtext[i] + ' ')\n }\n this.emit('write', '\\r\\n ')\n for (let i = 0; i < 16; i++) {\n this.emit('write', '\\x1b[' + (i < 8 ? `4${i}` : `10${i - 8}`) + 'm ')\n }\n this.emit('write', '\\x1b[m\\r\\n')\n for (let r = 0; r < 6; r++) {\n this.emit('write', ' ')\n for (let g = 0; g < 6; g++) {\n for (let b = 0; b < 6; b++) {\n this.emit('write', `\\x1b[48;5;${16 + r * 36 + g * 6 + b}m `)\n }\n this.emit('write', '\\x1b[m')\n }\n this.emit('write', '\\r\\n')\n }\n this.emit('write', ' ')\n for (let g = 0; g < 24; g++) {\n this.emit('write', `\\x1b[48;5;${232 + g}m `)\n }\n this.emit('write', '\\x1b[m\\r\\n\\n')\n this.destroy()\n }\n },\n ls: class ListCommands extends Process {\n run () {\n this.emit('write', '\\x1b[92mList of demo commands\\x1b[m\\r\\n')\n for (let i in demoshIndex) {\n if (typeof demoshIndex[i] === 'string') continue\n this.emit('write', i + '\\r\\n')\n }\n this.destroy()\n }\n },\n theme: class SetTheme extends Process {\n constructor (shell) {\n super()\n this.shell = shell\n }\n run (...args) {\n let theme = +args[0] | 0\n const maxnum = themes.length\n if (!args.length || !Number.isFinite(theme) || theme < 0 || theme >= maxnum) {\n this.emit('write', `\\x1b[31mUsage: theme [0–${maxnum - 1}]\\r\\n`)\n this.destroy()\n return\n }\n this.shell.terminal.theme = theme\n // HACK: reset drawn screen to prevent only partly redrawn screen\n this.shell.terminal.termScreen.drawnScreenFG = []\n this.emit('write', '')\n this.destroy()\n }\n },\n cursor: class SetCursor extends Process {\n run (...args) {\n let steady = args.includes('--steady')\n if (args.includes('block')) {\n this.emit('write', `\\x1b[${2 * steady} q`)\n } else if (args.includes('line')) {\n this.emit('write', `\\x1b[${3 + steady} q`)\n } else if (args.includes('bar') || args.includes('beam')) {\n this.emit('write', `\\x1b[${5 + steady} q`)\n } else {\n this.emit('write', '\\x1b[31mUsage: cursor [block|line|bar] [--steady]\\r\\n')\n }\n this.destroy()\n }\n },\n rainbow: class ToggleRainbow extends Process {\n constructor (shell) {\n super()\n this.shell = shell\n }\n run () {\n this.shell.terminal.rainbow = !this.shell.terminal.rainbow\n this.shell.terminal.rainbowTimer()\n this.emit('write', '')\n this.destroy()\n }\n },\n mouse: class ShowMouse extends Process {\n constructor (shell) {\n super()\n this.shell = shell\n }\n run () {\n this.shell.terminal.trackMouse = true\n demoData.mouseReceiver = this\n this.randomData = []\n this.highlighted = {}\n let characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n for (let i = 0; i < 23; i++) {\n let line = ''\n for (let j = 0; j < 79; j++) {\n line += characters[Math.floor(characters.length * Math.random())]\n }\n this.randomData.push(line)\n }\n this.scrollOffset = 0\n this.render()\n }\n render () {\n this.emit('write', '\\x1b[m\\x1b[2J\\x1b[1;1H')\n this.emit('write', '\\x1b[97m\\x1b[1mMouse Demo\\r\\n\\x1b[mMouse movement, clicking and scrolling!')\n\n // render random data for scrolling\n for (let y = 0; y < 23; y++) {\n let index = y + this.scrollOffset\n // proper modulo:\n index = ((index % this.randomData.length) + this.randomData.length) % this.randomData.length\n let line = this.randomData[index]\n let lineData = `\\x1b[${3 + y};1H\\x1b[38;5;239m`\n for (let x in line) {\n if (this.highlighted[(y + 2) * 80 + (+x)]) lineData += '\\x1b[97m'\n lineData += line[x]\n if (this.highlighted[(y + 2) * 80 + (+x)]) lineData += '\\x1b[38;5;239m'\n }\n this.emit('write', lineData)\n }\n\n // move cursor to mouse\n if (this.mouse) {\n this.emit('write', `\\x1b[${this.mouse.y + 1};${this.mouse.x + 1}H`)\n }\n }\n mouseMove (x, y) {\n this.mouse = { x, y }\n this.render()\n }\n mouseDown (x, y, button) {\n if (button === 4) this.scrollOffset--\n else if (button === 5) this.scrollOffset++\n else this.highlighted[y * 80 + x] = !this.highlighted[y * 80 + x]\n this.render()\n }\n mouseUp (x, y, button) {}\n destroy () {\n this.shell.terminal.write('\\x1b[2J\\x1b[1;1H')\n this.shell.terminal.trackMouse = false\n if (demoData.mouseReceiver === this) demoData.mouseReceiver = null\n super.destroy()\n }\n },\n sudo: class Sudo extends Process {\n constructor (shell) {\n super()\n this.shell = shell\n }\n run (...args) {\n if (args.length === 0) {\n this.emit('write', '\\x1b[31mUsage: sudo <command>\\x1b[m\\r\\n')\n this.destroy()\n } else if (args.length === 4 && args.join(' ').toLowerCase() === 'make me a sandwich') {\n const b = '\\x1b[33m'\n const r = '\\x1b[0m'\n const l = '\\x1b[32m'\n const c = '\\x1b[38;5;229m'\n const h = '\\x1b[38;5;225m'\n this.emit('write',\n ` ${b}_.---._\\r\\n` +\n ` _.-~ ~-._\\r\\n` +\n ` _.-~ ~-._\\r\\n` +\n ` _.-~ ~---._\\r\\n` +\n ` _.-~ ~\\\\\\r\\n` +\n ` .-~ _.;\\r\\n` +\n ` :-._ _.-~ ./\\r\\n` +\n ` \\`-._~-._ _..__.-~ _.-~\\r\\n` +\n ` ${c}/ ${b}~-._~-._ / .__..--${c}~-${l}---._\\r\\n` +\n `${c} \\\\_____(_${b};-._\\\\. _.-~_/${c} ~)${l}.. . \\\\\\r\\n` +\n `${l} /(_____ ${b}\\\\\\`--...--~_.-~${c}______..-+${l}_______)\\r\\n` +\n `${l} .(_________/${b}\\`--...--~/${l} _/ ${h} ${b}/\\\\\\r\\n` +\n `${b} /-._${h} \\\\_ ${l}(___./_..-~${h}__.....${b}__..-~./\\r\\n` +\n `${b} \\`-._~-._${h} ~\\\\--------~ .-~${b}_..__.-~ _.-~\\r\\n` +\n `${b} ~-._~-._ ${h}~---------\\` ${b}/ .__..--~\\r\\n` +\n `${b} ~-._\\\\. _.-~_/\\r\\n` +\n `${b} \\\\\\`--...--~_.-~\\r\\n` +\n `${b} \\`--...--~${r}\\r\\n`)\n this.destroy()\n } else {\n let name = args.shift()\n if (this.shell.index[name]) {\n let Process = this.shell.index[name]\n if (Process instanceof Function) {\n let child = new Process(this)\n let write = data => this.emit('write', data)\n child.on('write', write)\n child.on('exit', code => {\n child.removeListener('write', write)\n this.destroy()\n })\n child.run(...args)\n } else {\n this.emit('write', Process)\n this.destroy()\n }\n } else {\n this.emit('write', `sudo: ${name}: command not found\\r\\n`)\n this.destroy()\n }\n }\n }\n },\n make: class Make extends Process {\n run (...args) {\n if (args.length === 0) this.emit('write', '\\x1b[31mmake: *** No targets specified. Stop.\\x1b[0m\\r\\n')\n else if (args.length === 3 && args.join(' ').toLowerCase() === 'me a sandwich') {\n this.emit('write', '\\x1b[31mmake: me a sandwich : Permission denied\\x1b[0m\\r\\n')\n } else {\n this.emit('write', `\\x1b[31mmake: *** No rule to make target '${args.join(' ').toLowerCase()}'. Stop.\\x1b[0m\\r\\n`)\n }\n this.destroy()\n }\n },\n pwd: '/this/is/a/demo\\r\\n',\n cd: '\\x1b[38;5;239mNo directories to change to\\r\\n',\n whoami: `${window.navigator.userAgent}\\r\\n`,\n hostname: `${window.location.hostname}`,\n uname: 'ESPTerm Demo\\r\\n',\n mkdir: '\\x1b[38;5;239mDid not create a directory because this is a demo.\\r\\n',\n rm: '\\x1b[38;5;239mDid not delete anything because this is a demo.\\r\\n',\n cp: '\\x1b[38;5;239mNothing to copy because this is a demo.\\r\\n',\n mv: '\\x1b[38;5;239mNothing to move because this is a demo.\\r\\n',\n ln: '\\x1b[38;5;239mNothing to link because this is a demo.\\r\\n',\n touch: '\\x1b[38;5;239mNothing to touch\\r\\n',\n exit: '\\x1b[38;5;239mNowhere to go\\r\\n',\n github: class GoToGithub extends Process {\n run () {\n window.open('https://github.com/espterm/espterm-firmware')\n this.destroy()\n }\n }\n}\n\nclass DemoShell {\n constructor (terminal, printInfo) {\n this.terminal = terminal\n this.terminal.reset()\n this.parser = new ANSIParser((...args) => this.handleParsed(...args))\n this.history = []\n this.historyIndex = 0\n this.cursorPos = 0\n this.child = null\n this.index = demoshIndex\n\n if (printInfo) this.run('info')\n else this.prompt()\n }\n write (text) {\n if (this.child) {\n if (text.codePointAt(0) === 3) this.child.destroy()\n else this.child.write(text)\n } else this.parser.write(text)\n }\n prompt (success = true) {\n if (this.terminal.cursor.x !== 0) this.terminal.write('\\x1b[m\\x1b[38;5;238m⏎\\r\\n')\n this.terminal.write('\\x1b[34;1mdemosh \\x1b[m')\n if (!success) this.terminal.write('\\x1b[31m')\n this.terminal.write('$ \\x1b[m')\n this.history.unshift('')\n this.cursorPos = 0\n }\n copyFromHistoryIndex () {\n if (!this.historyIndex) return\n let current = this.history[this.historyIndex]\n this.history[0] = current\n this.historyIndex = 0\n }\n handleParsed (action, ...args) {\n this.terminal.write('\\b\\x1b[P'.repeat(this.cursorPos))\n if (action === 'write') {\n this.copyFromHistoryIndex()\n this.history[0] = this.history[0].substr(0, this.cursorPos) + args[0] + this.history[0].substr(this.cursorPos)\n this.cursorPos++\n } else if (action === 'back') {\n this.copyFromHistoryIndex()\n this.history[0] = this.history[0].substr(0, this.cursorPos - 1) + this.history[0].substr(this.cursorPos)\n this.cursorPos--\n if (this.cursorPos < 0) this.cursorPos = 0\n } else if (action === 'tab') {\n console.warn('TAB not implemented') // TODO completion\n } else if (action === 'move-cursor-x') {\n this.cursorPos = Math.max(0, Math.min(this.history[this.historyIndex].length, this.cursorPos + args[0]))\n } else if (action === 'delete-line') {\n this.copyFromHistoryIndex()\n this.history[0] = ''\n this.cursorPos = 0\n } else if (action === 'delete-word') {\n this.copyFromHistoryIndex()\n let words = this.history[0].substr(0, this.cursorPos).split(' ')\n words.pop()\n this.history[0] = words.join(' ') + this.history[0].substr(this.cursorPos)\n this.cursorPos = words.join(' ').length\n } else if (action === 'move-cursor-y') {\n this.historyIndex -= args[0]\n if (this.historyIndex < 0) this.historyIndex = 0\n if (this.historyIndex >= this.history.length) this.historyIndex = this.history.length - 1\n this.cursorPos = this.history[this.historyIndex].length\n }\n\n this.terminal.write(this.history[this.historyIndex])\n this.terminal.write('\\b'.repeat(this.history[this.historyIndex].length))\n this.terminal.moveForward(this.cursorPos)\n this.terminal.write('') // dummy. Apply the moveFoward\n\n if (action === 'return') {\n this.terminal.write('\\r\\n')\n this.parse(this.history[this.historyIndex])\n }\n }\n parse (input) {\n if (input === 'help') input = 'info'\n // TODO: basic chaining (i.e. semicolon)\n this.run(input)\n }\n run (command) {\n let parts = ['']\n\n let inQuote = false\n for (let character of command.trim()) {\n if (inQuote && character !== inQuote) {\n parts[parts.length - 1] += character\n } else if (inQuote) {\n inQuote = false\n } else if (character === '\"' || character === \"'\") {\n inQuote = character\n } else if (character.match(/\\s/)) {\n if (parts[parts.length - 1]) parts.push('')\n } else parts[parts.length - 1] += character\n }\n\n let name = parts.shift()\n\n if (name in this.index) {\n this.spawn(name, parts)\n } else {\n this.terminal.write(`demosh: Unknown command: ${name}\\r\\n`)\n this.prompt(false)\n }\n }\n spawn (name, args = []) {\n let Process = this.index[name]\n if (Process instanceof Function) {\n this.child = new Process(this)\n let write = data => this.terminal.write(data)\n this.child.on('write', write)\n this.child.on('exit', code => {\n if (this.child) this.child.removeListener('write', write)\n this.child = null\n this.prompt(!code)\n })\n this.child.run(...args)\n } else {\n this.terminal.write(Process)\n this.prompt()\n }\n }\n}\n\nwindow.demoInterface = module.exports = {\n input (data) {\n let type = data[0]\n let content = data.substr(1)\n\n if (type === 's') {\n this.shell.write(content)\n } else if (type === 'b') {\n let button = content.charCodeAt(0)\n let action = demoData.buttons[button]\n if (action) {\n if (typeof action === 'string') this.shell.write(action)\n else if (action instanceof Function) action(this.terminal, this.shell)\n }\n } else if (type === 'm' || type === 'p' || type === 'r') {\n let row = parse2B(content, 0)\n let column = parse2B(content, 2)\n let button = parse2B(content, 4)\n let modifiers = parse2B(content, 6)\n\n if (demoData.mouseReceiver) {\n if (type === 'm') demoData.mouseReceiver.mouseMove(column, row, button, modifiers)\n else if (type === 'p') demoData.mouseReceiver.mouseDown(column, row, button, modifiers)\n else if (type === 'r') demoData.mouseReceiver.mouseUp(column, row, button, modifiers)\n }\n }\n },\n didInit: false,\n init (screen) {\n if (this.didInit) return\n this.didInit = true\n this.terminal = new ScrollingTerminal(screen)\n this.shell = new DemoShell(this.terminal, true)\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/demo.js","require('./lib/polyfills')\nrequire('./modal')\nrequire('./notif')\nrequire('./appcommon')\ntry { require('./term/demo') } catch (err) {}\nrequire('./wifi')\n\nconst $ = require('./lib/chibi')\nconst { qs } = require('./utils')\n\n/* Export stuff to the global scope for inline scripts */\nwindow.termInit = require('./term')\nwindow.$ = $\nwindow.qs = qs\n\nwindow.themes = require('./term/themes')\n\n\n\n// WEBPACK FOOTER //\n// ./js/index.js","/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */\nif (!String.fromCodePoint) {\n (function () {\n var defineProperty = (function () {\n // IE 8 only supports `Object.defineProperty` on DOM elements\n try {\n var object = {};\n var $defineProperty = Object.defineProperty;\n var result = $defineProperty(object, object, object) && $defineProperty;\n } catch (error) {\n }\n return result;\n }());\n var stringFromCharCode = String.fromCharCode;\n var floor = Math.floor;\n var fromCodePoint = function () {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n if (!length) {\n return '';\n }\n var result = '';\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n if (codePoint <= 0xFFFF) { // BMP code point\n codeUnits.push(codePoint);\n } else { // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xD800;\n lowSurrogate = (codePoint % 0x400) + 0xDC00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n result += stringFromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n if (defineProperty) {\n defineProperty(String, 'fromCodePoint', {\n 'value': fromCodePoint,\n 'configurable': true,\n 'writable': true\n });\n } else {\n String.fromCodePoint = fromCodePoint;\n }\n }());\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/lib/polyfills.js","const $ = require('./lib/chibi')\nconst { mk, qs, qsa, cr } = require('./utils')\nconst modal = require('./modal')\nconst notify = require('./notif')\n\n/** Global generic init */\n$.ready(function () {\n // Opening menu on mobile / narrow screen\n function menuOpen () {\n $('#menu').toggleClass('expanded')\n }\n $('#brand')\n .on('click', menuOpen)\n .on('keypress', cr(menuOpen))\n\n // Checkbox UI (checkbox CSS and hidden input with int value)\n $('.Row.checkbox').forEach(function (x) {\n let inp = x.querySelector('input')\n let box = x.querySelector('.box')\n\n $(box).toggleClass('checked', inp.value)\n\n let hdl = function () {\n inp.value = 1 - inp.value\n $(box).toggleClass('checked', inp.value)\n }\n\n $(x).on('click', hdl).on('keypress', cr(hdl))\n })\n\n // Expanding boxes on mobile\n $('.Box.mobcol,.Box.fold').forEach(function (x) {\n let h = x.querySelector('h2')\n\n let hdl = function () {\n $(x).toggleClass('expanded')\n }\n $(h).on('click', hdl).on('keypress', cr(hdl))\n })\n\n $('form').forEach(function (x) {\n $(x).on('keypress', function (e) {\n if ((e.keyCode === 10 || e.keyCode === 13) && e.ctrlKey) {\n x.submit()\n }\n })\n })\n\n // loader dots...\n setInterval(function () {\n $('.anim-dots').each(function (x) {\n let $x = $(x)\n let dots = $x.html() + '.'\n if (dots.length === 5) dots = '.'\n $x.html(dots)\n })\n }, 1000)\n\n // flipping number boxes with the mouse wheel\n $('input[type=number]').on('mousewheel', function (e) {\n let $this = $(this)\n let val = +$this.val()\n if (isNaN(val)) val = 1\n\n const step = +($this.attr('step') || 1)\n const min = +$this.attr('min')\n const max = +$this.attr('max')\n if (e.wheelDelta > 0) {\n val += step\n } else {\n val -= step\n }\n\n if (!Number.isFinite(min)) val = Math.max(val, +min)\n if (!Number.isFinite(max)) val = Math.min(val, +max)\n $this.val(val)\n\n if ('createEvent' in document) {\n let evt = document.createEvent('HTMLEvents')\n evt.initEvent('change', false, true)\n $this[0].dispatchEvent(evt)\n } else {\n $this[0].fireEvent('onchange')\n }\n\n e.preventDefault()\n })\n\n // populate the form errors box from GET arg ?err=...\n // (a way to pass errors back from server via redirect)\n let errAt = window.location.search.indexOf('err=')\n if (errAt !== -1 && qs('.Box.errors')) {\n let errs = window.location.search.substr(errAt + 4).split(',')\n let humanReadableErrors = []\n errs.forEach(function (er) {\n let lbls = qsa('label[for=\"' + er + '\"]')\n for (let i = 0; i < lbls.length; i++) {\n let lbl = lbls[i]\n lbl.classList.add('error')\n if (i === 0) humanReadableErrors.push(lbl.childNodes[0].textContent.trim().replace(/: ?$/, ''))\n }\n // else {\n // hres.push(er)\n // }\n })\n\n qs('.Box.errors .list').innerHTML = humanReadableErrors.join(', ')\n qs('.Box.errors').classList.remove('hidden')\n }\n\n modal.init()\n notify.init()\n\n // remove tabindices from h2 if wide\n if (window.innerWidth > 550) {\n $('.Box h2').forEach(function (x) {\n x.removeAttribute('tabindex')\n })\n\n // brand works as a link back to term in widescreen mode\n let br = qs('#brand')\n br && br.addEventListener('click', function () {\n window.location.href = '/' // go to terminal\n })\n }\n})\n\n// setup the ajax loader\n$._loader = function (vis) {\n $('#loader').toggleClass('show', vis)\n}\n\nlet pageShown = false\n// reveal content on load\nfunction showPage () {\n pageShown = true\n $('#content').addClass('load')\n}\n// HACKITY HACK: fix this later\nwindow.showPage = showPage\n\n// Auto reveal pages other than the terminal (sets window.noAutoShow)\n$.ready(function () {\n if (window.noAutoShow === true) {\n setTimeout(function () {\n if (!pageShown) {\n let bnr = mk('P')\n bnr.id = 'load-failed'\n bnr.innerHTML =\n 'Server connection failed! Trying again' +\n '<span class=\"anim-dots\" style=\"width:1.5em;text-align:left;display:inline-block\">.</span>'\n qs('#screen').appendChild(bnr)\n showPage()\n }\n }, 2000)\n } else {\n setTimeout(function () {\n showPage()\n }, 1)\n }\n})\n\n\n\n// WEBPACK FOOTER //\n// ./js/appcommon.js","const $ = require('./lib/chibi')\nconst { mk, bool } = require('./utils')\nconst tr = require('./lang')\n\n;(function (w) {\n const authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2']\n let curSSID\n\n // Get XX % for a slider input\n function rangePt (inp) {\n return Math.round(((inp.value / inp.max) * 100)) + '%'\n }\n\n // Display selected STA SSID etc\n function selectSta (name, password, ip) {\n $('#sta_ssid').val(name)\n $('#sta_password').val(password)\n\n $('#sta-nw').toggleClass('hidden', name.length === 0)\n $('#sta-nw-nil').toggleClass('hidden', name.length > 0)\n\n $('#sta-nw .essid').html($.htmlEscape(name))\n const nopw = !password || password.length === 0\n $('#sta-nw .passwd').toggleClass('hidden', nopw)\n $('#sta-nw .nopasswd').toggleClass('hidden', !nopw)\n $('#sta-nw .ip').html(ip.length > 0 ? tr('wifi.connected_ip_is') + ip : tr('wifi.not_conn'))\n }\n\n /** Update display for received response */\n function onScan (resp, status) {\n // var ap_json = {\n // \"result\": {\n // \"inProgress\": \"0\",\n // \"APs\": [\n // {\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n // {\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n // ]\n // }\n // };\n\n if (status !== 200) {\n // bad response\n rescan(5000) // wait 5sm then retry\n return\n }\n\n try {\n resp = JSON.parse(resp)\n } catch (e) {\n console.log(e)\n rescan(5000)\n return\n }\n\n const done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0)\n rescan(done ? 15000 : 1000)\n if (!done) return // no redraw yet\n\n // clear the AP list\n let $list = $('#ap-list')\n // remove old APs\n $('#ap-list .AP').remove()\n\n $list.toggleClass('hidden', !done)\n $('#ap-loader').toggleClass('hidden', done)\n\n // scan done\n resp.result.APs.sort(function (a, b) {\n return b.rssi - a.rssi\n }).forEach(function (ap) {\n ap.enc = parseInt(ap.enc)\n\n if (ap.enc > 4) return // hide unsupported auths\n\n let item = mk('div')\n\n let $item = $(item)\n .data('ssid', ap.essid)\n .data('pwd', ap.enc)\n .attr('tabindex', 0)\n .addClass('AP')\n\n // mark current SSID\n if (ap.essid === curSSID) {\n $item.addClass('selected')\n }\n\n let inner = mk('div')\n let escapedSSID = $.htmlEscape(ap.essid)\n $(inner).addClass('inner')\n .htmlAppend(`<div class=\"rssi\">${ap.rssi_perc}</div>`)\n .htmlAppend(`<div class=\"essid\" title=\"${escapedSSID}\">${escapedSSID}</div>`)\n .htmlAppend(`<div class=\"auth\">${authStr[ap.enc]}</div>`)\n\n $item.on('click', function () {\n let $th = $(this)\n\n const conn_ssid = $th.data('ssid')\n let conn_pass = ''\n\n if (+$th.data('pwd')) {\n // this AP needs a password\n conn_pass = window.prompt(tr('wifi.enter_passwd').replace(':ssid:', conn_ssid))\n if (!conn_pass) return\n }\n\n $('#sta_password').val(conn_pass)\n $('#sta_ssid').val(conn_ssid)\n selectSta(conn_ssid, conn_pass, '')\n })\n\n item.appendChild(inner)\n $list[0].appendChild(item)\n })\n }\n\n function startScanning () {\n $('#ap-loader').removeClass('hidden')\n $('#ap-scan').addClass('hidden')\n $('#ap-loader .anim-dots').html('.')\n\n scanAPs()\n }\n\n /** Ask the CGI what APs are visible (async) */\n function scanAPs () {\n if (window._demo) {\n onScan(window._demo_aps, 200)\n } else {\n $.get('http://' + window._root + '/cfg/wifi/scan', onScan)\n }\n }\n\n function rescan (time) {\n setTimeout(scanAPs, time)\n }\n\n /** Set up the WiFi page */\n function wifiInit (cfg) {\n // Update slider value displays\n $('.Row.range').forEach(function (x) {\n let inp = x.querySelector('input')\n let disp1 = x.querySelector('.x-disp1')\n let disp2 = x.querySelector('.x-disp2')\n let t = rangePt(inp)\n $(disp1).html(t)\n $(disp2).html(t)\n $(inp).on('input', function () {\n t = rangePt(inp)\n $(disp1).html(t)\n $(disp2).html(t)\n })\n })\n\n // Forget STA credentials\n $('#forget-sta').on('click', () => {\n selectSta('', '', '')\n return false\n })\n\n selectSta(cfg.sta_ssid, cfg.sta_password, cfg.sta_active_ip)\n curSSID = cfg.sta_active_ssid\n }\n\n w.init = wifiInit\n w.startScanning = startScanning\n})(window.WiFi = {})\n\n\n\n// WEBPACK FOOTER //\n// ./js/wifi.js","// Generated from PHP locale file\nlet _tr = {\n \"wifi.connected_ip_is\": \"Connected, IP is \",\n \"wifi.not_conn\": \"Not connected.\",\n \"wifi.enter_passwd\": \"Enter password for \\\":ssid:\\\"\"\n};\n\nmodule.exports = function tr (key) { return _tr[key] || '?' + key + '?' }\n\n\n\n// WEBPACK FOOTER //\n// ./js/lang.js","const { qs, mk } = require('../utils')\nconst Notify = require('../notif')\nconst TermScreen = require('./screen')\nconst TermConnection = require('./connection')\nconst TermInput = require('./input')\nconst TermUpload = require('./upload')\nconst initSoftKeyboard = require('./soft_keyboard')\nconst attachDebugScreen = require('./debug_screen')\n\n/** Init the terminal sub-module - called from HTML */\nmodule.exports = function (opts) {\n const screen = new TermScreen()\n const conn = new TermConnection(screen)\n const input = TermInput(conn, screen)\n const termUpload = TermUpload(conn, input, screen)\n screen.input = input\n input.termUpload = termUpload\n\n // we delay the display of \"connecting\" to avoid flash when changing tabs with the terminal open\n let showConnectingTimeout = -1\n conn.on('open', () => {\n showConnectingTimeout = setTimeout(() => {\n screen.window.statusScreen = { title: 'Connecting', loading: true }\n }, 250)\n })\n conn.on('connect', () => {\n clearTimeout(showConnectingTimeout)\n screen.window.statusScreen = { title: 'Waiting for content', loading: true }\n })\n conn.on('load', () => {\n if (screen.window.statusScreen) screen.window.statusScreen = null\n })\n conn.on('disconnect', () => {\n clearTimeout(showConnectingTimeout)\n screen.window.statusScreen = { title: 'Disconnected' }\n screen.screen = []\n screen.screenFG = []\n screen.screenBG = []\n screen.screenAttrs = []\n })\n conn.on('silence', () => { screen.window.statusScreen = { title: 'Waiting for server', loading: true } })\n // conn.on('ping-fail', () => { screen.window.statusScreen = { title: 'Disconnected' } })\n conn.on('ping-success', () => { screen.window.statusScreen = { title: 'Re-connecting', loading: true } })\n\n conn.init()\n input.init(opts)\n termUpload.init()\n Notify.init()\n\n window.onerror = function (errorMsg, file, line, col) {\n Notify.show(`<b>JS ERROR!</b><br>${errorMsg}<br>at ${file}:${line}:${col}`, 10000, true)\n return false\n }\n\n qs('#screen').appendChild(screen.canvas)\n screen.load(opts.labels, opts) // load labels and theme\n\n initSoftKeyboard(screen, input)\n if (attachDebugScreen) attachDebugScreen(screen)\n\n let isFullscreen = false\n let fitScreen = false\n let fitScreenIfNeeded = function fitScreenIfNeeded () {\n if (isFullscreen) {\n screen.window.fitIntoWidth = window.screen.width\n screen.window.fitIntoHeight = window.screen.height\n } else {\n screen.window.fitIntoWidth = fitScreen ? window.innerWidth - 20 : 0\n screen.window.fitIntoHeight = fitScreen ? window.innerHeight : 0\n }\n }\n fitScreenIfNeeded()\n window.addEventListener('resize', fitScreenIfNeeded)\n\n let toggleFitScreen = function () {\n fitScreen = !fitScreen\n const resizeButtonIcon = qs('#resize-button-icon')\n if (fitScreen) {\n resizeButtonIcon.classList.remove('icn-resize-small')\n resizeButtonIcon.classList.add('icn-resize-full')\n } else {\n resizeButtonIcon.classList.remove('icn-resize-full')\n resizeButtonIcon.classList.add('icn-resize-small')\n }\n fitScreenIfNeeded()\n }\n\n qs('#term-fit-screen').addEventListener('click', function () {\n toggleFitScreen()\n return false\n })\n\n // add fullscreen mode & button\n if (window.Element.prototype.requestFullscreen || window.Element.prototype.webkitRequestFullscreen) {\n let checkForFullscreen = function () {\n // document.fullscreenElement is not really supported yet, so here's a hack\n if (isFullscreen && (window.innerWidth !== window.screen.width || window.innerHeight !== window.screen.height)) {\n isFullscreen = false\n fitScreenIfNeeded()\n }\n }\n setInterval(checkForFullscreen, 500)\n\n // (why are the buttons anchors?)\n let button = mk('a')\n button.href = '#'\n button.addEventListener('click', e => {\n e.preventDefault()\n\n isFullscreen = true\n fitScreenIfNeeded()\n screen.updateSize()\n\n if (screen.canvas.requestFullscreen) screen.canvas.requestFullscreen()\n else screen.canvas.webkitRequestFullscreen()\n })\n let icon = mk('i')\n icon.classList.add('icn-resize-full') // TODO: less confusing icons\n button.appendChild(icon)\n let span = mk('span')\n span.textContent = 'Fullscreen'\n button.appendChild(span)\n qs('#term-nav').insertBefore(button, qs('#term-nav').firstChild)\n }\n\n // for debugging\n window.termScreen = screen\n window.conn = conn\n window.input = input\n window.termUpl = termUpload\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/index.js","const EventEmitter = require('events')\nconst $ = require('../lib/chibi')\nconst { mk, qs } = require('../utils')\nconst notify = require('../notif')\nconst ScreenParser = require('./screen_parser')\nconst ScreenRenderer = require('./screen_renderer')\n\nmodule.exports = class TermScreen extends EventEmitter {\n constructor () {\n super()\n\n this.canvas = mk('canvas')\n this.ctx = this.canvas.getContext('2d')\n\n this.parser = new ScreenParser(this)\n this.renderer = new ScreenRenderer(this)\n\n // debug screen handle\n this._debug = null\n\n if ('AudioContext' in window || 'webkitAudioContext' in window) {\n this.audioCtx = new (window.AudioContext || window.webkitAudioContext)()\n } else {\n console.warn('No AudioContext!')\n }\n\n // dummy. Handle for Input\n this.input = new Proxy({}, {\n get () {\n return () => console.warn('TermScreen#input not set!')\n }\n })\n\n this.cursor = {\n x: 0,\n y: 0,\n blinking: true,\n visible: true,\n hanging: false,\n style: 'block'\n }\n\n this._window = {\n width: 0,\n height: 0,\n devicePixelRatio: 1,\n fontFamily: '\"DejaVu Sans Mono\", \"Liberation Mono\", \"Inconsolata\", \"Menlo\", monospace',\n fontSize: 20,\n gridScaleX: 1.0,\n gridScaleY: 1.2,\n fitIntoWidth: 0,\n fitIntoHeight: 0,\n debug: false,\n graphics: 0,\n statusScreen: null\n }\n\n // scaling caused by fitIntoWidth/fitIntoHeight\n this._windowScale = 1\n\n // properties of this.window that require updating size and redrawing\n this.windowState = {\n width: 0,\n height: 0,\n devicePixelRatio: 0,\n gridScaleX: 0,\n gridScaleY: 0,\n fontFamily: '',\n fontSize: 0,\n fitIntoWidth: 0,\n fitIntoHeight: 0\n }\n\n // current selection\n this.selection = {\n // when false, this will prevent selection in favor of mouse events,\n // though alt can be held to override it\n selectable: true,\n\n // selection start and end (x, y) tuples\n start: [0, 0],\n end: [0, 0]\n }\n\n // mouse features\n this.mouseMode = { clicks: false, movement: false }\n\n // make writing to window update size and draw\n const self = this\n this.window = new Proxy(this._window, {\n set (target, key, value, receiver) {\n target[key] = value\n self.scheduleSizeUpdate()\n self.renderer.scheduleDraw(`window:${key}=${value}`)\n self.emit(`update-window:${key}`, value)\n return true\n }\n })\n\n this.bracketedPaste = false\n this.blinkingCellCount = 0\n this.reverseVideo = false\n\n this.screen = []\n this.screenFG = []\n this.screenBG = []\n this.screenAttrs = []\n\n let selecting = false\n\n let selectStart = (x, y) => {\n if (selecting) return\n selecting = true\n this.selection.start = this.selection.end = this.screenToGrid(x, y, true)\n this.renderer.scheduleDraw('select-start')\n }\n\n let selectMove = (x, y) => {\n if (!selecting) return\n this.selection.end = this.screenToGrid(x, y, true)\n this.renderer.scheduleDraw('select-move')\n }\n\n let selectEnd = (x, y) => {\n if (!selecting) return\n selecting = false\n this.selection.end = this.screenToGrid(x, y, true)\n this.renderer.scheduleDraw('select-end')\n Object.assign(this.selection, this.getNormalizedSelection())\n }\n\n // bind event listeners\n\n this.canvas.addEventListener('mousedown', e => {\n if ((this.selection.selectable || e.altKey) && e.button === 0) {\n selectStart(e.offsetX, e.offsetY)\n } else {\n this.input.onMouseDown(...this.screenToGrid(e.offsetX, e.offsetY),\n e.button + 1)\n }\n })\n\n window.addEventListener('mousemove', e => {\n selectMove(e.offsetX, e.offsetY)\n })\n\n window.addEventListener('mouseup', e => {\n selectEnd(e.offsetX, e.offsetY)\n })\n\n // touch event listeners\n\n let touchPosition = null\n let touchDownTime = 0\n let touchSelectMinTime = 500\n let touchDidMove = false\n\n let getTouchPositionOffset = touch => {\n let rect = this.canvas.getBoundingClientRect()\n return [touch.clientX - rect.left, touch.clientY - rect.top]\n }\n\n this.canvas.addEventListener('touchstart', e => {\n touchPosition = getTouchPositionOffset(e.touches[0])\n touchDidMove = false\n touchDownTime = Date.now()\n })\n\n this.canvas.addEventListener('touchmove', e => {\n touchPosition = getTouchPositionOffset(e.touches[0])\n\n if (!selecting && touchDidMove === false) {\n if (touchDownTime < Date.now() - touchSelectMinTime) {\n selectStart(...touchPosition)\n }\n } else if (selecting) {\n e.preventDefault()\n selectMove(...touchPosition)\n }\n\n touchDidMove = true\n })\n\n this.canvas.addEventListener('touchend', e => {\n if (e.touches[0]) {\n touchPosition = getTouchPositionOffset(e.touches[0])\n }\n\n if (selecting) {\n e.preventDefault()\n selectEnd(...touchPosition)\n\n // selection ended; show touch select menu\n let touchSelectMenu = qs('#touch-select-menu')\n touchSelectMenu.classList.add('open')\n let rect = touchSelectMenu.getBoundingClientRect()\n\n // use middle position for x and one line above for y\n let selectionPos = this.gridToScreen(\n (this.selection.start[0] + this.selection.end[0]) / 2,\n this.selection.start[1] - 1\n )\n selectionPos[0] -= rect.width / 2\n selectionPos[1] -= rect.height / 2\n touchSelectMenu.style.transform = `translate(${selectionPos[0]}px, ${\n selectionPos[1]}px)`\n }\n\n if (!touchDidMove) {\n this.emit('tap', Object.assign(e, {\n x: touchPosition[0],\n y: touchPosition[1]\n }))\n }\n\n touchPosition = null\n })\n\n this.on('tap', e => {\n if (this.selection.start[0] !== this.selection.end[0] ||\n this.selection.start[1] !== this.selection.end[1]) {\n // selection is not empty\n // reset selection\n this.selection.start = this.selection.end = [0, 0]\n qs('#touch-select-menu').classList.remove('open')\n this.renderer.scheduleDraw('select-reset')\n } else {\n e.preventDefault()\n this.emit('open-soft-keyboard')\n }\n })\n\n $.ready(() => {\n let copyButton = qs('#touch-select-copy-btn')\n if (copyButton) {\n copyButton.addEventListener('click', () => {\n this.copySelectionToClipboard()\n })\n }\n })\n\n this.canvas.addEventListener('mousemove', e => {\n if (!selecting) {\n this.input.onMouseMove(...this.screenToGrid(e.offsetX, e.offsetY))\n }\n })\n\n this.canvas.addEventListener('mouseup', e => {\n if (!selecting) {\n this.input.onMouseUp(...this.screenToGrid(e.offsetX, e.offsetY),\n e.button + 1)\n }\n })\n\n this.canvas.addEventListener('wheel', e => {\n if (this.mouseMode.clicks) {\n this.input.onMouseWheel(...this.screenToGrid(e.offsetX, e.offsetY),\n e.deltaY > 0 ? 1 : -1)\n\n // prevent page scrolling\n e.preventDefault()\n }\n })\n\n this.canvas.addEventListener('contextmenu', e => {\n if (this.mouseMode.clicks) {\n // prevent mouse keys getting stuck\n e.preventDefault()\n }\n selectEnd(e.offsetX, e.offsetY)\n })\n }\n\n /**\n * Schedule a size update in the next millisecond\n */\n scheduleSizeUpdate () {\n clearTimeout(this._scheduledSizeUpdate)\n this._scheduledSizeUpdate = setTimeout(() => this.updateSize(), 1)\n }\n\n /**\n * Returns a CSS font string with this TermScreen's font settings and the\n * font modifiers.\n * @param {Object} modifiers\n * @param {string} [modifiers.style] - the font style\n * @param {string} [modifiers.weight] - the font weight\n * @returns {string} a CSS font string\n */\n getFont (modifiers = {}) {\n let fontStyle = modifiers.style || 'normal'\n let fontWeight = modifiers.weight || 'normal'\n return `${fontStyle} normal ${fontWeight} ${this.window.fontSize}px ${this.window.fontFamily}`\n }\n\n /**\n * Converts screen coordinates to grid coordinates.\n * @param {number} x - x in pixels\n * @param {number} y - y in pixels\n * @param {boolean} rounded - whether to round the coord, used for select highlighting\n * @returns {number[]} a tuple of (x, y) in cells\n */\n screenToGrid (x, y, rounded = false) {\n let cellSize = this.getCellSize()\n\n return [\n Math.floor((x + (rounded ? cellSize.width / 2 : 0)) / cellSize.width),\n Math.floor(y / cellSize.height)\n ]\n }\n\n /**\n * Converts grid coordinates to screen coordinates.\n * @param {number} x - x in cells\n * @param {number} y - y in cells\n * @param {boolean} [withScale] - when true, will apply window scale\n * @returns {number[]} a tuple of (x, y) in pixels\n */\n gridToScreen (x, y, withScale = false) {\n let cellSize = this.getCellSize()\n\n return [x * cellSize.width, y * cellSize.height].map(v => withScale ? v * this._windowScale : v)\n }\n\n /**\n * The character size, used for calculating the cell size. The space character\n * is used for measuring.\n * @returns {Object} the character size with `width` and `height` in pixels\n */\n getCharSize () {\n this.ctx.font = this.getFont()\n\n return {\n width: Math.floor(this.ctx.measureText(' ').width),\n height: this.window.fontSize\n }\n }\n\n /**\n * The cell size, which is the character size multiplied by the grid scale.\n * @returns {Object} the cell size with `width` and `height` in pixels\n */\n getCellSize () {\n let charSize = this.getCharSize()\n\n return {\n width: Math.ceil(charSize.width * this.window.gridScaleX),\n height: Math.ceil(charSize.height * this.window.gridScaleY)\n }\n }\n\n /**\n * Updates the canvas size if it changed\n */\n updateSize () {\n // see below (this is just updating it)\n this._window.devicePixelRatio = Math.round(this._windowScale * (window.devicePixelRatio || 1) * 2) / 2\n\n let didChange = false\n for (let key in this.windowState) {\n if (this.windowState.hasOwnProperty(key) && this.windowState[key] !== this.window[key]) {\n didChange = true\n this.windowState[key] = this.window[key]\n }\n }\n\n if (didChange) {\n const {\n width,\n height,\n fitIntoWidth,\n fitIntoHeight\n } = this.window\n const cellSize = this.getCellSize()\n\n // real height of the canvas element in pixels\n let realWidth = width * cellSize.width\n let realHeight = height * cellSize.height\n\n if (fitIntoWidth && fitIntoHeight) {\n let terminalAspect = realWidth / realHeight\n let fitAspect = fitIntoWidth / fitIntoHeight\n\n if (terminalAspect < fitAspect) {\n // align heights\n realHeight = fitIntoHeight\n realWidth = realHeight * terminalAspect\n } else {\n // align widths\n realWidth = fitIntoWidth\n realHeight = realWidth / terminalAspect\n }\n } else if (fitIntoWidth) {\n realHeight = fitIntoWidth / (realWidth / realHeight)\n realWidth = fitIntoWidth\n } else if (fitIntoHeight) {\n realWidth = fitIntoHeight * (realWidth / realHeight)\n realHeight = fitIntoHeight\n }\n\n // store new window scale\n this._windowScale = realWidth / (width * cellSize.width)\n\n // the DPR must be rounded to a very nice value to prevent gaps between cells\n let devicePixelRatio = this._window.devicePixelRatio = Math.round(this._windowScale * (window.devicePixelRatio || 1) * 2) / 2\n\n this.canvas.width = width * devicePixelRatio * cellSize.width\n this.canvas.style.width = `${realWidth}px`\n this.canvas.height = height * devicePixelRatio * cellSize.height\n this.canvas.style.height = `${realHeight}px`\n\n // the screen has been cleared (by changing canvas width)\n this.renderer.resetDrawn()\n\n // draw immediately; the canvas shouldn't flash\n this.renderer.draw('update-size')\n }\n }\n\n /**\n * Returns a normalized version of the current selection, such that `start`\n * is always before `end`.\n * @returns {Object} the normalized selection, with `start` and `end`\n */\n getNormalizedSelection () {\n let { start, end } = this.selection\n // if the start line is after the end line, or if they're both on the same\n // line but the start column comes after the end column, swap\n if (start[1] > end[1] || (start[1] === end[1] && start[0] > end[0])) {\n [start, end] = [end, start]\n }\n return { start, end }\n }\n\n /**\n * Returns whether or not a given cell is in the current selection.\n * @param {number} col - the column (x)\n * @param {number} line - the line (y)\n * @returns {boolean}\n */\n isInSelection (col, line) {\n let { start, end } = this.getNormalizedSelection()\n let colAfterStart = start[0] <= col\n let colBeforeEnd = col < end[0]\n let onStartLine = line === start[1]\n let onEndLine = line === end[1]\n\n if (onStartLine && onEndLine) return colAfterStart && colBeforeEnd\n else if (onStartLine) return colAfterStart\n else if (onEndLine) return colBeforeEnd\n else return start[1] < line && line < end[1]\n }\n\n /**\n * Sweeps for selected cells and joins them in a multiline string.\n * @returns {string} the selection\n */\n getSelectedText () {\n const screenLength = this.window.width * this.window.height\n let lines = []\n let previousLineIndex = -1\n\n for (let cell = 0; cell < screenLength; cell++) {\n let x = cell % this.window.width\n let y = Math.floor(cell / this.window.width)\n\n if (this.isInSelection(x, y)) {\n if (previousLineIndex !== y) {\n previousLineIndex = y\n lines.push('')\n }\n lines[lines.length - 1] += this.screen[cell]\n }\n }\n\n return lines.join('\\n')\n }\n\n /**\n * Copies the selection to clipboard and creates a notification balloon.\n */\n copySelectionToClipboard () {\n let selectedText = this.getSelectedText()\n // don't copy anything if nothing is selected\n if (!selectedText) return\n let textarea = mk('textarea')\n document.body.appendChild(textarea)\n textarea.value = selectedText\n textarea.select()\n if (document.execCommand('copy')) {\n notify.show('Copied to clipboard')\n } else {\n notify.show('Failed to copy')\n }\n document.body.removeChild(textarea)\n }\n\n /**\n * Shows an actual notification (if possible) or a notification balloon.\n * @param {string} text - the notification content\n */\n showNotification (text) {\n console.info(`Notification: ${text}`)\n if (window.Notification && window.Notification.permission === 'granted') {\n let notification = new window.Notification('ESPTerm', {\n body: text\n })\n notification.addEventListener('click', () => window.focus())\n } else {\n if (window.Notification && window.Notification.permission !== 'denied') {\n window.Notification.requestPermission()\n } else {\n // Fallback using the built-in notification balloon\n notify.show(text)\n }\n }\n }\n\n /**\n * Creates a beep sound.\n */\n beep () {\n const audioCtx = this.audioCtx\n if (!audioCtx) return\n\n // prevent screeching\n if (this._lastBeep && this._lastBeep > Date.now() - 50) return\n this._lastBeep = Date.now()\n\n if (!this._convolver) {\n this._convolver = audioCtx.createConvolver()\n let impulseLength = audioCtx.sampleRate * 0.8\n let impulse = audioCtx.createBuffer(2, impulseLength, audioCtx.sampleRate)\n for (let i = 0; i < impulseLength; i++) {\n impulse.getChannelData(0)[i] = (1 - i / impulseLength) ** (7 + Math.random())\n impulse.getChannelData(1)[i] = (1 - i / impulseLength) ** (7 + Math.random())\n }\n this._convolver.buffer = impulse\n this._convolver.connect(audioCtx.destination)\n }\n\n // main beep\n const mainOsc = audioCtx.createOscillator()\n const mainGain = audioCtx.createGain()\n mainOsc.connect(mainGain)\n mainGain.gain.value = 6\n mainOsc.frequency.value = 750\n mainOsc.type = 'sine'\n\n // surrogate beep (making it sound like 'oops')\n const surrOsc = audioCtx.createOscillator()\n const surrGain = audioCtx.createGain()\n surrOsc.connect(surrGain)\n surrGain.gain.value = 4\n surrOsc.frequency.value = 400\n surrOsc.type = 'sine'\n\n mainGain.connect(this._convolver)\n surrGain.connect(this._convolver)\n\n let startTime = audioCtx.currentTime\n mainOsc.start()\n mainOsc.stop(startTime + 0.5)\n surrOsc.start(startTime + 0.05)\n surrOsc.stop(startTime + 0.8)\n\n let loop = function () {\n if (audioCtx.currentTime < startTime + 0.8) window.requestAnimationFrame(loop)\n mainGain.gain.value *= 0.8\n surrGain.gain.value *= 0.8\n }\n loop()\n }\n\n load (...args) {\n this.parser.load(...args)\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/screen.js","const $ = require('../lib/chibi')\nconst { qs } = require('../utils')\nconst { themes } = require('./themes')\n\n// constants for decoding the update blob\nconst SEQ_REPEAT = 2\nconst SEQ_SET_COLORS = 3\nconst SEQ_SET_ATTRS = 4\nconst SEQ_SET_FG = 5\nconst SEQ_SET_BG = 6\n\nmodule.exports = class ScreenParser {\n constructor (screen) {\n this.screen = screen\n\n // true if TermScreen#load was called at least once\n this.contentLoaded = false\n }\n /**\n * Parses the content of an `S` message and schedules a draw\n * @param {string} str - the message content\n */\n loadContent (str) {\n // current index\n let i = 0\n let strArray = Array.from ? Array.from(str) : str.split('')\n\n // Uncomment to capture screen content for the demo page\n // console.log(JSON.stringify(`S${str}`))\n\n if (!this.contentLoaded) {\n let errmsg = qs('#load-failed')\n if (errmsg) errmsg.parentNode.removeChild(errmsg)\n this.contentLoaded = true\n }\n\n // window size\n const newHeight = strArray[i++].codePointAt(0) - 1\n const newWidth = strArray[i++].codePointAt(0) - 1\n const resized = (this.screen.window.height !== newHeight) || (this.screen.window.width !== newWidth)\n this.screen.window.height = newHeight\n this.screen.window.width = newWidth\n\n // cursor position\n let [cursorY, cursorX] = [\n strArray[i++].codePointAt(0) - 1,\n strArray[i++].codePointAt(0) - 1\n ]\n let cursorMoved = (cursorX !== this.screen.cursor.x || cursorY !== this.screen.cursor.y)\n this.screen.cursor.x = cursorX\n this.screen.cursor.y = cursorY\n\n if (cursorMoved) {\n this.screen.renderer.resetCursorBlink()\n this.screen.emit('cursor-moved')\n }\n\n // attributes\n let attributes = strArray[i++].codePointAt(0) - 1\n\n this.screen.cursor.visible = !!(attributes & 1)\n this.screen.cursor.hanging = !!(attributes & (1 << 1))\n\n this.screen.input.setAlts(\n !!(attributes & (1 << 2)), // cursors alt\n !!(attributes & (1 << 3)), // numpad alt\n !!(attributes & (1 << 4)), // fn keys alt\n !!(attributes & (1 << 12)) // crlf mode\n )\n\n let trackMouseClicks = !!(attributes & (1 << 5))\n let trackMouseMovement = !!(attributes & (1 << 6))\n\n // 0 - Block blink 2 - Block steady (1 is unused)\n // 3 - Underline blink 4 - Underline steady\n // 5 - I-bar blink 6 - I-bar steady\n let cursorShape = (attributes >> 9) & 0x07\n\n // if it's not zero, decrement such that the two most significant bits\n // are the type and the least significant bit is the blink state\n if (cursorShape > 0) cursorShape--\n\n let cursorStyle = cursorShape >> 1\n let cursorBlinking = !(cursorShape & 1)\n\n if (cursorStyle === 0) this.screen.cursor.style = 'block'\n else if (cursorStyle === 1) this.screen.cursor.style = 'line'\n else if (cursorStyle === 2) this.screen.cursor.style = 'bar'\n\n if (this.screen.cursor.blinking !== cursorBlinking) {\n this.screen.cursor.blinking = cursorBlinking\n this.screen.renderer.resetCursorBlink()\n }\n\n this.screen.input.setMouseMode(trackMouseClicks, trackMouseMovement)\n this.screen.selection.selectable = !trackMouseClicks && !trackMouseMovement\n $(this.screen.canvas).toggleClass('selectable', this.screen.selection.selectable)\n this.screen.mouseMode = {\n clicks: trackMouseClicks,\n movement: trackMouseMovement\n }\n\n let showButtons = !!(attributes & (1 << 7))\n let showConfigLinks = !!(attributes & (1 << 8))\n\n $('.x-term-conf-btn').toggleClass('hidden', !showConfigLinks)\n $('#action-buttons').toggleClass('hidden', !showButtons)\n\n this.screen.bracketedPaste = !!(attributes & (1 << 13))\n this.screen.reverseVideo = !!(attributes & (1 << 14))\n\n // content\n let fg = 7\n let bg = 0\n let attrs = 0\n let cell = 0 // cell index\n let lastChar = ' '\n let screenLength = this.screen.window.width * this.screen.window.height\n\n if (resized) {\n this.screen.updateSize()\n this.screen.blinkingCellCount = 0\n this.screen.screen = new Array(screenLength).fill(' ')\n this.screen.screenFG = new Array(screenLength).fill(' ')\n this.screen.screenBG = new Array(screenLength).fill(' ')\n this.screen.screenAttrs = new Array(screenLength).fill(0)\n }\n\n const MASK_LINE_ATTR = 0xC8\n const MASK_BLINK = 1 << 4\n\n let setCellContent = () => {\n // Remove blink attribute if it wouldn't have any effect\n let myAttrs = attrs\n let hasFG = attrs & (1 << 8)\n let hasBG = attrs & (1 << 9)\n if ((myAttrs & MASK_BLINK) !== 0 &&\n ((lastChar === ' ' && ((myAttrs & MASK_LINE_ATTR) === 0)) || // no line styles\n (fg === bg && hasFG && hasBG) // invisible text\n )\n ) {\n myAttrs ^= MASK_BLINK\n }\n // update blinking cells counter if blink state changed\n if ((this.screen.screenAttrs[cell] & MASK_BLINK) !== (myAttrs & MASK_BLINK)) {\n if (myAttrs & MASK_BLINK) this.screen.blinkingCellCount++\n else this.screen.blinkingCellCount--\n }\n\n this.screen.screen[cell] = lastChar\n this.screen.screenFG[cell] = fg\n this.screen.screenBG[cell] = bg\n this.screen.screenAttrs[cell] = myAttrs\n }\n\n while (i < strArray.length && cell < screenLength) {\n let character = strArray[i++]\n let charCode = character.codePointAt(0)\n\n let data\n switch (charCode) {\n case SEQ_REPEAT:\n let count = strArray[i++].codePointAt(0) - 1\n for (let j = 0; j < count; j++) {\n setCellContent()\n if (++cell > screenLength) break\n }\n break\n\n case SEQ_SET_COLORS:\n data = strArray[i++].codePointAt(0) - 1\n fg = data & 0xFF\n bg = (data >> 8) & 0xFF\n break\n\n case SEQ_SET_ATTRS:\n data = strArray[i++].codePointAt(0) - 1\n attrs = data & 0xFFFF\n break\n\n case SEQ_SET_FG:\n data = strArray[i++].codePointAt(0) - 1\n fg = data & 0xFF\n break\n\n case SEQ_SET_BG:\n data = strArray[i++].codePointAt(0) - 1\n bg = data & 0xFF\n break\n\n default:\n if (charCode < 32) character = '\\ufffd'\n lastChar = character\n setCellContent()\n cell++\n }\n }\n\n if (this.screen.window.debug) console.log(`Blinky cells: ${this.screen.blinkingCellCount}`)\n\n this.screen.renderer.scheduleDraw('load', 16)\n this.screen.emit('load')\n }\n\n /**\n * Parses the content of a `T` message and updates the screen title and button\n * labels.\n * @param {string} str - the message content\n */\n loadLabels (str) {\n let pieces = str.split('\\x01')\n let screenTitle = pieces[0]\n qs('#screen-title').textContent = screenTitle\n if (screenTitle.length === 0) screenTitle = 'Terminal'\n qs('title').textContent = `${screenTitle} :: ESPTerm`\n $('#action-buttons button').forEach((button, i) => {\n let label = pieces[i + 1].trim()\n // if empty string, use the \"dim\" effect and put nbsp instead to\n // stretch the button vertically\n button.innerHTML = label ? $.htmlEscape(label) : '&nbsp;'\n button.style.opacity = label ? 1 : 0.2\n })\n }\n\n /**\n * Loads a message from the server, and optionally a theme.\n * @param {string} str - the message\n * @param {object} [opts] - options\n * @param {number} [opts.theme] - theme\n * @param {number} [opts.defaultFg] - default foreground\n * @param {number} [opts.defaultBg] - default background\n */\n load (str, opts = null) {\n const content = str.substr(1)\n\n if (opts) {\n if (typeof opts.defaultFg !== 'undefined' && typeof opts.defaultBg !== 'undefined') {\n this.screen.renderer.setDefaultColors(opts.defaultFg, opts.defaultBg)\n }\n\n if (typeof opts.theme !== 'undefined') {\n if (opts.theme >= 0 && opts.theme < themes.length) {\n this.screen.renderer.palette = themes[opts.theme]\n }\n }\n }\n\n switch (str[0]) {\n case 'S':\n this.loadContent(content)\n break\n\n case 'T':\n this.loadLabels(content)\n break\n\n case 'B':\n this.screen.beep()\n break\n\n case 'G':\n this.screen.showNotification(content)\n break\n\n default:\n console.warn(`Bad data message type; ignoring.\\n${JSON.stringify(str)}`)\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/screen_parser.js","const { themes, buildColorTable, SELECTION_FG, SELECTION_BG } = require('./themes')\n\n// Some non-bold Fraktur symbols are outside the contiguous block\nconst frakturExceptions = {\n 'C': '\\u212d',\n 'H': '\\u210c',\n 'I': '\\u2111',\n 'R': '\\u211c',\n 'Z': '\\u2128'\n}\n\nmodule.exports = class ScreenRenderer {\n constructor (screen) {\n this.screen = screen\n this.ctx = screen.ctx\n\n this._palette = null // colors 0-15\n this.defaultBgNum = 0\n this.defaultFgNum = 7\n\n // 256color lookup table\n // should not be used to look up 0-15 (will return transparent)\n this.colorTable256 = buildColorTable()\n\n this.resetDrawn()\n\n this.blinkStyleOn = false\n this.blinkInterval = null\n this.cursorBlinkOn = false\n this.cursorBlinkInterval = null\n\n // start blink timers\n this.resetBlink()\n this.resetCursorBlink()\n }\n\n resetDrawn () {\n // used to determine if a cell should be redrawn; storing the current state\n // as it is on screen\n this.drawnScreen = []\n this.drawnScreenFG = []\n this.drawnScreenBG = []\n this.drawnScreenAttrs = []\n this.drawnCursor = [-1, -1, '']\n }\n\n /**\n * The color palette. Should define 16 colors in an array.\n * @type {string[]}\n */\n get palette () {\n return this._palette || themes[0]\n }\n\n /** @type {string[]} */\n set palette (palette) {\n if (this._palette !== palette) {\n this._palette = palette\n this.resetDrawn()\n this.scheduleDraw('palette')\n }\n }\n\n setDefaultColors (fg, bg) {\n this.defaultFgNum = fg\n this.defaultBgNum = bg\n this.resetDrawn()\n this.scheduleDraw('defaultColors')\n }\n\n /**\n * Schedule a draw in the next millisecond\n * @param {string} why - the reason why the draw occured (for debugging)\n * @param {number} [aggregateTime] - time to wait for more scheduleDraw calls\n * to occur. 1 ms by default.\n */\n scheduleDraw (why, aggregateTime = 1) {\n clearTimeout(this._scheduledDraw)\n this._scheduledDraw = setTimeout(() => this.draw(why), aggregateTime)\n }\n\n /**\n * Returns the specified color. If `i` is in the palette, it will return the\n * palette color. If `i` is between 16 and 255, it will return the 256color\n * value. If `i` is larger than 255, it will return an RGB color value. If `i`\n * is -1 (foreground) or -2 (background), it will return the selection colors.\n * @param {number} i - the color\n * @returns {string} the CSS color\n */\n getColor (i) {\n // return palette color if it exists\n if (i < 16 && i in this.palette) return this.palette[i]\n\n // -1 for selection foreground, -2 for selection background\n if (i === -1) return SELECTION_FG\n if (i === -2) return SELECTION_BG\n\n // 256 color\n if (i > 15 && i < 256) return this.colorTable256[i]\n\n // true color, encoded as (hex) + 256 (such that #000 == 256)\n if (i > 255) {\n i -= 256\n let red = (i >> 16) & 0xFF\n let green = (i >> 8) & 0xFF\n let blue = i & 0xFF\n return `rgb(${red}, ${green}, ${blue})`\n }\n\n // return error color\n return (Date.now() / 1000) % 2 === 0 ? '#f0f' : '#0f0'\n }\n\n /**\n * Resets the cursor blink to on and restarts the timer\n */\n resetCursorBlink () {\n this.cursorBlinkOn = true\n clearInterval(this.cursorBlinkInterval)\n this.cursorBlinkInterval = setInterval(() => {\n this.cursorBlinkOn = this.screen.cursor.blinking\n ? !this.cursorBlinkOn\n : true\n if (this.screen.cursor.blinking) this.scheduleDraw('cursor-blink')\n }, 500)\n }\n\n /**\n * Resets the blink style to on and restarts the timer\n */\n resetBlink () {\n this.blinkStyleOn = true\n clearInterval(this.blinkInterval)\n let intervals = 0\n this.blinkInterval = setInterval(() => {\n if (this.screen.blinkingCellCount <= 0) return\n\n intervals++\n if (intervals >= 4 && this.blinkStyleOn) {\n this.blinkStyleOn = false\n intervals = 0\n this.scheduleDraw('blink-style')\n } else if (intervals >= 1 && !this.blinkStyleOn) {\n this.blinkStyleOn = true\n intervals = 0\n this.scheduleDraw('blink-style')\n }\n }, 200)\n }\n\n /**\n * Draws a cell's background with the given parameters.\n * @param {Object} options\n * @param {number} options.x - x in cells\n * @param {number} options.y - y in cells\n * @param {number} options.cellWidth - cell width in pixels\n * @param {number} options.cellHeight - cell height in pixels\n * @param {number} options.bg - the background color\n */\n drawBackground ({ x, y, cellWidth, cellHeight, bg }) {\n const ctx = this.ctx\n ctx.fillStyle = this.getColor(bg)\n ctx.clearRect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n ctx.fillRect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n }\n\n /**\n * Draws a cell's character with the given parameters. Won't do anything if\n * text is an empty string.\n * @param {Object} options\n * @param {number} options.x - x in cells\n * @param {number} options.y - y in cells\n * @param {Object} options.charSize - the character size, an object with\n * `width` and `height` in pixels\n * @param {number} options.cellWidth - cell width in pixels\n * @param {number} options.cellHeight - cell height in pixels\n * @param {string} options.text - the cell content\n * @param {number} options.fg - the foreground color\n * @param {number} options.attrs - the cell's attributes\n */\n drawCharacter ({ x, y, charSize, cellWidth, cellHeight, text, fg, attrs }) {\n if (!text) return\n\n const ctx = this.ctx\n\n let underline = false\n let strike = false\n let overline = false\n if (attrs & (1 << 1)) ctx.globalAlpha = 0.5\n if (attrs & (1 << 3)) underline = true\n if (attrs & (1 << 5)) text = ScreenRenderer.alphaToFraktur(text)\n if (attrs & (1 << 6)) strike = true\n if (attrs & (1 << 7)) overline = true\n\n ctx.fillStyle = this.getColor(fg)\n\n let codePoint = text.codePointAt(0)\n if (codePoint >= 0x2580 && codePoint <= 0x259F) {\n // block elements\n ctx.beginPath()\n const left = x * cellWidth\n const top = y * cellHeight\n const cw = cellWidth\n const ch = cellHeight\n const c2w = cellWidth / 2\n const c2h = cellHeight / 2\n\n // http://www.fileformat.info/info/unicode/block/block_elements/utf8test.htm\n // 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F\n // 0x2580 ▀ ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▉ ▊ ▋ ▌ ▍ ▎ ▏\n // 0x2590 ▐ ░ ▒ ▓ ▔ ▕ ▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟\n\n if (codePoint === 0x2580) {\n // upper half block >▀<\n ctx.rect(left, top, cw, c2h)\n } else if (codePoint <= 0x2588) {\n // lower n eighth block (increasing) >▁< to >█<\n let offset = (1 - (codePoint - 0x2580) / 8) * ch\n ctx.rect(left, top + offset, cw, ch - offset)\n } else if (codePoint <= 0x258F) {\n // left n eighth block (decreasing) >▉< to >▏<\n let offset = (codePoint - 0x2588) / 8 * cw\n ctx.rect(left, top, cw - offset, ch)\n } else if (codePoint === 0x2590) {\n // right half block >▐<\n ctx.rect(left + c2w, top, c2w, ch)\n } else if (codePoint <= 0x2593) {\n // shading >░< >▒< >▓<\n\n // dot spacing by dividing cell size by a constant. This could be\n // reworked to always return a whole number, but that would require\n // prime factorization, and doing that without a loop would let you\n // take over the world, which is not within the scope of this project.\n let dotSpacingX, dotSpacingY, dotSize\n if (codePoint === 0x2591) {\n dotSpacingX = cw / 4\n dotSpacingY = ch / 10\n dotSize = 1\n } else if (codePoint === 0x2592) {\n dotSpacingX = cw / 6\n dotSpacingY = cw / 10\n dotSize = 1\n } else if (codePoint === 0x2593) {\n dotSpacingX = cw / 4\n dotSpacingY = cw / 7\n dotSize = 2\n }\n\n let alignRight = false\n for (let dy = 0; dy < ch; dy += dotSpacingY) {\n for (let dx = 0; dx < cw; dx += dotSpacingX) {\n // prevent overflow\n let dotSizeY = Math.min(dotSize, ch - dy)\n ctx.rect(x * cw + (alignRight ? cw - dx - dotSize : dx), y * ch + dy, dotSize, dotSizeY)\n }\n alignRight = !alignRight\n }\n } else if (codePoint === 0x2594) {\n // upper one eighth block >▔<\n ctx.rect(x * cw, y * ch, cw, ch / 8)\n } else if (codePoint === 0x2595) {\n // right one eighth block >▕<\n ctx.rect((x + 7 / 8) * cw, y * ch, cw / 8, ch)\n } else if (codePoint === 0x2596) {\n // left bottom quadrant >▖<\n ctx.rect(left, top + c2h, c2w, c2h)\n } else if (codePoint === 0x2597) {\n // right bottom quadrant >▗<\n ctx.rect(left + c2w, top + c2h, c2w, c2h)\n } else if (codePoint === 0x2598) {\n // left top quadrant >▘<\n ctx.rect(left, top, c2w, c2h)\n } else if (codePoint === 0x2599) {\n // left chair >▙<\n ctx.rect(left, top, c2w, ch)\n ctx.rect(left + c2w, top + c2h, c2w, c2h)\n } else if (codePoint === 0x259A) {\n // quadrants lt rb >▚<\n ctx.rect(left, top, c2w, c2h)\n ctx.rect(left + c2w, top + c2h, c2w, c2h)\n } else if (codePoint === 0x259B) {\n // left chair upside down >▛<\n ctx.rect(left, top, c2w, ch)\n ctx.rect(left + c2w, top, c2w, c2h)\n } else if (codePoint === 0x259C) {\n // right chair upside down >▜<\n ctx.rect(left, top, cw, c2h)\n ctx.rect(left + c2w, top + c2h, c2w, c2h)\n } else if (codePoint === 0x259D) {\n // right top quadrant >▝<\n ctx.rect(left + c2w, top, c2w, c2h)\n } else if (codePoint === 0x259E) {\n // quadrants lb rt >▞<\n ctx.rect(left, top + c2h, c2w, c2h)\n ctx.rect(left + c2w, top, c2w, c2h)\n } else if (codePoint === 0x259F) {\n // right chair upside down >▟<\n ctx.rect(left, top + c2h, c2w, c2h)\n ctx.rect(left + c2w, top, c2w, ch)\n }\n\n ctx.fill()\n } else {\n // Draw other characters using the text renderer\n ctx.fillText(text, (x + 0.5) * cellWidth, (y + 0.5) * cellHeight)\n }\n\n // -- line drawing - a reference for a possible future rect/line implementation ---\n // http://www.fileformat.info/info/unicode/block/box_drawing/utf8test.htm\n // 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F\n // 0x2500 ─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏\n // 0x2510 ┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟\n // 0x2520 ┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯\n // 0x2530 ┰ ┱ ┲ ┳ ┴ ┵ ┶ ┷ ┸ ┹ ┺ ┻ ┼ ┽ ┾ ┿\n // 0x2540 ╀ ╁ ╂ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊ ╋ ╌ ╍ ╎ ╏\n // 0x2550 ═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟\n // 0x2560 ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬ ╭ ╮ ╯\n // 0x2570 ╰ ╱ ╲ ╳ ╴ ╵ ╶ ╷ ╸ ╹ ╺ ╻ ╼ ╽ ╾ ╿\n\n if (underline || strike || overline) {\n ctx.strokeStyle = this.getColor(fg)\n ctx.lineWidth = 1\n ctx.lineCap = 'round'\n ctx.beginPath()\n\n if (underline) {\n let lineY = Math.round(y * cellHeight + charSize.height) + 0.5\n ctx.moveTo(x * cellWidth, lineY)\n ctx.lineTo((x + 1) * cellWidth, lineY)\n }\n\n if (strike) {\n let lineY = Math.round((y + 0.5) * cellHeight) + 0.5\n ctx.moveTo(x * cellWidth, lineY)\n ctx.lineTo((x + 1) * cellWidth, lineY)\n }\n\n if (overline) {\n let lineY = Math.round(y * cellHeight) + 0.5\n ctx.moveTo(x * cellWidth, lineY)\n ctx.lineTo((x + 1) * cellWidth, lineY)\n }\n\n ctx.stroke()\n }\n\n ctx.globalAlpha = 1\n }\n\n /**\n * Returns all adjacent cell indices given a radius.\n * @param {number} cell - the center cell index\n * @param {number} [radius] - the radius. 1 by default\n * @returns {number[]} an array of cell indices\n */\n getAdjacentCells (cell, radius = 1) {\n const { width, height } = this.screen.window\n const screenLength = width * height\n\n let cells = []\n\n for (let x = -radius; x <= radius; x++) {\n for (let y = -radius; y <= radius; y++) {\n if (x === 0 && y === 0) continue\n cells.push(cell + x + y * width)\n }\n }\n\n return cells.filter(cell => cell >= 0 && cell < screenLength)\n }\n\n /**\n * Updates the screen.\n * @param {string} why - the draw reason (for debugging)\n */\n draw (why) {\n const ctx = this.ctx\n const {\n width,\n height,\n devicePixelRatio,\n statusScreen\n } = this.screen.window\n\n if (statusScreen) {\n // draw status screen instead\n this.drawStatus(statusScreen)\n this.startDrawLoop()\n return\n } else this.stopDrawLoop()\n\n const charSize = this.screen.getCharSize()\n const { width: cellWidth, height: cellHeight } = this.screen.getCellSize()\n const screenLength = width * height\n\n ctx.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0)\n\n if (this.screen.window.debug && this.screen._debug) this.screen._debug.drawStart(why)\n\n ctx.font = this.screen.getFont()\n ctx.textAlign = 'center'\n ctx.textBaseline = 'middle'\n\n // bits in the attr value that affect the font\n const FONT_MASK = 0b101\n\n // Map of (attrs & FONT_MASK) -> Array of cell indices\n let fontGroups = new Map()\n\n // Map of (cell index) -> boolean, whether or not a cell has updated\n let updateMap = new Map()\n\n for (let cell = 0; cell < screenLength; cell++) {\n let x = cell % width\n let y = Math.floor(cell / width)\n let isCursor = !this.screen.cursor.hanging &&\n this.screen.cursor.x === x &&\n this.screen.cursor.y === y &&\n this.screen.cursor.visible &&\n this.cursorBlinkOn\n\n let wasCursor = x === this.drawnCursor[0] && y === this.drawnCursor[1]\n\n let inSelection = this.screen.isInSelection(x, y)\n\n let text = this.screen.screen[cell]\n let fg = this.screen.screenFG[cell] | 0\n let bg = this.screen.screenBG[cell] | 0\n let attrs = this.screen.screenAttrs[cell] | 0\n\n if (!(attrs & (1 << 8))) fg = this.defaultFgNum\n if (!(attrs & (1 << 9))) bg = this.defaultBgNum\n\n if (attrs & (1 << 10)) [fg, bg] = [bg, fg] // swap - reversed character colors\n if (this.screen.reverseVideo) [fg, bg] = [bg, fg] // swap - reversed all screen\n\n if (attrs & (1 << 4) && !this.blinkStyleOn) {\n // blinking is enabled and blink style is off\n // set text to nothing so drawCharacter doesn't draw anything\n text = ''\n }\n\n if (inSelection) {\n fg = -1\n bg = -2\n }\n\n let didUpdate = text !== this.drawnScreen[cell] || // text updated\n fg !== this.drawnScreenFG[cell] || // foreground updated, and this cell has text\n bg !== this.drawnScreenBG[cell] || // background updated\n attrs !== this.drawnScreenAttrs[cell] || // attributes updated\n isCursor !== wasCursor || // cursor blink/position updated\n (isCursor && this.screen.cursor.style !== this.drawnCursor[2]) // cursor style updated\n\n let font = attrs & FONT_MASK\n if (!fontGroups.has(font)) fontGroups.set(font, [])\n\n fontGroups.get(font).push({ cell, x, y, text, fg, bg, attrs, isCursor, inSelection })\n updateMap.set(cell, didUpdate)\n }\n\n // Map of (cell index) -> boolean, whether or not a cell should be redrawn\n const redrawMap = new Map()\n\n let isTextWide = text =>\n text !== ' ' && ctx.measureText(text).width >= (cellWidth + 0.05)\n\n // decide for each cell if it should be redrawn\n let updateRedrawMapAt = cell => {\n let shouldUpdate = updateMap.get(cell) || redrawMap.get(cell) || false\n\n // TODO: fonts (necessary?)\n let text = this.screen.screen[cell]\n let isWideCell = isTextWide(text)\n let checkRadius = isWideCell ? 2 : 1\n\n if (!shouldUpdate) {\n // check adjacent cells\n let adjacentDidUpdate = false\n\n for (let adjacentCell of this.getAdjacentCells(cell, checkRadius)) {\n // update this cell if:\n // - the adjacent cell updated (For now, this'll always be true because characters can be slightly larger than they say they are)\n // - the adjacent cell updated and this cell or the adjacent cell is wide\n if (updateMap.get(adjacentCell) && (this.screen.window.graphics < 2 || isWideCell || isTextWide(this.screen.screen[adjacentCell]))) {\n adjacentDidUpdate = true\n break\n }\n }\n\n if (adjacentDidUpdate) shouldUpdate = true\n }\n\n redrawMap.set(cell, shouldUpdate)\n }\n\n for (let cell of updateMap.keys()) updateRedrawMapAt(cell)\n\n // mask to redrawing regions only\n if (this.screen.window.graphics >= 1) {\n let debug = this.screen.window.debug && this.screen._debug\n ctx.save()\n ctx.beginPath()\n for (let y = 0; y < height; y++) {\n let regionStart = null\n for (let x = 0; x < width; x++) {\n let cell = y * width + x\n let redrawing = redrawMap.get(cell)\n if (redrawing && regionStart === null) regionStart = x\n if (!redrawing && regionStart !== null) {\n ctx.rect(regionStart * cellWidth, y * cellHeight, (x - regionStart) * cellWidth, cellHeight)\n if (debug) this.screen._debug.clipRect(regionStart * cellWidth, y * cellHeight, (x - regionStart) * cellWidth, cellHeight)\n regionStart = null\n }\n }\n if (regionStart !== null) {\n ctx.rect(regionStart * cellWidth, y * cellHeight, (width - regionStart) * cellWidth, cellHeight)\n if (debug) this.screen._debug.clipRect(regionStart * cellWidth, y * cellHeight, (width - regionStart) * cellWidth, cellHeight)\n }\n }\n ctx.clip()\n }\n\n // pass 1: backgrounds\n for (let font of fontGroups.keys()) {\n for (let data of fontGroups.get(font)) {\n let { cell, x, y, text, bg } = data\n\n if (redrawMap.get(cell)) {\n this.drawBackground({ x, y, cellWidth, cellHeight, bg })\n\n if (this.screen.window.debug && this.screen._debug) {\n // set cell flags\n let flags = (+redrawMap.get(cell))\n flags |= (+updateMap.get(cell)) << 1\n flags |= (+isTextWide(text)) << 2\n this.screen._debug.setCell(cell, flags)\n }\n }\n }\n }\n\n // reset drawn cursor\n this.drawnCursor = [-1, -1, -1]\n\n // pass 2: characters\n for (let font of fontGroups.keys()) {\n // set font once because in Firefox, this is a really slow action for some\n // reason\n let modifiers = {}\n if (font & 1) modifiers.weight = 'bold'\n if (font & 1 << 2) modifiers.style = 'italic'\n ctx.font = this.screen.getFont(modifiers)\n\n for (let data of fontGroups.get(font)) {\n let { cell, x, y, text, fg, bg, attrs, isCursor, inSelection } = data\n\n if (redrawMap.get(cell)) {\n this.drawCharacter({\n x, y, charSize, cellWidth, cellHeight, text, fg, attrs\n })\n\n this.drawnScreen[cell] = text\n this.drawnScreenFG[cell] = fg\n this.drawnScreenBG[cell] = bg\n this.drawnScreenAttrs[cell] = attrs\n\n if (isCursor) this.drawnCursor = [x, y, this.screen.cursor.style]\n\n if (isCursor && !inSelection) {\n ctx.save()\n ctx.beginPath()\n if (this.screen.cursor.style === 'block') {\n // block\n ctx.rect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n } else if (this.screen.cursor.style === 'bar') {\n // vertical bar\n let barWidth = 2\n ctx.rect(x * cellWidth, y * cellHeight, barWidth, cellHeight)\n } else if (this.screen.cursor.style === 'line') {\n // underline\n let lineHeight = 2\n ctx.rect(x * cellWidth, y * cellHeight + charSize.height, cellWidth, lineHeight)\n }\n ctx.clip()\n\n // swap foreground/background\n ;[fg, bg] = [bg, fg]\n\n // HACK: ensure cursor is visible\n if (fg === bg) bg = fg === 0 ? 7 : 0\n\n this.drawBackground({ x, y, cellWidth, cellHeight, bg })\n this.drawCharacter({\n x, y, charSize, cellWidth, cellHeight, text, fg, attrs\n })\n ctx.restore()\n }\n }\n }\n }\n\n if (this.screen.window.graphics >= 1) ctx.restore()\n\n if (this.screen.window.debug && this.screen._debug) this.screen._debug.drawEnd()\n\n this.screen.emit('draw')\n }\n\n drawStatus (statusScreen) {\n const ctx = this.ctx\n const {\n fontFamily,\n width,\n height,\n devicePixelRatio\n } = this.screen.window\n\n // reset drawnScreen to force redraw when statusScreen is disabled\n this.drawnScreen = []\n\n const cellSize = this.screen.getCellSize()\n const screenWidth = width * cellSize.width\n const screenHeight = height * cellSize.height\n\n ctx.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0)\n ctx.clearRect(0, 0, screenWidth, screenHeight)\n\n ctx.font = `24px ${fontFamily}`\n ctx.fillStyle = '#fff'\n ctx.textAlign = 'center'\n ctx.textBaseline = 'middle'\n ctx.fillText(statusScreen.title || '', screenWidth / 2, screenHeight / 2 - 50)\n\n if (statusScreen.loading) {\n // show loading spinner\n ctx.save()\n ctx.translate(screenWidth / 2, screenHeight / 2 + 20)\n\n ctx.strokeStyle = '#fff'\n ctx.lineWidth = 5\n ctx.lineCap = 'round'\n\n let t = Date.now() / 1000\n\n for (let i = 0; i < 12; i++) {\n ctx.rotate(Math.PI / 6)\n let offset = ((t * 12) - i) % 12\n ctx.globalAlpha = Math.max(0.2, 1 - offset / 3)\n ctx.beginPath()\n ctx.moveTo(0, 15)\n ctx.lineTo(0, 30)\n ctx.stroke()\n }\n\n ctx.restore()\n }\n }\n\n startDrawLoop () {\n if (this._drawTimerThread) return\n let threadID = Math.random().toString(36)\n this._drawTimerThread = threadID\n this.drawTimerLoop(threadID)\n }\n\n stopDrawLoop () {\n this._drawTimerThread = null\n }\n\n drawTimerLoop (threadID) {\n if (!threadID || threadID !== this._drawTimerThread) return\n window.requestAnimationFrame(() => this.drawTimerLoop(threadID))\n this.draw('draw-loop')\n }\n\n /**\n * Converts an alphabetic character to its fraktur variant.\n * @param {string} character - the character\n * @returns {string} the converted character\n */\n static alphaToFraktur (character) {\n if (character >= 'a' && character <= 'z') {\n character = String.fromCodePoint(0x1d51e - 0x61 + character.charCodeAt(0))\n } else if (character >= 'A' && character <= 'Z') {\n character = frakturExceptions[character] || String.fromCodePoint(0x1d504 - 0x41 + character.charCodeAt(0))\n }\n return character\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/screen_renderer.js","const EventEmitter = require('events')\nconst $ = require('../lib/chibi')\nlet demo\ntry { demo = require('./demo') } catch (err) {}\n\n/** Handle connections */\nmodule.exports = class TermConnection extends EventEmitter {\n constructor (screen) {\n super()\n\n this.screen = screen\n this.ws = null\n this.heartbeatTimeout = null\n this.pingInterval = null\n this.xoff = false\n this.autoXoffTimeout = null\n this.reconnTimeout = null\n this.forceClosing = false\n\n this.pageShown = false\n\n document.addEventListener('visibilitychange', () => {\n if (document.hidden === true) {\n console.info('Window lost focus, freeing socket')\n this.closeSocket()\n clearTimeout(this.heartbeatTimeout)\n } else {\n console.info('Window got focus, re-connecting')\n this.init()\n }\n }, false)\n }\n\n onWSOpen (evt) {\n console.log('CONNECTED')\n this.heartbeat()\n this.send('i')\n this.forceClosing = false\n\n this.emit('connect')\n }\n\n onWSClose (evt) {\n if (this.forceClosing) {\n this.forceClosing = false\n return\n }\n console.warn('SOCKET CLOSED, code ' + evt.code + '. Reconnecting...')\n if (evt.code < 1000) {\n console.error('Bad code from socket!')\n // this sometimes happens for unknown reasons, code < 1000 is invalid\n // location.reload()\n }\n\n clearTimeout(this.reconnTimeout)\n this.reconnTimeout = setTimeout(() => this.init(), 2000)\n\n this.emit('disconnect', evt.code)\n }\n\n onWSMessage (evt) {\n try {\n switch (evt.data.charAt(0)) {\n case '.':\n // heartbeat, no-op message\n break\n\n case '-':\n // console.log('xoff');\n this.xoff = true\n this.autoXoffTimeout = setTimeout(() => {\n this.xoff = false\n }, 250)\n break\n\n case '+':\n // console.log('xon');\n this.xoff = false\n clearTimeout(this.autoXoffTimeout)\n break\n\n default:\n this.emit('load')\n this.screen.load(evt.data)\n if (!this.pageShown) {\n window.showPage()\n this.pageShown = true\n }\n break\n }\n this.heartbeat()\n } catch (e) {\n console.error(e)\n }\n }\n\n canSend () {\n return !this.xoff\n }\n\n send (message) {\n if (window._demo) {\n if (typeof window.demoInterface !== 'undefined') {\n demo.input(message)\n } else {\n console.log(`TX: ${JSON.stringify(message)}`)\n }\n return true // Simulate success\n }\n if (this.xoff) {\n // TODO queue\n console.log(\"Can't send, flood control.\")\n return false\n }\n\n if (!this.ws) return false // for dry testing\n if (this.ws.readyState !== 1) {\n console.error('Socket not ready')\n return false\n }\n if (typeof message != 'string') {\n message = JSON.stringify(message)\n }\n this.ws.send(message)\n return true\n }\n\n /** Safely close the socket */\n closeSocket () {\n if (this.ws) {\n this.forceClosing = true\n this.ws.close()\n this.ws = null\n }\n }\n\n init () {\n if (window._demo) {\n if (typeof window.demoInterface === 'undefined') {\n window.alert('Demoing non-demo build!') // this will catch mistakes when deploying to the website\n } else {\n demo.init(this.screen)\n }\n return\n }\n\n clearTimeout(this.reconnTimeout)\n clearTimeout(this.heartbeatTimeout)\n\n this.closeSocket()\n\n this.ws = new window.WebSocket('ws://' + window._root + '/term/update.ws')\n this.ws.addEventListener('open', (...args) => this.onWSOpen(...args))\n this.ws.addEventListener('close', (...args) => this.onWSClose(...args))\n this.ws.addEventListener('message', (...args) => this.onWSMessage(...args))\n console.log('Opening socket.')\n this.heartbeat()\n\n this.emit('open')\n }\n\n heartbeat () {\n clearTimeout(this.heartbeatTimeout)\n this.heartbeatTimeout = setTimeout(() => this.onHeartbeatFail(), 2000)\n }\n\n onHeartbeatFail () {\n this.closeSocket()\n this.emit('silence')\n console.error('Heartbeat lost, probing server...')\n clearInterval(this.pingInterval)\n\n this.pingInterval = setInterval(() => {\n console.log('> ping')\n this.emit('ping')\n $.get('http://' + window._root + '/system/ping', (resp, status) => {\n if (status === 200) {\n clearInterval(this.pingInterval)\n console.info('Server ready, opening socket…')\n this.emit('ping-success')\n this.init()\n // location.reload()\n } else this.emit('ping-fail', status)\n }, {\n timeout: 100,\n loader: false // we have loader on-screen\n })\n }, 1000)\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/connection.js","const $ = require('../lib/chibi')\nconst { encode2B } = require('../utils')\n\n/**\n * User input\n *\n * --- Rx messages: ---\n * S - screen content (binary encoding of the entire screen with simple compression)\n * T - text labels - Title and buttons, \\0x01-separated\n * B - beep\n * . - heartbeat\n *\n * --- Tx messages ---\n * s - string\n * b - action button\n * p - mb press\n * r - mb release\n * m - mouse move\n */\nmodule.exports = function (conn, screen) {\n // handle for input object\n let input\n\n const KEY_NAMES = {\n 0x03: 'Cancel',\n 0x06: 'Help',\n 0x08: 'Backspace',\n 0x09: 'Tab',\n 0x0C: 'Clear',\n 0x0D: 'Enter',\n 0x10: 'Shift',\n 0x11: 'Control',\n 0x12: 'Alt',\n 0x13: 'Pause',\n 0x14: 'CapsLock',\n 0x1B: 'Escape',\n 0x20: ' ',\n 0x21: 'PageUp',\n 0x22: 'PageDown',\n 0x23: 'End',\n 0x24: 'Home',\n 0x25: 'ArrowLeft',\n 0x26: 'ArrowUp',\n 0x27: 'ArrowRight',\n 0x28: 'ArrowDown',\n 0x29: 'Select',\n 0x2A: 'Print',\n 0x2B: 'Execute',\n 0x2C: 'PrintScreen',\n 0x2D: 'Insert',\n 0x2E: 'Delete',\n 0x3A: ':',\n 0x3B: ';',\n 0x3C: '<',\n 0x3D: '=',\n 0x3E: '>',\n 0x3F: '?',\n 0x40: '@',\n 0x5B: 'Meta',\n 0x5C: 'Meta',\n 0x5D: 'ContextMenu',\n 0x6A: 'Numpad*',\n 0x6B: 'Numpad+',\n 0x6D: 'Numpad-',\n 0x6E: 'Numpad.',\n 0x6F: 'Numpad/',\n 0x90: 'NumLock',\n 0x91: 'ScrollLock',\n 0xA0: '^',\n 0xA1: '!',\n 0xA2: '\"',\n 0xA3: '#',\n 0xA4: '$',\n 0xA5: '%',\n 0xA6: '&',\n 0xA7: '_',\n 0xA8: '(',\n 0xA9: ')',\n 0xAA: '*',\n 0xAB: '+',\n 0xAC: '|',\n 0xAD: '-',\n 0xAE: '{',\n 0xAF: '}',\n 0xB0: '~',\n 0xBA: ';',\n 0xBB: '=',\n 0xBC: 'Numpad,',\n 0xBD: '-',\n 0xBE: 'Numpad,',\n 0xC0: '`',\n 0xC2: 'Numpad,',\n 0xDB: '[',\n 0xDC: '\\\\',\n 0xDD: ']',\n 0xDE: \"'\",\n 0xE0: 'Meta'\n }\n // numbers 0-9\n for (let i = 0x30; i <= 0x39; i++) KEY_NAMES[i] = String.fromCharCode(i)\n // characters A-Z\n for (let i = 0x41; i <= 0x5A; i++) KEY_NAMES[i] = String.fromCharCode(i)\n // function F1-F20\n for (let i = 0x70; i <= 0x83; i++) KEY_NAMES[i] = `F${i - 0x70 + 1}`\n // numpad 0-9\n for (let i = 0x60; i <= 0x69; i++) KEY_NAMES[i] = `Numpad${i - 0x60}`\n\n let cfg = {\n np_alt: false,\n cu_alt: false,\n fn_alt: false,\n mt_click: false,\n mt_move: false,\n no_keys: false,\n crlf_mode: false,\n all_fn: false\n }\n\n /** Fn alt choice for key message */\n const fa = (alt, normal) => cfg.fn_alt ? alt : normal\n\n /** Cursor alt choice for key message */\n const ca = (alt, normal) => cfg.cu_alt ? alt : normal\n\n /** Numpad alt choice for key message */\n const na = (alt, normal) => cfg.np_alt ? alt : normal\n\n const keymap = {\n /* eslint-disable key-spacing */\n 'Backspace': '\\x08',\n 'Tab': '\\x09',\n 'Enter': () => cfg.crlf_mode ? '\\x0d\\x0a' : '\\x0d',\n 'Control+Enter': '\\x0a',\n 'Escape': '\\x1b',\n 'ArrowUp': () => ca('\\x1bOA', '\\x1b[A'),\n 'ArrowDown': () => ca('\\x1bOB', '\\x1b[B'),\n 'ArrowRight': () => ca('\\x1bOC', '\\x1b[C'),\n 'ArrowLeft': () => ca('\\x1bOD', '\\x1b[D'),\n 'Home': () => ca('\\x1bOH', fa('\\x1b[H', '\\x1b[1~')),\n 'Insert': '\\x1b[2~',\n 'Delete': '\\x1b[3~',\n 'End': () => ca('\\x1bOF', fa('\\x1b[F', '\\x1b[4~')),\n 'PageUp': '\\x1b[5~',\n 'PageDown': '\\x1b[6~',\n 'F1': () => fa('\\x1bOP', '\\x1b[11~'),\n 'F2': () => fa('\\x1bOQ', '\\x1b[12~'),\n 'F3': () => fa('\\x1bOR', '\\x1b[13~'),\n 'F4': () => fa('\\x1bOS', '\\x1b[14~'),\n 'F5': '\\x1b[15~', // note the disconnect\n 'F6': '\\x1b[17~',\n 'F7': '\\x1b[18~',\n 'F8': '\\x1b[19~',\n 'F9': '\\x1b[20~',\n 'F10': '\\x1b[21~', // note the disconnect\n 'F11': '\\x1b[23~',\n 'F12': '\\x1b[24~',\n 'Shift+F1': () => fa('\\x1bO1;2P', '\\x1b[25~'),\n 'Shift+F2': () => fa('\\x1bO1;2Q', '\\x1b[26~'), // note the disconnect\n 'Shift+F3': () => fa('\\x1bO1;2R', '\\x1b[28~'),\n 'Shift+F4': () => fa('\\x1bO1;2S', '\\x1b[29~'), // note the disconnect\n 'Shift+F5': () => fa('\\x1b[15;2~', '\\x1b[31~'),\n 'Shift+F6': () => fa('\\x1b[17;2~', '\\x1b[32~'),\n 'Shift+F7': () => fa('\\x1b[18;2~', '\\x1b[33~'),\n 'Shift+F8': () => fa('\\x1b[19;2~', '\\x1b[34~'),\n 'Shift+F9': () => fa('\\x1b[20;2~', '\\x1b[35~'), // 35-38 are not standard - but what is?\n 'Shift+F10': () => fa('\\x1b[21;2~', '\\x1b[36~'),\n 'Shift+F11': () => fa('\\x1b[22;2~', '\\x1b[37~'),\n 'Shift+F12': () => fa('\\x1b[23;2~', '\\x1b[38~'),\n 'Numpad0': () => na('\\x1bOp', '0'),\n 'Numpad1': () => na('\\x1bOq', '1'),\n 'Numpad2': () => na('\\x1bOr', '2'),\n 'Numpad3': () => na('\\x1bOs', '3'),\n 'Numpad4': () => na('\\x1bOt', '4'),\n 'Numpad5': () => na('\\x1bOu', '5'),\n 'Numpad6': () => na('\\x1bOv', '6'),\n 'Numpad7': () => na('\\x1bOw', '7'),\n 'Numpad8': () => na('\\x1bOx', '8'),\n 'Numpad9': () => na('\\x1bOy', '9'),\n 'Numpad*': () => na('\\x1bOR', '*'),\n 'Numpad+': () => na('\\x1bOl', '+'),\n 'Numpad-': () => na('\\x1bOS', '-'),\n 'Numpad.': () => na('\\x1bOn', '.'),\n 'Numpad/': () => na('\\x1bOQ', '/'),\n // we don't implement numlock key (should change in numpad_alt mode,\n // but it's even more useless than the rest and also has the side\n // effect of changing the user's numlock state)\n\n // shortcuts\n 'Control+]': '\\x1b', // alternate way to enter ESC\n 'Control+\\\\': '\\x1c',\n 'Control+[': '\\x1d',\n 'Control+^': '\\x1e',\n 'Control+_': '\\x1f',\n\n // extra controls\n 'Control+ArrowLeft': '\\x1f[1;5D',\n 'Control+ArrowRight': '\\x1f[1;5C',\n 'Control+ArrowUp': '\\x1f[1;5A',\n 'Control+ArrowDown': '\\x1f[1;5B',\n 'Control+Home': '\\x1f[1;5H',\n 'Control+End': '\\x1f[1;5F',\n\n // extra shift controls\n 'Shift+ArrowLeft': '\\x1f[1;2D',\n 'Shift+ArrowRight': '\\x1f[1;2C',\n 'Shift+ArrowUp': '\\x1f[1;2A',\n 'Shift+ArrowDown': '\\x1f[1;2B',\n 'Shift+Home': '\\x1f[1;2H',\n 'Shift+End': '\\x1f[1;2F',\n\n // macOS text editing commands\n 'Alt+ArrowLeft': '\\x1bb', // ⌥← to go back a word (^[b)\n 'Alt+ArrowRight': '\\x1bf', // ⌥→ to go forward one word (^[f)\n 'Meta+ArrowLeft': '\\x01', // ⌘← to go to the beginning of a line (^A)\n 'Meta+ArrowRight': '\\x05', // ⌘→ to go to the end of a line (^E)\n 'Alt+Backspace': '\\x17', // ⌥⌫ to delete a word (^W)\n 'Meta+Backspace': '\\x15', // ⌘⌫ to delete to the beginning of a line (^U)\n\n // copy to clipboard\n 'Control+Shift+C' () {\n screen.copySelectionToClipboard()\n },\n 'Control+Insert' () {\n screen.copySelectionToClipboard()\n },\n\n // toggle debug mode\n 'Control+F12' () {\n screen.window.debug ^= 1\n }\n /* eslint-enable key-spacing */\n }\n\n // ctrl+[A-Z] sent as simple low ASCII codes\n for (let i = 1; i <= 26; i++) {\n keymap[`Control+${String.fromCharCode(0x40 + i)}`] = String.fromCharCode(i)\n }\n\n /** Send a literal message */\n function sendString (str) {\n return conn.send('s' + str)\n }\n\n /** Send a button event */\n function sendButton (n) {\n conn.send('b' + String.fromCharCode(n))\n }\n\n const shouldAcceptEvent = function () {\n if (cfg.no_keys) return false\n if (document.activeElement instanceof window.HTMLTextAreaElement) return false\n return true\n }\n\n const keyBlacklist = [\n 'F5', 'F11', 'F12', 'Shift+F5'\n ]\n\n const handleKeyDown = function (e) {\n if (!shouldAcceptEvent()) return\n if (cfg.no_keys) return\n\n let modifiers = []\n // sorted alphabetically\n if (e.altKey) modifiers.push('Alt')\n if (e.ctrlKey) modifiers.push('Control')\n if (e.metaKey) modifiers.push('Meta')\n if (e.shiftKey) modifiers.push('Shift')\n\n let key = KEY_NAMES[e.which] || e.key\n\n // ignore clipboard events\n if ((e.ctrlKey || e.metaKey) && key === 'V') return\n\n let binding = null\n\n for (let name in keymap) {\n let itemModifiers = name.split('+')\n let itemKey = itemModifiers.pop()\n\n if (itemKey === key && itemModifiers.sort().join() === modifiers.join()) {\n if (keyBlacklist.includes(name) && !cfg.all_fn) continue\n binding = keymap[name]\n break\n }\n }\n\n if (binding) {\n if (binding instanceof Function) binding = binding()\n e.preventDefault()\n if (typeof binding === 'string') {\n sendString(binding)\n }\n }\n }\n\n /** Bind/rebind key messages */\n function initKeys ({ allFn }) {\n // This takes care of text characters typed\n window.addEventListener('keypress', function (evt) {\n if (!shouldAcceptEvent()) return\n if (evt.ctrlKey || evt.metaKey) return\n\n let str = ''\n if (evt.key && evt.key.length === 1) str = evt.key\n else if (evt.which && evt.which !== 229) str = String.fromCodePoint(evt.which)\n\n if (str.length > 0 && str.charCodeAt(0) >= 32) {\n // prevent space from scrolling\n if (evt.which === 32) evt.preventDefault()\n sendString(str)\n }\n })\n\n window.addEventListener('keydown', handleKeyDown)\n window.addEventListener('copy', e => {\n if (!shouldAcceptEvent()) return\n let selectedText = screen.getSelectedText()\n if (selectedText) {\n e.preventDefault()\n e.clipboardData.setData('text/plain', selectedText)\n }\n })\n window.addEventListener('paste', e => {\n if (!shouldAcceptEvent()) return\n e.preventDefault()\n let string = e.clipboardData.getData('text/plain')\n if (string.includes('\\n') || string.length > 90) {\n if (!input.termUpload) console.error('input.termUpload is undefined')\n input.termUpload.setContent(string)\n input.termUpload.open()\n } else {\n // simple string, just paste it\n if (screen.bracketedPaste) string = `\\x1b[200~${string}\\x1b[201~`\n sendString(string)\n }\n })\n\n cfg.all_fn = allFn\n }\n\n // mouse button states\n let mb1 = 0\n let mb2 = 0\n let mb3 = 0\n\n /** Init the Input module */\n function init (opts) {\n initKeys(opts)\n\n // Button presses\n $('#action-buttons button').forEach(s => {\n s.addEventListener('click', function (evt) {\n sendButton(+this.dataset['n'])\n })\n })\n\n // global mouse state tracking - for motion reporting\n window.addEventListener('mousedown', evt => {\n if (evt.button === 0) mb1 = 1\n if (evt.button === 1) mb2 = 1\n if (evt.button === 2) mb3 = 1\n })\n\n window.addEventListener('mouseup', evt => {\n if (evt.button === 0) mb1 = 0\n if (evt.button === 1) mb2 = 0\n if (evt.button === 2) mb3 = 0\n })\n }\n\n // record modifier keys\n // bits: Meta, Alt, Shift, Ctrl\n let modifiers = 0b0000\n\n window.addEventListener('keydown', e => {\n if (e.ctrlKey) modifiers |= 1\n if (e.shiftKey) modifiers |= 2\n if (e.altKey) modifiers |= 4\n if (e.metaKey) modifiers |= 8\n })\n window.addEventListener('keyup', e => {\n modifiers = 0\n if (e.ctrlKey) modifiers |= 1\n if (e.shiftKey) modifiers |= 2\n if (e.altKey) modifiers |= 4\n if (e.metaKey) modifiers |= 8\n })\n\n /** Prepare modifiers byte for mouse message */\n function packModifiersForMouse () {\n return modifiers\n }\n\n input = {\n /** Init the Input module */\n init,\n\n /** Send a literal string message */\n sendString,\n\n /** Enable alternate key modes (cursors, numpad, fn) */\n setAlts: function (cu, np, fn, crlf) {\n if (cfg.cu_alt !== cu || cfg.np_alt !== np || cfg.fn_alt !== fn || cfg.crlf_mode !== crlf) {\n cfg.cu_alt = cu\n cfg.np_alt = np\n cfg.fn_alt = fn\n cfg.crlf_mode = crlf\n }\n },\n\n setMouseMode (click, move) {\n cfg.mt_click = click\n cfg.mt_move = move\n },\n\n // Mouse events\n onMouseMove (x, y) {\n if (!cfg.mt_move) return\n const b = mb1 ? 1 : mb2 ? 2 : mb3 ? 3 : 0\n const m = packModifiersForMouse()\n conn.send('m' + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m))\n },\n\n onMouseDown (x, y, b) {\n if (!cfg.mt_click) return\n if (b > 3 || b < 1) return\n const m = packModifiersForMouse()\n conn.send('p' + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m))\n },\n\n onMouseUp (x, y, b) {\n if (!cfg.mt_click) return\n if (b > 3 || b < 1) return\n const m = packModifiersForMouse()\n conn.send('r' + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m))\n // console.log(\"B \",b,\" M \",m);\n },\n\n onMouseWheel (x, y, dir) {\n if (!cfg.mt_click) return\n // -1 ... btn 4 (away from user)\n // +1 ... btn 5 (towards user)\n const m = packModifiersForMouse()\n const b = (dir < 0 ? 4 : 5)\n conn.send('p' + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m))\n // console.log(\"B \",b,\" M \",m);\n },\n\n /**\n * Prevent capturing keys. This is used for text input\n * modals on the terminal screen\n */\n blockKeys (yes) {\n cfg.no_keys = yes\n },\n\n handleKeyDown\n }\n return input\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/input.js","const $ = require('../lib/chibi')\nconst { qs } = require('../utils')\nconst modal = require('../modal')\n\n/** File upload utility */\nmodule.exports = function (conn, input, screen) {\n let lines, // array of lines without newlines\n line_i, // current line index\n fuTout, // timeout handle for line sending\n send_delay_ms, // delay between lines (ms)\n nl_str, // newline string to use\n curLine, // current line (when using fuOil)\n inline_pos // Offset in line (for long lines)\n\n // lines longer than this are split to chunks\n // sending a super-ling string through the socket is not a good idea\n const MAX_LINE_LEN = 128\n\n function openUploadDialog () {\n updateStatus('Ready...')\n modal.show('#fu_modal', onDialogClose)\n $('#fu_form').toggleClass('busy', false)\n input.blockKeys(true)\n }\n\n function onDialogClose () {\n console.log('Upload modal closed.')\n clearTimeout(fuTout)\n line_i = 0\n input.blockKeys(false)\n }\n\n function updateStatus (msg) {\n qs('#fu_prog').textContent = msg\n }\n\n function startUpload () {\n let v = qs('#fu_text').value\n if (!v.length) {\n fuClose()\n return\n }\n\n lines = v.split('\\n')\n line_i = 0\n inline_pos = 0 // offset in line\n send_delay_ms = qs('#fu_delay').value\n\n // sanitize - 0 causes overflows\n if (send_delay_ms < 0) {\n send_delay_ms = 0\n qs('#fu_delay').value = send_delay_ms\n }\n\n nl_str = {\n 'CR': '\\r',\n 'LF': '\\n',\n 'CRLF': '\\r\\n'\n }[qs('#fu_crlf').value]\n\n $('#fu_form').toggleClass('busy', true)\n updateStatus('Starting...')\n uploadLine()\n }\n\n function uploadLine () {\n if (!$('#fu_modal').hasClass('visible')) {\n // Modal is closed, cancel\n return\n }\n\n if (!conn.canSend()) {\n // postpone\n fuTout = setTimeout(uploadLine, 1)\n return\n }\n\n if (inline_pos === 0) {\n curLine = ''\n if (line_i === 0) {\n if (screen.bracketedPaste) {\n curLine = '\\x1b[200~'\n }\n }\n\n curLine += lines[line_i++] + nl_str\n\n if (line_i === lines.length) {\n if (screen.bracketedPaste) {\n curLine += '\\x1b[201~'\n }\n }\n }\n\n let chunk\n if ((curLine.length - inline_pos) <= MAX_LINE_LEN) {\n chunk = curLine.substr(inline_pos, MAX_LINE_LEN)\n inline_pos = 0\n } else {\n chunk = curLine.substr(inline_pos, MAX_LINE_LEN)\n inline_pos += MAX_LINE_LEN\n }\n\n if (!input.sendString(chunk)) {\n updateStatus('FAILED!')\n return\n }\n\n let pt = Math.round((line_i / lines.length) * 1000) / 10\n updateStatus(`${line_i} / ${lines.length} (${pt}%)`)\n\n if (lines.length > line_i || inline_pos > 0) {\n fuTout = setTimeout(uploadLine, send_delay_ms)\n } else {\n closeWhenReady()\n }\n }\n\n function closeWhenReady () {\n if (!conn.canSend()) {\n // stuck in XOFF still, wait to process...\n updateStatus('Waiting for Tx buffer...')\n setTimeout(closeWhenReady, 100)\n } else {\n updateStatus('Done.')\n // delay to show it\n fuClose()\n }\n }\n\n function fuClose () {\n modal.hide('#fu_modal')\n }\n\n return {\n init: function () {\n qs('#fu_file').addEventListener('change', function (evt) {\n let reader = new window.FileReader()\n let file = evt.target.files[0]\n let ftype = file.type || 'application/octet-stream'\n console.log('Selected file type: ' + ftype)\n if (!ftype.match(/text\\/.*|application\\/(json|csv|.*xml.*|.*script.*|x-php)/)) {\n // Deny load of blobs like img - can crash browser and will get corrupted anyway\n if (!window.confirm(`This does not look like a text file: ${ftype}\\nReally load?`)) {\n qs('#fu_file').value = ''\n return\n }\n }\n reader.onload = function (e) {\n const txt = e.target.result.replace(/[\\r\\n]+/, '\\n')\n qs('#fu_text').value = txt\n }\n console.log('Loading file...')\n reader.readAsText(file)\n }, false)\n\n qs('#term-fu-open').addEventListener('click', function () {\n openUploadDialog()\n return false\n })\n\n qs('#term-fu-start').addEventListener('click', function () {\n startUpload()\n return false\n })\n\n qs('#term-fu-close').addEventListener('click', function () {\n fuClose()\n return false\n })\n },\n open: openUploadDialog,\n setContent (content) {\n qs('#fu_text').value = content\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/upload.js","const { qs } = require('../utils')\n\nmodule.exports = function (screen, input) {\n const keyInput = qs('#softkb-input')\n if (!keyInput) return // abort, we're not on the terminal page\n\n const shortcutBar = document.createElement('div')\n shortcutBar.id = 'keyboard-shortcut-bar'\n if (navigator.userAgent.match(/iPad|iPhone|iPod/)) {\n qs('#screen').appendChild(shortcutBar)\n }\n\n let keyboardOpen = false\n\n // moves the input to where the cursor is on the canvas.\n // this is because most browsers will always scroll to wherever the focused\n // input is\n let updateInputPosition = function () {\n if (!keyboardOpen) return\n\n let [x, y] = screen.gridToScreen(screen.cursor.x, screen.cursor.y, true)\n keyInput.style.transform = `translate(${x}px, ${y}px)`\n }\n\n keyInput.addEventListener('focus', () => {\n keyboardOpen = true\n updateInputPosition()\n shortcutBar.classList.add('open')\n })\n\n keyInput.addEventListener('blur', () => {\n keyboardOpen = false\n shortcutBar.classList.remove('open')\n })\n\n screen.on('cursor-moved', updateInputPosition)\n\n qs('#term-kb-open').addEventListener('click', e => {\n e.preventDefault()\n keyInput.focus()\n })\n\n // Chrome for Android doesn't send proper keydown/keypress events with\n // real key values instead of 229 “Unidentified,” so here's a workaround\n // that deals with the input composition events.\n\n let lastCompositionString = ''\n\n // sends the difference between the last and the new composition string\n let sendInputDelta = function (newValue) {\n let resend = false\n if (newValue.length > lastCompositionString.length) {\n if (newValue.startsWith(lastCompositionString)) {\n // characters have been added at the end\n input.sendString(newValue.substr(lastCompositionString.length))\n } else resend = true\n } else if (newValue.length < lastCompositionString.length) {\n if (lastCompositionString.startsWith(newValue)) {\n // characters have been removed at the end\n input.sendString('\\b'.repeat(lastCompositionString.length -\n newValue.length))\n } else resend = true\n } else if (newValue !== lastCompositionString) resend = true\n\n if (resend) {\n // the entire string changed; resend everything\n input.sendString('\\b'.repeat(lastCompositionString.length) +\n newValue)\n }\n lastCompositionString = newValue\n }\n\n keyInput.addEventListener('keydown', e => {\n if (e.key === 'Unidentified') return\n\n keyInput.value = ''\n\n e.stopPropagation()\n input.handleKeyDown(e)\n })\n\n keyInput.addEventListener('keypress', e => {\n // prevent key duplication on iOS (because Safari *does* send proper events)\n e.stopPropagation()\n })\n\n keyInput.addEventListener('input', e => {\n e.stopPropagation()\n\n if (e.isComposing && 'data' in e) {\n sendInputDelta(e.data)\n } else if (e.isComposing) {\n // Firefox Mobile doesn't support InputEvent#data, so here's a hack\n // that just takes the input value and uses that\n sendInputDelta(keyInput.value)\n } else {\n if (e.inputType === 'insertCompositionText') input.sendString(e.data)\n else if (e.inputType === 'deleteContentBackward') {\n lastCompositionString = ''\n sendInputDelta('')\n } else if (e.inputType === 'insertText') {\n input.sendString(e.data)\n }\n }\n })\n\n keyInput.addEventListener('compositionstart', e => {\n lastCompositionString = ''\n })\n\n keyInput.addEventListener('compositionend', e => {\n lastCompositionString = ''\n keyInput.value = ''\n })\n\n screen.on('open-soft-keyboard', () => keyInput.focus())\n\n // shortcut bar\n const shortcuts = {\n Tab: 0x09,\n '←': 0x25,\n '↓': 0x28,\n '↑': 0x26,\n '→': 0x27,\n '^C': { which: 0x43, ctrlKey: true }\n }\n\n for (const shortcut in shortcuts) {\n const button = document.createElement('button')\n button.classList.add('shortcut-button')\n button.textContent = shortcut\n shortcutBar.appendChild(button)\n\n const key = shortcuts[shortcut]\n button.addEventListener('click', e => {\n e.preventDefault()\n let fakeEvent = key\n if (typeof key === 'number') fakeEvent = { which: key }\n fakeEvent.preventDefault = () => {}\n input.handleKeyDown(fakeEvent)\n })\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/soft_keyboard.js","const { mk } = require('../utils')\n\nmodule.exports = function attachDebugScreen (screen) {\n const debugCanvas = mk('canvas')\n const ctx = debugCanvas.getContext('2d')\n\n debugCanvas.style.position = 'absolute'\n // hackity hack should probably set this in CSS\n debugCanvas.style.top = '6px'\n debugCanvas.style.left = '6px'\n debugCanvas.style.pointerEvents = 'none'\n\n let addCanvas = function () {\n if (!debugCanvas.parentNode) screen.canvas.parentNode.appendChild(debugCanvas)\n }\n let removeCanvas = function () {\n if (debugCanvas.parentNode) debugCanvas.parentNode.removeChild(debugCanvas)\n }\n let updateCanvasSize = function () {\n let { width, height, devicePixelRatio } = screen.window\n let cellSize = screen.getCellSize()\n debugCanvas.width = width * cellSize.width * devicePixelRatio\n debugCanvas.height = height * cellSize.height * devicePixelRatio\n debugCanvas.style.width = `${width * cellSize.width}px`\n debugCanvas.style.height = `${height * cellSize.height}px`\n }\n\n let startTime, endTime, lastReason\n let cells = new Map()\n let clippedRects = []\n\n let startDrawing\n\n screen._debug = {\n drawStart (reason) {\n lastReason = reason\n startTime = Date.now()\n clippedRects = []\n },\n drawEnd () {\n endTime = Date.now()\n console.log(`Draw: ${lastReason} (${(endTime - startTime)} ms) with fancy graphics: ${screen.window.graphics}`)\n startDrawing()\n },\n setCell (cell, flags) {\n cells.set(cell, [flags, Date.now()])\n },\n clipRect (...args) {\n clippedRects.push(args)\n }\n }\n\n let clipPattern\n {\n let patternCanvas = document.createElement('canvas')\n patternCanvas.width = patternCanvas.height = 12\n let pctx = patternCanvas.getContext('2d')\n pctx.lineWidth = 1\n pctx.strokeStyle = '#00f'\n pctx.beginPath()\n pctx.moveTo(0, 0)\n pctx.lineTo(0 - 4, 12)\n pctx.moveTo(4, 0)\n pctx.lineTo(4 - 4, 12)\n pctx.moveTo(8, 0)\n pctx.lineTo(8 - 4, 12)\n pctx.moveTo(12, 0)\n pctx.lineTo(12 - 4, 12)\n pctx.moveTo(16, 0)\n pctx.lineTo(16 - 4, 12)\n pctx.stroke()\n clipPattern = ctx.createPattern(patternCanvas, 'repeat')\n }\n\n let isDrawing = false\n\n let drawLoop = function () {\n if (isDrawing) window.requestAnimationFrame(drawLoop)\n\n let { devicePixelRatio, width, height } = screen.window\n let { width: cellWidth, height: cellHeight } = screen.getCellSize()\n let screenLength = width * height\n let now = Date.now()\n\n ctx.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0)\n ctx.clearRect(0, 0, width * cellWidth, height * cellHeight)\n\n let activeCells = 0\n for (let cell = 0; cell < screenLength; cell++) {\n if (!cells.has(cell) || cells.get(cell)[0] === 0) continue\n\n let [flags, timestamp] = cells.get(cell)\n let elapsedTime = (now - timestamp) / 1000\n\n if (elapsedTime > 1) continue\n\n activeCells++\n ctx.globalAlpha = 0.5 * Math.max(0, 1 - elapsedTime)\n\n let x = cell % width\n let y = Math.floor(cell / width)\n\n if (flags & 1) {\n // redrawn\n ctx.fillStyle = '#f0f'\n }\n if (flags & 2) {\n // updated\n ctx.fillStyle = '#0f0'\n }\n\n ctx.fillRect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n\n if (flags & 4) {\n // wide cell\n ctx.lineWidth = 2\n ctx.strokeStyle = '#f00'\n ctx.strokeRect(x * cellWidth, y * cellHeight, cellWidth, cellHeight)\n }\n }\n\n if (clippedRects.length) {\n ctx.globalAlpha = 0.5\n ctx.beginPath()\n\n for (let rect of clippedRects) {\n ctx.rect(...rect)\n }\n\n ctx.fillStyle = clipPattern\n ctx.fill()\n }\n\n if (activeCells === 0) {\n isDrawing = false\n removeCanvas()\n }\n }\n\n startDrawing = function () {\n if (isDrawing) return\n addCanvas()\n updateCanvasSize()\n isDrawing = true\n drawLoop()\n }\n\n // debug toolbar\n const toolbar = mk('div')\n toolbar.classList.add('debug-toolbar')\n let toolbarAttached = false\n\n const attachToolbar = function () {\n screen.canvas.parentNode.appendChild(toolbar)\n }\n const detachToolbar = function () {\n toolbar.parentNode.removeChild(toolbar)\n }\n\n screen.on('update-window:debug', debug => {\n if (debug !== toolbarAttached) {\n toolbarAttached = debug\n if (debug) attachToolbar()\n else detachToolbar()\n }\n })\n\n screen.on('draw', () => {\n if (!toolbarAttached) return\n let cursorCell = screen.cursor.y * screen.window.width + screen.cursor.x\n let cellFG = screen.screenFG[cursorCell]\n let cellBG = screen.screenBG[cursorCell]\n let cellCode = (screen.screen[cursorCell] || '').codePointAt(0)\n let cellAttrs = screen.screenAttrs[cursorCell]\n let hexcode = cellCode.toString(16).toUpperCase()\n if (hexcode.length < 4) hexcode = `0000${hexcode}`.substr(-4)\n hexcode = `U+${hexcode}`\n toolbar.textContent = `Cursor cell (${cursorCell}): ${hexcode} FG: ${cellFG} BG: ${cellBG} Attrs: ${cellAttrs.toString(2)}`\n })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./js/term/debug_screen.js"],"sourceRoot":""}