"]=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(l.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(l.NORMAL)};var l;!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"}(l||(l={}));var h=function(){function t(t,e){this._inputHandler=t,this._terminal=e,this._state=l.NORMAL}return t.prototype.parse=function(t){var e,r,h,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=l.NORMAL;break;default:this._state=l.NORMAL,this._terminal.error("Unknown ESC control: %s.",r)}break;case l.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=l.NORMAL;break;case l.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=l.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 l.CSI_PARAM:if(r in a){a[r](this);break}this.finalizeParam(),this._state=l.CSI;case l.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=l.NORMAL,this._terminal.prefix="",this._terminal.postfix="";break;case l.DCS:if(r===i.C0.ESC||r===i.C0.BEL){r===i.C0.ESC&&this._position++;var f=void 0,d=void 0;switch(this._terminal.prefix){case"":break;case"$q":switch(f=this._terminal.currentParam,d=!1,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=l.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 l.IGNORE:r!==i.C0.ESC&&r!==i.C0.BEL||(r===i.C0.ESC&&this._position++,this._state=l.NORMAL)}}return this._state},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=h},{"./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,s=t("./utils/DomElementObjectPool");!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 o=null,a=function(){function t(t){this._terminal=t,this._refreshRowsQueue=[],this._refreshFramesSkipped=0,this._refreshAnimationFrame=null,this._spanElementObjectPool=new s.DomElementObjectPool("span"),null===o&&(o=i(this._terminal.element)),this._spanElementObjectPool=new s.DomElementObjectPool("span")}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;e-t>=this._terminal.rows/2&&(r=this._terminal.element.parentNode)&&this._terminal.element.removeChild(this._terminal.rowContainer);var i=this._terminal.cols,s=t;for(e>=this._terminal.rows&&(this._terminal.log("`end` is too large. Most likely a bad CSR."),e=this._terminal.rows-1);s<=e;s++){var a=s+this._terminal.ydisp,c=this._terminal.lines.get(a),l=void 0;l=this._terminal.y===s-(this._terminal.ybase-this._terminal.ydisp)&&this._terminal.cursorState&&!this._terminal.cursorHidden?this._terminal.x:-1;for(var h=this._terminal.defAttr,u=document.createDocumentFragment(),p="",f=void 0;this._terminal.children[s].children.length;){var d=this._terminal.children[s].children[0];this._terminal.children[s].removeChild(d),this._spanElementObjectPool.release(d)}for(var m=0;m>9&511,C=y>>18;if(C&n.BOLD&&(o||f.classList.add("xterm-bold"),b<8&&(b+=8)),C&n.UNDERLINE&&f.classList.add("xterm-underline"),C&n.BLINK&&f.classList.add("xterm-blink"),C&n.INVERSE){var w=v;v=b,b=w,1&C&&b<8&&(b+=8)}C&n.INVISIBLE&&f.classList.add("xterm-hidden"),C&n.INVERSE&&(257===v&&(v=15),256===b&&(b=0)),v<256&&f.classList.add("xterm-bg-color-"+v),b<256&&f.classList.add("xterm-color-"+b)}if(2===_)p+=''+g+"";else if(g.charCodeAt(0)>255)p+=''+g+"";else switch(g){case"&":p+="&";break;case"<":p+="<";break;case">":p+=">";break;default:p+=g<=" "?" ":g}h=y}}p&&!f&&(f=this._spanElementObjectPool.acquire()),f&&(p&&(f.innerHTML=p,p=""),u.appendChild(f),f=null),this._terminal.children[s].appendChild(u)}r&&this._terminal.element.appendChild(this._terminal.rowContainer),this._terminal.emit("refresh",{element:this._terminal.element,start:t,end:e})},t.prototype.refreshSelection=function(t,e){for(;this._terminal.selectionContainer.children.length;)this._terminal.selectionContainer.removeChild(this._terminal.selectionContainer.children[0]);if(t&&e){var r=t[1]-this._terminal.ydisp,i=e[1]-this._terminal.ydisp,n=Math.max(r,0),s=Math.min(i,this._terminal.rows-1);if(!(n>=this._terminal.rows||s<0)){var o=document.createDocumentFragment(),a=r===n?t[0]:0,c=n===s?e[0]:this._terminal.cols;o.appendChild(this._createSelectionElement(n,a,c));var l=s-n-1;if(o.appendChild(this._createSelectionElement(n+1,0,this._terminal.cols,l)),n!==s){var h=i===s?e[0]:this._terminal.cols;o.appendChild(this._createSelectionElement(s,0,h))}this._terminal.selectionContainer.appendChild(o)}}},t.prototype._createSelectionElement=function(t,e,r,i){void 0===i&&(i=1);var n=document.createElement("div");return n.style.height=i*this._terminal.charMeasure.height+"px",n.style.top=t*this._terminal.charMeasure.height+"px",n.style.left=e*this._terminal.charMeasure.width+"px",n.style.width=this._terminal.charMeasure.width*(r-e)+"px",n},t}();r.Renderer=a},{"./utils/DomElementObjectPool":16}],9:[function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(r,"__esModule",{value:!0});var n,s=t("./utils/Mouse"),o=t("./utils/Browser"),a=t("./EventEmitter"),c=t("./SelectionModel"),l=String.fromCharCode(160),h=new RegExp(l,"g");!function(t){t[t.NORMAL=0]="NORMAL",t[t.WORD=1]="WORD",t[t.LINE=2]="LINE"}(n||(n={}));var u=function(t){function e(e,r,i,s){var o=t.call(this)||this;return o._terminal=e,o._buffer=r,o._rowContainer=i,o._charMeasure=s,o._initListeners(),o.enable(),o._model=new c.SelectionModel(e),o._lastMouseDownTime=0,o._activeSelectionMode=n.NORMAL,o}return i(e,t),e.prototype._initListeners=function(){var t=this;this._bufferTrimListener=function(e){return t._onTrim(e)},this._mouseMoveListener=function(e){return t._onMouseMove(e)},this._mouseDownListener=function(e){return t._onMouseDown(e)},this._mouseUpListener=function(e){return t._onMouseUp(e)}},e.prototype.disable=function(){this.clearSelection(),this._buffer.off("trim",this._bufferTrimListener),this._rowContainer.removeEventListener("mousedown",this._mouseDownListener)},e.prototype.enable=function(){this._buffer.on("trim",this._bufferTrimListener),this._rowContainer.addEventListener("mousedown",this._mouseDownListener)},e.prototype.setBuffer=function(t){this._buffer=t,this.clearSelection()},Object.defineProperty(e.prototype,"hasSelection",{get:function(){var t=this._model.finalSelectionStart,e=this._model.finalSelectionEnd;return!(!t||!e)&&(t[0]!==e[0]||t[1]!==e[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionText",{get:function(){var t=this._model.finalSelectionStart,e=this._model.finalSelectionEnd;if(!t||!e)return"";var r=t[1]===e[1]?e[0]:null,i=[];i.push(this._translateBufferLineToString(this._buffer.get(t[1]),!0,t[0],r));for(var n=t[1]+1;n<=e[1]-1;n++){var s=this._buffer.get(n),a=this._translateBufferLineToString(s,!0);s.isWrapped?i[i.length-1]+=a:i.push(a)}if(t[1]!==e[1]){var s=this._buffer.get(e[1]),a=this._translateBufferLineToString(s,!0,0,e[0]);s.isWrapped?i[i.length-1]+=a:i.push(a)}return i.map(function(t){return t.replace(h," ")}).join(o.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),e.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh()},e.prototype._translateBufferLineToString=function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=null);for(var n="",s=r,o=i,a=0;a=a&&s--,i>=a&&o--)}var l=o||t.length;if(e){var h=n.search(/\s+$/);if(-1!==h&&(l=Math.min(l,h)),l<=s)return""}return n.substring(s,l)},e.prototype.refresh=function(t){var e=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return e._refresh()})),o.isLinux&&t&&this.selectionText.length&&this.emit("newselection",this.selectionText)},e.prototype._refresh=function(){this._refreshAnimationFrame=null,this.emit("refresh",{start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd})},e.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh()},e.prototype._onTrim=function(t){this._model.onTrim(t)&&this.refresh()},e.prototype._getMouseBufferCoords=function(t){var e=s.getCoords(t,this._rowContainer,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);return e[0]--,e[1]--,e[1]+=this._terminal.ydisp,e},e.prototype._getMouseEventScrollAmount=function(t){var e=s.getCoordsRelativeToElement(t,this._rowContainer)[1],r=this._terminal.rows*this._charMeasure.height;return e>=0&&e<=r?0:(e>r&&(e-=r),e=Math.min(Math.max(e,-50),50),(e/=50)/Math.abs(e)+Math.round(14*e))},e.prototype._onMouseDown=function(t){0===t.button&&(t.preventDefault(),this._dragScrollAmount=0,this._setMouseClickCount(t),t.shiftKey?this._onShiftClick(t):1===this._clickCount?this._onSingleClick(t):2===this._clickCount?this._onDoubleClick(t):3===this._clickCount&&this._onTripleClick(t),this._addMouseDownListeners(),this.refresh(!0))},e.prototype._addMouseDownListeners=function(){var t=this;this._rowContainer.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._rowContainer.ownerDocument.addEventListener("mouseup",this._mouseUpListener),this._dragScrollIntervalTimer=setInterval(function(){return t._dragScroll()},50)},e.prototype._removeMouseDownListeners=function(){this._rowContainer.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._rowContainer.ownerDocument.removeEventListener("mouseup",this._mouseUpListener),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=null},e.prototype._onShiftClick=function(t){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(t))},e.prototype._onSingleClick=function(t){this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=n.NORMAL,this._model.selectionStart=this._getMouseBufferCoords(t),this._model.selectionStart&&(this._model.selectionEnd=null,0===this._buffer.get(this._model.selectionStart[1])[this._model.selectionStart[0]][2]&&this._model.selectionStart[0]++)},e.prototype._onDoubleClick=function(t){var e=this._getMouseBufferCoords(t);e&&(this._activeSelectionMode=n.WORD,this._selectWordAt(e))},e.prototype._onTripleClick=function(t){var e=this._getMouseBufferCoords(t);e&&(this._activeSelectionMode=n.LINE,this._selectLineAt(e[1]))},e.prototype._setMouseClickCount=function(t){var e=(new Date).getTime();(e-this._lastMouseDownTime>400||this._distanceFromLastMousePosition(t)>10)&&(this._clickCount=0),this._lastMouseDownTime=e,this._lastMousePosition=[t.pageX,t.pageY],this._clickCount++},e.prototype._distanceFromLastMousePosition=function(t){return Math.max(Math.abs(this._lastMousePosition[0]-t.pageX),Math.abs(this._lastMousePosition[1]-t.pageY))},e.prototype._onMouseMove=function(t){var e=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(t),this._activeSelectionMode===n.LINE?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._terminal.cols-1:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]0?this._model.selectionEnd=[this._terminal.cols-1,this._terminal.ydisp+this._terminal.rows]:this._model.selectionEnd=[0,this._terminal.ydisp],this.refresh())},e.prototype._onMouseUp=function(t){this._removeMouseDownListeners()},e.prototype._convertViewportColToCharacterIndex=function(t,e){for(var r=e[0],i=0;e[0]>=i;i++)0===t[i][2]&&r--;return r},e.prototype._getWordAt=function(t){var e=this._buffer.get(t[1]),r=this._translateBufferLineToString(e,!1),i=this._convertViewportColToCharacterIndex(e,t),n=i,s=t[0]-n,o=0,a=0;if(" "===r.charAt(n)){for(;n>0&&" "===r.charAt(n-1);)n--;for(;i0&&!this._isCharWordSeparator(r.charAt(n-1));)0===e[c-1][2]&&(o++,c--),n--,c--;for(;i+1=0},e.prototype._selectLineAt=function(t){this._model.selectionStart=[0,t],this._model.selectionStartLength=this._terminal.cols},e}(a.EventEmitter);r.SelectionManager=u},{"./EventEmitter":4,"./SelectionModel":10,"./utils/Browser":13,"./utils/Mouse":18}],10:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t){this._terminal=t,this.clearSelection()}return t.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(t.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"finalSelectionEnd",{get:function(){return this.isSelectAllActive?[this._terminal.cols,this._terminal.ybase+this._terminal.rows-1]:this.selectionStart?!this.selectionEnd||this.areSelectionValuesReversed()?[this.selectionStart[0]+this.selectionStartLength,this.selectionStart[1]]:this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd:null},enumerable:!0,configurable:!0}),t.prototype.areSelectionValuesReversed=function(){var t=this.selectionStart,e=this.selectionEnd;return t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]},t.prototype.onTrim=function(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},t}();r.SelectionModel=i},{}],11:[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.terminal.selectionContainer.style.height=this.viewportElement.style.height),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.prototype.onTouchStart=function(t){this.lastTouchY=t.touches[0].pageY},t.prototype.onTouchMove=function(t){var e=this.lastTouchY-t.touches[0].pageY;this.lastTouchY=t.touches[0].pageY,0!==e&&(this.viewportElement.scrollTop+=e,t.preventDefault())},t}();r.Viewport=i},{}],12:[function(t,e,r){"use strict";function i(t,e){return e?t.replace(/\r?\n/g,"\r"):t}function n(t,e,r){e.browser.isMSIE?window.clipboardData.setData("Text",r.selectionText):t.clipboardData.setData("text/plain",r.selectionText),t.preventDefault()}function s(t,e){t.stopPropagation();var r=function(r){return r=i(r,e.browser.isMSWindows),e.handler(r),e.textarea.value="",e.emit("paste",r),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){e.style.position="fixed",e.style.width="20px",e.style.height="20px",e.style.left=t.clientX-10+"px",e.style.top=t.clientY-10+"px",e.style.zIndex="1000",e.focus(),setTimeout(function(){e.style.position=null,e.style.width=null,e.style.height=null,e.style.left=null,e.style.top=null,e.style.zIndex=null},4)}function a(t,e,r){o(t,e),e.value=r.selectionText,e.select()}Object.defineProperty(r,"__esModule",{value:!0}),r.prepareTextForTerminal=i,r.copyHandler=n,r.pasteHandler=s,r.moveTextAreaUnderMouseCursor=o,r.rightClickHandler=a},{}],13:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("./Generic"),n="undefined"==typeof navigator,s=n?"node":navigator.userAgent,o=n?"node":navigator.platform;r.isFirefox=!!~s.indexOf("Firefox"),r.isMSIE=!!~s.indexOf("MSIE")||!!~s.indexOf("Trident"),r.isMac=i.contains(["Macintosh","MacIntel","MacPPC","Mac68K"],o),r.isIpad="iPad"===o,r.isIphone="iPhone"===o,r.isMSWindows=i.contains(["Windows","Win16","Win32","WinCE"],o),r.isLinux=o.indexOf("Linux")>=0},{"./Generic":17}],14:[function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function e(e,r){var i=t.call(this)||this;return i._document=e,i._parentElement=r,i}return i(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),e.prototype.measure=function(){var t=this;this._measureElement?this._doMeasure():(this._measureElement=this._document.createElement("span"),this._measureElement.style.position="absolute",this._measureElement.style.top="0",this._measureElement.style.left="-9999em",this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement),setTimeout(function(){return t._doMeasure()},0))},e.prototype._doMeasure=function(){var t=this._measureElement.getBoundingClientRect();0!==t.width&&0!==t.height&&(this._width===t.width&&this._height===t.height||(this._width=t.width,this._height=t.height,this.emit("charsizechanged")))},e}(t("../EventEmitter.js").EventEmitter);r.CharMeasure=n},{"../EventEmitter.js":4}],15:[function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(r,"__esModule",{value:!0});var n=function(t){function e(e){var r=t.call(this)||this;return r._array=new Array(e),r._startIndex=0,r._length=0,r}return i(e,t),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this._array.length},set:function(t){for(var e=new Array(t),r=0;rthis._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){var s=this._length+r.length-this.maxLength;this._startIndex+=s,this._length=this.maxLength,this.emit("trim",s)}else this._length+=r.length}},e.prototype.trimStart=function(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.emit("trim",t)},e.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++,this.emit("trim",1)}else for(var n=0;n=0}Object.defineProperty(r,"__esModule",{value:!0}),r.contains=i},{}],18:[function(t,e,r){"use strict";function i(t,e){if(null==t.pageX)return null;for(var r=t.pageX,i=t.pageY;e&&e!==self.document.documentElement;)r-=e.offsetLeft,i-=e.offsetTop,e="offsetParent"in e?e.offsetParent:e.parentElement;return[r,i]}function n(t,e,r,n,s,o){var a=i(t,e);return a[0]=Math.ceil((a[0]+(o?r.width/2:0))/r.width),a[1]=Math.ceil(a[1]/r.height),a[0]=Math.min(Math.max(a[0],1),n+1),a[1]=Math.min(Math.max(a[1],1),s+1),a}function s(t,e,r,i,s){var o=n(t,e,r,i,s),a=o[0],c=o[1];return a+=32,c+=32,{x:a,y:c}}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoordsRelativeToElement=i,r.getCoords=n,r.getRawByteCoords=s},{}],19:[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=k,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||(x?x.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.customKeyEventHandler=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.selectionManager=this.selectionManager||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.selectionManager&&this.selectionManager.setBuffer(this.lines),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 l(t,e,r){var n=t<<16|e<<8|r;if(null!=l._cache[n])return l._cache[n];for(var s,o,a,c,h,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 n=this.lines.length-e,s=this.ydisp-n<0;this.lines.trimStart(n),this.ybase=Math.max(this.ybase-n,0),this.ydisp=Math.max(this.ydisp-n,0),s&&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(){var t=this,e=this;i.bindKeys(this),i.bindFocus(this),i.bindBlur(this),n(this.element,"copy",function(r){t.mouseEvents||d.copyHandler(r,e,t.selectionManager)});var r=function(t){return d.pasteHandler(t,e)};n(this.textarea,"paste",r),n(this.element,"paste",r),e.browser.isFirefox?n(this.element,"mousedown",function(e){2==e.button&&d.rightClickHandler(e,t.textarea,t.selectionManager)}):n(this.element,"contextmenu",function(e){d.rightClickHandler(e,t.textarea,t.selectionManager)}),e.browser.isLinux&&n(this.element,"auxclick",function(e){1===e.button&&d.moveTextAreaUnderMouseCursor(e,t.textarea,t.selectionManager)})},i.bindKeys=function(t){n(t.element,"keydown",function(e){x.activeElement==this&&t.keyDown(e)},!0),n(t.element,"keypress",function(e){x.activeElement==this&&t.keyPress(e)},!0),n(t.element,"keyup",function(e){h(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=x.createElement("div")),this.rowContainer.appendChild(t),this.children.push(t),t},i.prototype.open=function(t,e){var r=this,i=this,s=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.setAttribute("tabindex",0),this.viewportElement=x.createElement("div"),this.viewportElement.classList.add("xterm-viewport"),this.element.appendChild(this.viewportElement),this.viewportScrollArea=x.createElement("div"),this.viewportScrollArea.classList.add("xterm-scroll-area"),this.viewportElement.appendChild(this.viewportScrollArea),this.selectionContainer=x.createElement("div"),this.selectionContainer.classList.add("xterm-selection"),this.element.appendChild(this.selectionContainer),this.rowContainer=x.createElement("div"),this.rowContainer.classList.add("xterm-rows"),this.element.appendChild(this.rowContainer),this.children=[],this.linkifier.attachToDom(x,this.children),this.helperContainer=x.createElement("div"),this.helperContainer.classList.add("xterm-helpers"),this.element.appendChild(this.helperContainer),this.textarea=x.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(){i.emit("focus",{terminal:i})}),this.textarea.addEventListener("blur",function(){i.emit("blur",{terminal:i})}),this.helperContainer.appendChild(this.textarea),this.compositionView=x.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=x.createElement("style"),this.helperContainer.appendChild(this.charSizeStyleElement);s div{height:"+this.charMeasure.height+"px;}"},i.prototype.bindMouse=function(){function t(t){var e,r;if(e=o(t),r=S.getRawByteCoords(t,c.rowContainer,c.charMeasure,c.cols,c.rows))switch(i(e,r),t.overrideType||t.type){case"mousedown":l=e;break;case"mouseup":l=32}}function e(t){var e,r=l;(e=S.getRawByteCoords(t,c.rowContainer,c.charMeasure,c.cols,c.rows))&&i(r+=32,e)}function r(t,e){if(c.utfMouse){if(2047===e)return t.push(0);e<127?t.push(e):(e>2047&&(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(c.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 c.send(i)}return c.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 c.send(y.C0.ESC+"["+t+";"+(3===t?4:0)+";"+e.y+";"+e.x+";"+(e.page||0)+"&w")):c.urxvtMouse?(e.x-=32,e.y-=32,e.x++,e.y++,void c.send(y.C0.ESC+"["+t+";"+e.x+";"+e.y+"M")):c.sgrMouse?(e.x-=32,e.y-=32,void c.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 c.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,c.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,c.vt200Mouse?s&=n:c.normalMouse||(s=0),e=32+(s<<2)+e}var a=this.element,c=this,l=32;n(a,"mousedown",function(r){if(c.mouseEvents)return t(r),c.focus(),c.vt200Mouse?(r.overrideType="mouseup",t(r),c.cancel(r)):(c.normalMouse&&n(c.document,"mousemove",e),c.x10Mouse||n(c.document,"mouseup",function r(i){return t(i),c.normalMouse&&s(c.document,"mousemove",e),s(c.document,"mouseup",r),c.cancel(i)}),c.cancel(r))}),n(a,"wheel",function(e){if(c.mouseEvents&&!(c.x10Mouse||c.vt300Mouse||c.decLocator))return t(e),c.cancel(e)}),n(a,"wheel",function(t){if(!c.mouseEvents)return c.viewport.onWheel(t),c.cancel(t)}),n(a,"touchstart",function(t){if(!c.mouseEvents)return c.viewport.onTouchStart(t),c.cancel(t)}),n(a,"touchmove",function(t){if(!c.mouseEvents)return c.viewport.onTouchMove(t),c.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(t){var e;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),e=this.ybase+this.rows-1,(e-=this.rows-1-this.scrollBottom)===this.lines.length?this.lines.push(this.blankLine(void 0,t)):this.lines.splice(e,0,this.blankLine(void 0,t)),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){if(t<0){if(0===this.ydisp)return;this.userScrolling=!0}else 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;var r=this.parser.parse(e);this.parser.setState(r),this.updateRange(this.y),this.refresh(this.refreshStart,this.refreshEnd)}if(this.writeBuffer.length>0){var i=this;setTimeout(function(){i.innerWrite()},0)}else this.writeInProgress=!1},i.prototype.writeln=function(t){this.write(t+"\r\n")},i.prototype.attachCustomKeydownHandler=function(t){console.warn("attachCustomKeydownHandler() is DEPRECATED and will be removed soon. Please use attachCustomKeyEventHandler() instead."),this.attachCustomKeyEventHandler(t)},i.prototype.attachCustomKeyEventHandler=function(t){this.customKeyEventHandler=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.hasSelection=function(){return this.selectionManager.hasSelection},i.prototype.getSelection=function(){return this.selectionManager.selectionText},i.prototype.clearSelection=function(){this.selectionManager.clearSelection()},i.prototype.selectAll=function(){this.selectionManager.selectAll()},i.prototype.keyDown=function(t){if(this.customKeyEventHandler&&!1===this.customKeyEventHandler(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?this.browser.isMac&&!t.altKey&&!t.ctrlKey&&t.metaKey&&65===t.keyCode&&this.selectAll():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.customKeyEventHandler&&!1===this.customKeyEventHandler(t))return!1;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),!0)},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)){e>this.getOption("scrollback")&&this.setOption("scrollback",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.customKeyEventHandler,e=this.cursorBlinkInterval;i.call(this,this.options),this.customKeyEventHandler=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=l,l._cache={},l.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,"./SelectionManager":9,"./Viewport":11,"./handlers/Clipboard":12,"./utils/Browser":13,"./utils/CharMeasure":14,"./utils/CircularList":15,"./utils/Mouse":18}]},{},[19])(19)}),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),l=o-(parseInt(c.getPropertyValue("padding-top"))+parseInt(c.getPropertyValue("padding-bottom"))),h=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(l/e),n=parseInt(h/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=h[u]&&p in h[u].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||f?(l("ignoring socket cache for %s",a),r=c(a,e)):(h[u]||(l("new io instance for %s",a),h[u]=c(a,e)),r=h[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),l=r(3)("socket.io-client");t.exports=e=i;var h=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(h===setTimeout)return setTimeout(t,0);if((h===r||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.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*h;case"days":case"day":case"d":return r*l;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>=l?Math.round(t/l)+"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,l,"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 h();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 h()}return t}function l(t){this.reconPack=t,this.buffers=[]}function h(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 l(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()},l.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},l.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[h++%e.colors.length]}function n(t){function r(){}function n(){var t=n,r=+new Date,s=r-(l||r);t.diff=s,t.prev=l,t.curr=r,l=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*h;case"days":case"day":case"d":return r*l;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>=l?Math.round(t/l)+"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,l,"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 S={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},x=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),l=C(p/365.2425)+1970-1;k(l+1,0)<=p;l++);for(h=C((p-k(l,0))/30.42);k(l,h+1)<=p;h++);p=1+p-k(l,h),g=C((f=(a%864e5+864e5)%864e5)/36e5)%24,v=C(f/6e4)%60,b=C(f/1e3)%60,w=f%1e3}else l=a.getUTCFullYear(),h=a.getUTCMonth(),p=a.getUTCDate(),g=a.getUTCHours(),v=a.getUTCMinutes(),b=a.getUTCSeconds(),w=a.getUTCMilliseconds();a=(l<=0||l>=1e4?(l<0?"-":"+")+x(6,l<0?-l:l):x(4,l))+"-"+x(2,h+1)+"-"+x(2,p)+"T"+x(2,g)+":"+x(2,v)+":"+x(2,b)+"."+x(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),S=[],B=s,s+=n,"[object Array]"==c){for(T=0,L=a.length;T0)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,M));break;default:R()}else{if(34==n)break;for(n=s.charCodeAt(M),e=M;n>=32&&92!=n&&34!=n;)n=s.charCodeAt(++M);t+=s.slice(e,M)}if(34==s.charCodeAt(M))return M++,t;R();default:if(e=M,45==n&&(i=!0,n=s.charCodeAt(++M)),n>=48&&n<=57){for(48==n&&(n=s.charCodeAt(M+1))>=48&&n<=57&&R(),i=!1;M=48&&n<=57;M++);if(46==s.charCodeAt(M)){for(r=++M;r=48&&n<=57;r++);r==M&&R(),M=r}if(101==(n=s.charCodeAt(M))||69==n){for(43!=(n=s.charCodeAt(++M))&&45!=n||M++,r=M;r=48&&n<=57;r++);r==M&&R(),M=r}return+s.slice(e,M)}if(i&&R(),"true"==s.slice(M,M+4))return M+=4,!0;if("false"==s.slice(M,M+5))return M+=5,!1;if("null"==s.slice(M,M+4))return M+=4,null;R()}return"$"},O=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(O(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)]=O(P());return e}R()}return t},D=function(t,e,r){var i=N(t,e,r);i===y?delete t[e]:t[e]=i},N=function(t,e,r){var i,n=t[e];if("object"==typeof n&&n)if("[object Array]"==_.call(n))for(i=n.length;i--;)D(n,i,r);else m(n,function(t){D(n,t,r)});return r.call(t,e,n)};e.parse=function(t,e){var r,i;return M=0,T=""+t,r=O(P()),"$"!=P()&&R(),M=T=null,e&&"[object Function]"==_.call(e)?N((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,l=o.JSON3,h=!1,u=i(o,o.JSON3={noConflict:function(){return h||(h=!0,o.JSON=c,o.JSON3=l,c=l=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=h(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=h(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),l=r(27),h=r(2),u=r(43),p=r(36);t.exports=i,i.priorWebsocketSuccess=!1,o(i.prototype),i.protocol=l.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=l.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),h.send([{type:"ping",data:"probe"}]),h.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",h),!h)return;i.priorWebsocketSuccess="websocket"===h.name,a('pausing current transport "%s"',p.transport.name),p.transport.pause(function(){u||"closed"!==p.readyState&&(a("changing transport and sending upgrade packet"),l(),p.setTransport(h),h.send([{type:"upgrade"}]),p.emit("upgrade",h),h=null,p.upgrading=!1,p.flush())})}else{a('probe transport "%s" failed',t);var r=new Error("probe error");r.transport=h.name,p.emit("upgradeError",r)}}))}function r(){u||(u=!0,l(),h.close(),h=null)}function n(e){var i=new Error("probe error: "+e);i.transport=h.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){h&&t.name!==h.name&&(a('"%s" works - aborting "%s"',t.name,h.name),r())}function l(){h.removeListener("open",e),h.removeListener("error",n),h.removeListener("close",s),p.removeListener("close",o),p.removeListener("upgrading",c)}a('probing transport "%s"',t);var h=this.createTransport(t,{probe:1}),u=!1,p=this;i.priorWebsocketSuccess=!1,h.once("open",e),h.once("error",n),h.once("close",s),this.once("close",o),this.once("upgrading",c),h.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(!l)return{type:r,data:{base64:!0,data:t.substr(1)}};var i=l.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,l=t.length;c0;){for(var a=new Uint8Array(n),c=0===a[0],l="",h=1;255!=a[h];h++){if(l.length>310){o=!0;break}l+=a[h]}if(o)return i(b,0,1);n=p(n,2+l.length),l=parseInt(l);var u=p(n,0,l);if(c)try{u=String.fromCharCode.apply(null,new Uint8Array(u))}catch(t){var f=new Uint8Array(u);u="";for(h=0;hi&&(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 l(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 h(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:h,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,l=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var h=new ArrayBuffer(a),u=new Uint8Array(h);for(e=0;e>4,u[l++]=(15&n)<<4|s>>2,u[l++]=(3&s)<<6|63&o;return h}}()},function(t,e){(function(e){function r(t){for(var e=0;e0);return e}function i(t){var e=0;for(h=0;h';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"),h=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=h,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(l,"\\\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),l=r(38),h=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