!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=52)}([function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}(t.exports=n).prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var o,s=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a/=s=2,l/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o>>10&1023|55296),h=56320|1023&h),n.push(h),i+=u}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return 0r&&(t+=" ... ")),""},l.prototype.compare=function(t,e,r,n,i){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(n,i),h=t.slice(e,r),u=0;uthis.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,s,a,l,c,h,u=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return c=e,h=r,P(F(t,this.length-c),this,c,h);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return this,a=e,l=r,P(I(t),this,a,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=e,s=r,P(function(t,e){for(var r,n,i,o=[],s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,this.length-o),this,o,s);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;it.length)throw new RangeError("Index out of range")}function T(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function R(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function M(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return o||M(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,o){return o||M(t,0,r,8),i.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n>>8):T(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):T(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;0<=--o&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):T(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):T(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function I(t){return n.toByteArray(function(t){var e;if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function P(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(17))},function(t,e,r){var n=r(38);t.exports=function(t){var e=t.xdomain,r=t.xscheme,i=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||n))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!r&&i)return new XDomainRequest}catch(t){}if(!e)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},function(t,e,r){var n=r(1);function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.isReactNative=t.isReactNative,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}r(0)((t.exports=i).prototype),i.prototype.onError=function(t,e){var r=new Error(t);return r.type="TransportError",r.description=e,this.emit("error",r),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){var e=n.decodePacket(t,this.socket.binaryType);this.onPacket(e)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,r){var n=r(28),i=r(8),o=r(18),s=r(2)("socket.io-client");t.exports=e=l;var a=e.managers={};function l(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i=n(t),l=i.source,c=i.id,h=i.path,u=a[c]&&h in a[c].nsps;return r=e.forceNew||e["force new connection"]||!1===e.multiplex||u?(s("ignoring socket cache for %s",l),o(l,e)):(a[c]||(s("new io instance for %s",l),a[c]=o(l,e)),a[c]),i.query&&!e.query&&(e.query=i.query),r.socket(i.path,e)}e.protocol=i.protocol,e.connect=l,e.Manager=r(18),e.Socket=r(24)},function(t,e,r){t.exports=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[s]={exports:{}};e[s][0].call(c.exports,function(t){return i(e[s][1][t]||t)},c,c.exports,t,e,r,n)}return r[s].exports}for(var o=!1,s=0;st;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},e.prototype._createAccessibilityTreeNode=function(){var t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t},e.prototype._onTab=function(t){for(var e=0;ethis._terminal.rows},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return 0<=t&&tr.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:e},t.prototype.fillViewportRows=function(t){if(0===this.lines.length){void 0===t&&(t=r.DEFAULT_ATTR);for(var e=this._terminal.rows;e--;)this.lines.push(this.getBlankLine(t))}},t.prototype.clear=function(){this.setBufferLineFactory(this._terminal.options.experimentalBufferLineImpl),this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new o.CircularList(this._getCorrectBufferLength(this._terminal.rows)),this.scrollTop=0,this.scrollBottom=this._terminal.rows-1,this.setupTabStops()},t.prototype.resize=function(t,e){var n=this._getCorrectBufferLength(e);if(n>this.lines.maxLength&&(this.lines.maxLength=n),0e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(n=this._terminal.cols?this._terminal.cols-1:t<0?0:t},t.prototype.nextStop=function(t){for(null==t&&(t=this.x);!this.tabs[++t]&&t=this._terminal.cols?this._terminal.cols-1:t<0?0:t},t.prototype.addMarker=function(t){var e=this,r=new h(t);return this.markers.push(r),r.register(this.lines.addDisposableListener("trim",function(t){r.line-=t,r.line<0&&r.dispose()})),r.register(r.addDisposableListener("dispose",function(){return e._removeMarker(r)})),r},t.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},t.prototype.iterator=function(t,e,r,n,i){return new u(this,t,e,r,n,i)},t}();r.Buffer=c;var h=function(t){function e(r){var n=t.call(this)||this;return n.line=r,n._id=e._nextId++,n.isDisposed=!1,n}return i(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.emit("dispose"),t.prototype.dispose.call(this))},e._nextId=1,e}(s.EventEmitter);r.Marker=h;var u=function(){function t(t,e,r,n,i,o){void 0===r&&(r=0),void 0===n&&(n=t.lines.length),void 0===i&&(i=0),void 0===o&&(o=0),this._buffer=t,this._trimRight=e,this._startIndex=r,this._endIndex=n,this._startOverscan=i,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return t.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);for(var e="",r=t.first;r<=t.last;++r)e+=this._buffer.translateBufferLineToString(r,this._trimRight);return this._current=t.last+1,{range:t,content:e}},t}();r.BufferStringIterator=u},{"./BufferLine":3,"./common/CircularList":16,"./common/EventEmitter":18,"./renderer/atlas/Types":44}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./Buffer"),i=function(){function t(t,e,r){this.isWrapped=!1,this._data=[],e||(e=[0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(var i=0;it;)this._data.pop();this.length=this._data.length},t.prototype.fill=function(t){for(var e=0;ethis.length){var n=new Uint32Array(3*t);this.length&&(3*te[i][1])return!1;for(;n<=i;)if(t>e[r=n+i>>1][1])n=r+1;else{if(!(t=n)return e+r.wcwidth(o);var s=t.charCodeAt(i);56320<=s&&s<=57343?o=1024*(o-55296)+s-56320+65536:e+=r.wcwidth(s)}e+=r.wcwidth(o)}return e}},{"./common/TypedArrayUtils":20}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(t,e,r){this._textarea=t,this._compositionView=e,this._terminal=r,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}return t.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},t.prototype.compositionupdate=function(t){var e=this;this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout(function(){e._compositionPosition.end=e._textarea.value.length},0)},t.prototype.compositionend=function(){this._finalizeComposition(!0)},t.prototype.keydown=function(t){if(this._isComposing||this._isSendingComposition){if(229===t.keyCode)return!1;if(16===t.keyCode||17===t.keyCode||18===t.keyCode)return!1;this._finalizeComposition(!1)}return 229!==t.keyCode||(this._handleAnyTextareaChanges(),!1)},t.prototype._finalizeComposition=function(t){var e=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),t){var r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(e._isSendingComposition){e._isSendingComposition=!1;var t;t=e._isComposing?e._textarea.value.substring(r.start,r.end):e._textarea.value.substring(r.start),e._terminal.handler(t)}},0)}else{this._isSendingComposition=!1;var n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._terminal.handler(n)}},t.prototype._handleAnyTextareaChanges=function(){var t=this,e=this._textarea.value;setTimeout(function(){if(!t._isComposing){var r=t._textarea.value.replace(e,"");0>4){case 2:o=~o?o:d;break;case 3:~o&&(this._printHandler(t,o,d),o=-1),(f=this._executeHandlers[e])?f():this._executeHandlerFb(e);break;case 0:~o?(this._printHandler(t,o,d),o=-1):~s&&(u.put(t,s,d),s=-1);break;case 1:if(159",function(){return n.keypadNumericMode()}),n._parser.setEscHandler("c",function(){return n.reset()}),n._parser.setEscHandler("n",function(){return n.setgLevel(2)}),n._parser.setEscHandler("o",function(){return n.setgLevel(3)}),n._parser.setEscHandler("|",function(){return n.setgLevel(3)}),n._parser.setEscHandler("}",function(){return n.setgLevel(2)}),n._parser.setEscHandler("~",function(){return n.setgLevel(1)}),n._parser.setEscHandler("%@",function(){return n.selectDefaultCharset()}),n._parser.setEscHandler("%G",function(){return n.selectDefaultCharset()});var i=function(t){a._parser.setEscHandler("("+t,function(){return n.selectCharset("("+t)}),a._parser.setEscHandler(")"+t,function(){return n.selectCharset(")"+t)}),a._parser.setEscHandler("*"+t,function(){return n.selectCharset("*"+t)}),a._parser.setEscHandler("+"+t,function(){return n.selectCharset("+"+t)}),a._parser.setEscHandler("-"+t,function(){return n.selectCharset("-"+t)}),a._parser.setEscHandler("."+t,function(){return n.selectCharset("."+t)}),a._parser.setEscHandler("/"+t,function(){return n.selectCharset("/"+t)})},a=this;for(var l in s.CHARSETS)i(l);return n._parser.setErrorHandler(function(t){return n._terminal.error("Parsing error: ",t),t}),n._parser.setDcsHandler("$q",new f(n._terminal)),n}return i(e,t),e.prototype.dispose=function(){t.prototype.dispose.call(this),this._terminal=null},e.prototype.parse=function(t){if(this._terminal){var e=this._terminal.buffer,r=e.x,n=e.y;this._terminal.debug&&this._terminal.log("data: "+t),this._surrogateFirst&&(t=this._surrogateFirst+t,this._surrogateFirst=""),this._parser.parse(t),(e=this._terminal.buffer).x===r&&e.y===n||this._terminal.emit("cursormove")}},e.prototype.print=function(t,e,r){var n,i,o,s=this._terminal.buffer,c=this._terminal.charset,h=this._terminal.options.screenReaderMode,u=this._terminal.cols,f=this._terminal.wraparoundMode,p=this._terminal.insertMode,d=this._terminal.curAttr,_=s.lines.get(s.y+s.ybase);this._terminal.updateRange(s.y);for(var m=e;m=r){this._surrogateFirst=n;continue}var y=t.charCodeAt(m);56320<=y&&y<=57343?(i=1024*(i-55296)+y-56320+65536,n+=t.charAt(m)):m--}if(o=l.wcwidth(i),c&&(i=(n=c[n]||n).charCodeAt(0)),h&&this._terminal.emit("a11y.char",n),o||!s.x){if(s.x+o-1>=u)if(f)s.x=0,s.y++,s.y>s.scrollBottom?(s.y--,this._terminal.scroll(!0)):s.lines.get(s.y).isWrapped=!0,_=s.lines.get(s.y+s.ybase);else if(2===o)continue;if(p)_.insertCells(s.x,o,[d,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),2===_.get(u-1)[a.CHAR_DATA_WIDTH_INDEX]&&_.set(u-1,[d,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);if(_.set(s.x++,[d,n,o,i]),0t.scrollBottom&&(t.y--,this._terminal.scroll()),t.x>=this._terminal.cols&&t.x--,this._terminal.emit("linefeed")},e.prototype.carriageReturn=function(){this._terminal.buffer.x=0},e.prototype.backspace=function(){0=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},e.prototype.cursorForward=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.x+=e,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.cursorBackward=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.buffer.x-=e,this._terminal.buffer.x<0&&(this._terminal.buffer.x=0)},e.prototype.cursorNextLine=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.y+=e,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},e.prototype.cursorPrecedingLine=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.y-=e,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},e.prototype.cursorCharAbsolute=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.x=e-1},e.prototype.cursorPosition=function(t){var e,r=t[0]-1;e=2<=t.length?t[1]-1:0,r<0?r=0:r>=this._terminal.rows&&(r=this._terminal.rows-1),e<0?e=0:e>=this._terminal.cols&&(e=this._terminal.cols-1),this._terminal.buffer.x=e,this._terminal.buffer.y=r},e.prototype.cursorForwardTab=function(t){for(var e=t[0]||1;e--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},e.prototype._eraseInBufferLine=function(t,e,r,n){void 0===n&&(n=!1);var i=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+t);i.replaceCells(e,r,[this._terminal.eraseAttr(),a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),n&&(i.isWrapped=!1)},e.prototype._resetBufferLine=function(t){this._eraseInBufferLine(t,0,this._terminal.cols,!0)},e.prototype.eraseInDisplay=function(t){var e;switch(t[0]){case 0:for(e=this._terminal.buffer.y,this._terminal.updateRange(e),this._eraseInBufferLine(e++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);e=this._terminal.cols&&(this._terminal.buffer.lines.get(e+1).isWrapped=!1);e--;)this._resetBufferLine(e);this._terminal.updateRange(0);break;case 2:for(e=this._terminal.rows,this._terminal.updateRange(e-1);e--;)this._resetBufferLine(e);this._terminal.updateRange(0);break;case 3:var r=this._terminal.buffer.lines.length-this._terminal.rows;0=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.hPositionRelative=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.x+=e,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.repeatPrecedingCharacter=function(t){var e=this._terminal.buffer,r=e.lines.get(e.ybase+e.y);r.replaceCells(e.x,e.x+(t[0]||1),r.get(e.x-1)||[a.DEFAULT_ATTR,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE])},e.prototype.sendDeviceAttributes=function(t,e){0"===e&&(this._terminal.is("xterm")?this._terminal.handler(o.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.handler(o.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.handler(t[0]+"c"):this._terminal.is("screen")&&this._terminal.handler(o.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.handler(o.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.handler(o.C0.ESC+"[?6c"))},e.prototype.linePosAbsolute=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.y=e-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},e.prototype.vPositionRelative=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.y+=e,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},e.prototype.hVPosition=function(t){t[0]<1&&(t[0]=1),t[1]<1&&(t[1]=1),this._terminal.buffer.y=t[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=t[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.tabClear=function(t){var e=t[0];e<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===e&&(this._terminal.buffer.tabs={})},e.prototype.setMode=function(t,e){if(1>18,i=this._terminal.curAttr>>9&511,o=511&this._terminal.curAttr,s=0;s>18,i=a.DEFAULT_ATTR>>9&511,o=511&a.DEFAULT_ATTR):1===e?n|=1:3===e?n|=64:4===e?n|=2:5===e?n|=4:7===e?n|=8:8===e?n|=16:2===e?n|=32:22===e?(n&=-2,n&=-33):23===e?n&=-65:24===e?n&=-3:25===e?n&=-5:27===e?n&=-9:28===e?n&=-17:39===e?i=a.DEFAULT_ATTR>>9&511:49===e?o=511&a.DEFAULT_ATTR:38===e?2===t[s+1]?(s+=2,-1===(i=this._terminal.matchColor(255&t[s],255&t[s+1],255&t[s+2]))&&(i=511),s+=2):5===t[s+1]&&(i=e=255&t[s+=2]):48===e?2===t[s+1]?(s+=2,-1===(o=this._terminal.matchColor(255&t[s],255&t[s+1],255&t[s+2]))&&(o=511),s+=2):5===t[s+1]&&(o=e=255&t[s+=2]):100===e?(i=a.DEFAULT_ATTR>>9&511,o=511&a.DEFAULT_ATTR):this._terminal.error("Unknown SGR attribute: %d.",e);this._terminal.curAttr=n<<18|i<<9|o}else this._terminal.curAttr=a.DEFAULT_ATTR},e.prototype.deviceStatus=function(t,e){if(e){if("?"===e)switch(t[0]){case 6:var r=this._terminal.buffer.y+1,n=this._terminal.buffer.x+1;this._terminal.emit("data",o.C0.ESC+"[?"+r+";"+n+"R")}}else switch(t[0]){case 5:this._terminal.emit("data",o.C0.ESC+"[0n");break;case 6:r=this._terminal.buffer.y+1,n=this._terminal.buffer.x+1;this._terminal.emit("data",o.C0.ESC+"["+r+";"+n+"R")}},e.prototype.softReset=function(t,e){"!"===e&&(this._terminal.cursorHidden=!1,this._terminal.insertMode=!1,this._terminal.originMode=!1,this._terminal.wraparoundMode=!0,this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.applicationCursor=!1,this._terminal.buffer.scrollTop=0,this._terminal.buffer.scrollBottom=this._terminal.rows-1,this._terminal.curAttr=a.DEFAULT_ATTR,this._terminal.buffer.x=this._terminal.buffer.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null])},e.prototype.setCursorStyle=function(t,e){if(" "===e){var r=t[0]<1?1:t[0];switch(r){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 n=r%2==1;this._terminal.setOption("cursorBlink",n)}},e.prototype.setScrollRegion=function(t,e){e||(this._terminal.buffer.scrollTop=(t[0]||1)-1,this._terminal.buffer.scrollBottom=(t[1]&&t[1]<=this._terminal.rows?t[1]:this._terminal.rows)-1,this._terminal.buffer.x=0,this._terminal.buffer.y=0)},e.prototype.saveCursor=function(t){this._terminal.buffer.savedX=this._terminal.buffer.x,this._terminal.buffer.savedY=this._terminal.buffer.y,this._terminal.buffer.savedCurAttr=this._terminal.curAttr},e.prototype.restoreCursor=function(t){this._terminal.buffer.x=this._terminal.buffer.savedX||0,this._terminal.buffer.y=this._terminal.buffer.savedY||0,this._terminal.curAttr=this._terminal.buffer.savedCurAttr||a.DEFAULT_ATTR},e.prototype.setTitle=function(t){this._terminal.handleTitle(t)},e.prototype.nextLine=function(){this._terminal.buffer.x=0,this.index()},e.prototype.keypadApplicationMode=function(){this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},e.prototype.keypadNumericMode=function(){this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},e.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0),this._terminal.setgCharset(0,s.DEFAULT_CHARSET)},e.prototype.selectCharset=function(t){if(2!==t.length)return this.selectDefaultCharset();"/"!==t[0]&&this._terminal.setgCharset(u[t[0]],s.CHARSETS[t[1]]||s.DEFAULT_CHARSET)},e.prototype.index=function(){this._terminal.index()},e.prototype.tabSet=function(){this._terminal.tabSet()},e.prototype.reverseIndex=function(){this._terminal.reverseIndex()},e.prototype.reset=function(){this._parser.reset(),this._terminal.reset()},e.prototype.setgLevel=function(t){this._terminal.setgLevel(t)},e}(h.Disposable);r.InputHandler=p},{"./Buffer":2,"./CharWidth":5,"./EscapeSequenceParser":7,"./common/Lifecycle":19,"./common/data/EscapeSequences":21,"./core/data/Charsets":23}],9:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=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])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o=t("./ui/MouseZoneManager"),s=t("./common/EventEmitter"),a=t("./Buffer"),l=t("./CharWidth"),c=function(t){function e(e){var r=t.call(this)||this;return r._terminal=e,r._linkMatchers=[],r._nextLinkMatcherId=0,r._rowsToLinkify={start:null,end:null},r}return i(e,t),e.prototype.attachToDom=function(t){this._mouseZoneManager=t},e.prototype.linkifyRows=function(t,r){var n=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=r):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,r)),this._mouseZoneManager.clearAll(t,r),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return n._linkifyRows()},e.TIME_BEFORE_LINKIFY))},e.prototype._linkifyRows=function(){this._rowsTimeoutId=null;var t=this._terminal.buffer,r=t.ydisp+this._rowsToLinkify.start;if(!(r>=t.lines.length)){for(var n=t.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+1,i=Math.ceil(e.OVERSCAN_CHAR_LIMIT/this._terminal.cols),o=this._terminal.buffer.iterator(!1,r,n,i,i);o.hasNext();)for(var s=o.next(),a=0;a>9&511}r.validationCallback?r.validationCallback(l,function(t){i._rowsTimeoutId||t&&i._addLink(h[1],h[0]-i._terminal.buffer.ydisp,l,r,u)}):c._addLink(h[1],h[0]-c._terminal.buffer.ydisp,l,r,u)},c=this;null!==(n=o.exec(e));){if("break"===l())break}},e.prototype._addLink=function(t,e,r,n,i){var s=this,a=l.getStringCellWidth(r),c=t%this._terminal.cols,h=e+Math.floor(t/this._terminal.cols),u=(c+a)%this._terminal.cols,f=h+Math.floor((c+a)/this._terminal.cols);0===u&&(u=this._terminal.cols,f--),this._mouseZoneManager.add(new o.MouseZone(c+1,h+1,u+1,f+1,function(t){if(n.handler)return n.handler(t,r);window.open(r,"_blank")},function(t){s.emit("linkhover",s._createLinkHoverEvent(c,h,u,f,i)),s._terminal.element.classList.add("xterm-cursor-pointer")},function(t){s.emit("linktooltip",s._createLinkHoverEvent(c,h,u,f,i)),n.hoverTooltipCallback&&n.hoverTooltipCallback(t,r)},function(){s.emit("linkleave",s._createLinkHoverEvent(c,h,u,f,i)),s._terminal.element.classList.remove("xterm-cursor-pointer"),n.hoverLeaveCallback&&n.hoverLeaveCallback()},function(t){return!n.willLinkActivate||n.willLinkActivate(t,r)}))},e.prototype._createLinkHoverEvent=function(t,e,r,n,i){return{x1:t,y1:e,x2:r,y2:n,cols:this._terminal.cols,fg:i}},e.TIME_BEFORE_LINKIFY=200,e.OVERSCAN_CHAR_LIMIT=2e3,e}(s.EventEmitter);r.Linkifier=c},{"./Buffer":2,"./CharWidth":5,"./common/EventEmitter":18,"./ui/MouseZoneManager":51}],10:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=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])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o=t("./ui/MouseHelper"),s=t("./core/Platform"),a=t("./common/EventEmitter"),l=t("./SelectionModel"),c=t("./Buffer"),h=t("./handlers/AltClickHandler"),u=String.fromCharCode(160),f=new RegExp(u,"g"),p=function(t){function e(e,r){var n=t.call(this)||this;return n._terminal=e,n._charMeasure=r,n._enabled=!0,n._initListeners(),n.enable(),n._model=new l.SelectionModel(e),n._activeSelectionMode=0,n}return i(e,t),e.prototype.dispose=function(){t.prototype.dispose.call(this),this._removeMouseDownListeners()},Object.defineProperty(e.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0}),e.prototype._initListeners=function(){var t=this;this._mouseMoveListener=function(e){return t._onMouseMove(e)},this._mouseUpListener=function(e){return t._onMouseUp(e)},this._trimListener=function(e){return t._onTrim(e)},this.initBuffersListeners()},e.prototype.initBuffersListeners=function(){var t=this;this._terminal.buffer.lines.on("trim",this._trimListener),this._terminal.buffers.on("activate",function(e){return t._onBufferActivate(e)})},e.prototype.disable=function(){this.clearSelection(),this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},Object.defineProperty(e.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),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=[];if(3===this._activeSelectionMode){if(t[0]===e[0])return"";for(var n=t[1];n<=e[1];n++){var i=this._buffer.translateBufferLineToString(n,!0,t[0],e[0]);r.push(i)}}else{var o=t[1]===e[1]?e[0]:void 0;r.push(this._buffer.translateBufferLineToString(t[1],!0,t[0],o));for(n=t[1]+1;n<=e[1]-1;n++){var a=this._buffer.lines.get(n);i=this._buffer.translateBufferLineToString(n,!0);a.isWrapped?r[r.length-1]+=i:r.push(i)}if(t[1]!==e[1]){a=this._buffer.lines.get(e[1]),i=this._buffer.translateBufferLineToString(e[1],!0,0,e[0]);a.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map(function(t){return t.replace(f," ")}).join(s.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),e.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh()},e.prototype.refresh=function(t){var e=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return e._refresh()})),s.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,columnSelectMode:3===this._activeSelectionMode})},e.prototype.isClickInSelection=function(t){var e=this._getMouseBufferCoords(t),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!(!r||!n)&&this._areCoordsInSelection(e,r,n)},e.prototype._areCoordsInSelection=function(t,e,r){return t[1]>e[1]&&t[1]=e[0]&&t[0]=e[0]},e.prototype.selectWordAtCursor=function(t){var e=this._getMouseBufferCoords(t);e&&(this._selectWordAt(e,!1),this._model.selectionEnd=null,this.refresh(!0))},e.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._terminal.emit("selection")},e.prototype.selectLines=function(t,e){this._model.clearSelection(),t=Math.max(t,0),e=Math.min(e,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,t],this._model.selectionEnd=[this._terminal.cols,e],this.refresh(),this._terminal.emit("selection")},e.prototype._onTrim=function(t){this._model.onTrim(t)&&this.refresh()},e.prototype._getMouseBufferCoords=function(t){var e=this._terminal.mouseHelper.getCoords(t,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);return e?(e[0]--,e[1]--,e[1]+=this._terminal.buffer.ydisp,e):null},e.prototype._getMouseEventScrollAmount=function(t){var e=o.MouseHelper.getCoordsRelativeToElement(t,this._terminal.screenElement)[1],r=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return 0<=e&&e<=r?0:(r=this._model.selectionStart[0]))0===e.get(this._model.selectionStart[0])[c.CHAR_DATA_WIDTH_INDEX]&&this._model.selectionStart[0]++}},e.prototype._onDoubleClick=function(t){var e=this._getMouseBufferCoords(t);e&&(this._activeSelectionMode=1,this._selectWordAt(e,!0))},e.prototype._onTripleClick=function(t){var e=this._getMouseBufferCoords(t);e&&(this._activeSelectionMode=2,this._selectLineAt(e[1]))},e.prototype.shouldColumnSelect=function(t){return t.altKey&&!(s.isMac&&this._terminal.options.macOptionClickForcesSelection)},e.prototype._onMouseMove=function(t){t.stopImmediatePropagation();var e=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(t),this._model.selectionEnd){if(2===this._activeSelectionMode?this._model.selectionEnd[1]=n;n++){var i=t.get(n);0===i[c.CHAR_DATA_WIDTH_INDEX]?r--:1=this._terminal.cols)return null;var i=this._buffer.lines.get(t[1]);if(!i)return null;var o=this._buffer.translateBufferLineToString(t[1],!1),s=this._convertViewportColToCharacterIndex(i,t),a=s,l=t[0]-s,h=0,u=0,f=0,p=0;if(" "===o.charAt(s)){for(;0this._terminal.cols;)e.length-=this._terminal.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?e.start:e.start+e.length,r]}},e.prototype._isCharWordSeparator=function(t){return 0!==t[c.CHAR_DATA_WIDTH_INDEX]&&0<=" ()[]{}'\"".indexOf(t[c.CHAR_DATA_CHAR_INDEX])},e.prototype._selectLineAt=function(t){var e=this._buffer.getWrappedRangeForLine(t);this._model.selectionStart=[0,e.first],this._model.selectionEnd=[this._terminal.cols,e.last],this._model.selectionStartLength=0},e}(a.EventEmitter);r.SelectionManager=p},{"./Buffer":2,"./SelectionModel":11,"./common/EventEmitter":18,"./core/Platform":22,"./handlers/AltClickHandler":25,"./ui/MouseHelper":50}],11:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=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(){if(this.isSelectAllActive)return[this._terminal.cols,this._terminal.buffer.ybase+this._terminal.rows-1];if(!this.selectionStart)return null;if(this.selectionEnd&&!this.areSelectionValuesReversed())return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd;var t=this.selectionStart[0]+this.selectionStartLength;return t>this._terminal.cols?[t%this._terminal.cols,this.selectionStart[1]+Math.floor(t/this._terminal.cols)]:[t,this.selectionStart[1]]},enumerable:!0,configurable:!0}),t.prototype.areSelectionValuesReversed=function(){var t=this.selectionStart,e=this.selectionEnd;return!(!t||!e)&&(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=n},{}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_BELL_SOUND="data:audio/wav;base64,UklGRigBAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQQBAADpAFgCwAMlBZoG/wdmCcoKRAypDQ8PbRDBEQQTOxRtFYcWlBePGIUZXhoiG88bcBz7HHIdzh0WHlMeZx51HmkeUx4WHs8dah0AHXwc3hs9G4saxRnyGBIYGBcQFv8U4RPAEoYRQBACD70NWwwHC6gJOwjWBloF7gOBAhABkf8b/qv8R/ve+Xf4Ife79W/0JfPZ8Z/wde9N7ijtE+wU6xvqM+lb6H7nw+YX5mrlxuQz5Mzje+Ma49fioeKD4nXiYeJy4pHitOL04j/jn+MN5IPkFOWs5U3mDefM55/ogOl36m7rdOyE7abuyu8D8Unyj/Pg9D/2qfcb+Yn6/vuK/Qj/lAAlAg==";var n=function(){function t(t){this._terminal=t}return Object.defineProperty(t,"audioContext",{get:function(){if(!t._audioContext){var e=window.AudioContext||window.webkitAudioContext;if(!e)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;t._audioContext=new e}return t._audioContext},enumerable:!0,configurable:!0}),t.prototype.playBellSound=function(){var e=t.audioContext;if(e){var r=e.createBufferSource();e.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),function(t){r.buffer=t,r.connect(e.destination),r.start(0)})}},t.prototype._base64ToArrayBuffer=function(t){for(var e=window.atob(t),r=e.length,n=new Uint8Array(r),i=0;ir){var n=this.buffer.lines.length-r,i=this.buffer.ydisp-n<0;this.buffer.lines.trimStart(n),this.buffer.ybase=Math.max(this.buffer.ybase-n,0),this.buffer.ydisp=Math.max(this.buffer.ydisp-n,0),i&&this.refresh(0,this.rows-1)}}}switch(this.options[t]=e,t){case"fontFamily":case"fontSize":this.renderer&&(this.renderer.clear(),this.charMeasure.measure(this.options));break;case"drawBoldTextInBrightColors":case"experimentalCharAtlas":case"enableBold":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":this.renderer&&(this.renderer.clear(),this.renderer.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this.renderer&&(this.unregister(this.renderer),this.renderer.dispose(),this.renderer=null),this._setupRenderer(),this.renderer.onCharSizeChanged(),this._theme&&this.renderer.setTheme(this._theme),this.mouseHelper.setRenderer(this.renderer);break;case"scrollback":this.buffers.resize(this.cols,this.rows),this.viewport&&this.viewport.syncScrollArea();break;case"screenReaderMode":e?this._accessibilityManager||(this._accessibilityManager=new A.AccessibilityManager(this)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"experimentalBufferLineImpl":this.buffers.normal.setBufferLineFactory(e),this.buffers.alt.setBufferLineFactory(e),this._blankLine=null}this.renderer&&this.renderer.onOptionsChanged()}},e.prototype._onTextAreaFocus=function(t){this.sendFocus&&this.handler(u.C0.ESC+"[I"),this.updateCursorStyle(t),this.element.classList.add("focus"),this.showCursor(),this.emit("focus")},e.prototype.blur=function(){return this.textarea.blur()},e.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.sendFocus&&this.handler(u.C0.ESC+"[O"),this.element.classList.remove("focus"),this.emit("blur")},e.prototype._initGlobal=function(){var t=this;this._bindKeys(),this.register(g.addDisposableDomListener(this.element,"copy",function(e){t.hasSelection()&&h.copyHandler(e,t,t.selectionManager)}));var e=function(e){return h.pasteHandler(e,t)};this.register(g.addDisposableDomListener(this.textarea,"paste",e)),this.register(g.addDisposableDomListener(this.element,"paste",e)),y.isFirefox?this.register(g.addDisposableDomListener(this.element,"mousedown",function(e){2===e.button&&h.rightClickHandler(e,t.textarea,t.selectionManager,t.options.rightClickSelectsWord)})):this.register(g.addDisposableDomListener(this.element,"contextmenu",function(e){h.rightClickHandler(e,t.textarea,t.selectionManager,t.options.rightClickSelectsWord)})),y.isLinux&&this.register(g.addDisposableDomListener(this.element,"auxclick",function(e){1===e.button&&h.moveTextAreaUnderMouseCursor(e,t.textarea)}))},e.prototype._bindKeys=function(){var t=this,e=this;this.register(g.addDisposableDomListener(this.element,"keydown",function(t){R.activeElement===this&&e._keyDown(t)},!0)),this.register(g.addDisposableDomListener(this.element,"keypress",function(t){R.activeElement===this&&e._keyPress(t)},!0)),this.register(g.addDisposableDomListener(this.element,"keyup",function(r){var n;16!==(n=r).keyCode&&17!==n.keyCode&&18!==n.keyCode&&t.focus(),e._keyUp(r)},!0)),this.register(g.addDisposableDomListener(this.textarea,"keydown",function(e){return t._keyDown(e)},!0)),this.register(g.addDisposableDomListener(this.textarea,"keypress",function(e){return t._keyPress(e)},!0)),this.register(g.addDisposableDomListener(this.textarea,"compositionstart",function(){return t._compositionHelper.compositionstart()})),this.register(g.addDisposableDomListener(this.textarea,"compositionupdate",function(e){return t._compositionHelper.compositionupdate(e)})),this.register(g.addDisposableDomListener(this.textarea,"compositionend",function(){return t._compositionHelper.compositionend()})),this.register(this.addDisposableListener("refresh",function(){return t._compositionHelper.updateCompositionElements()})),this.register(this.addDisposableListener("refresh",function(e){return t._queueLinkification(e.start,e.end)}))},e.prototype.open=function(t){var e=this;if(this._parent=t||this._parent,!this._parent)throw new Error("Terminal requires a parent element.");this._context=this._parent.ownerDocument.defaultView,this._document=this._parent.ownerDocument,this._screenDprMonitor=new S.ScreenDprMonitor,this._screenDprMonitor.setListener(function(){return e.emit("dprchange",window.devicePixelRatio)}),this.register(this._screenDprMonitor),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),this._parent.appendChild(this.element);var r=R.createDocumentFragment();this._viewportElement=R.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),r.appendChild(this._viewportElement),this._viewportScrollArea=R.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=R.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=R.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),r.appendChild(this.screenElement),this._mouseZoneManager=new E.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.addDisposableListener("scroll",function(){return e._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=R.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(g.addDisposableDomListener(this.textarea,"focus",function(t){return e._onTextAreaFocus(t)})),this.register(g.addDisposableDomListener(this.textarea,"blur",function(){return e._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea),this._compositionView=R.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=new a.CompositionHelper(this.textarea,this._compositionView,this),this._helperContainer.appendChild(this._compositionView),this.charMeasure=new m.CharMeasure(R,this._helperContainer),this.element.appendChild(r),this._setupRenderer(),this._theme=this.options.theme,this.options.theme=null,this.viewport=new c.Viewport(this,this._viewportElement,this._viewportScrollArea,this.charMeasure),this.viewport.onThemeChanged(this.renderer.colorManager.colors),this.register(this.viewport),this.register(this.addDisposableListener("cursormove",function(){return e.renderer.onCursorMove()})),this.register(this.addDisposableListener("resize",function(){return e.renderer.onResize(e.cols,e.rows)})),this.register(this.addDisposableListener("blur",function(){return e.renderer.onBlur()})),this.register(this.addDisposableListener("focus",function(){return e.renderer.onFocus()})),this.register(this.addDisposableListener("dprchange",function(){return e.renderer.onWindowResize(window.devicePixelRatio)})),this.register(g.addDisposableDomListener(window,"resize",function(){return e.renderer.onWindowResize(window.devicePixelRatio)})),this.register(this.charMeasure.addDisposableListener("charsizechanged",function(){return e.renderer.onCharSizeChanged()})),this.register(this.renderer.addDisposableListener("resize",function(t){return e.viewport.syncScrollArea()})),this.selectionManager=new _.SelectionManager(this,this.charMeasure),this.register(g.addDisposableDomListener(this.element,"mousedown",function(t){return e.selectionManager.onMouseDown(t)})),this.register(this.selectionManager.addDisposableListener("refresh",function(t){return e.renderer.onSelectionChanged(t.start,t.end,t.columnSelectMode)})),this.register(this.selectionManager.addDisposableListener("newselection",function(t){e.textarea.value=t,e.textarea.focus(),e.textarea.select()})),this.register(this.addDisposableListener("scroll",function(){e.viewport.syncScrollArea(),e.selectionManager.refresh()})),this.register(g.addDisposableDomListener(this._viewportElement,"scroll",function(){return e.selectionManager.refresh()})),this.mouseHelper=new C.MouseHelper(this.renderer),this.options.screenReaderMode&&(this._accessibilityManager=new A.AccessibilityManager(this)),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},e.prototype._setupRenderer=function(){switch(this.options.rendererType){case"canvas":this.renderer=new p.Renderer(this,this.options.theme);break;case"dom":this.renderer=new x.DomRenderer(this,this.options.theme);break;default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}this.register(this.renderer)},e.prototype._setTheme=function(t){this._theme=t;var e=this.renderer.setTheme(t);this.viewport&&this.viewport.onThemeChanged(e)},e.prototype.bindMouse=function(){var t=this,e=this.element,r=this,n=32;function i(t){var e,i;if(e=function(t){var e,n,i;switch(t.overrideType||t.type){case"mousedown":e=null!==t.button&&void 0!==t.button?+t.button:null!==t.which&&void 0!==t.which?t.which-1:null,y.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.deltaY<0?64:65}return i=(t.shiftKey?4:0)|(t.metaKey?8:0)|(n=t.ctrlKey?16:0),r.vt200Mouse?i&=n:r.normalMouse||(i=0),32+(i<<2)+e}(t),i=r.mouseHelper.getRawByteCoords(t,r.screenElement,r.charMeasure,r.cols,r.rows))switch(s(e,i),t.overrideType||t.type){case"mousedown":n=e;break;case"mouseup":n=32}}function o(t,e){if(r.utfMouse){if(2047===e)return void t.push(0);e<127?t.push(e):(2047>6),t.push(128|63&e))}else{if(255===e)return void t.push(0);127=this.buffer.ybase&&(this._userScrolling=!1);var r=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+t,this.buffer.ybase),0),r!==this.buffer.ydisp&&(e||this.emit("scroll",this.buffer.ydisp),this.refresh(0,this.rows-1))},e.prototype.scrollPages=function(t){this.scrollLines(t*(this.rows-1))},e.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},e.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},e.prototype.scrollToLine=function(t){var e=t-this.buffer.ydisp;0!==e&&this.scrollLines(e)},e.prototype.write=function(t){var e=this;this._isDisposed||t&&(this.writeBuffer.push(t),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBuffer.length&&(this.handler(u.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0this._refreshEnd&&(this._refreshEnd=t)},e.prototype.maxRange=function(){this._refreshStart=0,this._refreshEnd=this.rows-1},e.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var t=1;tthis.buffer.scrollBottom&&(this.buffer.y--,this.scroll()),this.buffer.x>=this.cols&&this.buffer.x--},e.prototype.reverseIndex=function(){if(this.buffer.y===this.buffer.scrollTop){var t=this.buffer.scrollBottom-this.buffer.scrollTop;this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,t,1),this.buffer.lines.set(this.buffer.y+this.buffer.ybase,this.buffer.getBlankLine(this.eraseAttr())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)}else this.buffer.y--},e.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var t=this._customKeyEventHandler,e=this._inputHandler,r=this.cursorState;this._setup(),this._customKeyEventHandler=t,this._inputHandler=e,this.cursorState=r,this.refresh(0,this.rows-1),this.viewport&&this.viewport.syncScrollArea()},e.prototype.tabSet=function(){this.buffer.tabs[this.buffer.x]=!0},e.prototype.cancel=function(t,e){if(this.options.cancelEvents||e)return t.preventDefault(),t.stopPropagation(),!1},e.prototype.matchColor=function(t,e,r){var n=t<<16|e<<8|r;if(null!==O[n]&&void 0!==O[n])return O[n];for(var i,o,s,a,l,c,h,u,f=1/0,p=-1,d=0;d>>24,h=i>>>16&255,u=i>>>8&255,0===(o=Math.pow(30*(s-c),2)+Math.pow(59*(a-h),2)+Math.pow(11*(l-u),2))){p=d;break}othis._length)for(var e=this._length;ethis._maxLength){var o=this._length+r.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.emit("trim",o)}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(0this._maxLength;)this._length--,this._startIndex++,this.emit("trim",1)}else for(n=0;n=t.length)return t;r=(t.length+r)%t.length,n=n>=t.length?t.length:(t.length+n)%t.length;for(var i=r;i"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(t,e,r,o){var s={type:0,cancel:!1,key:void 0},a=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:"UIKeyInputUpArrow"===t.key?s.key=e?n.C0.ESC+"OA":n.C0.ESC+"[A":"UIKeyInputLeftArrow"===t.key?s.key=e?n.C0.ESC+"OD":n.C0.ESC+"[D":"UIKeyInputRightArrow"===t.key?s.key=e?n.C0.ESC+"OC":n.C0.ESC+"[C":"UIKeyInputDownArrow"===t.key&&(s.key=e?n.C0.ESC+"OB":n.C0.ESC+"[B");break;case 8:if(t.shiftKey){s.key=n.C0.BS;break}if(t.altKey){s.key=n.C0.ESC+n.C0.DEL;break}s.key=n.C0.DEL;break;case 9:if(t.shiftKey){s.key=n.C0.ESC+"[Z";break}s.key=n.C0.HT,s.cancel=!0;break;case 13:s.key=n.C0.CR,s.cancel=!0;break;case 27:s.key=n.C0.ESC,s.cancel=!0;break;case 37:a?(s.key=n.C0.ESC+"[1;"+(a+1)+"D",s.key===n.C0.ESC+"[1;3D"&&(s.key=r?n.C0.ESC+"b":n.C0.ESC+"[1;5D")):s.key=e?n.C0.ESC+"OD":n.C0.ESC+"[D";break;case 39:a?(s.key=n.C0.ESC+"[1;"+(a+1)+"C",s.key===n.C0.ESC+"[1;3C"&&(s.key=r?n.C0.ESC+"f":n.C0.ESC+"[1;5C")):s.key=e?n.C0.ESC+"OC":n.C0.ESC+"[C";break;case 38:a?(s.key=n.C0.ESC+"[1;"+(a+1)+"A",s.key===n.C0.ESC+"[1;3A"&&(s.key=n.C0.ESC+"[1;5A")):s.key=e?n.C0.ESC+"OA":n.C0.ESC+"[A";break;case 40:a?(s.key=n.C0.ESC+"[1;"+(a+1)+"B",s.key===n.C0.ESC+"[1;3B"&&(s.key=n.C0.ESC+"[1;5B")):s.key=e?n.C0.ESC+"OB":n.C0.ESC+"[B";break;case 45:t.shiftKey||t.ctrlKey||(s.key=n.C0.ESC+"[2~");break;case 46:s.key=a?n.C0.ESC+"[3;"+(a+1)+"~":n.C0.ESC+"[3~";break;case 36:s.key=a?n.C0.ESC+"[1;"+(a+1)+"H":e?n.C0.ESC+"OH":n.C0.ESC+"[H";break;case 35:s.key=a?n.C0.ESC+"[1;"+(a+1)+"F":e?n.C0.ESC+"OF":n.C0.ESC+"[F";break;case 33:t.shiftKey?s.type=2:s.key=n.C0.ESC+"[5~";break;case 34:t.shiftKey?s.type=3:s.key=n.C0.ESC+"[6~";break;case 112:s.key=a?n.C0.ESC+"[1;"+(a+1)+"P":n.C0.ESC+"OP";break;case 113:s.key=a?n.C0.ESC+"[1;"+(a+1)+"Q":n.C0.ESC+"OQ";break;case 114:s.key=a?n.C0.ESC+"[1;"+(a+1)+"R":n.C0.ESC+"OR";break;case 115:s.key=a?n.C0.ESC+"[1;"+(a+1)+"S":n.C0.ESC+"OS";break;case 116:s.key=a?n.C0.ESC+"[15;"+(a+1)+"~":n.C0.ESC+"[15~";break;case 117:s.key=a?n.C0.ESC+"[17;"+(a+1)+"~":n.C0.ESC+"[17~";break;case 118:s.key=a?n.C0.ESC+"[18;"+(a+1)+"~":n.C0.ESC+"[18~";break;case 119:s.key=a?n.C0.ESC+"[19;"+(a+1)+"~":n.C0.ESC+"[19~";break;case 120:s.key=a?n.C0.ESC+"[20;"+(a+1)+"~":n.C0.ESC+"[20~";break;case 121:s.key=a?n.C0.ESC+"[21;"+(a+1)+"~":n.C0.ESC+"[21~";break;case 122:s.key=a?n.C0.ESC+"[23;"+(a+1)+"~":n.C0.ESC+"[23~";break;case 123:s.key=a?n.C0.ESC+"[24;"+(a+1)+"~":n.C0.ESC+"[24~";break;default:if(!t.ctrlKey||t.shiftKey||t.altKey||t.metaKey)if(r&&!o||!t.altKey||t.metaKey)r&&!t.altKey&&!t.ctrlKey&&t.metaKey?65===t.keyCode&&(s.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&48<=t.keyCode&&1===t.key.length&&(s.key=t.key);else{var l=i[t.keyCode],c=l&&l[t.shiftKey?1:0];if(c)s.key=n.C0.ESC+c;else if(65<=t.keyCode&&t.keyCode<=90){var h=t.ctrlKey?t.keyCode-64:t.keyCode+32;s.key=n.C0.ESC+String.fromCharCode(h)}}else 65<=t.keyCode&&t.keyCode<=90?s.key=String.fromCharCode(t.keyCode-64):32===t.keyCode?s.key=String.fromCharCode(0):51<=t.keyCode&&t.keyCode<=55?s.key=String.fromCharCode(t.keyCode-51+27):56===t.keyCode?s.key=String.fromCharCode(127):219===t.keyCode?s.key=String.fromCharCode(27):220===t.keyCode?s.key=String.fromCharCode(28):221===t.keyCode&&(s.key=String.fromCharCode(29))}return s}},{"../../common/data/EscapeSequences":21}],25:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../common/data/EscapeSequences"),i=function(){function t(t,e){var r;this._mouseEvent=t,this._terminal=e,this._lines=this._terminal.buffer.lines,this._startCol=this._terminal.buffer.x,this._startRow=this._terminal.buffer.y;var n=this._terminal.mouseHelper.getCoords(this._mouseEvent,this._terminal.element,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows,!1);n&&(r=n.map(function(t){return t-1}),this._endCol=r[0],this._endRow=r[1])}return t.prototype.move=function(){this._mouseEvent.altKey&&void 0!==this._endCol&&void 0!==this._endRow&&this._terminal.handler(this._arrowSequences())},t.prototype._arrowSequences=function(){return this._terminal.buffer.hasScrollback?this._moveHorizontallyOnly():this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()},t.prototype._resetStartingRow=function(){return 0===this._moveToRequestedRow().length?"":o(this._bufferLine(this._startCol,this._startRow,this._startCol,this._startRow-this._wrappedRowsForRow(this._startRow),!1).length,this._sequence("D"))},t.prototype._moveToRequestedRow=function(){var t=this._startRow-this._wrappedRowsForRow(this._startRow),e=this._endRow-this._wrappedRowsForRow(this._endRow);return o(Math.abs(t-e)-this._wrappedRowsCount(),this._sequence(this._verticalDirection()))},t.prototype._moveToRequestedCol=function(){var t;t=0=this._endCol&&tthis._endRow?"A":"B"},t.prototype._bufferLine=function(t,e,r,n,i){for(var o=t,s=e,a="";o!==r||s!==n;)o+=i?1:-1,i&&o>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(s,!1,t,o),t=o=0,s++):!i&&o<0&&(a+=this._terminal.buffer.translateBufferLineToString(s,!1,0,t+1),t=o=this._terminal.cols-1,s--);return a+this._terminal.buffer.translateBufferLineToString(s,!1,t,o)},t.prototype._sequence=function(t){var e=this._terminal.applicationCursor?"O":"[";return n.C0.ESC+e+t},t}();function o(t,e){t=Math.floor(t);for(var r="",n=0;n>9,c=0;c>9;if(0!==f){if(p!==l){if(1>>0})}for(r=0;r<24;r++){var s=8+10*r,a=c(s);t.push({css:"#"+a+a+a,rgba:(s<<24|s<<16|s<<8|255)>>>0})}return t}();var h=function(){function t(t,e){this.allowTransparency=e;var l=t.createElement("canvas");l.width=1,l.height=1,this._ctx=l.getContext("2d"),this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this.colors={foreground:n,background:i,cursor:o,cursorAccent:s,selection:a,ansi:r.DEFAULT_ANSI_COLORS.slice()}}return t.prototype.setTheme=function(t){this.colors.foreground=this._parseColor(t.foreground,n),this.colors.background=this._parseColor(t.background,i),this.colors.cursor=this._parseColor(t.cursor,o,!0),this.colors.cursorAccent=this._parseColor(t.cursorAccent,s,!0),this.colors.selection=this._parseColor(t.selection,a,!0),this.colors.ansi[0]=this._parseColor(t.black,r.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(t.red,r.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(t.green,r.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(t.yellow,r.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(t.blue,r.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(t.magenta,r.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(t.cyan,r.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(t.white,r.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(t.brightBlack,r.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(t.brightRed,r.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(t.brightGreen,r.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(t.brightYellow,r.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(t.brightBlue,r.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(t.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(t.brightCyan,r.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(t.brightWhite,r.DEFAULT_ANSI_COLORS[15])},t.prototype._parseColor=function(t,e,r){if(void 0===r&&(r=this.allowTransparency),!t)return e;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=t,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+t+" is invalid using fallback "+e.css),e;this._ctx.fillRect(0,0,1,1);var n=this._ctx.getImageData(0,0,1,1).data;return r||255===n[3]?{css:t,rgba:(n[0]<<24|n[1]<<16|n[2]<<8|n[3])>>>0}:(console.warn("Color: "+t+" is using transparency, but allowTransparency is false. Using fallback "+e.css+"."),e)},t}();r.ColorManager=h},{}],30:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=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])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o=t("../Buffer"),s=function(t){function e(e,r,n){var i=t.call(this,e,"cursor",r,!0,n)||this;return i._state={x:null,y:null,isFocused:null,style:null,width:null},i._cursorRenderers={bar:i._renderBarCursor.bind(i),block:i._renderBlockCursor.bind(i),underline:i._renderUnderlineCursor.bind(i)},i}return i(e,t),e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this._state={x:null,y:null,isFocused:null,style:null,width:null}},e.prototype.reset=function(t){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null,this.onOptionsChanged(t))},e.prototype.onBlur=function(t){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),t.refresh(t.buffer.y,t.buffer.y)},e.prototype.onFocus=function(t){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(t):t.refresh(t.buffer.y,t.buffer.y)},e.prototype.onOptionsChanged=function(t){var e=this;t.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new a(t,function(){e._render(t,!0)})):(this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null),t.refresh(t.buffer.y,t.buffer.y))},e.prototype.onCursorMove=function(t){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation(t)},e.prototype.onGridChanged=function(t,e,r){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(t,!1):this._cursorBlinkStateManager.restartBlinkAnimation(t)},e.prototype._render=function(t,e){if(t.cursorState&&!t.cursorHidden){var r=t.buffer.ybase+t.buffer.y,n=r-t.buffer.ydisp;if(n<0||n>=t.rows)this._clearCursor();else{var i=t.buffer.lines.get(r).get(t.buffer.x);if(i){if(!t.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(t,t.buffer.x,n,i),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=n,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,void(this._state.width=i[o.CHAR_DATA_WIDTH_INDEX]);if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t.buffer.x&&this._state.y===n&&this._state.isFocused===t.isFocused&&this._state.style===t.options.cursorStyle&&this._state.width===i[o.CHAR_DATA_WIDTH_INDEX])return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[t.options.cursorStyle||"block"](t,t.buffer.x,n,i),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=n,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,this._state.width=i[o.CHAR_DATA_WIDTH_INDEX]}else this._clearCursor()}}}else this._clearCursor()},e.prototype._clearCursor=function(){this._state&&(this.clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:null,y:null,isFocused:null,style:null,width:null})},e.prototype._renderBarCursor=function(t,e,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(e,r),this._ctx.restore()},e.prototype._renderBlockCursor=function(t,e,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(e,r,n[o.CHAR_DATA_WIDTH_INDEX],1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(t,n,e,r),this._ctx.restore()},e.prototype._renderUnderlineCursor=function(t,e,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(e,r),this._ctx.restore()},e.prototype._renderBlurCursor=function(t,e,r,n){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(e,r,n[o.CHAR_DATA_WIDTH_INDEX],1),this._ctx.restore()},e}(t("./BaseRenderLayer").BaseRenderLayer);r.CursorRenderLayer=s;var a=function(){function t(t,e){this._renderCallback=e,this.isCursorVisible=!0,t.isFocused&&this._restartInterval()}return Object.defineProperty(t.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=null),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=null),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)},t.prototype.restartBlinkAnimation=function(t){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){e._renderCallback(),e._animationFrame=null})))},t.prototype._restartInterval=function(t){var e=this;void 0===t&&(t=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout(function(){if(e._animationTimeRestarted){var t=600-(Date.now()-e._animationTimeRestarted);if(e._animationTimeRestarted=null,0=t.rows||a<0)){if(this._ctx.fillStyle=this._colors.selection.css,n){var l=e[0],c=r[0]-l,h=a-s+1;this.fillCells(l,s,c,h)}else{l=i===s?e[0]:0;var u=s===a?r[0]:t.cols;this.fillCells(l,s,u-l,1);var f=Math.max(a-s-1,0);if(this.fillCells(0,s+1,t.cols,f),s!==a){var p=o===a?r[0]:t.cols;this.fillCells(0,a,p,1)}}this._state.start=[e[0],e[1]],this._state.end=[r[0],r[1]],this._state.columnSelectMode=n,this._state.ydisp=t.buffer.ydisp}}},e.prototype._didStateChange=function(t,e,r,n){return!this._areCoordinatesEqual(t,this._state.start)||!this._areCoordinatesEqual(e,this._state.end)||r!==this._state.columnSelectMode||n!==this._state.ydisp},e.prototype._areCoordinatesEqual=function(t,e){return!(!t||!e)&&t[0]===e[0]&&t[1]===e[1]},e}(t("./BaseRenderLayer").BaseRenderLayer);r.SelectionRenderLayer=o},{"./BaseRenderLayer":27}],35:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=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])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o=t("../Buffer"),s=t("./atlas/Types"),a=t("./GridCache"),l=t("./BaseRenderLayer"),c=t("./atlas/CharAtlasUtils"),h=function(t){function e(e,r,n,i,o){var s=t.call(this,e,"text",r,o,n)||this;return s._characterOverlapCache={},s._state=new a.GridCache,s._characterJoinerRegistry=i,s}return i(e,t),e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r);var n=this._getFont(e,!1,!1);this._characterWidth===r.scaledCharWidth&&this._characterFont===n||(this._characterWidth=r.scaledCharWidth,this._characterFont=n,this._characterOverlapCache={}),this._state.clear(),this._state.resize(e.cols,e.rows)},e.prototype.reset=function(t){this._state.clear(),this.clearAll()},e.prototype._forEachCell=function(t,e,r,n,i){for(var a=e;a<=r;a++)for(var l=a+t.buffer.ydisp,c=t.buffer.lines.get(l),h=n?n.getJoinedCharacters(l):[],u=0;u>18,b=511&_,w=_>>9&511;if(8&C){var E=b;b=w,(w=E)===s.DEFAULT_COLOR&&(w=s.INVERTED_DEFAULT_COLOR),b===s.DEFAULT_COLOR&&(b=s.INVERTED_DEFAULT_COLOR)}i(p,d,m,u,a,w,b,C),u=g}}},e.prototype._drawBackground=function(t,e,r){var n=this,i=this._ctx,o=t.cols,a=0,l=0,h=null;i.save(),this._forEachCell(t,e,r,null,function(t,e,r,u,f,p,d,_){var m=null;d===s.INVERTED_DEFAULT_COLOR?m=n._colors.foreground.css:c.is256Color(d)&&(m=n._colors.ansi[d].css),null===h&&(a=u,l=f),f!==l?(i.fillStyle=h,n.fillCells(a,l,o-a,1),a=u,l=f):h!==m&&(i.fillStyle=h,n.fillCells(a,l,u-a,1),a=u,l=f),h=m}),null!==h&&(i.fillStyle=h,this.fillCells(a,l,o-a,1)),i.restore()},e.prototype._drawForeground=function(t,e,r){var n=this;this._forEachCell(t,e,r,this._characterJoinerRegistry,function(e,r,i,o,a,l,h,u){16&u||(2&u&&(n._ctx.save(),l===s.INVERTED_DEFAULT_COLOR?n._ctx.fillStyle=n._colors.background.css:c.is256Color(l)?n._ctx.fillStyle=n._colors.ansi[l].css:n._ctx.fillStyle=n._colors.foreground.css,n.fillBottomLineAtCells(o,a,i),n._ctx.restore()),n.drawChars(t,r,e,i,o,a,l,h,!!(1&u),!!(32&u),!!(64&u)))})},e.prototype.onGridChanged=function(t,e,r){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this.clearCells(0,e,t.cols,r-e+1),this._drawBackground(t,e,r),this._drawForeground(t,e,r))},e.prototype.onOptionsChanged=function(t){this.setTransparency(t,t.options.allowTransparency)},e.prototype._isOverlapping=function(t){if(1!==t[o.CHAR_DATA_WIDTH_INDEX])return!1;if(t[o.CHAR_DATA_CODE_INDEX]<256)return!1;var e=t[o.CHAR_DATA_CHAR_INDEX];if(this._characterOverlapCache.hasOwnProperty(e))return this._characterOverlapCache[e];this._ctx.save(),this._ctx.font=this._characterFont;var r=Math.floor(this._ctx.measureText(e).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[e]=r},e}(l.BaseRenderLayer);r.TextRenderLayer=h},{"../Buffer":2,"./BaseRenderLayer":27,"./GridCache":31,"./atlas/CharAtlasUtils":39,"./atlas/Types":44}],36:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(){this._didWarmUp=!1}return t.prototype.dispose=function(){},t.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},t.prototype._doWarmUp=function(){},t.prototype.beginFrame=function(){},t}();r.default=n},{}],37:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./CharAtlasUtils"),i=t("./DynamicCharAtlas"),o=t("./NoneCharAtlas"),s=t("./StaticCharAtlas"),a={none:o.default,static:s.default,dynamic:i.default},l=[];r.acquireCharAtlas=function(t,e,r,i){for(var o=n.generateConfig(r,i,t,e),s=0;s>>24,i=e.rgba>>>16&255,o=e.rgba>>>8&255,s=0;s=this.capacity)r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=t,r.value=e,this._map[t]=r;else{var n=this._nodePool;0e;)this._rowContainer.removeChild(this._rowElements.pop())},e.prototype.onResize=function(t,e){this._refreshRowElements(t,e),this._updateDimensions()},e.prototype.onCharSizeChanged=function(){this._updateDimensions()},e.prototype.onBlur=function(){this._rowContainer.classList.remove(d)},e.prototype.onFocus=function(){this._rowContainer.classList.add(d)},e.prototype.onSelectionChanged=function(t,e,r){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(t&&e){var n=t[1]-this._terminal.buffer.ydisp,i=e[1]-this._terminal.buffer.ydisp,o=Math.max(n,0),s=Math.min(i,this._terminal.rows-1);if(!(o>=this._terminal.rows||s<0)){var a=document.createDocumentFragment();if(r)a.appendChild(this._createSelectionElement(o,t[0],e[0],s-o+1));else{var l=n===o?t[0]:0,c=o===s?e[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(o,l,c));var h=s-o-1;if(a.appendChild(this._createSelectionElement(o+1,0,this._terminal.cols,h)),o!==s){var u=i===s?e[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(s,0,u))}}this._selectionContainer.appendChild(a)}}},e.prototype._createSelectionElement=function(t,e,r,n){void 0===n&&(n=1);var i=document.createElement("div");return i.style.height=n*this.dimensions.actualCellHeight+"px",i.style.top=t*this.dimensions.actualCellHeight+"px",i.style.left=e*this.dimensions.actualCellWidth+"px",i.style.width=this.dimensions.actualCellWidth*(r-e)+"px",i},e.prototype.onCursorMove=function(){},e.prototype.onOptionsChanged=function(){this._updateDimensions(),this.setTheme(void 0),this._terminal.refresh(0,this._terminal.rows-1)},e.prototype.clear=function(){this._rowElements.forEach(function(t){return t.innerHTML=""})},e.prototype.refreshRows=function(t,e){this._renderDebouncer.refresh(t,e)},e.prototype._renderRows=function(t,e){for(var r=this._terminal,n=r.buffer.ybase+r.buffer.y,i=this._terminal.buffer.x,o=t;o<=e;o++){var s=this._rowElements[o];s.innerHTML="";var a=o+r.buffer.ydisp,l=r.buffer.lines.get(a),c=r.options.cursorStyle;s.appendChild(this._rowFactory.createRow(l,a===n,c,i,this.dimensions.actualCellWidth,r.cols))}this._terminal.emit("refresh",{start:t,end:e})},Object.defineProperty(e.prototype,"_terminalSelector",{get:function(){return"."+h+this._terminalClass},enumerable:!0,configurable:!0}),e.prototype.registerCharacterJoiner=function(t){return-1},e.prototype.deregisterCharacterJoiner=function(t){return!1},e.prototype._onLinkHover=function(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!0)},e.prototype._onLinkLeave=function(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!1)},e.prototype._setCellUnderline=function(t,e,r,n,i,o){for(;t!==e||r!==n;){var s=this._rowElements[r];if(!s)return;var a=s.children[t];a&&(a.style.textDecoration=o?"underline":"none"),++t>=i&&(t=0,r++)}},e}(o.EventEmitter);r.DomRenderer=y},{"../../common/EventEmitter":18,"../../ui/RenderDebouncer":52,"../ColorManager":29,"../atlas/Types":44,"./DomRendererRowFactory":46}],46:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../../Buffer"),i=t("../atlas/Types");r.BOLD_CLASS="xterm-bold",r.ITALIC_CLASS="xterm-italic",r.CURSOR_CLASS="xterm-cursor",r.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",r.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",r.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var o=function(){function t(t){this._document=t}return t.prototype.createRow=function(t,e,o,s,a,l){for(var c=this._document.createDocumentFragment(),h=0,u=Math.min(t.length,l)-1;0<=u;u--){if((f=t.get(u))[n.CHAR_DATA_CODE_INDEX]!==n.NULL_CELL_CODE||e&&u===s){h=u+1;break}}for(u=0;u>18,g=511&d,v=d>>9&511;if(e&&u===s)switch(m.classList.add(r.CURSOR_CLASS),o){case"bar":m.classList.add(r.CURSOR_STYLE_BAR_CLASS);break;case"underline":m.classList.add(r.CURSOR_STYLE_UNDERLINE_CLASS);break;default:m.classList.add(r.CURSOR_STYLE_BLOCK_CLASS)}if(8&y){var C=g;g=v,(v=C)===i.DEFAULT_COLOR&&(v=i.INVERTED_DEFAULT_COLOR),g===i.DEFAULT_COLOR&&(g=i.INVERTED_DEFAULT_COLOR)}1&y&&(v<8&&(v+=8),m.classList.add(r.BOLD_CLASS)),64&y&&m.classList.add(r.ITALIC_CLASS),m.textContent=p,v!==i.DEFAULT_COLOR&&m.classList.add("xterm-fg-"+v),g!==i.DEFAULT_COLOR&&m.classList.add("xterm-bg-"+g),c.appendChild(m)}}return c},t}();r.DomRendererRowFactory=o},{"../../Buffer":2,"../atlas/Types":44}],47:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=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])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o=function(t){function e(e,r){var n=t.call(this)||this;return n._document=e,n._parentElement=r,n._measureElement=n._document.createElement("span"),n._measureElement.classList.add("xterm-char-measure-element"),n._measureElement.textContent="W",n._measureElement.setAttribute("aria-hidden","true"),n._parentElement.appendChild(n._measureElement),n}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(t){this._measureElement.style.fontFamily=t.fontFamily,this._measureElement.style.fontSize=t.fontSize+"px";var e=this._measureElement.getBoundingClientRect();0!==e.width&&0!==e.height&&(this._width===e.width&&this._height===e.height||(this._width=e.width,this._height=Math.ceil(e.height),this.emit("charsizechanged")))},e}(t("../common/EventEmitter").EventEmitter);r.CharMeasure=o},{"../common/EventEmitter":18}],48:[function(t,e,r){"use strict";function n(t){return t.replace(/\r?\n/g,"\r")}function i(t,e){return e?"[200~"+t+"[201~":t}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},200)}Object.defineProperty(r,"__esModule",{value:!0}),r.prepareTextForTerminal=n,r.bracketTextForPaste=i,r.copyHandler=function(t,e,r){e.browser.isMSIE?window.clipboardData.setData("Text",r.selectionText):t.clipboardData.setData("text/plain",r.selectionText),t.preventDefault()},r.pasteHandler=function(t,e){t.stopPropagation();var r=function(r){r=i(r=n(r),e.bracketedPasteMode),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"))},r.moveTextAreaUnderMouseCursor=o,r.rightClickHandler=function(t,e,r,n){o(t,e),n&&!r.isClickInSelection(t)&&r.selectWordAtCursor(t),e.value=r.selectionText,e.select()}},{}],49:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=function(t,e,r,n){return t.addEventListener(e,r,n),{dispose:function(){r&&(t.removeEventListener(e,r,n),r=t=null)}}}},{}],50:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(t){this._renderer=t}return t.prototype.setRenderer=function(t){this._renderer=t},t.getCoordsRelativeToElement=function(t,e){var r=e.getBoundingClientRect();return[t.clientX-r.left,t.clientY-r.top]},t.prototype.getCoords=function(e,r,n,i,o,s){if(!n.width||!n.height)return null;var a=t.getCoordsRelativeToElement(e,r);return a?(a[0]=Math.ceil((a[0]+(s?this._renderer.dimensions.actualCellWidth/2:0))/this._renderer.dimensions.actualCellWidth),a[1]=Math.ceil(a[1]/this._renderer.dimensions.actualCellHeight),a[0]=Math.min(Math.max(a[0],1),i+(s?1:0)),a[1]=Math.min(Math.max(a[1],1),o),a):null},t.prototype.getRawByteCoords=function(t,e,r,n,i){var o=this.getCoords(t,e,r,n,i),s=o[0],a=o[1];return{x:s+=32,y:a+=32}},t}();r.MouseHelper=n},{}],51:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=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])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o=t("../common/Lifecycle"),s=t("./Lifecycle"),a=function(t){function e(e){var r=t.call(this)||this;return r._terminal=e,r._zones=[],r._areZonesActive=!1,r._tooltipTimeout=null,r._currentZone=null,r._lastHoverCoords=[null,null],r.register(s.addDisposableDomListener(r._terminal.element,"mousedown",function(t){return r._onMouseDown(t)})),r._mouseMoveListener=function(t){return r._onMouseMove(t)},r._clickListener=function(t){return r._onClick(t)},r}return i(e,t),e.prototype.dispose=function(){t.prototype.dispose.call(this),this._deactivate()},e.prototype.add=function(t){this._zones.push(t),1===this._zones.length&&this._activate()},e.prototype.clearAll=function(t,e){if(0!==this._zones.length){e||(t=0,e=this._terminal.rows-1);for(var r=0;rt&&n.y1<=e+1||n.y2>t&&n.y2<=e+1||n.y1e+1)&&(this._currentZone&&this._currentZone===n&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(r--,1))}0===this._zones.length&&this._deactivate()}},e.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._terminal.element.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.addEventListener("click",this._clickListener))},e.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._terminal.element.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.removeEventListener("click",this._clickListener))},e.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},e.prototype._onHover=function(t){var e=this,r=this._findZoneEventAt(t);r!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),r&&((this._currentZone=r).hoverCallback&&r.hoverCallback(t),this._tooltipTimeout=setTimeout(function(){return e._onTooltip(t)},500)))},e.prototype._onTooltip=function(t){this._tooltipTimeout=null;var e=this._findZoneEventAt(t);e&&e.tooltipCallback&&e.tooltipCallback(t)},e.prototype._onMouseDown=function(t){if(this._areZonesActive){var e=this._findZoneEventAt(t);e&&e.willLinkActivate(t)&&(t.preventDefault(),t.stopImmediatePropagation())}},e.prototype._onClick=function(t){var e=this._findZoneEventAt(t);e&&(e.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},e.prototype._findZoneEventAt=function(t){var e=this._terminal.mouseHelper.getCoords(t,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows);if(!e)return null;for(var r=e[0],n=e[1],i=0;i=o.x1&&r=o.x1||n===o.y2&&ro.y1&&n=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();c("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var r=setTimeout(function(){t.skipReconnect||(c("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(c("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(c("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(r)}})}},p.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,r){var n=r(11),i=r(39),o=r(47),s=r(48);e.polling=function(t){var e=!1,r=!1,s=!1!==t.jsonp;if("undefined"!=typeof location){var a="https:"===location.protocol,l=location.port;l||(l=a?443:80),e=t.hostname!==location.hostname||l!==t.port,r=t.secure!==a}if(t.xdomain=e,t.xscheme=r,"open"in new n(t)&&!t.forceJSONP)return new i(t);if(!s)throw new Error("JSONP disabled");return new o(t)},e.websocket=s},function(t,e,r){var n=r(12),i=r(3),o=r(1),s=r(4),a=r(22),l=r(5)("engine.io-client:polling");t.exports=h;var c=null!=new(r(11))({xdomain:!1}).responseType;function h(t){var e=t&&t.forceBase64;c&&!e||(this.supportsBinary=!1),n.call(this,t)}s(h,n),h.prototype.name="polling",h.prototype.doOpen=function(){this.poll()},h.prototype.pause=function(t){var e=this;function r(){l("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(l("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){l("pre-pause polling complete"),--n||r()})),this.writable||(l("we are currently writing - waiting to pause"),n++,this.once("drain",function(){l("pre-pause writing complete"),--n||r()}))}else r()},h.prototype.poll=function(){l("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},h.prototype.onData=function(t){var e=this;l("polling got data %s",t),o.decodePayload(t,this.socket.binaryType,function(t,r,n){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():l('ignoring poll - transport state "%s"',this.readyState))},h.prototype.doClose=function(){var t=this;function e(){l("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(l("transport open - closing"),e()):(l("transport not open - deferring close"),this.once("open",e))},h.prototype.write=function(t){var e=this;this.writable=!1;var r=function(){e.writable=!0,e.emit("drain")};o.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,r)})},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(t[this.timestampParam]=a()),this.supportsBinary||t.sid||(t.b64=1),t=i.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(r=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+t}},function(t,e,r){(function(e){var n=r(9),i=Object.prototype.toString,o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===i.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===i.call(File);t.exports=function t(r){if(!r||"object"!=typeof r)return!1;if(n(r)){for(var i=0,a=r.length;i>16&255,a[l++]=e>>8&255,a[l++]=255&e;var f;return 2===s&&(e=i[t.charCodeAt(u)]<<2|i[t.charCodeAt(u+1)]>>4,a[l++]=255&e),1===s&&(e=i[t.charCodeAt(u)]<<10|i[t.charCodeAt(u+1)]<<4|i[t.charCodeAt(u+2)]>>2,a[l++]=e>>8&255,a[l++]=255&e),a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,l=(1<>1,h=-7,u=r?i-1:0,f=r?-1:1,p=t[e+u];for(u+=f,o=p&(1<<-h)-1,p>>=-h,h+=a;0>=-h,h+=n;0>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),2<=(e+=1<=s+u?f/l:f*Math.pow(2,1-u))*l&&(s++,l/=2),h<=s+u?(a=0,s=h):1<=s+u?(a=(e*l-1)*Math.pow(2,i),s+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,i),s=0));8<=i;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<>e&63|128)}function c(t,e){if(0==(4294967168&t))return o(t);var r="";return 0==(4294965248&t)?r=o(t>>6&31|192):0==(4294901760&t)?(a(t,e)||(t=65533),r=o(t>>12&15|224),r+=l(t,6)):0==(4292870144&t)&&(r=o(t>>18&7|240),r+=l(t,12),r+=l(t,6)),r+o(63&t|128)}function h(){if(n<=i)throw Error("Invalid byte index");var t=255&r[i];if(i++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function u(t){var e,o;if(n>>10&1023|55296),e=56320|1023&e),i+=o(e);return i}(c)}}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n>2],o+=t[(3&n[r])<<4|n[r+1]>>4],o+=t[(15&n[r+1])<<2|n[r+2]>>6],o+=t[63&n[r+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},e.decode=function(t){var e,n,i,o,s,a=.75*t.length,l=t.length,c=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[c++]=(15&i)<<4|o>>2,u[c++]=(3&o)<<6|63&s;return h}}()},function(t,e){var r=void 0!==r?r:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,n=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),i=n&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),o=r&&r.prototype.append&&r.prototype.getBlob;function s(t){return t.map(function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var r=new Uint8Array(t.byteLength);r.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=r.buffer}return e}return t})}function a(t,e){e=e||{};var n=new r;return s(t).forEach(function(t){n.append(t)}),e.type?n.getBlob(e.type):n.getBlob()}function l(t,e){return new Blob(s(t),e||{})}"undefined"!=typeof Blob&&(a.prototype=Blob.prototype,l.prototype=Blob.prototype),t.exports=n?i?Blob:l:o?a:void 0},function(t,e,r){function n(t){var r;function n(){if(n.enabled){var t=n,i=+new Date,o=i-(r||i);t.diff=o,t.prev=r,t.curr=i,r=i;for(var s=new Array(arguments.length),a=0;a';n=document.createElement(t)}catch(t){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form.action=this.uri(),h(),t=t.replace(a,"\\\n"),this.area.value=t.replace(s,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&c()}:this.iframe.onload=c}}).call(this,r(17))},function(t,e,r){(function(e){var n,i,o=r(12),s=r(1),a=r(3),l=r(4),c=r(22),h=r(5)("engine.io-client:websocket");if("undefined"==typeof self)try{i=r(49)}catch(l){}else n=self.WebSocket||self.MozWebSocket;var u=n||i;function f(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=n&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(u=i),o.call(this,t)}l(t.exports=f,o),f.prototype.name="websocket",f.prototype.supportsBinary=!0,f.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new u(t,e):new u(t):new u(t,e,r)}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()}},f.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)}},f.prototype.write=function(t){var r=this;this.writable=!1;for(var n=t.length,i=0,o=n;i>>0;r--;)e[r]=t[r];return e}function K(t){return t.classList?Y(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(t){return t})}function V(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function J(t){return Object.keys(t||{}).reduce(function(e,r){return e+"".concat(r,": ").concat(t[r],";")},"")}function Z(t){return t.size!==j.size||t.x!==j.x||t.y!==j.y||t.rotate!==j.rotate||t.flipX||t.flipY}function G(t){var e=t.transform,r=t.containerWidth,n=t.iconWidth,i={transform:"translate(".concat(r/2," 256)")},o="translate(".concat(32*e.x,", ").concat(32*e.y,") "),s="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),a="rotate(".concat(e.rotate," 0 0)");return{outer:i,inner:{transform:"".concat(o," ").concat(s," ").concat(a)},path:{transform:"translate(".concat(n/2*-1," -256)")}}}var $={x:0,y:0,width:"100%",height:"100%"};function Q(t){var e=t.icons,r=e.main,n=e.mask,i=t.prefix,o=t.iconName,s=t.transform,l=t.symbol,c=t.title,h=t.extra,u=t.watchable,f=void 0!==u&&u,p=n.found?n:r,d=p.width,_=p.height,m="fa-w-".concat(Math.ceil(d/_*16)),y=[F.replacementClass,o?"".concat(F.familyPrefix,"-").concat(o):"",m].filter(function(t){return-1===h.classes.indexOf(t)}).concat(h.classes).join(" "),g={children:[],attributes:a({},h.attributes,{"data-prefix":i,"data-icon":o,class:y,role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(d," ").concat(_)})};f&&(g.attributes[S]=""),c&&g.children.push({tag:"title",attributes:{id:g.attributes["aria-labelledby"]||"title-".concat(X())},children:[c]});var v,C,b,w,E,A,L,x,k,T,R,M,D,H,O,B,I,P,N,U,W,j,z=a({},g,{prefix:i,iconName:o,main:r,mask:n,transform:s,symbol:l,styles:h.styles}),q=n.found&&r.found?(C=(v=z).children,b=v.attributes,w=v.main,E=v.mask,A=v.transform,L=w.width,x=w.icon,k=E.width,T=E.icon,R=G({transform:A,containerWidth:k,iconWidth:L}),M={tag:"rect",attributes:a({},$,{fill:"white"})},D={tag:"g",attributes:a({},R.inner),children:[{tag:"path",attributes:a({},x.attributes,R.path,{fill:"black"})}]},H={tag:"g",attributes:a({},R.outer),children:[D]},O="mask-".concat(X()),I={tag:"defs",children:[{tag:"clipPath",attributes:{id:B="clip-".concat(X())},children:[T]},{tag:"mask",attributes:a({},$,{id:O,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[M,H]}]},C.push(I,{tag:"rect",attributes:a({fill:"currentColor","clip-path":"url(#".concat(B,")"),mask:"url(#".concat(O,")")},$)}),{children:C,attributes:b}):function(t){var e=t.children,r=t.attributes,n=t.main,i=t.transform,o=J(t.styles);if(0").concat(s.map(yt).join(""),"")}var gt=function(){};function vt(t){return"string"==typeof(t.getAttribute?t.getAttribute(S):null)}var Ct={replace:function(t){var e=t[0],r=t[1].map(function(t){return yt(t)}).join("\n");if(e.parentNode&&e.outerHTML)e.outerHTML=r+(F.keepOriginalSource&&"svg"!==e.tagName.toLowerCase()?"\x3c!-- ".concat(e.outerHTML," --\x3e"):"");else if(e.parentNode){var n=document.createElement("span");e.parentNode.replaceChild(n,e),n.outerHTML=r}},nest:function(t){var e=t[0],r=t[1];if(~K(e).indexOf(F.replacementClass))return Ct.replace(t);var n=new RegExp("".concat(F.familyPrefix,"-.*"));delete r[0].attributes.style;var i=r[0].attributes.class.split(" ").reduce(function(t,e){return e===F.replacementClass||e.match(n)?t.toSvg.push(e):t.toNode.push(e),t},{toNode:[],toSvg:[]});r[0].attributes.class=i.toSvg.join(" ");var o=r.map(function(t){return yt(t)}).join("\n");e.setAttribute("class",i.toNode.join(" ")),e.setAttribute(S,""),e.innerHTML=o}};function bt(t,e){var r="function"==typeof e?e:gt;0===t.length?r():(_.requestAnimationFrame||function(t){return t()})(function(){var e=!0===F.autoReplaceSvg?Ct.replace:Ct[F.autoReplaceSvg]||Ct.replace,n=ot.begin("mutate");t.map(e),n(),r()})}var wt=!1,Et=null;function At(t){for(var e="",r=0;r Start Log',console.log("stopping log, "+ae),ne=new Date,te+"\r\n\r\nLog End for "+ee+": "+ne.getFullYear()+"/"+(ne.getMonth()+1)+"/"+ne.getDate()+" @ "+ne.getHours()+":"+ne.getMinutes()+":"+ne.getSeconds()+"\r\n"):(le=ae=!0,logBtn.innerHTML=' Stop Log',downloadLogBtn.style.color="#000",downloadLogBtn.addEventListener("click",Ae),console.log("starting log, "+ae),ne=new Date,"Log Start for "+ee+": "+ne.getFullYear()+"/"+(ne.getMonth()+1)+"/"+ne.getDate()+" @ "+ne.getHours()+":"+ne.getMinutes()+":"+ne.getSeconds()+"\r\n\r\n"),re=ne,ue.focus(),!1}function Ae(){if(!0===le){ie="WebSSH2-"+re.getFullYear()+(re.getMonth()+1)+re.getDate()+"_"+re.getHours()+re.getMinutes()+re.getSeconds()+".log";var t=new Blob([te.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,ie);else{var e=window.document.createElement("a");e.href=window.URL.createObjectURL(t),e.download=ie,document.body.appendChild(e),e.click(),document.body.removeChild(e)}}ue.focus()}ue.on("data",function(t){se.emit("data",t)}),se.on("data",function(t){ue.write(t),ae&&(te+=t)}),se.on("connect",function(){se.emit("geometry",ue.cols,ue.rows)}),se.on("setTerminalOpts",function(t){ue.setOption("cursorBlink",t.cursorBlink),ue.setOption("scrollback",t.scrollback),ue.setOption("tabStopWidth",t.tabStopWidth),ue.setOption("bellStyle",t.bellStyle)}),se.on("title",function(t){document.title=t}),se.on("menu",function(t){Ce(t)}),se.on("status",function(t){fe.innerHTML=t}),se.on("ssherror",function(t){fe.innerHTML=t,fe.style.backgroundColor="red",oe=!0}),se.on("headerBackground",function(t){pe.style.backgroundColor=t}),se.on("header",function(t){t&&(pe.innerHTML=t,pe.style.display="block",me.style.height="calc(100% - 38px)",ye())}),se.on("footer",function(t){ee=t,_e.innerHTML=t}),se.on("statusBackground",function(t){fe.style.backgroundColor=t}),se.on("allowreplay",function(t){!0===t?(console.log("allowreplay: "+t),ce=!0,Ce(de.innerHTML+' Credentials')):(ce=!1,console.log("allowreplay: "+t))}),se.on("allowreauth",function(t){!0===t?(console.log("allowreauth: "+t),he=!0,Ce(de.innerHTML+' Switch User')):(he=!1,console.log("allowreauth: "+t))}),se.on("disconnect",function(t){oe||(fe.style.backgroundColor="red",fe.innerHTML="WEBSOCKET SERVER DISCONNECTED: "+t),se.io.reconnection(!1)}),se.on("error",function(t){oe||(fe.style.backgroundColor="red",fe.innerHTML="ERROR: "+t)}),se.on("reauth",function(){he&&be()}),ue.on("title",function(t){document.title=t})},function(t,e){},,,,,function(t,e){}]);