/*! WebSSH2 2017-05-27 */ function replayCredentials(){return socket.emit("control","replayCredentials"),console.log("replaying credentials"),!1}function toggleLog(){return!0===sessionLogEnable?(sessionLogEnable=!1,document.getElementById("toggleLog").innerHTML='Start Log',console.log("stopping log, "+sessionLogEnable),currentDate=new Date,sessionLog=sessionLog+"\r\n\r\nLog End for "+sessionFooter+": "+currentDate.getFullYear()+"/"+(currentDate.getMonth()+1)+"/"+currentDate.getDate()+" @ "+currentDate.getHours()+":"+currentDate.getMinutes()+":"+currentDate.getSeconds()+"\r\n",logDate=currentDate,!1):(sessionLogEnable=!0,document.getElementById("toggleLog").innerHTML='Logging - STOP LOG',document.getElementById("downloadLog").style.display="inline",console.log("starting log, "+sessionLogEnable),currentDate=new Date,sessionLog="Log Start for "+sessionFooter+": "+currentDate.getFullYear()+"/"+(currentDate.getMonth()+1)+"/"+currentDate.getDate()+" @ "+currentDate.getHours()+":"+currentDate.getMinutes()+":"+currentDate.getSeconds()+"\r\n\r\n",logDate=currentDate,!1)}function downloadLog(){myFile="WebSSH2-"+logDate.getFullYear()+(logDate.getMonth()+1)+logDate.getDate()+"_"+logDate.getHours()+logDate.getMinutes()+logDate.getSeconds()+".log";var t=new Blob([sessionLog.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"")],{type:"text/plain"});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(t,myFile);else{var e=window.document.createElement("a");e.href=window.URL.createObjectURL(t),e.download=myFile,document.body.appendChild(e),e.click(),document.body.removeChild(e)}}!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Terminal=t()}}(function(){return function t(e,r,i){function n(o,a){if(!r[o]){if(!e[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(s)return s(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var l=r[o]={exports:{}};e[o][0].call(l.exports,function(t){var r=e[o][1][t];return n(r||t)},l,l.exports,t,e,r,i)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o0&&t.terminal.handler(r)}},0)},t.prototype.updateCompositionElements=function(t){var e=this;if(this.isComposing){var r=this.terminal.element.querySelector(".terminal-cursor");if(r){var i=this.terminal.element.querySelector(".xterm-rows").offsetTop+r.offsetTop;this.compositionView.style.left=r.offsetLeft+"px",this.compositionView.style.top=i+"px",this.compositionView.style.height=r.offsetHeight+"px",this.compositionView.style.lineHeight=r.offsetHeight+"px";var n=this.compositionView.getBoundingClientRect();this.textarea.style.left=r.offsetLeft+"px",this.textarea.style.top=i+"px",this.textarea.style.width=n.width+"px",this.textarea.style.height=n.height+"px",this.textarea.style.lineHeight=n.height+"px"}t||setTimeout(function(){return e.updateCompositionElements(!0)},0)}},t.prototype.clearTextareaPosition=function(){this.textarea.style.left="",this.textarea.style.top=""},t}();r.CompositionHelper=i},{}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});!function(t){t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="",t.BS="\b",t.HT="\t",t.LF="\n",t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""}(r.C0||(r.C0={}))},{}],4:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(){this._events=this._events||{}}return t.prototype.on=function(t,e){this._events[t]=this._events[t]||[],this._events[t].push(e)},t.prototype.off=function(t,e){if(this._events[t])for(var r=this._events[t],i=r.length;i--;)if(r[i]===e||r[i].listener===e)return void r.splice(i,1)},t.prototype.removeAllListeners=function(t){this._events[t]&&delete this._events[t]},t.prototype.once=function(t,e){function r(){var i=Array.prototype.slice.call(arguments);return this.off(t,r),e.apply(this,i)}return r.listener=e,this.on(t,r)},t.prototype.emit=function(t){if(this._events[t])for(var e=Array.prototype.slice.call(arguments,1),r=this._events[t],i=0;i=" "){var r=o(e);this._terminal.charset&&this._terminal.charset[t]&&(t=this._terminal.charset[t]);var i=this._terminal.y+this._terminal.ybase;if(!r&&this._terminal.x)return void(this._terminal.lines.get(i)[this._terminal.x-1]&&(this._terminal.lines.get(i)[this._terminal.x-1][2]?this._terminal.lines.get(i)[this._terminal.x-1][1]+=t:this._terminal.lines.get(i)[this._terminal.x-2]&&(this._terminal.lines.get(i)[this._terminal.x-2][1]+=t),this._terminal.updateRange(this._terminal.y)));if(this._terminal.x+r-1>=this._terminal.cols)if(this._terminal.wraparoundMode)this._terminal.x=0,++this._terminal.y>this._terminal.scrollBottom&&(this._terminal.y--,this._terminal.scroll());else if(2===r)return;if(i=this._terminal.y+this._terminal.ybase,this._terminal.insertMode)for(var n=0;nthis._terminal.scrollBottom&&(this._terminal.y--,this._terminal.scroll()),this._terminal.x>=this._terminal.cols&&this._terminal.x--},t.prototype.carriageReturn=function(){this._terminal.x=0},t.prototype.backspace=function(){this._terminal.x>0&&this._terminal.x--},t.prototype.tab=function(){this._terminal.x=this._terminal.nextStop()},t.prototype.shiftOut=function(){this._terminal.setgLevel(1)},t.prototype.shiftIn=function(){this._terminal.setgLevel(0)},t.prototype.insertChars=function(t){var e,r,i,n;for((e=t[0])<1&&(e=1),r=this._terminal.y+this._terminal.ybase,i=this._terminal.x,n=[this._terminal.eraseAttr()," ",1];e--&&i=this._terminal.rows&&(this._terminal.y=this._terminal.rows-1),this._terminal.x>=this._terminal.cols&&this._terminal.x--},t.prototype.cursorForward=function(t){var e=t[0];e<1&&(e=1),this._terminal.x+=e,this._terminal.x>=this._terminal.cols&&(this._terminal.x=this._terminal.cols-1)},t.prototype.cursorBackward=function(t){var e=t[0];e<1&&(e=1),this._terminal.x>=this._terminal.cols&&this._terminal.x--,this._terminal.x-=e,this._terminal.x<0&&(this._terminal.x=0)},t.prototype.cursorNextLine=function(t){var e=t[0];e<1&&(e=1),this._terminal.y+=e,this._terminal.y>=this._terminal.rows&&(this._terminal.y=this._terminal.rows-1),this._terminal.x=0},t.prototype.cursorPrecedingLine=function(t){var e=t[0];e<1&&(e=1),this._terminal.y-=e,this._terminal.y<0&&(this._terminal.y=0),this._terminal.x=0},t.prototype.cursorCharAbsolute=function(t){var e=t[0];e<1&&(e=1),this._terminal.x=e-1},t.prototype.cursorPosition=function(t){var e,r;e=t[0]-1,r=t.length>=2?t[1]-1:0,e<0?e=0:e>=this._terminal.rows&&(e=this._terminal.rows-1),r<0?r=0:r>=this._terminal.cols&&(r=this._terminal.cols-1),this._terminal.x=r,this._terminal.y=e},t.prototype.cursorForwardTab=function(t){for(var e=t[0]||1;e--;)this._terminal.x=this._terminal.nextStop()},t.prototype.eraseInDisplay=function(t){var e;switch(t[0]){case 0:for(this._terminal.eraseRight(this._terminal.x,this._terminal.y),e=this._terminal.y+1;e0&&(this._terminal.lines.trimStart(r),this._terminal.ybase=Math.max(this._terminal.ybase-r,0),this._terminal.ydisp=Math.max(this._terminal.ydisp-r,0))}},t.prototype.eraseInLine=function(t){switch(t[0]){case 0:this._terminal.eraseRight(this._terminal.x,this._terminal.y);break;case 1:this._terminal.eraseLeft(this._terminal.x,this._terminal.y);break;case 2:this._terminal.eraseLine(this._terminal.y)}},t.prototype.insertLines=function(t){var e,r,i;for((e=t[0])<1&&(e=1),r=this._terminal.y+this._terminal.ybase,i=this._terminal.rows-1-this._terminal.scrollBottom,i=this._terminal.rows-1+this._terminal.ybase-i+1;e--;)this._terminal.lines.length===this._terminal.lines.maxLength&&(this._terminal.lines.trimStart(1),this._terminal.ybase--,this._terminal.ydisp--,r--,i--),this._terminal.lines.splice(r,0,this._terminal.blankLine(!0)),this._terminal.lines.splice(i,1);this._terminal.updateRange(this._terminal.y),this._terminal.updateRange(this._terminal.scrollBottom)},t.prototype.deleteLines=function(t){var e,r,i;for((e=t[0])<1&&(e=1),r=this._terminal.y+this._terminal.ybase,i=this._terminal.rows-1-this._terminal.scrollBottom,i=this._terminal.rows-1+this._terminal.ybase-i;e--;)this._terminal.lines.length===this._terminal.lines.maxLength&&(this._terminal.lines.trimStart(1),this._terminal.ybase-=1,this._terminal.ydisp-=1),this._terminal.lines.splice(i+1,0,this._terminal.blankLine(!0)),this._terminal.lines.splice(r,1);this._terminal.updateRange(this._terminal.y),this._terminal.updateRange(this._terminal.scrollBottom)},t.prototype.deleteChars=function(t){var e,r,i;for((e=t[0])<1&&(e=1),r=this._terminal.y+this._terminal.ybase,i=[this._terminal.eraseAttr()," ",1];e--;)this._terminal.lines.get(r).splice(this._terminal.x,1),this._terminal.lines.get(r).push(i)},t.prototype.scrollUp=function(t){for(var e=t[0]||1;e--;)this._terminal.lines.splice(this._terminal.ybase+this._terminal.scrollTop,1),this._terminal.lines.splice(this._terminal.ybase+this._terminal.scrollBottom,0,this._terminal.blankLine());this._terminal.updateRange(this._terminal.scrollTop),this._terminal.updateRange(this._terminal.scrollBottom)},t.prototype.scrollDown=function(t){for(var e=t[0]||1;e--;)this._terminal.lines.splice(this._terminal.ybase+this._terminal.scrollBottom,1),this._terminal.lines.splice(this._terminal.ybase+this._terminal.scrollTop,0,this._terminal.blankLine());this._terminal.updateRange(this._terminal.scrollTop),this._terminal.updateRange(this._terminal.scrollBottom)},t.prototype.eraseChars=function(t){var e,r,i,n;for((e=t[0])<1&&(e=1),r=this._terminal.y+this._terminal.ybase,i=this._terminal.x,n=[this._terminal.eraseAttr()," ",1];e--&&i=this._terminal.cols&&(this._terminal.x=this._terminal.cols-1)},t.prototype.HPositionRelative=function(t){var e=t[0];e<1&&(e=1),this._terminal.x+=e,this._terminal.x>=this._terminal.cols&&(this._terminal.x=this._terminal.cols-1)},t.prototype.repeatPrecedingCharacter=function(t){for(var e=t[0]||1,r=this._terminal.lines.get(this._terminal.ybase+this._terminal.y),i=r[this._terminal.x-1]||[this._terminal.defAttr," ",1];e--;)r[this._terminal.x++]=i},t.prototype.sendDeviceAttributes=function(t){t[0]>0||(this._terminal.prefix?">"===this._terminal.prefix&&(this._terminal.is("xterm")?this._terminal.send(i.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.send(i.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.send(t[0]+"c"):this._terminal.is("screen")&&this._terminal.send(i.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.send(i.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.send(i.C0.ESC+"[?6c"))},t.prototype.linePosAbsolute=function(t){var e=t[0];e<1&&(e=1),this._terminal.y=e-1,this._terminal.y>=this._terminal.rows&&(this._terminal.y=this._terminal.rows-1)},t.prototype.VPositionRelative=function(t){var e=t[0];e<1&&(e=1),this._terminal.y+=e,this._terminal.y>=this._terminal.rows&&(this._terminal.y=this._terminal.rows-1),this._terminal.x>=this._terminal.cols&&this._terminal.x--},t.prototype.HVPosition=function(t){t[0]<1&&(t[0]=1),t[1]<1&&(t[1]=1),this._terminal.y=t[0]-1,this._terminal.y>=this._terminal.rows&&(this._terminal.y=this._terminal.rows-1),this._terminal.x=t[1]-1,this._terminal.x>=this._terminal.cols&&(this._terminal.x=this._terminal.cols-1)},t.prototype.tabClear=function(t){var e=t[0];e<=0?delete this._terminal.tabs[this._terminal.x]:3===e&&(this._terminal.tabs={})},t.prototype.setMode=function(t){if(t.length>1)for(var e=0;e1e3,this._terminal.mouseEvents=!0,this._terminal.element.style.cursor="default",this._terminal.log("Binding to mouse events.");break;case 1004:this._terminal.sendFocus=!0;break;case 1005:this._terminal.utfMouse=!0;break;case 1006:this._terminal.sgrMouse=!0;break;case 1015:this._terminal.urxvtMouse=!0;break;case 25:this._terminal.cursorHidden=!1;break;case 1049:case 47:case 1047:if(!this._terminal.normal){var r={lines:this._terminal.lines,ybase:this._terminal.ybase,ydisp:this._terminal.ydisp,x:this._terminal.x,y:this._terminal.y,scrollTop:this._terminal.scrollTop,scrollBottom:this._terminal.scrollBottom,tabs:this._terminal.tabs};this._terminal.reset(),this._terminal.viewport.syncScrollArea(),this._terminal.normal=r,this._terminal.showCursor()}}}else switch(t[0]){case 4:this._terminal.insertMode=!0}},t.prototype.resetMode=function(t){if(t.length>1)for(var e=0;e>18,s=this._terminal.curAttr>>9&511,o=511&this._terminal.curAttr;i=30&&e<=37?s=e-30:e>=40&&e<=47?o=e-40:e>=90&&e<=97?s=(e+=8)-90:e>=100&&e<=107?o=(e+=8)-100:0===e?(n=this._terminal.defAttr>>18,s=this._terminal.defAttr>>9&511,o=511&this._terminal.defAttr):1===e?n|=1:4===e?n|=2:5===e?n|=4:7===e?n|=8:8===e?n|=16:22===e?n&=-2:24===e?n&=-3:25===e?n&=-5:27===e?n&=-9:28===e?n&=-17:39===e?s=this._terminal.defAttr>>9&511:49===e?o=511&this._terminal.defAttr:38===e?2===t[i+1]?(i+=2,-1===(s=this._terminal.matchColor(255&t[i],255&t[i+1],255&t[i+2]))&&(s=511),i+=2):5===t[i+1]&&(s=e=255&t[i+=2]):48===e?2===t[i+1]?(i+=2,-1===(o=this._terminal.matchColor(255&t[i],255&t[i+1],255&t[i+2]))&&(o=511),i+=2):5===t[i+1]&&(o=e=255&t[i+=2]):100===e?(s=this._terminal.defAttr>>9&511,o=511&this._terminal.defAttr):this._terminal.error("Unknown SGR attribute: %d.",e);this._terminal.curAttr=n<<18|s<<9|o}else this._terminal.curAttr=this._terminal.defAttr},t.prototype.deviceStatus=function(t){if(this._terminal.prefix){if("?"===this._terminal.prefix)switch(t[0]){case 6:this._terminal.send(i.C0.ESC+"[?"+(this._terminal.y+1)+";"+(this._terminal.x+1)+"R")}}else switch(t[0]){case 5:this._terminal.send(i.C0.ESC+"[0n");break;case 6:this._terminal.send(i.C0.ESC+"["+(this._terminal.y+1)+";"+(this._terminal.x+1)+"R")}},t.prototype.softReset=function(t){this._terminal.cursorHidden=!1,this._terminal.insertMode=!1,this._terminal.originMode=!1,this._terminal.wraparoundMode=!0,this._terminal.applicationKeypad=!1,this._terminal.viewport.syncScrollArea(),this._terminal.applicationCursor=!1,this._terminal.scrollTop=0,this._terminal.scrollBottom=this._terminal.rows-1,this._terminal.curAttr=this._terminal.defAttr,this._terminal.x=this._terminal.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null]},t.prototype.setCursorStyle=function(t){var e=t[0]<1?1:t[0];switch(e){case 1:case 2:this._terminal.setOption("cursorStyle","block");break;case 3:case 4:this._terminal.setOption("cursorStyle","underline");break;case 5:case 6:this._terminal.setOption("cursorStyle","bar")}var r=e%2==1;this._terminal.setOption("cursorBlink",r)},t.prototype.setScrollRegion=function(t){this._terminal.prefix||(this._terminal.scrollTop=(t[0]||1)-1,this._terminal.scrollBottom=(t[1]&&t[1]<=this._terminal.rows?t[1]:this._terminal.rows)-1,this._terminal.x=0,this._terminal.y=0)},t.prototype.saveCursor=function(t){this._terminal.savedX=this._terminal.x,this._terminal.savedY=this._terminal.y},t.prototype.restoreCursor=function(t){this._terminal.x=this._terminal.savedX||0,this._terminal.y=this._terminal.savedY||0},t}();r.InputHandler=s;var o=function(t){function e(t){var e,r=0,i=n.length-1;if(tn[i][1])return!1;for(;i>=r;)if(e=Math.floor((r+i)/2),t>n[e][1])r=e+1;else{if(!(t=127&&r<160?t.control:e(r)?0:i(r)?2:1}function i(t){return t>=4352&&(t<=4447||9001===t||9002===t||t>=11904&&t<=42191&&12351!==t||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510||t>=131072&&t<=196605||t>=196608&&t<=262141)}var n=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];return r}({nul:0,control:0})},{"./Charsets":1,"./EscapeSequences":3}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=new RegExp("(?:^|[^\\da-z\\.-]+)((https?:\\/\\/)((([\\da-z\\.-]+)\\.([a-z\\.]{2,6}))|((\\d{1,3}\\.){3}\\d{1,3})|(localhost))(:\\d{1,5})?(\\/[\\/\\w\\.\\-%~]*)*(\\?[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?(#[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?)($|[^\\/\\w\\.\\-%]+)"),n=0,s=function(){function t(){this._nextLinkMatcherId=n,this._rowTimeoutIds=[],this._linkMatchers=[],this.registerLinkMatcher(i,null,{matchIndex:1})}return t.prototype.attachToDom=function(t,e){this._document=t,this._rows=e},t.prototype.linkifyRow=function(e){if(this._document){var r=this._rowTimeoutIds[e];r&&clearTimeout(r),this._rowTimeoutIds[e]=setTimeout(this._linkifyRow.bind(this,e),t.TIME_BEFORE_LINKIFY)}},t.prototype.setHypertextLinkHandler=function(t){this._linkMatchers[n].handler=t},t.prototype.setHypertextValidationCallback=function(t){this._linkMatchers[n].validationCallback=t},t.prototype.registerLinkMatcher=function(t,e,r){if(void 0===r&&(r={}),this._nextLinkMatcherId!==n&&!e)throw new Error("handler must be defined");var i={id:this._nextLinkMatcherId++,regex:t,handler:e,matchIndex:r.matchIndex,validationCallback:r.validationCallback,priority:r.priority||0};return this._addLinkMatcherToList(i),i.id},t.prototype._addLinkMatcherToList=function(t){if(0!==this._linkMatchers.length){for(var e=this._linkMatchers.length-1;e>=0;e--)if(t.priority<=this._linkMatchers[e].priority)return void this._linkMatchers.splice(e+1,0,t);this._linkMatchers.splice(0,0,t)}else this._linkMatchers.push(t)},t.prototype.deregisterLinkMatcher=function(t){for(var e=1;e0){if(i.validationCallback)for(var s=0;s=0){var p=this._createAnchorElement(a,e.handler,i);if(l.textContent.length===a.length)if(3===l.nodeType)this._replaceNode(l,p);else{var f=l;if("A"===f.nodeName)return r;f.innerHTML="",f.appendChild(p)}else h+=this._replaceNodeSubstringWithNode(l,p,a,u);if(r.push(p),!(o=t.textContent.substring(c).match(e.regex))||0===o.length)return r;a=o["number"!=typeof e.matchIndex?0:e.matchIndex],c+=o.index+a.length}}return r},t.prototype._createAnchorElement=function(t,e,r){var i=this._document.createElement("a");return i.textContent=t,i.draggable=!1,r?(i.href=t,i.target="_blank",i.addEventListener("click",function(r){if(e)return e(r,t)})):i.addEventListener("click",function(r){if(!i.classList.contains("xterm-invalid-link"))return e(r,t)}),i},t.prototype._replaceNode=function(t){for(var e=[],r=1;r"]=function(t){return t.setPrefix(">")},a["!"]=function(t){return t.setPrefix("!")},a[0]=function(t){return t.setParam(10*t.getParam())},a[1]=function(t){return t.setParam(10*t.getParam()+1)},a[2]=function(t){return t.setParam(10*t.getParam()+2)},a[3]=function(t){return t.setParam(10*t.getParam()+3)},a[4]=function(t){return t.setParam(10*t.getParam()+4)},a[5]=function(t){return t.setParam(10*t.getParam()+5)},a[6]=function(t){return t.setParam(10*t.getParam()+6)},a[7]=function(t){return t.setParam(10*t.getParam()+7)},a[8]=function(t){return t.setParam(10*t.getParam()+8)},a[9]=function(t){return t.setParam(10*t.getParam()+9)},a.$=function(t){return t.setPostfix("$")},a['"']=function(t){return t.setPostfix('"')},a[" "]=function(t){return t.setPostfix(" ")},a["'"]=function(t){return t.setPostfix("'")},a[";"]=function(t){return t.finalizeParam()},a[i.C0.CAN]=function(t){return t.setState(h.NORMAL)};var c={};c["@"]=function(t,e,r){return t.insertChars(e)},c.A=function(t,e,r){return t.cursorUp(e)},c.B=function(t,e,r){return t.cursorDown(e)},c.C=function(t,e,r){return t.cursorForward(e)},c.D=function(t,e,r){return t.cursorBackward(e)},c.E=function(t,e,r){return t.cursorNextLine(e)},c.F=function(t,e,r){return t.cursorPrecedingLine(e)},c.G=function(t,e,r){return t.cursorCharAbsolute(e)},c.H=function(t,e,r){return t.cursorPosition(e)},c.I=function(t,e,r){return t.cursorForwardTab(e)},c.J=function(t,e,r){return t.eraseInDisplay(e)},c.K=function(t,e,r){return t.eraseInLine(e)},c.L=function(t,e,r){return t.insertLines(e)},c.M=function(t,e,r){return t.deleteLines(e)},c.P=function(t,e,r){return t.deleteChars(e)},c.S=function(t,e,r){return t.scrollUp(e)},c.T=function(t,e,r){e.length<2&&!r&&t.scrollDown(e)},c.X=function(t,e,r){return t.eraseChars(e)},c.Z=function(t,e,r){return t.cursorBackwardTab(e)},c["`"]=function(t,e,r){return t.charPosAbsolute(e)},c.a=function(t,e,r){return t.HPositionRelative(e)},c.b=function(t,e,r){return t.repeatPrecedingCharacter(e)},c.c=function(t,e,r){return t.sendDeviceAttributes(e)},c.d=function(t,e,r){return t.linePosAbsolute(e)},c.e=function(t,e,r){return t.VPositionRelative(e)},c.f=function(t,e,r){return t.HVPosition(e)},c.g=function(t,e,r){return t.tabClear(e)},c.h=function(t,e,r){return t.setMode(e)},c.l=function(t,e,r){return t.resetMode(e)},c.m=function(t,e,r){return t.charAttributes(e)},c.n=function(t,e,r){return t.deviceStatus(e)},c.p=function(t,e,r){switch(r){case"!":t.softReset(e)}},c.q=function(t,e,r,i){" "===i&&t.setCursorStyle(e)},c.r=function(t,e){return t.setScrollRegion(e)},c.s=function(t,e){return t.saveCursor(e)},c.u=function(t,e){return t.restoreCursor(e)},c[i.C0.CAN]=function(t,e,r,i,n){return n.setState(h.NORMAL)};var h;!function(t){t[t.NORMAL=0]="NORMAL",t[t.ESCAPED=1]="ESCAPED",t[t.CSI_PARAM=2]="CSI_PARAM",t[t.CSI=3]="CSI",t[t.OSC=4]="OSC",t[t.CHARSET=5]="CHARSET",t[t.DCS=6]="DCS",t[t.IGNORE=7]="IGNORE"}(h||(h={}));var l=function(){function t(t,e){this._inputHandler=t,this._terminal=e,this._state=h.NORMAL}return t.prototype.parse=function(t){var e,r,l,u,p=t.length;for(this._position=0,this._terminal.surrogate_high&&(t=this._terminal.surrogate_high+t,this._terminal.surrogate_high="");this._position":this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport.syncScrollArea(),this._state=h.NORMAL;break;default:this._state=h.NORMAL,this._terminal.error("Unknown ESC control: %s.",r)}break;case h.CHARSET:r in n.CHARSETS?(e=n.CHARSETS[r],"/"===r&&this.skipNextChar()):e=n.DEFAULT_CHARSET,this._terminal.setgCharset(this._terminal.gcharset,e),this._terminal.gcharset=null,this._state=h.NORMAL;break;case h.OSC:if(r===i.C0.ESC||r===i.C0.BEL){switch(r===i.C0.ESC&&this._position++,this._terminal.params.push(this._terminal.currentParam),this._terminal.params[0]){case 0:case 1:case 2:this._terminal.params[1]&&(this._terminal.title=this._terminal.params[1],this._terminal.handleTitle(this._terminal.title))}this._terminal.params=[],this._terminal.currentParam=0,this._state=h.NORMAL}else this._terminal.params.length?this._terminal.currentParam+=r:r>="0"&&r<="9"?this._terminal.currentParam=10*this._terminal.currentParam+r.charCodeAt(0)-48:";"===r&&(this._terminal.params.push(this._terminal.currentParam),this._terminal.currentParam="");break;case h.CSI_PARAM:if(r in a){a[r](this);break}this.finalizeParam(),this._state=h.CSI;case h.CSI:r in c?c[r](this._inputHandler,this._terminal.params,this._terminal.prefix,this._terminal.postfix,this):this._terminal.error("Unknown CSI code: %s.",r),this._state=h.NORMAL,this._terminal.prefix="",this._terminal.postfix="";break;case h.DCS:if(r===i.C0.ESC||r===i.C0.BEL){switch(r===i.C0.ESC&&this._position++,this._terminal.prefix){case"":break;case"$q":var f=this._terminal.currentParam,d=!1;switch(f){case'"q':f='0"q';break;case'"p':f='61"p';break;case"r":f=this._terminal.scrollTop+1+";"+(this._terminal.scrollBottom+1)+"r";break;case"m":f="0m";break;default:this._terminal.error("Unknown DCS Pt: %s.",f),f=""}this._terminal.send(i.C0.ESC+"P"+ +d+"$r"+f+i.C0.ESC+"\\");break;case"+p":break;case"+q":f=this._terminal.currentParam,d=!1,this._terminal.send(i.C0.ESC+"P"+ +d+"+r"+f+i.C0.ESC+"\\");break;default:this._terminal.error("Unknown DCS prefix: %s.",this._terminal.prefix)}this._terminal.currentParam=0,this._terminal.prefix="",this._state=h.NORMAL}else this._terminal.currentParam?this._terminal.currentParam+=r:this._terminal.prefix||"$"===r||"+"===r?2===this._terminal.prefix.length?this._terminal.currentParam=r:this._terminal.prefix+=r:this._terminal.currentParam=r;break;case h.IGNORE:r!==i.C0.ESC&&r!==i.C0.BEL||(r===i.C0.ESC&&this._position++,this._state=h.NORMAL)}}},t.prototype.setState=function(t){this._state=t},t.prototype.setPrefix=function(t){this._terminal.prefix=t},t.prototype.setPostfix=function(t){this._terminal.postfix=t},t.prototype.setParam=function(t){this._terminal.currentParam=t},t.prototype.getParam=function(){return this._terminal.currentParam},t.prototype.finalizeParam=function(){this._terminal.params.push(this._terminal.currentParam),this._terminal.currentParam=0},t.prototype.skipNextChar=function(){this._position++},t}();r.Parser=l},{"./Charsets":1,"./EscapeSequences":3}],8:[function(t,e,r){"use strict";function i(t){var e=t.ownerDocument.createElement("span");e.innerHTML="hello world",t.appendChild(e);var r=e.offsetWidth,i=e.offsetHeight;e.style.fontWeight="bold";var n=e.offsetWidth,s=e.offsetHeight;return t.removeChild(e),r!==n||i!==s}Object.defineProperty(r,"__esModule",{value:!0});var n;!function(t){t[t.BOLD=1]="BOLD",t[t.UNDERLINE=2]="UNDERLINE",t[t.BLINK=4]="BLINK",t[t.INVERSE=8]="INVERSE",t[t.INVISIBLE=16]="INVISIBLE"}(n||(n={}));var s=null,o=function(){function t(t){this._terminal=t,this._refreshRowsQueue=[],this._refreshFramesSkipped=0,this._refreshAnimationFrame=null,null===s&&(s=i(this._terminal.element))}return t.prototype.queueRefresh=function(t,e){this._refreshRowsQueue.push({start:t,end:e}),this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(this._refreshLoop.bind(this)))},t.prototype._refreshLoop=function(){if(this._terminal.writeBuffer.length>0&&this._refreshFramesSkipped++<=5)this._refreshAnimationFrame=window.requestAnimationFrame(this._refreshLoop.bind(this));else{this._refreshFramesSkipped=0;var t,e;if(this._refreshRowsQueue.length>4)t=0,e=this._terminal.rows-1;else{t=this._refreshRowsQueue[0].start,e=this._refreshRowsQueue[0].end;for(var r=1;re&&(e=this._refreshRowsQueue[r].end)}this._refreshRowsQueue=[],this._refreshAnimationFrame=null,this._refresh(t,e)}},t.prototype._refresh=function(t,e){var r,i,o,a,c,h,l,u,p,f,d,m,y,g,_;document.activeElement;for(e-t>=this._terminal.rows/2&&(_=this._terminal.element.parentNode)&&this._terminal.element.removeChild(this._terminal.rowContainer),u=this._terminal.cols,i=t,e>=this._terminal.rows&&(this._terminal.log("`end` is too large. Most likely a bad CSR."),e=this._terminal.rows-1);i<=e;i++)if(g=i+this._terminal.ydisp,(a=this._terminal.lines.get(g))&&this._terminal.children[i]){for(c="",r=this._terminal.y===i-(this._terminal.ybase-this._terminal.ydisp)&&this._terminal.cursorState&&!this._terminal.cursorHidden?this._terminal.x:-1,f=this._terminal.defAttr,o=0;o"),p!==this._terminal.defAttr))if(-1===p)c+='';else{var v=[];d=511&p,m=p>>9&511,(y=p>>18)&n.BOLD&&(s||v.push("xterm-bold"),m<8&&(m+=8)),y&n.UNDERLINE&&v.push("xterm-underline"),y&n.BLINK&&v.push("xterm-blink"),y&n.INVERSE&&(d=[m,m=d][0],1&y&&m<8&&(m+=8)),y&n.INVISIBLE&&v.push("xterm-hidden"),y&n.INVERSE&&(257===d&&(d=15),256===m&&(m=0)),d<256&&v.push("xterm-bg-color-"+d),m<256&&v.push("xterm-color-"+m),c+="'),h){case"&":c+="&";break;case"<":c+="<";break;case">":c+=">";break;default:c+=h<=" "?" ":h}2===l&&(c+=""),f=p}f!==this._terminal.defAttr&&(c+=""),this._terminal.children[i].innerHTML=c}_&&this._terminal.element.appendChild(this._terminal.rowContainer),this._terminal.emit("refresh",{element:this._terminal.element,start:t,end:e})},t}();r.Renderer=o},{}],9:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e,r,i){var n=this;this.terminal=t,this.viewportElement=e,this.scrollArea=r,this.charMeasure=i,this.currentRowHeight=0,this.lastRecordedBufferLength=0,this.lastRecordedViewportHeight=0,this.terminal.on("scroll",this.syncScrollArea.bind(this)),this.terminal.on("resize",this.syncScrollArea.bind(this)),this.viewportElement.addEventListener("scroll",this.onScroll.bind(this)),setTimeout(function(){return n.syncScrollArea()},0)}return t.prototype.refresh=function(){if(this.charMeasure.height>0){var t=this.charMeasure.height!==this.currentRowHeight;t&&(this.currentRowHeight=this.charMeasure.height,this.viewportElement.style.lineHeight=this.charMeasure.height+"px",this.terminal.rowContainer.style.lineHeight=this.charMeasure.height+"px");var e=this.lastRecordedViewportHeight!==this.terminal.rows;(t||e)&&(this.lastRecordedViewportHeight=this.terminal.rows,this.viewportElement.style.height=this.charMeasure.height*this.terminal.rows+"px"),this.scrollArea.style.height=this.charMeasure.height*this.lastRecordedBufferLength+"px"}},t.prototype.syncScrollArea=function(){this.lastRecordedBufferLength!==this.terminal.lines.length?(this.lastRecordedBufferLength=this.terminal.lines.length,this.refresh()):this.lastRecordedViewportHeight!==this.terminal.rows?this.refresh():this.charMeasure.height!==this.currentRowHeight&&this.refresh();var t=this.terminal.ydisp*this.currentRowHeight;this.viewportElement.scrollTop!==t&&(this.viewportElement.scrollTop=t)},t.prototype.onScroll=function(t){var e=Math.round(this.viewportElement.scrollTop/this.currentRowHeight)-this.terminal.ydisp;this.terminal.scrollDisp(e,!0)},t.prototype.onWheel=function(t){if(0!==t.deltaY){var e=1;t.deltaMode===WheelEvent.DOM_DELTA_LINE?e=this.currentRowHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e=this.currentRowHeight*this.terminal.rows),this.viewportElement.scrollTop+=t.deltaY*e,t.preventDefault()}},t}();r.Viewport=i},{}],10:[function(t,e,r){"use strict";function i(t){var e=String.fromCharCode(32),r=String.fromCharCode(160),i=new RegExp(r,"g");return t.split("\n").map(function(t){return t.replace(/\s+$/g,"").replace(i,e)}).join("\n")}function n(t,e){var r=i(window.getSelection().toString());e.browser.isMSIE?window.clipboardData.setData("Text",r):t.clipboardData.setData("text/plain",r),t.preventDefault()}function s(t,e){t.stopPropagation();var r=function(r){return e.handler(r),e.textarea.value="",e.cancel(t)};e.browser.isMSIE?window.clipboardData&&r(window.clipboardData.getData("Text")):t.clipboardData&&r(t.clipboardData.getData("text/plain"))}function o(t,e){var r=document.getSelection(),n=i(r.toString()),s=!1,o=t.clientX,a=t.clientY;if(r.rangeCount){for(var c=r.getRangeAt(0).getClientRects(),h=0;hl.left&&ol.top&&athis._length)for(var e=this._length;e=t;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(var n=0;nthis.maxLength?(this._startIndex+=this._length+r.length-this.maxLength,this._length=this.maxLength):this._length+=r.length}},t.prototype.trimStart=function(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t},t.prototype.shiftElements=function(t,e,r){if(!(e<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(n=e-1;n>=0;n--)this.set(t+n+r,this.get(t+n));var i=t+e+r-this._length;if(i>0)for(this._length+=i;this._length>this.maxLength;)this._length--,this._startIndex++}else for(var n=0;n=0}Object.defineProperty(r,"__esModule",{value:!0}),r.contains=i},{}],15:[function(t,e,r){"use strict";function i(t){var e=this;if(!(this instanceof i))return new i(arguments[0],arguments[1],arguments[2]);e.browser=w,e.cancel=i.cancel,p.EventEmitter.call(this),"number"==typeof t&&(t={cols:arguments[0],rows:arguments[1],handler:arguments[2]}),t=t||{},Object.keys(i.defaults).forEach(function(r){null==t[r]&&(t[r]=i.options[r],i[r]!==i.defaults[r]&&(t[r]=i[r])),e[r]=t[r]}),8===t.colors.length?t.colors=t.colors.concat(i._colors.slice(8)):16===t.colors.length?t.colors=t.colors.concat(i._colors.slice(16)):10===t.colors.length?t.colors=t.colors.slice(0,-2).concat(i._colors.slice(8,-2),t.colors.slice(-2)):18===t.colors.length&&(t.colors=t.colors.concat(i._colors.slice(16,-2),t.colors.slice(-2))),this.colors=t.colors,this.options=t,this.parent=t.body||t.parent||(k?k.getElementsByTagName("body")[0]:null),this.cols=t.cols||t.geometry[0],this.rows=t.rows||t.geometry[1],this.geometry=[this.cols,this.rows],t.handler&&this.on("data",t.handler),this.ybase=0,this.ydisp=0,this.x=0,this.y=0,this.cursorState=0,this.cursorHidden=!1,this.convertEol,this.queue="",this.scrollTop=0,this.scrollBottom=this.rows-1,this.customKeydownHandler=null,this.cursorBlinkInterval=null,this.applicationKeypad=!1,this.applicationCursor=!1,this.originMode=!1,this.insertMode=!1,this.wraparoundMode=!0,this.normal=null,this.charset=null,this.gcharset=null,this.glevel=0,this.charsets=[null],this.decLocator,this.x10Mouse,this.vt200Mouse,this.vt300Mouse,this.normalMouse,this.mouseEvents,this.sendFocus,this.utfMouse,this.sgrMouse,this.urxvtMouse,this.element,this.children,this.refreshStart,this.refreshEnd,this.savedX,this.savedY,this.savedCols,this.readable=!0,this.writable=!0,this.defAttr=131840,this.curAttr=this.defAttr,this.params=[],this.currentParam=0,this.prefix="",this.postfix="",this.inputHandler=new g.InputHandler(this),this.parser=new _.Parser(this.inputHandler,this),this.renderer=this.renderer||null,this.linkifier=this.linkifier||new b.Linkifier,this.writeBuffer=[],this.writeInProgress=!1,this.xoffSentToCatchUp=!1,this.writeStopped=!1,this.surrogate_high="",this.lines=new m.CircularList(this.scrollback);for(var r=this.rows;r--;)this.lines.push(this.blankLine());this.tabs,this.setupStops(),this.userScrolling=!1}function n(t,e,r,i){Array.isArray(t)||(t=[t]),t.forEach(function(t){t.addEventListener(e,r,i||!1)})}function s(t,e,r,i){t.removeEventListener(e,r,i||!1)}function o(t,e){if(this.cancelEvents||e)return t.preventDefault(),t.stopPropagation(),!1}function a(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function c(t,e){var r=t.browser.isMac&&e.altKey&&!e.ctrlKey&&!e.metaKey||t.browser.isMSWindows&&e.altKey&&e.ctrlKey&&!e.metaKey;return"keypress"==e.type?r:r&&(!e.keyCode||e.keyCode>47)}function h(t,e,r){var n=t<<16|e<<8|r;if(null!=h._cache[n])return h._cache[n];for(var s,o,a,c,l,u=1/0,p=-1,f=0;f>16&255,t>>8&255,255&t]);return e}(),i.defaults={colors:i.colors,theme:"default",convertEol:!1,termName:"xterm",geometry:[80,24],cursorBlink:!1,cursorStyle:"block",visualBell:!1,popOnBell:!1,scrollback:1e3,screenKeys:!1,debug:!1,cancelEvents:!1,disableStdin:!1,useFlowControl:!1,tabStopWidth:8},i.options={},i.focus=null,function(t,e,r){if(t.forEach)return t.forEach(e,r);for(var i=0;ie){var r=this.lines.length-e,n=this.ydisp-r<0;this.lines.trimStart(r),this.ybase=Math.max(this.ybase-r,0),this.ydisp=Math.max(this.ydisp-r,0),n&&this.refresh(0,this.rows-1)}this.lines.maxLength=e,this.viewport.syncScrollArea()}}switch(this[t]=e,this.options[t]=e,t){case"cursorBlink":this.setCursorBlinking(e);break;case"cursorStyle":this.element.classList.toggle("xterm-cursor-style-underline","underline"===e),this.element.classList.toggle("xterm-cursor-style-bar","bar"===e);break;case"tabStopWidth":this.setupStops()}},i.prototype.restartCursorBlinking=function(){this.setCursorBlinking(this.options.cursorBlink)},i.prototype.setCursorBlinking=function(t){if(this.element.classList.toggle("xterm-cursor-blink",t),this.clearCursorBlinkingInterval(),t){var e=this;this.cursorBlinkInterval=setInterval(function(){e.element.classList.toggle("xterm-cursor-blink-on")},600)}},i.prototype.clearCursorBlinkingInterval=function(){this.element.classList.remove("xterm-cursor-blink-on"),this.cursorBlinkInterval&&(clearInterval(this.cursorBlinkInterval),this.cursorBlinkInterval=null)},i.bindFocus=function(t){n(t.textarea,"focus",function(e){t.sendFocus&&t.send(y.C0.ESC+"[I"),t.element.classList.add("focus"),t.showCursor(),t.restartCursorBlinking.apply(t),i.focus=t,t.emit("focus",{terminal:t})})},i.prototype.blur=function(){return this.textarea.blur()},i.bindBlur=function(t){n(t.textarea,"blur",function(e){t.refresh(t.y,t.y),t.sendFocus&&t.send(y.C0.ESC+"[O"),t.element.classList.remove("focus"),t.clearCursorBlinkingInterval.apply(t),i.focus=null,t.emit("blur",{terminal:t})})},i.prototype.initGlobal=function(){function t(t){d.rightClickHandler.call(this,t,e)}var e=this;i.bindKeys(this),i.bindFocus(this),i.bindBlur(this),n(this.element,"copy",function(t){d.copyHandler.call(this,t,e)}),n(this.textarea,"paste",function(t){d.pasteHandler.call(this,t,e)}),n(this.element,"paste",function(t){d.pasteHandler.call(this,t,e)}),e.browser.isFirefox?n(this.element,"mousedown",function(e){2==e.button&&t(e)}):n(this.element,"contextmenu",t)},i.bindKeys=function(t){n(t.element,"keydown",function(e){k.activeElement==this&&t.keyDown(e)},!0),n(t.element,"keypress",function(e){k.activeElement==this&&t.keyPress(e)},!0),n(t.element,"keyup",function(e){l(e)||t.focus(t)},!0),n(t.textarea,"keydown",function(e){t.keyDown(e)},!0),n(t.textarea,"keypress",function(e){t.keyPress(e),this.value=""},!0),n(t.textarea,"compositionstart",t.compositionHelper.compositionstart.bind(t.compositionHelper)),n(t.textarea,"compositionupdate",t.compositionHelper.compositionupdate.bind(t.compositionHelper)),n(t.textarea,"compositionend",t.compositionHelper.compositionend.bind(t.compositionHelper)),t.on("refresh",t.compositionHelper.updateCompositionElements.bind(t.compositionHelper)),t.on("refresh",function(e){t.queueLinkification(e.start,e.end)})},i.prototype.insertRow=function(t){return"object"!=typeof t&&(t=k.createElement("div")),this.rowContainer.appendChild(t),this.children.push(t),t},i.prototype.open=function(t,e){var r=this,i=0;if(this.parent=t||this.parent,!this.parent)throw new Error("Terminal requires a parent element.");for(this.context=this.parent.ownerDocument.defaultView,this.document=this.parent.ownerDocument,this.body=this.document.getElementsByTagName("body")[0],this.element=this.document.createElement("div"),this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.classList.add("xterm-theme-"+this.theme),this.setCursorBlinking(this.options.cursorBlink),this.element.style.height,this.element.setAttribute("tabindex",0),this.viewportElement=k.createElement("div"),this.viewportElement.classList.add("xterm-viewport"),this.element.appendChild(this.viewportElement),this.viewportScrollArea=k.createElement("div"),this.viewportScrollArea.classList.add("xterm-scroll-area"),this.viewportElement.appendChild(this.viewportScrollArea),this.rowContainer=k.createElement("div"),this.rowContainer.classList.add("xterm-rows"),this.element.appendChild(this.rowContainer),this.children=[],this.linkifier.attachToDom(k,this.children),this.helperContainer=k.createElement("div"),this.helperContainer.classList.add("xterm-helpers"),this.element.appendChild(this.helperContainer),this.textarea=k.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.textarea.addEventListener("focus",function(){r.emit("focus",{terminal:r})}),this.textarea.addEventListener("blur",function(){r.emit("blur",{terminal:r})}),this.helperContainer.appendChild(this.textarea),this.compositionView=k.createElement("div"),this.compositionView.classList.add("composition-view"),this.compositionHelper=new u.CompositionHelper(this.textarea,this.compositionView,this),this.helperContainer.appendChild(this.compositionView),this.charSizeStyleElement=k.createElement("style"),this.helperContainer.appendChild(this.charSizeStyleElement);i2047&&(e=2047),t.push(192|e>>6),t.push(128|63&e))}else{if(255===e)return t.push(0);e>127&&(e=127),t.push(e)}}function i(t,e){if(h.vt300Mouse){t&=3,e.x-=32,e.y-=32;var i=y.C0.ESC+"[24";if(0===t)i+="1";else if(1===t)i+="3";else if(2===t)i+="5";else{if(3===t)return;i+="0"}return i+="~["+e.x+","+e.y+"]\r",void h.send(i)}return h.decLocator?(t&=3,e.x-=32,e.y-=32,0===t?t=2:1===t?t=4:2===t?t=6:3===t&&(t=3),void h.send(y.C0.ESC+"["+t+";"+(3===t?4:0)+";"+e.y+";"+e.x+";"+(e.page||0)+"&w")):h.urxvtMouse?(e.x-=32,e.y-=32,e.x++,e.y++,void h.send(y.C0.ESC+"["+t+";"+e.x+";"+e.y+"M")):h.sgrMouse?(e.x-=32,e.y-=32,void h.send(y.C0.ESC+"[<"+((3==(3&t)?-4&t:t)-32)+";"+e.x+";"+e.y+(3==(3&t)?"m":"M"))):(r(i=[],t),r(i,e.x),r(i,e.y),void h.send(y.C0.ESC+"[M"+String.fromCharCode.apply(String,i)))}function o(t){var e,r,i,n,s;switch(t.overrideType||t.type){case"mousedown":e=null!=t.button?+t.button:null!=t.which?t.which-1:null,h.browser.isMSIE&&(e=1===e?0:4===e?1:e);break;case"mouseup":e=3;break;case"DOMMouseScroll":e=t.detail<0?64:65;break;case"wheel":e=t.wheelDeltaY>0?64:65}return r=t.shiftKey?4:0,i=t.metaKey?8:0,n=t.ctrlKey?16:0,s=r|i|n,h.vt200Mouse?s&=n:h.normalMouse||(s=0),e=32+(s<<2)+e}function a(t){var e,r,i;if(null!=t.pageX){for(e=t.pageX,r=t.pageY,i=h.element;i&&i!==h.document.documentElement;)e-=i.offsetLeft,r-=i.offsetTop,i="offsetParent"in i?i.offsetParent:i.parentNode;return e=Math.ceil(e/h.charMeasure.width),r=Math.ceil(r/h.charMeasure.height),e<0&&(e=0),e>h.cols&&(e=h.cols),r<0&&(r=0),r>h.rows&&(r=h.rows),e+=32,r+=32,{x:e,y:r,type:"wheel"}}}var c=this.element,h=this,l=32;n(c,"mousedown",function(r){if(h.mouseEvents)return t(r),h.focus(),h.vt200Mouse?(r.overrideType="mouseup",t(r),h.cancel(r)):(h.normalMouse&&n(h.document,"mousemove",e),h.x10Mouse||n(h.document,"mouseup",function r(i){return t(i),h.normalMouse&&s(h.document,"mousemove",e),s(h.document,"mouseup",r),h.cancel(i)}),h.cancel(r))}),n(c,"wheel",function(e){if(h.mouseEvents&&!(h.x10Mouse||h.vt300Mouse||h.decLocator))return t(e),h.cancel(e)}),n(c,"wheel",function(t){if(!h.mouseEvents)return h.viewport.onWheel(t),h.cancel(t)})},i.prototype.destroy=function(){this.readable=!1,this.writable=!1,this._events={},this.handler=function(){},this.write=function(){},this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},i.prototype.refresh=function(t,e){this.renderer&&this.renderer.queueRefresh(t,e)},i.prototype.queueLinkification=function(t,e){if(this.linkifier)for(var r=t;r<=e;r++)this.linkifier.linkifyRow(r)},i.prototype.showCursor=function(){this.cursorState||(this.cursorState=1,this.refresh(this.y,this.y))},i.prototype.scroll=function(){var t;this.lines.length===this.lines.maxLength&&(this.lines.trimStart(1),this.ybase--,0!==this.ydisp&&this.ydisp--),this.ybase++,this.userScrolling||(this.ydisp=this.ybase),t=this.ybase+this.rows-1,(t-=this.rows-1-this.scrollBottom)===this.lines.length?this.lines.push(this.blankLine()):this.lines.splice(t,0,this.blankLine()),0!==this.scrollTop&&(0!==this.ybase&&(this.ybase--,this.userScrolling||(this.ydisp=this.ybase)),this.lines.splice(this.ybase+this.scrollTop,1)),this.updateRange(this.scrollTop),this.updateRange(this.scrollBottom),this.emit("scroll",this.ydisp)},i.prototype.scrollDisp=function(t,e){t<0?this.userScrolling=!0:t+this.ydisp>=this.ybase&&(this.userScrolling=!1),this.ydisp+=t,this.ydisp>this.ybase?this.ydisp=this.ybase:this.ydisp<0&&(this.ydisp=0),e||this.emit("scroll",this.ydisp),this.refresh(0,this.rows-1)},i.prototype.scrollPages=function(t){this.scrollDisp(t*(this.rows-1))},i.prototype.scrollToTop=function(){this.scrollDisp(-this.ydisp)},i.prototype.scrollToBottom=function(){this.scrollDisp(this.ybase-this.ydisp)},i.prototype.write=function(t){if(this.writeBuffer.push(t),this.options.useFlowControl&&!this.xoffSentToCatchUp&&this.writeBuffer.length>=5&&(this.send(y.C0.DC3),this.xoffSentToCatchUp=!0),!this.writeInProgress&&this.writeBuffer.length>0){this.writeInProgress=!0;var e=this;setTimeout(function(){e.innerWrite()})}},i.prototype.innerWrite=function(){for(var t=this.writeBuffer.splice(0,300);t.length>0;){var e=t.shift();e.length;this.xoffSentToCatchUp&&0===t.length&&0===this.writeBuffer.length&&(this.send(y.C0.DC1),this.xoffSentToCatchUp=!1),this.refreshStart=this.y,this.refreshEnd=this.y,this.parser.parse(e),this.updateRange(this.y),this.refresh(this.refreshStart,this.refreshEnd)}if(this.writeBuffer.length>0){var r=this;setTimeout(function(){r.innerWrite()},0)}else this.writeInProgress=!1},i.prototype.writeln=function(t){this.write(t+"\r\n")},i.prototype.attachCustomKeydownHandler=function(t){this.customKeydownHandler=t},i.prototype.setHypertextLinkHandler=function(t){if(!this.linkifier)throw new Error("Cannot attach a hypertext link handler before Terminal.open is called");this.linkifier.setHypertextLinkHandler(t),this.refresh(0,this.rows-1)},i.prototype.setHypertextValidationCallback=function(t){if(!this.linkifier)throw new Error("Cannot attach a hypertext validation callback before Terminal.open is called");this.linkifier.setHypertextValidationCallback(t),this.refresh(0,this.rows-1)},i.prototype.registerLinkMatcher=function(t,e,r){if(this.linkifier){var i=this.linkifier.registerLinkMatcher(t,e,r);return this.refresh(0,this.rows-1),i}},i.prototype.deregisterLinkMatcher=function(t){this.linkifier&&this.linkifier.deregisterLinkMatcher(t)&&this.refresh(0,this.rows-1)},i.prototype.keyDown=function(t){if(this.customKeydownHandler&&!1===this.customKeydownHandler(t))return!1;if(this.restartCursorBlinking(),!this.compositionHelper.keydown.bind(this.compositionHelper)(t))return this.ybase!==this.ydisp&&this.scrollToBottom(),!1;var e=this.evaluateKeyEscapeSequence(t);return e.key===y.C0.DC3?this.writeStopped=!0:e.key===y.C0.DC1&&(this.writeStopped=!1),e.scrollDisp?(this.scrollDisp(e.scrollDisp),this.cancel(t,!0)):!!c(this,t)||(e.cancel&&this.cancel(t,!0),!e.key||(this.emit("keydown",t),this.emit("key",e.key,t),this.showCursor(),this.handler(e.key),this.cancel(t,!0)))},i.prototype.evaluateKeyEscapeSequence=function(t){var e={cancel:!1,key:void 0,scrollDisp:void 0},r=t.shiftKey<<0|t.altKey<<1|t.ctrlKey<<2|t.metaKey<<3;switch(t.keyCode){case 8:if(t.shiftKey){e.key=y.C0.BS;break}e.key=y.C0.DEL;break;case 9:if(t.shiftKey){e.key=y.C0.ESC+"[Z";break}e.key=y.C0.HT,e.cancel=!0;break;case 13:e.key=y.C0.CR,e.cancel=!0;break;case 27:e.key=y.C0.ESC,e.cancel=!0;break;case 37:r?(e.key=y.C0.ESC+"[1;"+(r+1)+"D",e.key==y.C0.ESC+"[1;3D"&&(e.key=this.browser.isMac?y.C0.ESC+"b":y.C0.ESC+"[1;5D")):this.applicationCursor?e.key=y.C0.ESC+"OD":e.key=y.C0.ESC+"[D";break;case 39:r?(e.key=y.C0.ESC+"[1;"+(r+1)+"C",e.key==y.C0.ESC+"[1;3C"&&(e.key=this.browser.isMac?y.C0.ESC+"f":y.C0.ESC+"[1;5C")):this.applicationCursor?e.key=y.C0.ESC+"OC":e.key=y.C0.ESC+"[C";break;case 38:r?(e.key=y.C0.ESC+"[1;"+(r+1)+"A",e.key==y.C0.ESC+"[1;3A"&&(e.key=y.C0.ESC+"[1;5A")):this.applicationCursor?e.key=y.C0.ESC+"OA":e.key=y.C0.ESC+"[A";break;case 40:r?(e.key=y.C0.ESC+"[1;"+(r+1)+"B",e.key==y.C0.ESC+"[1;3B"&&(e.key=y.C0.ESC+"[1;5B")):this.applicationCursor?e.key=y.C0.ESC+"OB":e.key=y.C0.ESC+"[B";break;case 45:t.shiftKey||t.ctrlKey||(e.key=y.C0.ESC+"[2~");break;case 46:e.key=r?y.C0.ESC+"[3;"+(r+1)+"~":y.C0.ESC+"[3~";break;case 36:r?e.key=y.C0.ESC+"[1;"+(r+1)+"H":this.applicationCursor?e.key=y.C0.ESC+"OH":e.key=y.C0.ESC+"[H";break;case 35:r?e.key=y.C0.ESC+"[1;"+(r+1)+"F":this.applicationCursor?e.key=y.C0.ESC+"OF":e.key=y.C0.ESC+"[F";break;case 33:t.shiftKey?e.scrollDisp=-(this.rows-1):e.key=y.C0.ESC+"[5~";break;case 34:t.shiftKey?e.scrollDisp=this.rows-1:e.key=y.C0.ESC+"[6~";break;case 112:e.key=r?y.C0.ESC+"[1;"+(r+1)+"P":y.C0.ESC+"OP";break;case 113:e.key=r?y.C0.ESC+"[1;"+(r+1)+"Q":y.C0.ESC+"OQ";break;case 114:e.key=r?y.C0.ESC+"[1;"+(r+1)+"R":y.C0.ESC+"OR";break;case 115:e.key=r?y.C0.ESC+"[1;"+(r+1)+"S":y.C0.ESC+"OS";break;case 116:e.key=r?y.C0.ESC+"[15;"+(r+1)+"~":y.C0.ESC+"[15~";break;case 117:e.key=r?y.C0.ESC+"[17;"+(r+1)+"~":y.C0.ESC+"[17~";break;case 118:e.key=r?y.C0.ESC+"[18;"+(r+1)+"~":y.C0.ESC+"[18~";break;case 119:e.key=r?y.C0.ESC+"[19;"+(r+1)+"~":y.C0.ESC+"[19~";break;case 120:e.key=r?y.C0.ESC+"[20;"+(r+1)+"~":y.C0.ESC+"[20~";break;case 121:e.key=r?y.C0.ESC+"[21;"+(r+1)+"~":y.C0.ESC+"[21~";break;case 122:e.key=r?y.C0.ESC+"[23;"+(r+1)+"~":y.C0.ESC+"[23~";break;case 123:e.key=r?y.C0.ESC+"[24;"+(r+1)+"~":y.C0.ESC+"[24~";break;default:!t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?this.browser.isMac||!t.altKey||t.ctrlKey||t.metaKey||(t.keyCode>=65&&t.keyCode<=90?e.key=y.C0.ESC+String.fromCharCode(t.keyCode+32):192===t.keyCode?e.key=y.C0.ESC+"`":t.keyCode>=48&&t.keyCode<=57&&(e.key=y.C0.ESC+(t.keyCode-48))):t.keyCode>=65&&t.keyCode<=90?e.key=String.fromCharCode(t.keyCode-64):32===t.keyCode?e.key=String.fromCharCode(0):t.keyCode>=51&&t.keyCode<=55?e.key=String.fromCharCode(t.keyCode-51+27):56===t.keyCode?e.key=String.fromCharCode(127):219===t.keyCode?e.key=String.fromCharCode(27):220===t.keyCode?e.key=String.fromCharCode(28):221===t.keyCode&&(e.key=String.fromCharCode(29))}return e},i.prototype.setgLevel=function(t){this.glevel=t,this.charset=this.charsets[t]},i.prototype.setgCharset=function(t,e){this.charsets[t]=e,this.glevel===t&&(this.charset=e)},i.prototype.keyPress=function(t){var e;if(this.cancel(t),t.charCode)e=t.charCode;else if(null==t.which)e=t.keyCode;else{if(0===t.which||0===t.charCode)return!1;e=t.which}return!(!e||(t.altKey||t.ctrlKey||t.metaKey)&&!c(this,t))&&(e=String.fromCharCode(e),this.emit("keypress",e,t),this.emit("key",e,t),this.showCursor(),this.handler(e),!1)},i.prototype.send=function(t){var e=this;this.queue||setTimeout(function(){e.handler(e.queue),e.queue=""},1),this.queue+=t},i.prototype.bell=function(){if(this.visualBell){var t=this;this.element.style.borderColor="white",setTimeout(function(){t.element.style.borderColor=""},10),this.popOnBell&&this.focus()}},i.prototype.log=function(){if(this.debug&&this.context.console&&this.context.console.log){var t=Array.prototype.slice.call(arguments);this.context.console.log.apply(this.context.console,t)}},i.prototype.error=function(){if(this.debug&&this.context.console&&this.context.console.error){var t=Array.prototype.slice.call(arguments);this.context.console.error.apply(this.context.console,t)}},i.prototype.resize=function(t,e){if(!isNaN(t)&&!isNaN(e)){var r,i,n,s,o;if(t!==this.cols||e!==this.rows){if(t<1&&(t=1),e<1&&(e=1),(n=this.cols)0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(this.blankLine())),this.children.lengthe;)if(this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++)),this.children.length>e){if(!(r=this.children.shift()))continue;r.parentNode.removeChild(r)}this.rows=e,this.y>=e&&(this.y=e-1),o&&(this.y+=o),this.x>=t&&(this.x=t-1),this.scrollTop=0,this.scrollBottom=e-1,this.charMeasure.measure(),this.refresh(0,this.rows-1),this.normal=null,this.geometry=[this.cols,this.rows],this.emit("resize",{terminal:this,cols:t,rows:e})}}},i.prototype.updateRange=function(t){tthis.refreshEnd&&(this.refreshEnd=t)},i.prototype.maxRange=function(){this.refreshStart=0,this.refreshEnd=this.rows-1},i.prototype.setupStops=function(t){for(null!=t?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t0;);return t>=this.cols?this.cols-1:t<0?0:t},i.prototype.nextStop=function(t){for(null==t&&(t=this.x);!this.tabs[++t]&&t=this.cols?this.cols-1:t<0?0:t},i.prototype.eraseRight=function(t,e){var r=this.lines.get(this.ybase+e);if(r){for(var i=[this.eraseAttr()," ",1];tthis.scrollBottom&&(this.y--,this.scroll()),this.x>=this.cols&&this.x--},i.prototype.reverseIndex=function(){this.y===this.scrollTop?(this.lines.shiftElements(this.y+this.ybase,this.rows-1,1),this.lines.set(this.y+this.ybase,this.blankLine(!0)),this.updateRange(this.scrollTop),this.updateRange(this.scrollBottom)):this.y--},i.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var t=this.customKeydownHandler,e=this.cursorBlinkInterval;i.call(this,this.options),this.customKeydownHandler=t,this.cursorBlinkInterval=e,this.refresh(0,this.rows-1),this.viewport.syncScrollArea()},i.prototype.tabSet=function(){this.tabs[this.x]=!0},i.prototype.matchColor=h,h._cache={},h.distance=function(t,e,r,i,n,s){return Math.pow(30*(t-i),2)+Math.pow(59*(e-n),2)+Math.pow(11*(r-s),2)},i.EventEmitter=p.EventEmitter,i.inherits=a,i.on=n,i.off=s,i.cancel=o,e.exports=i},{"./CompositionHelper":2,"./EscapeSequences":3,"./EventEmitter":4,"./InputHandler":5,"./Linkifier":6,"./Parser":7,"./Renderer":8,"./Viewport":9,"./handlers/Clipboard":10,"./utils/Browser":11,"./utils/CharMeasure":12,"./utils/CircularList":13}]},{},[15])(15)}),function(t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("../../xterm")):"function"==typeof define?define(["../../xterm"],t):t(window.Terminal)}(function(t){var e={};return e.proposeGeometry=function(t){if(!t.element.parentElement)return null;var e,r,i,n,s=window.getComputedStyle(t.element.parentElement),o=parseInt(s.getPropertyValue("height")),a=Math.max(0,parseInt(s.getPropertyValue("width"))-17),c=window.getComputedStyle(t.element),h=o-(parseInt(c.getPropertyValue("padding-top"))+parseInt(c.getPropertyValue("padding-bottom"))),l=a-(parseInt(c.getPropertyValue("padding-right"))+parseInt(c.getPropertyValue("padding-left"))),u=(t.rowContainer,t.rowContainer.firstElementChild),p=u.innerHTML;return u.style.display="inline",u.innerHTML="W",i=u.getBoundingClientRect().width,u.style.display="",e=u.getBoundingClientRect().height,u.innerHTML=p,r=parseInt(h/e),n=parseInt(l/i),{cols:n,rows:r}},e.fit=function(t){var r=e.proposeGeometry(t);r&&t.resize(r.cols,r.rows)},t.prototype.proposeGeometry=function(){return e.proposeGeometry(this)},t.prototype.fit=function(){return e.fit(this)},e}),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.io=e():t.io=e()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function i(t,e){"object"===(void 0===t?"undefined":s(t))&&(e=t,t=void 0),e=e||{};var r,i=o(t),a=i.source,u=i.id,p=i.path,f=l[u]&&p in l[u].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||f?(h("ignoring socket cache for %s",a),r=c(a,e)):(l[u]||(h("new io instance for %s",a),l[u]=c(a,e)),r=l[u]),i.query&&!e.query?e.query=i.query:e&&"object"===s(e.query)&&(e.query=n(e.query)),r.socket(i.path,e)}function n(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e.join("&")}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=r(1),a=r(7),c=r(17),h=r(3)("socket.io-client");t.exports=e=i;var l=e.managers={};e.protocol=a.protocol,e.connect=i,e.Manager=r(17),e.Socket=r(44)},function(t,e,r){(function(e){"use strict";function i(t,r){var i=t;r=r||e.location,null==t&&(t=r.protocol+"//"+r.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(s("protocol-less url %s",t),t=void 0!==r?r.protocol+"//"+t:"https://"+t),s("parse %s",t),i=n(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";var o=-1!==i.host.indexOf(":")?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+o+":"+i.port,i.href=i.protocol+"://"+o+(r&&r.port===i.port?"":":"+i.port),i}var n=r(2),s=r(3)("socket.io-client:url");t.exports=i}).call(e,function(){return this}())},function(t,e){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,n=t.indexOf("["),s=t.indexOf("]");-1!=n&&-1!=s&&(t=t.substring(0,n)+t.substring(n,s).replace(/:/g,";")+t.substring(s,t.length));for(var o=r.exec(t||""),a={},c=14;c--;)a[i[c]]=o[c]||"";return-1!=n&&-1!=s&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(t,e,r){(function(i){function n(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function s(){var t=arguments,r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),!r)return t;var i="color: "+this.color,n=0,s=0;return(t=[t[0],i,"color: inherit"].concat(Array.prototype.slice.call(t,1)))[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(n++,"%c"===t&&(s=n))}),t.splice(s,0,i),t}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}}function c(){try{return e.storage.debug}catch(t){}if(void 0!==i&&"env"in i)return i.env.DEBUG}(e=t.exports=r(5)).log=o,e.formatArgs=s,e.save=a,e.load=c,e.useColors=n,e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(c())}).call(e,r(4))},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function n(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function s(t){if(u===clearTimeout)return clearTimeout(t);if((u===i||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(t);try{return u(t)}catch(e){try{return u.call(null,t)}catch(e){return u.call(this,t)}}}function o(){m&&f&&(m=!1,f.length?d=f.concat(d):y=-1,d.length&&a())}function a(){if(!m){var t=n(o);m=!0;for(var e=d.length;e;){for(f=d,d=[];++y1)for(var r=1;r1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*l;case"days":case"day":case"d":return r*h;case"hours":case"hour":case"hrs":case"hr":case"h":return r*c;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function i(t){return t>=h?Math.round(t/h)+"d":t>=c?Math.round(t/c)+"h":t>=a?Math.round(t/a)+"m":t>=o?Math.round(t/o)+"s":t+"ms"}function n(t){return s(t,h,"day")||s(t,c,"hour")||s(t,a,"minute")||s(t,o,"second")||t+" ms"}function s(t,e,r){if(!(t0)return r(t);if("number"===s&&!1===isNaN(t))return e.long?n(t):i(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,r){function i(){}function n(t){var r="",i=!1;return r+=t.type,e.BINARY_EVENT!=t.type&&e.BINARY_ACK!=t.type||(r+=t.attachments,r+="-"),t.nsp&&"/"!=t.nsp&&(i=!0,r+=t.nsp),null!=t.id&&(i&&(r+=",",i=!1),r+=t.id),null!=t.data&&(i&&(r+=","),r+=p.stringify(t.data)),u("encoded %j as %s",t,r),r}function s(t,e){function r(t){var r=d.deconstructPacket(t),i=n(r.packet),s=r.buffers;s.unshift(i),e(s)}d.removeBlobs(t,r)}function o(){this.reconstructor=null}function a(t){var r={},i=0;if(r.type=Number(t.charAt(0)),null==e.types[r.type])return l();if(e.BINARY_EVENT==r.type||e.BINARY_ACK==r.type){for(var n="";"-"!=t.charAt(++i)&&(n+=t.charAt(i),i!=t.length););if(n!=Number(n)||"-"!=t.charAt(i))throw new Error("Illegal attachments");r.attachments=Number(n)}if("/"==t.charAt(i+1))for(r.nsp="";++i&&","!=(o=t.charAt(i))&&(r.nsp+=o,i!=t.length););else r.nsp="/";var s=t.charAt(i+1);if(""!==s&&Number(s)==s){for(r.id="";++i;){var o=t.charAt(i);if(null==o||Number(o)!=o){--i;break}if(r.id+=t.charAt(i),i==t.length)break}r.id=Number(r.id)}return t.charAt(++i)&&(r=c(r,t.substr(i))),u("decoded %s as %j",t,r),r}function c(t,e){try{t.data=p.parse(e)}catch(t){return l()}return t}function h(t){this.reconPack=t,this.buffers=[]}function l(t){return{type:e.ERROR,data:"parser error"}}var u=r(8)("socket.io-parser"),p=r(11),f=r(13),d=r(14),m=r(16);e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=i,e.Decoder=o,i.prototype.encode=function(t,r){u("encoding packet %j",t),e.BINARY_EVENT==t.type||e.BINARY_ACK==t.type?s(t,r):r([n(t)])},f(o.prototype),o.prototype.add=function(t){var r;if("string"==typeof t)r=a(t),e.BINARY_EVENT==r.type||e.BINARY_ACK==r.type?(this.reconstructor=new h(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!m(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(r=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",r))}},o.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},h.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length==this.reconPack.attachments){var e=d.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},h.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e,r){function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function n(){var t=arguments,r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),!r)return t;var i="color: "+this.color,n=0,s=0;return(t=[t[0],i,"color: inherit"].concat(Array.prototype.slice.call(t,1)))[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(n++,"%c"===t&&(s=n))}),t.splice(s,0,i),t}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}}function a(){var t;try{t=e.storage.debug}catch(t){}return t}(e=t.exports=r(9)).log=s,e.formatArgs=n,e.save=o,e.load=a,e.useColors=i,e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){return JSON.stringify(t)},e.enable(a())},function(t,e,r){function i(){return e.colors[l++%e.colors.length]}function n(t){function r(){}function n(){var t=n,r=+new Date,s=r-(h||r);t.diff=s,t.prev=h,t.curr=r,h=r,null==t.useColors&&(t.useColors=e.useColors()),null==t.color&&t.useColors&&(t.color=i());var o=Array.prototype.slice.call(arguments);o[0]=e.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var a=0;o[0]=o[0].replace(/%([a-z%])/g,function(r,i){if("%%"===r)return r;a++;var n=e.formatters[i];if("function"==typeof n){var s=o[a];r=n.call(t,s),o.splice(a,1),a--}return r}),"function"==typeof e.formatArgs&&(o=e.formatArgs.apply(t,o)),(n.log||e.log||console.log.bind(console)).apply(t,o)}r.enabled=!1,n.enabled=!0;var s=e.enabled(t)?n:r;return s.namespace=t,s}function s(t){e.save(t);for(var r=(t||"").split(/[\s,]+/),i=r.length,n=0;n1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*l;case"days":case"day":case"d":return r*h;case"hours":case"hour":case"hrs":case"hr":case"h":return r*c;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}}}function i(t){return t>=h?Math.round(t/h)+"d":t>=c?Math.round(t/c)+"h":t>=a?Math.round(t/a)+"m":t>=o?Math.round(t/o)+"s":t+"ms"}function n(t){return s(t,h,"day")||s(t,c,"hour")||s(t,a,"minute")||s(t,o,"second")||t+" ms"}function s(t,e,r){if(!(t1)))/4)-C((t-1901+e)/100)+C((t-1601+e)/400)};if((d=g.hasOwnProperty)||(d=function(t){var e,r={};return(r.__proto__=null,r.__proto__={toString:1},r).toString!=_?d=function(t){var e=this.__proto__,r=t in(this.__proto__=null,this);return this.__proto__=e,r}:(e=r.constructor,d=function(t){var r=(this.constructor||e).prototype;return t in this&&!(t in r&&this[t]===r[t])}),r=null,d.call(this,t)}),m=function(t,e){var r,i,s,o=0;(r=function(){this.valueOf=0}).prototype.valueOf=0,i=new r;for(s in i)d.call(i,s)&&o++;return r=i=null,o?m=2==o?function(t,e){var r,i={},n="[object Function]"==_.call(t);for(r in t)n&&"prototype"==r||d.call(i,r)||!(i[r]=1)||!d.call(t,r)||e(r)}:function(t,e){var r,i,n="[object Function]"==_.call(t);for(r in t)n&&"prototype"==r||!d.call(t,r)||(i="constructor"===r)||e(r);(i||d.call(t,r="constructor"))&&e(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],m=function(t,e){var r,s,o="[object Function]"==_.call(t),a=!o&&"function"!=typeof t.constructor&&n[typeof t.hasOwnProperty]&&t.hasOwnProperty||d;for(r in t)o&&"prototype"==r||!a.call(t,r)||e(r);for(s=i.length;r=i[--s];a.call(t,r)&&e(r));}),m(t,e)},!r("json-stringify")){var x={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},S=function(t,e){return("000000"+(e||0)).slice(-t)},E=function(t){for(var e='"',r=0,i=t.length,n=!b||i>10,s=n&&(b?t.split(""):t);r-1/0&&a<1/0){if(k){for(p=C(a/864e5),h=C(p/365.2425)+1970-1;k(h+1,0)<=p;h++);for(l=C((p-k(h,0))/30.42);k(h,l+1)<=p;l++);p=1+p-k(h,l),g=C((f=(a%864e5+864e5)%864e5)/36e5)%24,v=C(f/6e4)%60,b=C(f/1e3)%60,w=f%1e3}else h=a.getUTCFullYear(),l=a.getUTCMonth(),p=a.getUTCDate(),g=a.getUTCHours(),v=a.getUTCMinutes(),b=a.getUTCSeconds(),w=a.getUTCMilliseconds();a=(h<=0||h>=1e4?(h<0?"-":"+")+S(6,h<0?-h:h):S(4,h))+"-"+S(2,l+1)+"-"+S(2,p)+"T"+S(2,g)+":"+S(2,v)+":"+S(2,b)+"."+S(3,w)+"Z"}else a=null;if(r&&(a=r.call(e,t,a)),null===a)return"null";if("[object Boolean]"==(c=_.call(a)))return""+a;if("[object Number]"==c)return a>-1/0&&a<1/0?""+a:"null";if("[object String]"==c)return E(""+a);if("object"==typeof a){for(L=o.length;L--;)if(o[L]===a)throw u();if(o.push(a),x=[],M=s,s+=n,"[object Array]"==c){for(B=0,L=a.length;B0)for(i="",r>10&&(r=10);i.length=48&&n<=57||n>=97&&n<=102||n>=65&&n<=70||R();t+=L("0x"+s.slice(e,T));break;default:R()}else{if(34==n)break;for(n=s.charCodeAt(T),e=T;n>=32&&92!=n&&34!=n;)n=s.charCodeAt(++T);t+=s.slice(e,T)}if(34==s.charCodeAt(T))return T++,t;R();default:if(e=T,45==n&&(i=!0,n=s.charCodeAt(++T)),n>=48&&n<=57){for(48==n&&(n=s.charCodeAt(T+1))>=48&&n<=57&&R(),i=!1;T=48&&n<=57;T++);if(46==s.charCodeAt(T)){for(r=++T;r=48&&n<=57;r++);r==T&&R(),T=r}if(101==(n=s.charCodeAt(T))||69==n){for(43!=(n=s.charCodeAt(++T))&&45!=n||T++,r=T;r=48&&n<=57;r++);r==T&&R(),T=r}return+s.slice(e,T)}if(i&&R(),"true"==s.slice(T,T+4))return T+=4,!0;if("false"==s.slice(T,T+5))return T+=5,!1;if("null"==s.slice(T,T+4))return T+=4,null;R()}return"$"},N=function(t){var e,r;if("$"==t&&R(),"string"==typeof t){if("@"==(b?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(e=[];"]"!=(t=P());r||(r=!0))r&&(","==t?"]"==(t=P())&&R():R()),","==t&&R(),e.push(N(t));return e}if("{"==t){for(e={};"}"!=(t=P());r||(r=!0))r&&(","==t?"}"==(t=P())&&R():R()),","!=t&&"string"==typeof t&&"@"==(b?t.charAt(0):t[0])&&":"==P()||R(),e[t.slice(1)]=N(P());return e}R()}return t},O=function(t,e,r){var i=I(t,e,r);i===y?delete t[e]:t[e]=i},I=function(t,e,r){var i,n=t[e];if("object"==typeof n&&n)if("[object Array]"==_.call(n))for(i=n.length;i--;)O(n,i,r);else m(n,function(t){O(n,t,r)});return r.call(t,e,n)};e.parse=function(t,e){var r,i;return T=0,B=""+t,r=N(P()),"$"!=P()&&R(),T=B=null,e&&"[object Function]"==_.call(e)?I((i={},i[""]=r,i),"",e):r}}}return e.runInContext=i,e}var n={function:!0,object:!0},s=n[typeof e]&&e&&!e.nodeType&&e,o=n[typeof window]&&window||this,a=s&&n[typeof t]&&t&&!t.nodeType&&"object"==typeof r&&r;if(!a||a.global!==a&&a.window!==a&&a.self!==a||(o=a),s)i(o,s);else{var c=o.JSON,h=o.JSON3,l=!1,u=i(o,o.JSON3={noConflict:function(){return l||(l=!0,o.JSON=c,o.JSON3=h,c=h=null),u}});o.JSON={parse:u.parse,stringify:u.stringify}}}).call(this)}).call(e,r(12)(t),function(){return this}())},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function r(t){if(t)return i(t)}function i(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},r.prototype.once=function(t,e){function r(){i.off(t,r),e.apply(this,arguments)}var i=this;return this._callbacks=this._callbacks||{},r.fn=e,this.on(t,r),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r=this._callbacks[t];if(!r)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var i,n=0;n0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},i.prototype.cleanup=function(){u("cleanup");for(var t=this.subs.length,e=0;e=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();u("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var r=setTimeout(function(){t.skipReconnect||(u("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(u("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(u("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(r)}})}},i.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,r){t.exports=r(19)},function(t,e,r){t.exports=r(20),t.exports.parser=r(27)},function(t,e,r){(function(e){function i(t,r){if(!(this instanceof i))return new i(t,r);r=r||{},t&&"object"==typeof t&&(r=t,t=null),t?(t=l(t),r.hostname=t.host,r.secure="https"===t.protocol||"wss"===t.protocol,r.port=t.port,t.query&&(r.query=t.query)):r.host&&(r.hostname=l(r.host).host),this.secure=null!=r.secure?r.secure:e.location&&"https:"===location.protocol,r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.agent=r.agent||!1,this.hostname=r.hostname||(e.location?location.hostname:"localhost"),this.port=r.port||(e.location&&location.port?location.port:this.secure?443:80),this.query=r.query||{},"string"==typeof this.query&&(this.query=p.decode(this.query)),this.upgrade=!1!==r.upgrade,this.path=(r.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!r.forceJSONP,this.jsonp=!1!==r.jsonp,this.forceBase64=!!r.forceBase64,this.enablesXDR=!!r.enablesXDR,this.timestampParam=r.timestampParam||"t",this.timestampRequests=r.timestampRequests,this.transports=r.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=r.policyPort||843,this.rememberUpgrade=r.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=r.onlyBinaryUpgrades,this.perMessageDeflate=!1!==r.perMessageDeflate&&(r.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=r.pfx||null,this.key=r.key||null,this.passphrase=r.passphrase||null,this.cert=r.cert||null,this.ca=r.ca||null,this.ciphers=r.ciphers||null,this.rejectUnauthorized=void 0===r.rejectUnauthorized?null:r.rejectUnauthorized,this.forceNode=!!r.forceNode;var n="object"==typeof e&&e;n.global===n&&(r.extraHeaders&&Object.keys(r.extraHeaders).length>0&&(this.extraHeaders=r.extraHeaders),r.localAddress&&(this.localAddress=r.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function n(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}var s=r(21),o=r(35),a=r(3)("engine.io-client:socket"),c=r(42),h=r(27),l=r(2),u=r(43),p=r(36);t.exports=i,i.priorWebsocketSuccess=!1,o(i.prototype),i.protocol=h.protocol,i.Socket=i,i.Transport=r(26),i.transports=r(21),i.parser=r(27),i.prototype.createTransport=function(t){a('creating transport "%s"',t);var e=n(this.query);return e.EIO=h.protocol,e.transport=t,this.id&&(e.sid=this.id),new s[t]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:e,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders,forceNode:this.forceNode,localAddress:this.localAddress})},i.prototype.open=function(){var t;if(this.rememberUpgrade&&i.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},i.prototype.setTransport=function(t){a("setting transport %s",t.name);var e=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},i.prototype.probe=function(t){function e(){if(p.onlyBinaryUpgrades){var e=!this.supportsBinary&&p.transport.supportsBinary;u=u||e}u||(a('probe transport "%s" opened',t),l.send([{type:"ping",data:"probe"}]),l.once("packet",function(e){if(!u)if("pong"===e.type&&"probe"===e.data){if(a('probe transport "%s" pong',t),p.upgrading=!0,p.emit("upgrading",l),!l)return;i.priorWebsocketSuccess="websocket"===l.name,a('pausing current transport "%s"',p.transport.name),p.transport.pause(function(){u||"closed"!==p.readyState&&(a("changing transport and sending upgrade packet"),h(),p.setTransport(l),l.send([{type:"upgrade"}]),p.emit("upgrade",l),l=null,p.upgrading=!1,p.flush())})}else{a('probe transport "%s" failed',t);var r=new Error("probe error");r.transport=l.name,p.emit("upgradeError",r)}}))}function r(){u||(u=!0,h(),l.close(),l=null)}function n(e){var i=new Error("probe error: "+e);i.transport=l.name,r(),a('probe transport "%s" failed because of error: %s',t,e),p.emit("upgradeError",i)}function s(){n("transport closed")}function o(){n("socket closed")}function c(t){l&&t.name!==l.name&&(a('"%s" works - aborting "%s"',t.name,l.name),r())}function h(){l.removeListener("open",e),l.removeListener("error",n),l.removeListener("close",s),p.removeListener("close",o),p.removeListener("upgrading",c)}a('probing transport "%s"',t);var l=this.createTransport(t,{probe:1}),u=!1,p=this;i.priorWebsocketSuccess=!1,l.once("open",e),l.once("error",n),l.once("close",s),this.once("close",o),this.once("upgrading",c),l.open()},i.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",i.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var t=0,e=this.upgrades.length;t1?{type:v[n],data:t.substring(1)}:{type:v[n]}:b}var n=new Uint8Array(t)[0],s=p(t,1);return C&&"blob"===r&&(s=new C([s])),{type:v[n],data:s}},e.decodeBase64Packet=function(t,e){var r=v[t.charAt(0)];if(!h)return{type:r,data:{base64:!0,data:t.substr(1)}};var i=h.decode(t.substr(1));return"blob"===e&&C&&(i=new C([i])),{type:r,data:i}},e.encodePayload=function(t,r,i){function n(t){return t.length+":"+t}function s(t,i){e.encodePacket(t,!!o&&r,!0,function(t){i(null,n(t))})}"function"==typeof r&&(i=r,r=null);var o=u(t);return r&&o?C&&!g?e.encodePayloadAsBlob(t,i):e.encodePayloadAsArrayBuffer(t,i):t.length?void c(t,s,function(t,e){return i(e.join(""))}):i("0:")},e.decodePayload=function(t,r,i){if("string"!=typeof t)return e.decodePayloadAsBinary(t,r,i);"function"==typeof r&&(i=r,r=null);var n;if(""==t)return i(b,0,1);for(var s,o,a="",c=0,h=t.length;c0;){for(var a=new Uint8Array(n),c=0===a[0],h="",l=1;255!=a[l];l++){if(h.length>310){o=!0;break}h+=a[l]}if(o)return i(b,0,1);n=p(n,2+h.length),h=parseInt(h);var u=p(n,0,h);if(c)try{u=String.fromCharCode.apply(null,new Uint8Array(u))}catch(t){var f=new Uint8Array(u);u="";for(l=0;li&&(r=i),e>=i||e>=r||0===i)return new ArrayBuffer(0);for(var n=new Uint8Array(t),s=new Uint8Array(r-e),o=e,a=0;o=55296&&e<=56319&&n65535&&(n+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),n+=v(e);return n}function c(t,e){return v(t>>e&63|128)}function h(t){if(0==(4294967168&t))return v(t);var e="";return 0==(4294965248&t)?e=v(t>>6&31|192):0==(4294901760&t)?(e=v(t>>12&15|224),e+=c(t,6)):0==(4292870144&t)&&(e=v(t>>18&7|240),e+=c(t,12),e+=c(t,6)),e+=v(63&t|128)}function l(t){for(var e=o(t),r=e.length,i=-1,n="";++i=g)throw Error("Invalid byte index");var t=255&y[_];if(_++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function p(){var t,e,r,i,n;if(_>g)throw Error("Invalid byte index");if(_==g)return!1;if(t=255&y[_],_++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|(e=u()))>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if(e=u(),r=u(),(n=(15&t)<<12|e<<6|r)>=2048)return n;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=u(),r=u(),i=u(),(n=(15&t)<<18|e<<12|r<<6|i)>=65536&&n<=1114111))return n;throw Error("Invalid WTF-8 detected")}function f(t){y=o(t),g=y.length,_=0;for(var e,r=[];!1!==(e=p());)r.push(e);return a(r)}var d="object"==typeof e&&e,m=("object"==typeof t&&t&&t.exports,"object"==typeof n&&n);var y,g,_,v=String.fromCharCode,b={version:"1.0.0",encode:l,decode:f};void 0!==(i=function(){return b}.call(e,r,e,t))&&(t.exports=i)}()}).call(e,r(12)(t),function(){return this}())},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),i=0;i>2],s+=t[(3&i[r])<<4|i[r+1]>>4],s+=t[(15&i[r+1])<<2|i[r+2]>>6],s+=t[63&i[r+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s},e.decode=function(t){var e,i,n,s,o,a=.75*t.length,c=t.length,h=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var l=new ArrayBuffer(a),u=new Uint8Array(l);for(e=0;e>4,u[h++]=(15&n)<<4|s>>2,u[h++]=(3&s)<<6|63&o;return l}}()},function(t,e){(function(e){function r(t){for(var e=0;e0);return e}function i(t){var e=0;for(l=0;l';s=document.createElement(t)}catch(t){(s=document.createElement("iframe")).name=n.iframeId,s.src="javascript:0"}s.id=n.iframeId,n.form.appendChild(s),n.iframe=s}var n=this;if(!this.form){var s,o=document.createElement("form"),a=document.createElement("textarea"),l=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=l,o.method="POST",o.setAttribute("accept-charset","utf-8"),a.name="d",o.appendChild(a),document.body.appendChild(o),this.form=o,this.area=a}this.form.action=this.uri(),i(),t=t.replace(h,"\\\n"),this.area.value=t.replace(c,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&r()}:this.iframe.onload=r}}).call(e,function(){return this}())},function(t,e,r){(function(e){function i(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=u&&!t.forceNode,this.usingBrowserWebSocket||(p=n),s.call(this,t)}var n,s=r(26),o=r(27),a=r(36),c=r(37),h=r(38),l=r(3)("engine.io-client:websocket"),u=e.WebSocket||e.MozWebSocket;if("undefined"==typeof window)try{n=r(41)}catch(t){}var p=u;p||"undefined"!=typeof window||(p=n),t.exports=i,c(i,s),i.prototype.name="websocket",i.prototype.supportsBinary=!0,i.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e={agent:this.agent,perMessageDeflate:this.perMessageDeflate};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(e.headers=this.extraHeaders),this.localAddress&&(e.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?new p(t):new p(t,void 0,e)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},i.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},i.prototype.write=function(t){function r(){i.emit("flush"),setTimeout(function(){i.writable=!0,i.emit("drain")},0)}var i=this;this.writable=!1;for(var n=t.length,s=0,a=n;s0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=r,r.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-r:t+r}return 0|Math.min(t,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(t){this.ms=t},r.prototype.setMax=function(t){this.max=t},r.prototype.setJitter=function(t){this.jitter=t}}])});var sessionLogEnable=!1,sessionLog,sessionFooter,logDate,currentDate,myFile,errorExists;document.getElementById("downloadLog").style.display="none",document.getElementById("credentials").style.display="none";var terminalContainer=document.getElementById("terminal-container"),term=new Terminal({cursorBlink:!0}),socket,termid;if(term.open(terminalContainer,{focus:!0}),term.fit(),document.location.pathname){var parts=document.location.pathname.split("/"),base=parts.slice(0,parts.length-1).join("/")+"/",resource=base.substring(1)+"socket.io";socket=io.connect(null,{resource:resource})}else socket=io.connect();socket.on("connect",function(){socket.emit("geometry",term.cols,term.rows),term.on("data",function(t){socket.emit("data",t)}),socket.on("title",function(t){document.title=t}).on("status",function(t){document.getElementById("status").innerHTML=t}).on("ssherror",function(t){document.getElementById("status").innerHTML=t,document.getElementById("status").style.backgroundColor="red",errorExists=!0}).on("headerBackground",function(t){document.getElementById("header").style.backgroundColor=t}).on("header",function(t){document.getElementById("header").innerHTML=t}).on("footer",function(t){sessionFooter=t,document.getElementById("footer").innerHTML=t}).on("statusBackground",function(t){document.getElementById("status").style.backgroundColor=t}).on("allowreplay",function(t){!0===t?(console.log("allowreplay: "+t),document.getElementById("credentials").style.display="inline"):document.getElementById("credentials").style.display="none"}).on("data",function(t){term.write(t),sessionLogEnable&&(sessionLog+=t)}).on("disconnect",function(t){errorExists||(document.getElementById("status").style.backgroundColor="red",document.getElementById("status").innerHTML="WEBSOCKET SERVER DISCONNECTED: "+t),socket.io.reconnection(!1)}).on("error",function(t){errorExists||(document.getElementById("status").style.backgroundColor="red",document.getElementById("status").innerHTML="ERROR: "+t)})}); //# sourceMappingURL=src/webssh2.min.map