]> prime8.dev >> repos - ttyd.git/commitdiff
xterm.js 3.13.0
authorShuanglei Tao <tsl0922@gmail.com>
Wed, 15 May 2019 12:39:32 +0000 (20:39 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Wed, 15 May 2019 12:39:32 +0000 (20:39 +0800)
html/package.json
html/yarn.lock
src/index.html

index b872750e313a689082bd225bd8c5b2cc8d3cb271..7f3282f81f25a913d6b142cdc84d0df526448b31 100644 (file)
@@ -16,7 +16,7 @@
     "dependencies": {
         "core-js": "^2.5.3",
         "fast-text-encoding": "^1.0.0",
-        "xterm": "^3.12.2",
+        "xterm": "^3.13.0",
         "zmodem.js": "^0.1.7"
     },
     "devDependencies": {
index 18d0c43a02dea576fdeb94a39d676cfdf7f2cddf..4494eef03735258d7d8817ca884a73dbaa932a8a 100644 (file)
@@ -8902,10 +8902,10 @@ xdg-basedir@^3.0.0:
   resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
   integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68=
 
-xterm@^3.12.2:
-  version "3.12.2"
-  resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.12.2.tgz#ec8563857c7b098973bab4dbf537f1a7c6a790c8"
-  integrity sha512-FSXovDdsqIKqoayC6+zFzhaHi+A3NSceM5rgTW88DH7sS96HdwMToB2p1rW+FyNsSqfAgFwlXDRQk+fh/aHvPQ==
+xterm@^3.13.0:
+  version "3.13.0"
+  resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.13.0.tgz#d0e06c3cf4c1f079aa83f646948457db3b04220b"
+  integrity sha512-FZVmvkkbkky3zldJ2NNOZ9h8jirtbGTlF4sIKMDrejR4wPsVZ3o4F++DQVkdeZqjAwtNOMoR17PMSOTZ+h070g==
 
 y18n@^3.2.1:
   version "3.2.1"
index 7798c616df4ac786ae2a99789cb5d19c556533ac..5775b01acd9f9492d647bc562d3bbb1b60e790d6 100644 (file)
@@ -1 +1 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><title>ttyd - Terminal</title><link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA0xpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTgyRjc1RjA3MTZEMTFFNjg2M0NCOEY3RjJBMEY3N0EiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTgyRjc1RUY3MTZEMTFFNjg2M0NCOEY3RjJBMEY3N0EiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjU3YmQxNjhjLWI5ZDctMTE3OS1hM2RlLWZmNjQyYTM4NTJmMCIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjU3YmQxNjhjLWI5ZDctMTE3OS1hM2RlLWZmNjQyYTM4NTJmMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhsssMYAAALDSURBVHjaxFa9jxJBFH8zDMdCYrhIAppgIjaG5C5RQ+zO2Gty5gpbY2KsbOyu1MrGGEtj/A9stLPXs6CjJ5GYIF6AE5IDBHZmfG92F4ZzvQAnyyO7O8zX+73f+5gRd3bvvSgffN4/l948YgASFhQ9aWhqM6+pYfrVjD5WH9NK8f7x8ebNnVtvWC6b/RaPxy8zxsxmbB5lIfNsIDMggreezqG1o9GIGj8E45zFNzYgnU4D5xyUUkBglpFAKfgWa5gFY89rNVvgJJMgSBkpjcViIISA4XAI4/EYkBXTdyYQ9LOUU9sw7bmG2lqgPwwAKSV9D/P5/G2csNtoNJ71+32HFjqOszyQkDY9xLbrjkEorSe+wYGc67o72Wz2dSqV+tjr9e4iiAfdbnfL+G4B10wtDV/nBSYAN5O053eivVqtvq1UKr/RDaVCofCyVCo9ogXE0qISppgsJ3GlCzzGkQHcOEgT8n2xWLyfy+XeDwaDK7Va7Xm73X4YUHaaRfMwcbIPdTNBGWBSwkP3Ewdr9Xr9FcbAUwpICkyKAXuTRdkIAxH4QThOEn61W2YSKruAVpeJiUQiYRQjqHImk9nDjDiPijnO+d7pdN5hXOwRuGXdYRggANIdM9sy2tTeGPsuNpvNJwgkRVUMpYPdV5dJURsIZZ9WBEB6aRhKkeeWSzi2j9kxk8vLFqsABFkvlWSYhoqdni6zY2dRfHJfYoErvxBFLb5expVUDFlYCwDpM8CU0pEDoADUGH9YCf8dgKuQSRagXoo/Lg0Da3CBVwm9syBKBv46FfHNIlc+BYFZQHe0yBnQPgN0HFtV8H8VmXko8ABgEOo1uIDZMbCWALRiQAR/gkvpqsU+Rcl4gW9zR6JLCXXQ5XTVAKR/sqIvGODl89BnJfLHcRJNceP6tQ9fDr4+RmRHmAUqoiLEkOnM1vb2pz8CDACUMgcHE3VMqAAAAABJRU5ErkJggg==" /><style type="text/css">.xterm{font-feature-settings:"liga" 0;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:10}.xterm .xterm-helper-textarea{position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-10;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm{cursor:text}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:100;color:transparent}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.box{background-color:#fff;border-radius:5px;box-shadow:0 2px 3px hsla(0,0%,4%,.1),0 0 0 1px hsla(0,0%,4%,.1);color:#4a4a4a;display:block;padding:1.25rem}.progress{border:none;border-radius:290486px;display:block;height:1rem;overflow:hidden;padding:0;width:100%}.progress:not(:last-child){margin-bottom:1.5rem}.progress::-webkit-progress-bar{background-color:#dbdbdb}.progress::-webkit-progress-value{background-color:#3273dc}.progress::-moz-progress-bar{background-color:#3273dc}.progress::-ms-fill{background-color:#3273dc;border:none}.modal{bottom:0;left:0;right:0;top:0;align-items:center;display:none;overflow:hidden;position:fixed;z-index:40}.modal.is-active{display:flex}.file-input{height:.01em;left:0;outline:none;position:absolute;top:0;width:.01em}.file-cta,.file-name{align-items:center;box-shadow:none;display:inline-flex;height:2.25em;justify-content:flex-start;line-height:1.5;position:relative;vertical-align:top;border-color:#dbdbdb;border-radius:3px;font-size:1em;padding:calc(.375em - 1px) 1em;white-space:nowrap}.file-name{border-color:#dbdbdb;border-style:solid;border-width:1px 1px 1px 0;display:block;max-width:16em;overflow:hidden;text-align:left;text-overflow:ellipsis}.file-name:active,.file-name:focus{outline:none}.file-cta{background-color:#f5f5f5;color:#4a4a4a}.file-cta:active,.file-cta:focus{outline:none}.button{float:right;align-items:center;border-radius:2px;display:inline-flex;font-size:.75rem;height:2em;line-height:1.5;position:relative;vertical-align:top;background-color:#3273dc;border-color:transparent;color:#fff;cursor:pointer;justify-content:center;padding:calc(.375em - 1px) .75em;text-align:center;white-space:nowrap}.button:active,.button:focus{outline:none}.button:hover{background-color:#276cda;border-color:transparent;color:#fff}.modal-background{bottom:0;left:0;position:absolute;right:0;top:0;background-color:hsla(0,0%,4%,.86)}.modal-content{margin:0 20px;max-height:calc(100vh - 160px);overflow:auto;position:relative;width:100%}@media print,screen and (min-width:769px){.modal-content{margin:0 auto;max-height:calc(100vh - 40px);width:640px}}body,html{height:100%;min-height:100%;margin:0;overflow:hidden}#terminal-container{width:auto;height:100%;margin:0 auto;padding:0;background-color:#2b2b2b}#terminal-container .terminal{padding:5px}#modal strong{color:#268bd2}#modal span{color:#2aa198}#modal header{font-weight:700;text-align:center;padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid #ddd}#progress{padding-top:10px;color:#93a1a1}#progress progress{margin:10px 0}#progress span{font-weight:700}#status{margin-top:10px;text-align:center}#choose{padding-top:10px}#choose .file-name{border-color:transparent}#file-name{background-color:#fafffd;text-align:center}</style></head><body><div id="terminal-container"></div><div class="modal" id="modal"><div class="modal-background"></div><div class="modal-content"><div class="box"><header id="header"></header><div id="status"><strong>Files remaining: </strong><span id="files-remaining"></span>, <strong>Bytes remaining: </strong><span id="bytes-remaining"></span></div><div id="choose" class="file has-name is-fullwidth"><label class="file-label"><input id="files" class="file-input" type="file" multiple="multiple"> <span class="file-cta"><strong class="file-label">Choose file(s)… </strong></span><span id="file-names" class="file-name"></span></label></div><div id="progress"><p id="file-name"></p><progress id="progress-bar" class="progress" max="100"></progress><p id="progress-info"><span id="bytes-received">-</span>/<span id="bytes-file">-</span> (<span id="percent-received"></span>) transferred <a id="skip" class="button">Skip</a></p></div></div></div></div><script src="auth_token.js"></script><script type="text/javascript">!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=246)}([function(e,t,r){var n=r(3),i=r(11),o=r(16),s=r(33),a=r(20),l=function(e,t,r){var c,h,u,f,_=e&l.F,d=e&l.G,p=e&l.S,m=e&l.P,y=e&l.B,v=d?n:p?n[t]||(n[t]={}):(n[t]||{}).prototype,g=d?i:i[t]||(i[t]={}),b=g.prototype||(g.prototype={});for(c in d&&(r=t),r)u=((h=!_&&v&&void 0!==v[c])?v:r)[c],f=y&&h?a(u,n):m&&"function"==typeof u?a(Function.call,u):u,v&&s(v,c,u,e&l.U),g[c]!=u&&o(g,c,f),m&&b[c]!=u&&(b[c]=u)};n.core=i,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,r){var n=r(79)("wks"),i=r(29),o=r(3).Symbol,s="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=s&&o[e]||(s?o:i)("Symbol."+e))}).store=n},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){var n=r(59);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(25),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){e.exports=!r(7)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n=r(13),i=r(106),o=r(35),s=Object.defineProperty;t.f=r(6)?Object.defineProperty:function(e,t,r){if(n(e),t=o(t,!0),n(r),i)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(141),s=r(140),a=r(139),l=r(17),c=r(14);t.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.MAX_BUFFER_SIZE=4294967295,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32,t.FILL_CHAR_DATA=[t.DEFAULT_ATTR,t.NULL_CELL_CHAR,t.NULL_CELL_WIDTH,t.NULL_CELL_CODE];var h=function(){function e(e,t){this._terminal=e,this._hasScrollback=t,this.markers=[],this._cols=this._terminal.cols,this._rows=this._terminal.rows,this.clear()}return e.prototype.getBlankLine=function(e,r){var n=[e,t.NULL_CELL_CHAR,t.NULL_CELL_WIDTH,t.NULL_CELL_CODE];return new o.BufferLine(this._cols,n,r)},Object.defineProperty(e.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows},enumerable:!0,configurable:!0}),e.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;var r=e+this._terminal.options.scrollback;return r>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:r},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=t.DEFAULT_ATTR);for(var r=this._rows;r--;)this.lines.push(this.getBlankLine(e))}},e.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,r){var n=this._getCorrectBufferLength(r);if(n>this.lines.maxLength&&(this.lines.maxLength=n),this.lines.length>0){if(this._cols<e)for(var i=0;i<this.lines.length;i++)this.lines.get(i).resize(e,t.FILL_CHAR_DATA);var s=0;if(this._rows<r)for(var a=this._rows;a<r;a++)this.lines.length<r+this.ybase&&(this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e,t.FILL_CHAR_DATA)));else for(a=this._rows;a>r;a--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(n<this.lines.maxLength){var l=this.lines.length-n;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0)),this.lines.maxLength=n}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,r-1),s&&(this.y+=s),this.savedY=Math.min(this.savedY,r-1),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(e,r),this._cols>e))for(i=0;i<this.lines.length;i++)this.lines.get(i).resize(e,t.FILL_CHAR_DATA);this._cols=e,this._rows=r},Object.defineProperty(e.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._terminal.isWinptyCompatEnabled},enumerable:!0,configurable:!0}),e.prototype._reflow=function(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,t){var r=s.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y);if(r.length>0){var n=s.reflowLargerCreateNewLayout(this.lines,r);s.reflowLargerApplyNewLayout(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}},e.prototype._reflowLargerAdjustViewport=function(e,r,n){for(var i=n;i-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new o.BufferLine(e,t.FILL_CHAR_DATA))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--)},e.prototype._reflowSmaller=function(e,r){for(var n=[],i=0,o=this.lines.length-1;o>=0;o--){var a=this.lines.get(o);if(a.isWrapped||!(a.getTrimmedLength()<=e)){for(var l=[a];a.isWrapped&&o>0;)a=this.lines.get(--o),l.unshift(a);var c=this.ybase+this.y;if(!(c>=o&&c<o+l.length)){var h=l[l.length-1].getTrimmedLength(),u=s.reflowSmallerGetNewLineLengths(l,this._cols,e),f=u.length-l.length,_=void 0;_=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+f):Math.max(0,this.lines.length-this.lines.maxLength+f);for(var d=[],p=0;p<f;p++){var m=this.getBlankLine(t.DEFAULT_ATTR,!0);d.push(m)}d.length>0&&(n.push({start:o+l.length+i,newLines:d}),i+=d.length),l.push.apply(l,d);var y=u.length-1,v=u[y];0===v&&(v=u[--y]);for(var g=l.length-f-1,b=h;g>=0;){var C=Math.min(b,v);if(l[y].copyCellsFrom(l[g],b-C,v-C,C,!0),0===(v-=C)&&(v=u[--y]),0===(b-=C)){g--;var w=Math.max(g,0);b=s.getWrappedLineTrimmedLength(l,w,this._cols)}}for(p=0;p<l.length;p++)u[p]<e&&l[p].set(u[p],t.FILL_CHAR_DATA);for(var E=f-_;E-- >0;)0===this.ybase?this.y<r-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+i)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++)}}}if(n.length>0){var S=[],A=[];for(p=0;p<this.lines.length;p++)A.push(this.lines.get(p));var L=this.lines.length,x=L-1,k=0,T=n[k];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+i);var O=0;for(p=Math.min(this.lines.maxLength-1,L+i-1);p>=0;p--)if(T&&T.start>x+O){for(var R=T.newLines.length-1;R>=0;R--)this.lines.set(p--,T.newLines[R]);p++,S.push({index:x+1,amount:T.newLines.length}),O+=T.newLines.length,T=n[++k]}else this.lines.set(p,A[x--]);var M=0;for(p=S.length-1;p>=0;p--)S[p].index+=M,this.lines.emit("insert",S[p]),M+=S[p].amount;var D=Math.max(0,L+i-this.lines.maxLength);D>0&&this.lines.emitMayRemoveListeners("trim",D)}},e.prototype.stringIndexToBufferIndex=function(e,r,n){for(void 0===n&&(n=!1);r;){var i=this.lines.get(e);if(!i)return[-1,-1];for(var o=n?i.getTrimmedLength():i.length,s=0;s<o;++s)if(i.get(s)[t.CHAR_DATA_WIDTH_INDEX]&&(r-=i.get(s)[t.CHAR_DATA_CHAR_INDEX].length||1),r<0)return[e,s];e++}return[e,0]},e.prototype.translateBufferLineToString=function(e,t,r,n){void 0===r&&(r=0);var i=this.lines.get(e);return i?i.translateToString(t,r,n):""},e.prototype.getWrappedRangeForLine=function(e){for(var t=e,r=e;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}},e.prototype.setupTabStops=function(e){for(null!==e&&void 0!==e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._terminal.options.tabStopWidth)this.tabs[e]=!0},e.prototype.prevStop=function(e){for(null!==e&&void 0!==e||(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null!==e&&void 0!==e||(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,r=new u(e);return this.markers.push(r),r.register(this.lines.addDisposableListener("trim",function(e){r.line-=e,r.line<0&&r.dispose()})),r.register(this.lines.addDisposableListener("insert",function(e){r.line>=e.index&&(r.line+=e.amount)})),r.register(this.lines.addDisposableListener("delete",function(e){r.line>=e.index&&r.line<e.index+e.amount&&r.dispose(),r.line>e.index&&(r.line-=e.amount)})),r.register(r.addDisposableListener("dispose",function(){return t._removeMarker(r)})),r},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,r,n,i){return new f(this,e,t,r,n,i)},e}();t.Buffer=h;var u=function(e){function t(r){var n=e.call(this)||this;return n.line=r,n._id=t._nextId++,n.isDisposed=!1,n}return i(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.emit("dispose"),e.prototype.dispose.call(this))},t._nextId=1,t}(l.EventEmitter);t.Marker=u;var f=function(){function e(e,t,r,n,i,o){void 0===r&&(r=0),void 0===n&&(n=e.lines.length),void 0===i&&(i=0),void 0===o&&(o=0),this._buffer=e,this._trimRight=t,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 e.prototype.hasNext=function(){return this._current<this._endIndex},e.prototype.next=function(){var e=this._buffer.getWrappedRangeForLine(this._current);e.first<this._startIndex-this._startOverscan&&(e.first=this._startIndex-this._startOverscan),e.last>this._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",r=e.first;r<=e.last;++r)t+=this._buffer.translateBufferLineToString(r,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();t.BufferStringIterator=f},function(e,t,r){var n=r(45),i=r(59);e.exports=function(e){return n(i(e))}},function(e,t){var r=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=r)},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t){return!!e&&n(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,r){var n=r(2);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_COLOR=256,t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},function(e,t,r){var n=r(0),i=r(11),o=r(7);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],s={};s[e]=t(r),n(n.S+n.F*o(function(){r(1)}),"Object",s)}},function(e,t,r){var n=r(8),i=r(34);e.exports=r(6)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){var t=e.call(this)||this;return t._events=t._events||{},t}return i(t,e),t.prototype.on=function(e,t){this._events[e]=this._events[e]||[],this._events[e].push(t)},t.prototype.addDisposableListener=function(e,t){var r=this;this.on(e,t);var n=!1;return{dispose:function(){n||(r.off(e,t),n=!0)}}},t.prototype.off=function(e,t){if(this._events[e])for(var r=this._events[e],n=r.length;n--;)if(r[n]===t)return void r.splice(n,1)},t.prototype.removeAllListeners=function(e){this._events[e]&&delete this._events[e]},t.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(this._events[e])for(var n=this._events[e],i=0;i<n.length;i++)n[i].apply(this,t)},t.prototype.emitMayRemoveListeners=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(this._events[e])for(var n=this._events[e],i=n.length,o=0;o<n.length;o++)n[o].apply(this,t),o-=i-n.length,i=n.length},t.prototype.listeners=function(e){return this._events[e]||[]},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._events={}},t}(r(26).Disposable);t.EventEmitter=o},function(e,t,r){"use strict";if(r(6)){var n=r(30),i=r(3),o=r(7),s=r(0),a=r(51),l=r(65),c=r(20),h=r(68),u=r(34),f=r(16),_=r(66),d=r(25),p=r(5),m=r(91),y=r(31),v=r(35),g=r(21),b=r(42),C=r(2),w=r(4),E=r(76),S=r(46),A=r(43),L=r(40).f,x=r(74),k=r(29),T=r(1),O=r(24),R=r(58),M=r(52),D=r(70),H=r(32),I=r(73),P=r(56),F=r(71),B=r(101),N=r(8),j=r(22),W=N.f,U=j.f,Z=i.RangeError,z=i.TypeError,V=i.Uint8Array,K=Array.prototype,X=l.ArrayBuffer,G=l.DataView,Y=O(0),q=O(2),J=O(3),Q=O(4),$=O(5),ee=O(6),te=R(!0),re=R(!1),ne=D.values,ie=D.keys,oe=D.entries,se=K.lastIndexOf,ae=K.reduce,le=K.reduceRight,ce=K.join,he=K.sort,ue=K.slice,fe=K.toString,_e=K.toLocaleString,de=T("iterator"),pe=T("toStringTag"),me=k("typed_constructor"),ye=k("def_constructor"),ve=a.CONSTR,ge=a.TYPED,be=a.VIEW,Ce=O(1,function(e,t){return Le(M(e,e[ye]),t)}),we=o(function(){return 1===new V(new Uint16Array([1]).buffer)[0]}),Ee=!!V&&!!V.prototype.set&&o(function(){new V(1).set({})}),Se=function(e,t){var r=d(e);if(r<0||r%t)throw Z("Wrong offset!");return r},Ae=function(e){if(C(e)&&ge in e)return e;throw z(e+" is not a typed array!")},Le=function(e,t){if(!(C(e)&&me in e))throw z("It is not a typed array constructor!");return new e(t)},xe=function(e,t){return ke(M(e,e[ye]),t)},ke=function(e,t){for(var r=0,n=t.length,i=Le(e,n);n>r;)i[r]=t[r++];return i},Te=function(e,t,r){W(e,t,{get:function(){return this._d[r]}})},Oe=function(e){var t,r,n,i,o,s,a=w(e),l=arguments.length,h=l>1?arguments[1]:void 0,u=void 0!==h,f=x(a);if(void 0!=f&&!E(f)){for(s=f.call(a),n=[],t=0;!(o=s.next()).done;t++)n.push(o.value);a=n}for(u&&l>2&&(h=c(h,arguments[2],2)),t=0,r=p(a.length),i=Le(this,r);r>t;t++)i[t]=u?h(a[t],t):a[t];return i},Re=function(){for(var e=0,t=arguments.length,r=Le(this,t);t>e;)r[e]=arguments[e++];return r},Me=!!V&&o(function(){_e.call(new V(1))}),De=function(){return _e.apply(Me?ue.call(Ae(this)):Ae(this),arguments)},He={copyWithin:function(e,t){return B.call(Ae(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Q(Ae(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return F.apply(Ae(this),arguments)},filter:function(e){return xe(this,q(Ae(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return $(Ae(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Ae(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){Y(Ae(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return re(Ae(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Ae(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ce.apply(Ae(this),arguments)},lastIndexOf:function(e){return se.apply(Ae(this),arguments)},map:function(e){return Ce(Ae(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ae.apply(Ae(this),arguments)},reduceRight:function(e){return le.apply(Ae(this),arguments)},reverse:function(){for(var e,t=Ae(this).length,r=Math.floor(t/2),n=0;n<r;)e=this[n],this[n++]=this[--t],this[t]=e;return this},some:function(e){return J(Ae(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return he.call(Ae(this),e)},subarray:function(e,t){var r=Ae(this),n=r.length,i=y(e,n);return new(M(r,r[ye]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,p((void 0===t?n:y(t,n))-i))}},Ie=function(e,t){return xe(this,ue.call(Ae(this),e,t))},Pe=function(e){Ae(this);var t=Se(arguments[1],1),r=this.length,n=w(e),i=p(n.length),o=0;if(i+t>r)throw Z("Wrong length!");for(;o<i;)this[t+o]=n[o++]},Fe={entries:function(){return oe.call(Ae(this))},keys:function(){return ie.call(Ae(this))},values:function(){return ne.call(Ae(this))}},Be=function(e,t){return C(e)&&e[ge]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},Ne=function(e,t){return Be(e,t=v(t,!0))?u(2,e[t]):U(e,t)},je=function(e,t,r){return!(Be(e,t=v(t,!0))&&C(r)&&g(r,"value"))||g(r,"get")||g(r,"set")||r.configurable||g(r,"writable")&&!r.writable||g(r,"enumerable")&&!r.enumerable?W(e,t,r):(e[t]=r.value,e)};ve||(j.f=Ne,N.f=je),s(s.S+s.F*!ve,"Object",{getOwnPropertyDescriptor:Ne,defineProperty:je}),o(function(){fe.call({})})&&(fe=_e=function(){return ce.call(this)});var We=_({},He);_(We,Fe),f(We,de,Fe.values),_(We,{slice:Ie,set:Pe,constructor:function(){},toString:fe,toLocaleString:De}),Te(We,"buffer","b"),Te(We,"byteOffset","o"),Te(We,"byteLength","l"),Te(We,"length","e"),W(We,pe,{get:function(){return this[ge]}}),e.exports=function(e,t,r,l){var c=e+((l=!!l)?"Clamped":"")+"Array",u="get"+e,_="set"+e,d=i[c],y=d||{},v=d&&A(d),g=!d||!a.ABV,w={},E=d&&d.prototype,x=function(e,r){W(e,r,{get:function(){return function(e,r){var n=e._d;return n.v[u](r*t+n.o,we)}(this,r)},set:function(e){return function(e,r,n){var i=e._d;l&&(n=(n=Math.round(n))<0?0:n>255?255:255&n),i.v[_](r*t+i.o,n,we)}(this,r,e)},enumerable:!0})};g?(d=r(function(e,r,n,i){h(e,d,c,"_d");var o,s,a,l,u=0,_=0;if(C(r)){if(!(r instanceof X||"ArrayBuffer"==(l=b(r))||"SharedArrayBuffer"==l))return ge in r?ke(d,r):Oe.call(d,r);o=r,_=Se(n,t);var y=r.byteLength;if(void 0===i){if(y%t)throw Z("Wrong length!");if((s=y-_)<0)throw Z("Wrong length!")}else if((s=p(i)*t)+_>y)throw Z("Wrong length!");a=s/t}else a=m(r),o=new X(s=a*t);for(f(e,"_d",{b:o,o:_,l:s,e:a,v:new G(o)});u<a;)x(e,u++)}),E=d.prototype=S(We),f(E,"constructor",d)):o(function(){d(1)})&&o(function(){new d(-1)})&&I(function(e){new d,new d(null),new d(1.5),new d(e)},!0)||(d=r(function(e,r,n,i){var o;return h(e,d,c),C(r)?r instanceof X||"ArrayBuffer"==(o=b(r))||"SharedArrayBuffer"==o?void 0!==i?new y(r,Se(n,t),i):void 0!==n?new y(r,Se(n,t)):new y(r):ge in r?ke(d,r):Oe.call(d,r):new y(m(r))}),Y(v!==Function.prototype?L(y).concat(L(v)):L(y),function(e){e in d||f(d,e,y[e])}),d.prototype=E,n||(E.constructor=d));var k=E[de],T=!!k&&("values"==k.name||void 0==k.name),O=Fe.values;f(d,me,!0),f(E,ge,c),f(E,be,!0),f(E,ye,d),(l?new d(1)[pe]==c:pe in E)||W(E,pe,{get:function(){return c}}),w[c]=d,s(s.G+s.W+s.F*(d!=y),w),s(s.S,c,{BYTES_PER_ELEMENT:t}),s(s.S+s.F*o(function(){y.of.call(d,1)}),c,{from:Oe,of:Re}),"BYTES_PER_ELEMENT"in E||f(E,"BYTES_PER_ELEMENT",t),s(s.P,c,He),P(c),s(s.P+s.F*Ee,c,{set:Pe}),s(s.P+s.F*!T,c,Fe),n||E.toString==fe||(E.toString=fe),s(s.P+s.F*o(function(){new d(1).slice()}),c,{slice:Ie}),s(s.P+s.F*(o(function(){return[1,2].toLocaleString()!=new d([1,2]).toLocaleString()})||!o(function(){E.toLocaleString.call([1,2])})),c,{toLocaleString:De}),H[c]=T?k:O,n||T||f(E,de,O)}}else e.exports=function(){}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){var n=r(19);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(41),i=r(34),o=r(10),s=r(35),a=r(21),l=r(106),c=Object.getOwnPropertyDescriptor;t.f=r(6)?c:function(e,t){if(e=o(e),t=s(t,!0),l)try{return c(e,t)}catch(e){}if(a(e,t))return i(!n.f.call(e,t),e[t])}},function(e,t,r){var n=r(1)("unscopables"),i=Array.prototype;void 0==i[n]&&r(16)(i,n,{}),e.exports=function(e){i[n][e]=!0}},function(e,t,r){var n=r(20),i=r(45),o=r(4),s=r(5),a=r(72);e.exports=function(e,t){var r=1==e,l=2==e,c=3==e,h=4==e,u=6==e,f=5==e||u,_=t||a;return function(t,a,d){for(var p,m,y=o(t),v=i(y),g=n(a,d,3),b=s(v.length),C=0,w=r?_(t,b):l?_(t,0):void 0;b>C;C++)if((f||C in v)&&(m=g(p=v[C],C,y),e))if(r)w[C]=m;else if(m)switch(e){case 3:return!0;case 5:return p;case 6:return C;case 2:w.push(p)}else if(h)return!1;return u?-1:c||h?h:w}}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._disposables=[],this._isDisposed=!1}return e.prototype.dispose=function(){this._isDisposed=!0,this._disposables.forEach(function(e){return e.dispose()}),this._disposables.length=0},e.prototype.register=function(e){this._disposables.push(e)},e.prototype.unregister=function(e){var t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)},e}();t.Disposable=n},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n=r(104),i=r(78);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t){e.exports=!1},function(e,t,r){var n=r(25),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):o(e,t)}},function(e,t){e.exports={}},function(e,t,r){var n=r(3),i=r(16),o=r(21),s=r(29)("src"),a=Function.toString,l=(""+a).split("toString");r(11).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,r,a){var c="function"==typeof r;c&&(o(r,"name")||i(r,"name",t)),e[t]!==r&&(c&&(o(r,s)||i(r,s,e[t]?""+e[t]:l.join(String(t)))),e===n?e[t]=r:a?e[t]?e[t]=r:i(e,t,r):(delete e[t],i(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n=r(2);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="undefined"==typeof navigator,i=n?"node":navigator.userAgent,o=n?"node":navigator.platform;function s(e,t){return e.indexOf(t)>=0}t.isFirefox=!!~i.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.isMSIE=!!~i.indexOf("MSIE")||!!~i.indexOf("Trident"),t.isMac=s(["Macintosh","MacIntel","MacPPC","Mac68K"],o),t.isIpad="iPad"===o,t.isIphone="iPhone"===o,t.isMSWindows=s(["Windows","Win16","Win32","WinCE"],o),t.isLinux=o.indexOf("Linux")>=0},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14);t.generateConfig=function(e,t,r,n){var i={foreground:n.foreground,background:n.background,cursor:null,cursorAccent:null,selection:null,ansi:n.ansi.slice(0,16)};return{type:r.options.experimentalCharAtlas,devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:r.options.fontFamily,fontSize:r.options.fontSize,fontWeight:r.options.fontWeight,fontWeightBold:r.options.fontWeightBold,allowTransparency:r.options.allowTransparency,colors:i}},t.configEquals=function(e,t){for(var r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==t.colors.ansi[r].rgba)return!1;return e.type===t.type&&e.devicePixelRatio===t.devicePixelRatio&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.scaledCharWidth===t.scaledCharWidth&&e.scaledCharHeight===t.scaledCharHeight&&e.colors.foreground===t.colors.foreground&&e.colors.background===t.colors.background},t.is256Color=function(e){return e<n.DEFAULT_COLOR}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i={aborted:"Session aborted",peer_aborted:"Peer aborted session",already_aborted:"Session already aborted",crc:function(e,t){return this.got=e.slice(0),this.expected=t.slice(0),"CRC check failed! (got: "+e.join()+"; expected: "+t.join()+")"},validation:function(e){return e}};e.exports.Error=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=function(e){var t=i[e];switch(void 0===t?"undefined":n(t)){case"string":return t;case"function":var r=[].slice.call(arguments).slice(1);return t.apply(this,r)}return null}.apply(r,arguments);return o?(r.type=e,r.message=o):r.message=e,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Error),t}()},function(e,t,r){"use strict";e.exports.ZMLIB={ZDLE:24,XON:17,XOFF:19,ABORT_SEQUENCE:[24,24,24,24,24],strip_ignored_bytes:function(e){for(var t=e.length-1;t>=0;t--)switch(e[t]){case 17:case 145:case 19:case 147:e.splice(t,1);continue}return e},find_subarray:function(e,t){var r,n=0;Date.now();e:for(;-1!==n&&-1!==(n=e.indexOf(t[0],n));){for(r=1;r<t.length;r++)if(e[n+r]!==t[r]){n++;continue e}return n}return-1}}},function(e,t,r){var n=r(104),i=r(78).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){var n=r(27),i=r(1)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,r,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:o?n(t):"Object"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,r){var n=r(21),i=r(4),o=r(80)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,r){var n=r(8).f,i=r(21),o=r(1)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,r){var n=r(27);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){var n=r(13),i=r(105),o=r(78),s=r(80)("IE_PROTO"),a=function(){},l=function(){var e,t=r(81)("iframe"),n=o.length;for(t.style.display="none",r(77).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;n--;)delete l.prototype[o[n]];return l()};e.exports=Object.create||function(e,t){var r;return null!==e?(a.prototype=n(e),r=new a,a.prototype=null,r[s]=e):r=l(),void 0===t?r:i(r,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=l("#ffffff"),i=l("#000000"),o=l("#ffffff"),s=l("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967159};function l(e){return{css:e,rgba:parseInt(e.slice(1),16)<<8|255}}function c(e){var t=e.toString(16);return t.length<2?"0"+t:t}t.DEFAULT_ANSI_COLORS=function(){for(var e=[l("#2e3436"),l("#cc0000"),l("#4e9a06"),l("#c4a000"),l("#3465a4"),l("#75507b"),l("#06989a"),l("#d3d7cf"),l("#555753"),l("#ef2929"),l("#8ae234"),l("#fce94f"),l("#729fcf"),l("#ad7fa8"),l("#34e2e2"),l("#eeeeec")],t=[0,95,135,175,215,255],r=0;r<216;r++){var n=t[r/36%6|0],i=t[r/6%6|0],o=t[r%6];e.push({css:"#"+c(n)+c(i)+c(o),rgba:(n<<24|i<<16|o<<8|255)>>>0})}for(r=0;r<24;r++){var s=8+10*r,a=c(s);e.push({css:"#"+a+a+a,rgba:(s<<24|s<<16|s<<8|255)>>>0})}return e}();var h=function(){function e(e,r){this.allowTransparency=r;var l=e.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:t.DEFAULT_ANSI_COLORS.slice()}}return e.prototype.setTheme=function(e){this.colors.foreground=this._parseColor(e.foreground,n),this.colors.background=this._parseColor(e.background,i),this.colors.cursor=this._parseColor(e.cursor,o,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,s,!0),this.colors.selection=this._parseColor(e.selection,a,!0),this.colors.ansi[0]=this._parseColor(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15])},e.prototype._parseColor=function(e,t,r){if(void 0===r&&(r=this.allowTransparency),!e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var n=this._ctx.getImageData(0,0,1,1).data;return r||255===n[3]?{css:e,rgba:(n[0]<<24|n[1]<<16|n[2]<<8|n[3])>>>0}:(console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t)},e}();t.ColorManager=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),i=r(86),o=r(9),s=r(37),a=function(){function e(e,t,r,n,i){this._container=e,this._alpha=n,this._colors=i,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+t+"-layer"),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return e.prototype.dispose=function(){this._container.removeChild(this._canvas),this._charAtlas&&this._charAtlas.dispose()},e.prototype._initCanvas=function(){this._ctx=this._canvas.getContext("2d",{alpha:this._alpha}),this._alpha||this.clearAll()},e.prototype.onOptionsChanged=function(e){},e.prototype.onBlur=function(e){},e.prototype.onFocus=function(e){},e.prototype.onCursorMove=function(e){},e.prototype.onGridChanged=function(e,t,r){},e.prototype.onSelectionChanged=function(e,t,r,n){void 0===n&&(n=!1)},e.prototype.onThemeChanged=function(e,t){this._refreshCharAtlas(e,t)},e.prototype.setTransparency=function(e,t){if(t!==this._alpha){var r=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._colors),this.onGridChanged(e,0,e.rows-1)}},e.prototype._refreshCharAtlas=function(e,t){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=i.acquireCharAtlas(e,t,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},e.prototype.resize=function(e,t){this._scaledCellWidth=t.scaledCellWidth,this._scaledCellHeight=t.scaledCellHeight,this._scaledCharWidth=t.scaledCharWidth,this._scaledCharHeight=t.scaledCharHeight,this._scaledCharLeft=t.scaledCharLeft,this._scaledCharTop=t.scaledCharTop,this._canvas.width=t.scaledCanvasWidth,this._canvas.height=t.scaledCanvasHeight,this._canvas.style.width=t.canvasWidth+"px",this._canvas.style.height=t.canvasHeight+"px",this._alpha||this.clearAll(),this._refreshCharAtlas(e,this._colors)},e.prototype.fillCells=function(e,t,r,n){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight)},e.prototype.fillBottomLineAtCells=function(e,t,r){void 0===r&&(r=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,r*this._scaledCellWidth,window.devicePixelRatio)},e.prototype.fillLeftLineAtCell=function(e,t){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)},e.prototype.strokeRectAtCell=function(e,t,r,n){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,r*this._scaledCellWidth-window.devicePixelRatio,n*this._scaledCellHeight-window.devicePixelRatio)},e.prototype.clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},e.prototype.clearCells=function(e,t,r,n){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight))},e.prototype.fillCharTrueColor=function(e,t,r,n){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline="middle",this._clipRow(e,n),this._ctx.fillText(t[o.CHAR_DATA_CHAR_INDEX],r*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},e.prototype.drawChars=function(e,t,r,i,o,s,a,l,c,h,u){a+=e.options.drawBoldTextInBrightColors&&c&&a<8&&a!==n.INVERTED_DEFAULT_COLOR?8:0,this._currentGlyphIdentifier.chars=t,this._currentGlyphIdentifier.code=r,this._currentGlyphIdentifier.bg=l,this._currentGlyphIdentifier.fg=a,this._currentGlyphIdentifier.bold=c&&e.options.enableBold,this._currentGlyphIdentifier.dim=h,this._currentGlyphIdentifier.italic=u,this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,o*this._scaledCellWidth+this._scaledCharLeft,s*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,i,a,o,s,c&&e.options.enableBold,h,u)},e.prototype._drawUncachedChars=function(e,t,r,i,o,a,l,c,h){this._ctx.save(),this._ctx.font=this._getFont(e,l,h),this._ctx.textBaseline="middle",i===n.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:s.is256Color(i)?this._ctx.fillStyle=this._colors.ansi[i].css:this._ctx.fillStyle=this._colors.foreground.css,this._clipRow(e,a),c&&(this._ctx.globalAlpha=n.DIM_OPACITY),this._ctx.fillText(t,o*this._scaledCellWidth+this._scaledCharLeft,a*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},e.prototype._clipRow=function(e,t){this._ctx.beginPath(),this._ctx.rect(0,t*this._scaledCellHeight,e.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},e.prototype._getFont=function(e,t,r){var n=t?e.options.fontWeightBold:e.options.fontWeight;return(r?"italic":"")+" "+n+" "+e.options.fontSize*window.devicePixelRatio+"px "+e.options.fontFamily},e}();t.BaseRenderLayer=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.NUL="\0",e.SOH="\ 1",e.STX="\ 2",e.ETX="\ 3",e.EOT="\ 4",e.ENQ="\ 5",e.ACK="\ 6",e.BEL="\a",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="\ e",e.SI="\ f",e.DLE="\10",e.DC1="\11",e.DC2="\12",e.DC3="\13",e.DC4="\14",e.NAK="\15",e.SYN="\16",e.ETB="\17",e.CAN="\18",e.EM="\19",e.SUB="\1a",e.ESC="\e",e.FS="\1c",e.GS="\1d",e.RS="\1e",e.US="\1f",e.SP=" ",e.DEL="\7f"}(t.C0||(t.C0={})),function(e){e.PAD="\80",e.HOP="\81",e.BPH="\82",e.NBH="\83",e.IND="\84",e.NEL="\85",e.SSA="\86",e.ESA="\87",e.HTS="\88",e.HTJ="\89",e.VTS="\8a",e.PLD="\8b",e.PLU="\8c",e.RI="\8d",e.SS2="\8e",e.SS3="\8f",e.DCS="\90",e.PU1="\91",e.PU2="\92",e.STS="\93",e.CCH="\94",e.MW="\95",e.SPA="\96",e.EPA="\97",e.SOS="\98",e.SGCI="\99",e.SCI="\9a",e.CSI="\9b",e.ST="\9c",e.OSC="\9d",e.PM="\9e",e.APC="\9f"}(t.C1||(t.C1={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=function(e,t,r,n){return e.addEventListener(t,r,n),{dispose:function(){r&&(e.removeEventListener(t,r,n),e=null,r=null)}}}},function(e,t,r){for(var n,i=r(3),o=r(16),s=r(29),a=s("typed_array"),l=s("view"),c=!(!i.ArrayBuffer||!i.DataView),h=c,u=0,f="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");u<9;)(n=i[f[u++]])?(o(n.prototype,a,!0),o(n.prototype,l,!0)):h=!1;e.exports={ABV:c,CONSTR:h,TYPED:a,VIEW:l}},function(e,t,r){var n=r(13),i=r(19),o=r(1)("species");e.exports=function(e,t){var r,s=n(e).constructor;return void 0===s||void 0==(r=n(s)[o])?t:i(r)}},function(e,t,r){"use strict";e.exports=r(30)||!r(7)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete r(3)[e]})},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(29)("meta"),i=r(2),o=r(21),s=r(8).f,a=0,l=Object.isExtensible||function(){return!0},c=!r(7)(function(){return l(Object.preventExtensions({}))}),h=function(e){s(e,n,{value:{i:"O"+ ++a,w:{}}})},u=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,n)){if(!l(e))return"F";if(!t)return"E";h(e)}return e[n].i},getWeak:function(e,t){if(!o(e,n)){if(!l(e))return!0;if(!t)return!1;h(e)}return e[n].w},onFreeze:function(e){return c&&u.NEED&&l(e)&&!o(e,n)&&h(e),e}}},function(e,t,r){"use strict";var n=r(3),i=r(8),o=r(6),s=r(1)("species");e.exports=function(e){var t=n[e];o&&t&&!t[s]&&i.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,r){var n=r(27);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){var n=r(10),i=r(5),o=r(31);e.exports=function(e){return function(t,r,s){var a,l=n(t),c=i(l.length),h=o(s,c);if(e&&r!=r){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((e||h in l)&&l[h]===r)return e||h||0;return!e&&-1}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on  "+e);return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blankLine="Blank line",t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this._terminal=e,this._callback=t,this._animationFrame=null}return e.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)},e.prototype.refresh=function(e,t){var r=this;e=null!==e&&void 0!==e?e:0,t=null!==t&&void 0!==t?t:this._terminal.rows-1;var n=void 0!==this._rowStart&&null!==this._rowStart,i=void 0!==this._rowEnd&&null!==this._rowEnd;this._rowStart=n?Math.min(this._rowStart,e):e,this._rowEnd=i?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return r._innerRefresh()}))},e.prototype._innerRefresh=function(){this._rowStart=Math.max(this._rowStart,0),this._rowEnd=Math.min(this._rowEnd,this._terminal.rows-1),this._callback(this._rowStart,this._rowEnd),this._rowStart=null,this._rowEnd=null,this._animationFrame=null},e}();t.RenderDebouncer=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();t.default=n},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,o,s=e.exports;Object.assign(s,r(39));var a=s.ZMLIB.ZDLE;s.ZDLE=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config={},t&&this.set_escape_ctrl_chars(!!t.escape_ctrl_chars)}return n(e,[{key:"set_escape_ctrl_chars",value:function(e){if("boolean"!=typeof e)throw"need boolean!";e!==this._config.escape_ctrl_chars&&(this._config.escape_ctrl_chars=e,this._setup_zdle_table())}},{key:"escapes_ctrl_chars",value:function(){return!!this._config.escape_ctrl_chars}},{key:"encode",value:function(e){if(!this._zdle_table)throw"No ZDLE encode table configured!";var t=this._zdle_table,r=this._lastcode,n=new ArrayBuffer(2*e.length),s=new Uint8Array(n),l=this._config.escape_ctrl_chars,c=0;for(i=0;i<e.length;i++){if(!(o=t[e[i]]))throw console.trace(),console.error("bad encode() call:",JSON.stringify(e)),this._lastcode=r,"Invalid octet: "+e[i];r=e[i],1===o||(l||2===o||64==(127&r))&&(s[c]=a,c++,r^=64),s[c]=r,c++}return this._lastcode=r,e.splice(0),e.push.apply(e,new Uint8Array(n,0,c)),e}},{key:"_setup_zdle_table",value:function(){for(var e=new Array(256),t=0;t<e.length;t++)if(96&t)e[t]=1;else switch(t){case a:case s.ZMLIB.XOFF:case s.ZMLIB.XON:case 128|s.ZMLIB.XOFF:case 128|s.ZMLIB.XON:e[t]=2;break;case 16:case 144:e[t]=this._config.turbo_escape?1:2;break;case 13:case 141:e[t]=this._config.escape_ctrl_chars?2:this._config.turbo_escape?1:3;break;default:e[t]=this._config.escape_ctrl_chars?2:1}this._zdle_table=e}}],[{key:"decode",value:function(e){for(var t=e.length-1;t>=0;t--)e[t]===a&&e.splice(t,2,e[t+1]-64);return e}},{key:"splice",value:function(t,r,n){var i=0;r||(r=0);for(var o=r;o<t.length&&i<n;o++)i++,t[o]===a&&o++;if(i===n){if(t.length===o-1)return;return t.splice(0,r),e.decode(t.splice(0,o-r))}}}]),e}()},function(e,t,r){"use strict";for(var n=e.exports,i=[48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102],o={},s=0;s<i.length;s++)o[i[s]]=s;n.ENCODELIB={pack_u16_be:function(e){if(e>65535)throw"Number cannot exceed 16 bits: "+e;return[e>>8,255&e]},pack_u32_le:function(e){var t=e/65536;return[255&e,(65535&e)>>8,255&t,t>>8]},unpack_u16_be:function(e){return(e[0]<<8)+e[1]},unpack_u32_le:function(e){return e[0]+(e[1]<<8)+(e[2]<<16)+16777216*e[3]},octets_to_hex:function(e){for(var t=[],r=0;r<e.length;r++)t.push(i[e[r]>>4],i[15&e[r]]);return t},parse_hex_octets:function(e){for(var t=new Array(e.length/2),r=0;r<t.length;r++)t[r]=(o[e[2*r]]<<4)+o[e[1+2*r]];return t}}},function(e,t,r){"use strict";var n=r(3),i=r(6),o=r(30),s=r(51),a=r(16),l=r(66),c=r(7),h=r(68),u=r(25),f=r(5),_=r(91),d=r(40).f,p=r(8).f,m=r(71),y=r(44),v="prototype",g="Wrong index!",b=n.ArrayBuffer,C=n.DataView,w=n.Math,E=n.RangeError,S=n.Infinity,A=b,L=w.abs,x=w.pow,k=w.floor,T=w.log,O=w.LN2,R=i?"_b":"buffer",M=i?"_l":"byteLength",D=i?"_o":"byteOffset";function H(e,t,r){var n,i,o,s=new Array(r),a=8*r-t-1,l=(1<<a)-1,c=l>>1,h=23===t?x(2,-24)-x(2,-77):0,u=0,f=e<0||0===e&&1/e<0?1:0;for((e=L(e))!=e||e===S?(i=e!=e?1:0,n=l):(n=k(T(e)/O),e*(o=x(2,-n))<1&&(n--,o*=2),(e+=n+c>=1?h/o:h*x(2,1-c))*o>=2&&(n++,o/=2),n+c>=l?(i=0,n=l):n+c>=1?(i=(e*o-1)*x(2,t),n+=c):(i=e*x(2,c-1)*x(2,t),n=0));t>=8;s[u++]=255&i,i/=256,t-=8);for(n=n<<t|i,a+=t;a>0;s[u++]=255&n,n/=256,a-=8);return s[--u]|=128*f,s}function I(e,t,r){var n,i=8*r-t-1,o=(1<<i)-1,s=o>>1,a=i-7,l=r-1,c=e[l--],h=127&c;for(c>>=7;a>0;h=256*h+e[l],l--,a-=8);for(n=h&(1<<-a)-1,h>>=-a,a+=t;a>0;n=256*n+e[l],l--,a-=8);if(0===h)h=1-s;else{if(h===o)return n?NaN:c?-S:S;n+=x(2,t),h-=s}return(c?-1:1)*n*x(2,h-t)}function P(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function F(e){return[255&e]}function B(e){return[255&e,e>>8&255]}function N(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function j(e){return H(e,52,8)}function W(e){return H(e,23,4)}function U(e,t,r){p(e[v],t,{get:function(){return this[r]}})}function Z(e,t,r,n){var i=_(+r);if(i+t>e[M])throw E(g);var o=e[R]._b,s=i+e[D],a=o.slice(s,s+t);return n?a:a.reverse()}function z(e,t,r,n,i,o){var s=_(+r);if(s+t>e[M])throw E(g);for(var a=e[R]._b,l=s+e[D],c=n(+i),h=0;h<t;h++)a[l+h]=c[o?h:t-h-1]}if(s.ABV){if(!c(function(){b(1)})||!c(function(){new b(-1)})||c(function(){return new b,new b(1.5),new b(NaN),"ArrayBuffer"!=b.name})){for(var V,K=(b=function(e){return h(this,b),new A(_(e))})[v]=A[v],X=d(A),G=0;X.length>G;)(V=X[G++])in b||a(b,V,A[V]);o||(K.constructor=b)}var Y=new C(new b(2)),q=C[v].setInt8;Y.setInt8(0,2147483648),Y.setInt8(1,2147483649),!Y.getInt8(0)&&Y.getInt8(1)||l(C[v],{setInt8:function(e,t){q.call(this,e,t<<24>>24)},setUint8:function(e,t){q.call(this,e,t<<24>>24)}},!0)}else b=function(e){h(this,b,"ArrayBuffer");var t=_(e);this._b=m.call(new Array(t),0),this[M]=t},C=function(e,t,r){h(this,C,"DataView"),h(e,b,"DataView");var n=e[M],i=u(t);if(i<0||i>n)throw E("Wrong offset!");if(i+(r=void 0===r?n-i:f(r))>n)throw E("Wrong length!");this[R]=e,this[D]=i,this[M]=r},i&&(U(b,"byteLength","_l"),U(C,"buffer","_b"),U(C,"byteLength","_l"),U(C,"byteOffset","_o")),l(C[v],{getInt8:function(e){return Z(this,1,e)[0]<<24>>24},getUint8:function(e){return Z(this,1,e)[0]},getInt16:function(e){var t=Z(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Z(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return P(Z(this,4,e,arguments[1]))},getUint32:function(e){return P(Z(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return I(Z(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return I(Z(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){z(this,1,e,F,t)},setUint8:function(e,t){z(this,1,e,F,t)},setInt16:function(e,t){z(this,2,e,B,t,arguments[2])},setUint16:function(e,t){z(this,2,e,B,t,arguments[2])},setInt32:function(e,t){z(this,4,e,N,t,arguments[2])},setUint32:function(e,t){z(this,4,e,N,t,arguments[2])},setFloat32:function(e,t){z(this,4,e,W,t,arguments[2])},setFloat64:function(e,t){z(this,8,e,j,t,arguments[2])}});y(b,"ArrayBuffer"),y(C,"DataView"),a(C[v],s.VIEW,!0),t.ArrayBuffer=b,t.DataView=C},function(e,t,r){var n=r(33);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},function(e,t,r){"use strict";var n=r(19);e.exports.f=function(e){return new function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)}(e)}},function(e,t){e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){"use strict";var n=r(42),i={};i[r(1)("toStringTag")]="z",i+""!="[object z]"&&r(33)(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},function(e,t,r){"use strict";var n=r(23),i=r(218),o=r(32),s=r(10);e.exports=r(107)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},function(e,t,r){"use strict";var n=r(4),i=r(31),o=r(5);e.exports=function(e){for(var t=n(this),r=o(t.length),s=arguments.length,a=i(s>1?arguments[1]:void 0,r),l=s>2?arguments[2]:void 0,c=void 0===l?r:i(l,r);c>a;)t[a++]=e;return t}},function(e,t,r){var n=r(232);e.exports=function(e,t){return new(n(e))(t)}},function(e,t,r){var n=r(1)("iterator"),i=!1;try{var o=[7][n]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o=[7],s=o[n]();s.next=function(){return{done:r=!0}},o[n]=function(){return s},e(o)}catch(e){}return r}},function(e,t,r){var n=r(42),i=r(1)("iterator"),o=r(32);e.exports=r(11).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[n(e)]}},function(e,t,r){"use strict";var n=r(8),i=r(34);e.exports=function(e,t,r){t in e?n.f(e,t,i(0,r)):e[t]=r}},function(e,t,r){var n=r(32),i=r(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||o[i]===e)}},function(e,t,r){var n=r(3).document;e.exports=n&&n.documentElement},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(3),i=n["__core-js_shared__"]||(n["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t,r){var n=r(79)("keys"),i=r(29);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(2),i=r(3).document,o=n(i)&&n(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._renderer=e}return e.prototype.setRenderer=function(e){this._renderer=e},e.getCoordsRelativeToElement=function(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left,e.clientY-r.top]},e.prototype.getCoords=function(t,r,n,i,o,s){if(!n.width||!n.height)return null;var a=e.getCoordsRelativeToElement(t,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},e.prototype.getRawByteCoords=function(e,t,r,n,i){var o=this.getCoords(e,t,r,n,i),s=o[0],a=o[1];return{x:s+=32,y:a+=32}},e}();t.MouseHelper=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(26),s=r(50),a=function(e){function t(t){var r=e.call(this)||this;return r._terminal=t,r._zones=[],r._areZonesActive=!1,r._tooltipTimeout=null,r._currentZone=null,r._lastHoverCoords=[null,null],r.register(s.addDisposableDomListener(r._terminal.element,"mousedown",function(e){return r._onMouseDown(e)})),r._mouseMoveListener=function(e){return r._onMouseMove(e)},r._mouseLeaveListener=function(e){return r._onMouseLeave(e)},r._clickListener=function(e){return r._onClick(e)},r}return i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._deactivate()},t.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},t.prototype.clearAll=function(e,t){if(0!==this._zones.length){t||(e=0,t=this._terminal.rows-1);for(var r=0;r<this._zones.length;r++){var n=this._zones[r];(n.y1>e&&n.y1<=t+1||n.y2>e&&n.y2<=t+1||n.y1<e&&n.y2>t+1)&&(this._currentZone&&this._currentZone===n&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(r--,1))}0===this._zones.length&&this._deactivate()}},t.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._terminal.element.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.addEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.addEventListener("click",this._clickListener))},t.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._terminal.element.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.removeEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.removeEventListener("click",this._clickListener))},t.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},t.prototype._onHover=function(e){var t=this,r=this._findZoneEventAt(e);r!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),r&&(this._currentZone=r,r.hoverCallback&&r.hoverCallback(e),this._tooltipTimeout=setTimeout(function(){return t._onTooltip(e)},500)))},t.prototype._onTooltip=function(e){this._tooltipTimeout=null;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},t.prototype._onMouseDown=function(e){if(this._areZonesActive){var t=this._findZoneEventAt(e);t&&t.willLinkActivate(e)&&(e.preventDefault(),e.stopImmediatePropagation())}},t.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},t.prototype._onClick=function(e){var t=this._findZoneEventAt(e);t&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._findZoneEventAt=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows);if(!t)return null;for(var r=t[0],n=t[1],i=0;i<this._zones.length;i++){var o=this._zones[i];if(o.y1===o.y2){if(n===o.y1&&r>=o.x1&&r<o.x2)return o}else if(n===o.y1&&r>=o.x1||n===o.y2&&r<o.x2||n>o.y1&&n<o.y2)return o}return null},t}(o.Disposable);t.MouseZoneManager=a;var l=function(){return function(e,t,r,n,i,o,s,a,l){this.x1=e,this.y1=t,this.x2=r,this.y2=n,this.clickCallback=i,this.hoverCallback=o,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=l}}();t.MouseZone=l},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setListener=function(e){var t=this;this._listener&&this.clearListener(),this._listener=e,this._outerListener=function(){t._listener(window.devicePixelRatio,t._currentDevicePixelRatio),t._updateDpr()},this._updateDpr()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.clearListener()},t.prototype._updateDpr=function(){this._resolutionMediaMatchList&&this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener)},t.prototype.clearListener=function(){this._listener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._listener=null,this._outerListener=null)},t}(r(26).Disposable);t.ScreenDprMonitor=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(36),i=r(14);function o(e,t){for(var r=!0,n=t.rgba>>>24,i=t.rgba>>>16&255,o=t.rgba>>>8&255,s=0;s<e.data.length;s+=4)e.data[s]===n&&e.data[s+1]===i&&e.data[s+2]===o?e.data[s+3]=0:r=!1;return r}function s(e,t){return e+" "+t.fontSize*t.devicePixelRatio+"px "+t.fontFamily}t.generateStaticCharAtlasTexture=function(e,t,r){var a=r.scaledCharWidth+i.CHAR_ATLAS_CELL_SPACING,l=r.scaledCharHeight+i.CHAR_ATLAS_CELL_SPACING,c=t(255*a,34*l),h=c.getContext("2d",{alpha:r.allowTransparency});h.fillStyle=r.colors.background.css,h.fillRect(0,0,c.width,c.height),h.save(),h.fillStyle=r.colors.foreground.css,h.font=s(r.fontWeight,r),h.textBaseline="middle";for(var u=0;u<256;u++)h.save(),h.beginPath(),h.rect(u*a,0,a,l),h.clip(),h.fillText(String.fromCharCode(u),u*a,l/2),h.restore();for(h.save(),h.font=s(r.fontWeightBold,r),u=0;u<256;u++)h.save(),h.beginPath(),h.rect(u*a,l,a,l),h.clip(),h.fillText(String.fromCharCode(u),u*a,1.5*l),h.restore();h.restore(),h.font=s(r.fontWeight,r);for(var f=0;f<16;f++){var _=(f+2)*l;for(u=0;u<256;u++)h.save(),h.beginPath(),h.rect(u*a,_,a,l),h.clip(),h.fillStyle=r.colors.ansi[f].css,h.fillText(String.fromCharCode(u),u*a,_+l/2),h.restore()}for(h.font=s(r.fontWeightBold,r),f=0;f<16;f++)for(_=(f+2+16)*l,u=0;u<256;u++)h.save(),h.beginPath(),h.rect(u*a,_,a,l),h.clip(),h.fillStyle=r.colors.ansi[f].css,h.fillText(String.fromCharCode(u),u*a,_+l/2),h.restore();if(h.restore(),!("createImageBitmap"in e)||n.isFirefox||n.isSafari)return c;var d=h.getImageData(0,0,c.width,c.height);return o(d,r.colors.background),e.createImageBitmap(d)},t.clearColor=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(37),i=r(129),o=r(127),s=r(126),a={none:o.default,static:s.default,dynamic:i.default},l=[];t.acquireCharAtlas=function(e,t,r,i){for(var o=n.generateConfig(r,i,e,t),s=0;s<l.length;s++){var c=(h=l[s]).ownedBy.indexOf(e);if(c>=0){if(n.configEquals(h.config,o))return h.atlas;1===h.ownedBy.length?(h.atlas.dispose(),l.splice(s,1)):h.ownedBy.splice(c,1);break}}for(s=0;s<l.length;s++){var h=l[s];if(n.configEquals(h.config,o))return h.ownedBy.push(e),h.atlas}var u={atlas:new a[e.options.experimentalCharAtlas](document,o),config:o,ownedBy:[e]};return l.push(u),u.atlas},t.removeTerminalFromCache=function(e){for(var t=0;t<l.length;t++){var r=l[t].ownedBy.indexOf(e);if(-1!==r){1===l[t].ownedBy.length?(l[t].atlas.dispose(),l.splice(t,1)):l[t].ownedBy.splice(r,1);break}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var n=0,i=0;this._interim&&(56320<=(a=e.charCodeAt(i++))&&a<=57343?t[n++]=1024*(this._interim-55296)+a-56320+65536:(t[n++]=this._interim,t[n++]=a),this._interim=0);for(var o=i;o<r;++o){var s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,n;var a;56320<=(a=e.charCodeAt(o))&&a<=57343?t[n++]=1024*(s-55296)+a-56320+65536:(t[n++]=s,t[n++]=a)}else t[n++]=s}return n},e}();t.StringToUtf32=n,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=e.length);for(var n="",i=t;i<r;++i){var o=e[i];o>65535?(o-=65536,n+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):n+=String.fromCharCode(o)}return n}},function(e,t,r){"use strict";function n(e,t,r,n){if(void 0===r&&(r=0),void 0===n&&(n=e.length),r>=e.length)return e;r=(e.length+r)%e.length,n=n>=e.length?e.length:(e.length+n)%e.length;for(var i=r;i<n;++i)e[i]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.fill=function(e,t,r,i){return e.fill?e.fill(t,r,i):n(e,t,r,i)},t.fillFallback=n,t.concat=function(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(88);t.wcwidth=function(e){var t=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],r=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];var i=0|e.control,o=new Uint8Array(65536);n.fill(o,1),o[0]=e.nul,n.fill(o,e.control,1,32),n.fill(o,e.control,127,160),n.fill(o,2,4352,4448),o[9001]=2,o[9002]=2,n.fill(o,2,11904,42192),o[12351]=1,n.fill(o,2,44032,55204),n.fill(o,2,63744,64256),n.fill(o,2,65040,65050),n.fill(o,2,65072,65136),n.fill(o,2,65280,65377),n.fill(o,2,65504,65511);for(var s=0;s<t.length;++s)n.fill(o,0,t[s][0],t[s][1]+1);return function(e){return e<32?0|i:e<127?1:e<65536?o[e]:function(e,t){var r,n=0,i=t.length-1;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=n;)if(e>t[r=n+i>>1][1])n=r+1;else{if(!(e<t[r][0]))return!0;i=r-1}return!1}(t=e,r)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1;var t}}({nul:0,control:0}),t.getStringCellWidth=function(e){for(var r=0,n=e.length,i=0;i<n;++i){var o=e.charCodeAt(i);if(55296<=o&&o<=56319){if(++i>=n)return r+t.wcwidth(o);var s=e.charCodeAt(i);56320<=s&&s<=57343?o=1024*(o-55296)+s-56320+65536:r+=t.wcwidth(s)}r+=t.wcwidth(o)}return r}},function(e,t,r){"use strict";var n,i=r(147),o=e.exports;Object.assign(o,r(38),r(64));var s=16,a=4129,l=65535,c=1<<s-1;function h(e,t){return n||function(){n=new Array(256);for(var e=s-8,t=0;t<256;t++){for(var r=t<<e&l,i=0;i<8;i++)0!=(r&c)?(r<<=1,r^=a):r<<=1;n[t]=r&l}}(),n[t>>8&255]^(255&t)<<8^e}function u(e,t){if(e.join()!==t.join())throw new o.Error("crc",t,e)}o.CRC={crc16:function(e){for(var t=e[0],r=1;r<e.length;r++)t=h(e[r],t);return t=h(0,h(0,t)),o.ENCODELIB.pack_u16_be(t)},crc32:function(e){return o.ENCODELIB.pack_u32_le(i.buf(e)>>>0)},verify16:function(e,t){return u(this.crc16(e),t)},verify32:function(e,t){try{u(this.crc32(e),t)}catch(t){throw t.input=e.slice(0),t}}}},function(e,t,r){var n=r(25),i=r(5);e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=i(t);if(t!==r)throw RangeError("Wrong length!");return r}},function(e,t,r){var n=r(13),i=r(2),o=r(67);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,r){var n,i,o,s=r(20),a=r(176),l=r(77),c=r(81),h=r(3),u=h.process,f=h.setImmediate,_=h.clearImmediate,d=h.MessageChannel,p=h.Dispatch,m=0,y={},v=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},g=function(e){v.call(e.data)};f&&_||(f=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return y[++m]=function(){a("function"==typeof e?e:Function(e),t)},n(m),m},_=function(e){delete y[e]},"process"==r(27)(u)?n=function(e){u.nextTick(s(v,e,1))}:p&&p.now?n=function(e){p.now(s(v,e,1))}:d?(o=(i=new d).port2,i.port1.onmessage=g,n=s(o.postMessage,o,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(n=function(e){h.postMessage(e+"","*")},h.addEventListener("message",g,!1)):n="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),v.call(e)}}:function(e){setTimeout(s(v,e,1),0)}),e.exports={set:f,clear:_}},function(e,t,r){var n=r(8),i=r(22),o=r(97),s=r(10);e.exports=function(e,t){for(var r,a=o(s(t)),l=a.length,c=0;l>c;)n.f(e,r=a[c++],i.f(t,r));return e}},function(e,t,r){var n=r(28),i=r(10),o=r(41).f;e.exports=function(e){return function(t){for(var r,s=i(t),a=n(s),l=a.length,c=0,h=[];l>c;)o.call(s,r=a[c++])&&h.push(e?[r,s[r]]:s[r]);return h}}},function(e,t,r){var n=r(40),i=r(54),o=r(13),s=r(3).Reflect;e.exports=s&&s.ownKeys||function(e){var t=n.f(o(e)),r=i.f;return r?t.concat(r(e)):t}},function(e,t,r){var n=r(10),i=r(40).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return s.slice()}}(e):i(n(e))}},function(e,t,r){t.f=r(1)},function(e,t,r){"use strict";var n=r(57),i=r(2),o=r(5),s=r(20),a=r(1)("isConcatSpreadable");e.exports=function e(t,r,l,c,h,u,f,_){for(var d,p,m=h,y=0,v=!!f&&s(f,_,3);y<c;){if(y in l){if(d=v?v(l[y],y,r):l[y],p=!1,i(d)&&(p=void 0!==(p=d[a])?!!p:n(d)),p&&u>0)m=e(t,r,d,o(d.length),m,u-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=d}m++}y++}return m}},function(e,t,r){"use strict";var n=r(4),i=r(31),o=r(5);e.exports=[].copyWithin||function(e,t){var r=n(this),s=o(r.length),a=i(e,s),l=i(t,s),c=arguments.length>2?arguments[2]:void 0,h=Math.min((void 0===c?s:i(c,s))-l,s-a),u=1;for(l<a&&a<l+h&&(u=-1,l+=h-1,a+=h-1);h-- >0;)l in r?r[a]=r[l]:delete r[a],a+=u,l+=u;return r}},function(e,t,r){var n=r(19),i=r(4),o=r(45),s=r(5);e.exports=function(e,t,r,a,l){n(t);var c=i(e),h=o(c),u=s(c.length),f=l?u-1:0,_=l?-1:1;if(r<2)for(;;){if(f in h){a=h[f],f+=_;break}if(f+=_,l?f<0:u<=f)throw TypeError("Reduce of empty array with no initial value")}for(;l?f>=0:u>f;f+=_)f in h&&(a=t(a,h[f],f,c));return a}},function(e,t,r){var n=r(13);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&n(o.call(e)),t}}},function(e,t,r){var n=r(21),i=r(10),o=r(58)(!1),s=r(80)("IE_PROTO");e.exports=function(e,t){var r,a=i(e),l=0,c=[];for(r in a)r!=s&&n(a,r)&&c.push(r);for(;t.length>l;)n(a,r=t[l++])&&(~o(c,r)||c.push(r));return c}},function(e,t,r){var n=r(8),i=r(13),o=r(28);e.exports=r(6)?Object.defineProperties:function(e,t){i(e);for(var r,s=o(t),a=s.length,l=0;a>l;)n.f(e,r=s[l++],t[r]);return e}},function(e,t,r){e.exports=!r(6)&&!r(7)(function(){return 7!=Object.defineProperty(r(81)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";var n=r(30),i=r(0),o=r(33),s=r(16),a=r(21),l=r(32),c=r(240),h=r(44),u=r(43),f=r(1)("iterator"),_=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,r,p,m,y,v){c(r,t,p);var g,b,C,w=function(e){if(!_&&e in L)return L[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},E=t+" Iterator",S="values"==m,A=!1,L=e.prototype,x=L[f]||L["@@iterator"]||m&&L[m],k=!_&&x||w(m),T=m?S?w("entries"):k:void 0,O="Array"==t&&L.entries||x;if(O&&(C=u(O.call(new e)))!==Object.prototype&&C.next&&(h(C,E,!0),n||a(C,f)||s(C,f,d)),S&&x&&"values"!==x.name&&(A=!0,k=function(){return x.call(this)}),n&&!v||!_&&!A&&L[f]||s(L,f,k),l[t]=k,l[E]=d,m)if(g={values:S?k:w("values"),keys:y?k:w("keys"),entries:T},v)for(b in g)b in L||o(L,b,g[b]);else i(i.P+i.F*(_||A),t,g);return g}},function(e,t,r){"use strict";var n=r(241)(!0);r(107)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t,r){"use strict";function n(e,t,r){if(!e.overlayNode_){if(!e.element)return;e.overlayNode_=document.createElement("div"),e.overlayNode_.style.cssText="border-radius: 15px;font-size: xx-large;opacity: 0.75;padding: 0.2em 0.5em 0.2em 0.5em;position: absolute;-webkit-user-select: none;-webkit-transition: opacity 180ms ease-in;-moz-user-select: none;-moz-transition: opacity 180ms ease-in;",e.overlayNode_.addEventListener("mousedown",function(e){e.preventDefault(),e.stopPropagation()},!0)}e.overlayNode_.style.color="#101010",e.overlayNode_.style.backgroundColor="#f0f0f0",e.overlayNode_.textContent=t,e.overlayNode_.style.opacity="0.75",e.overlayNode_.parentNode||e.element.appendChild(e.overlayNode_);var n=e.element.getBoundingClientRect(),i=e.overlayNode_.getBoundingClientRect();e.overlayNode_.style.top=(n.height-i.height)/2+"px",e.overlayNode_.style.left=(n.width-i.width)/2+"px",e.overlayTimeout_&&clearTimeout(e.overlayTimeout_),null!==r&&(e.overlayTimeout_=setTimeout(function(){e.overlayNode_.style.opacity="0",e.overlayTimeout_=setTimeout(function(){e.overlayNode_.parentNode&&e.overlayNode_.parentNode.removeChild(e.overlayNode_),e.overlayTimeout_=null,e.overlayNode_.style.opacity="0.75"},200)},r||1500))}Object.defineProperty(t,"__esModule",{value:!0}),t.showOverlay=n,t.apply=function(e){e.prototype.showOverlay=function(e,t){return n(this,e,t)}}},function(e,t,r){"use strict";function n(e){if(!e.element.parentElement)return null;var t=window.getComputedStyle(e.element.parentElement),r=parseInt(t.getPropertyValue("height")),n=Math.max(0,parseInt(t.getPropertyValue("width"))),i=window.getComputedStyle(e.element),o=r-(parseInt(i.getPropertyValue("padding-top"))+parseInt(i.getPropertyValue("padding-bottom"))),s=n-(parseInt(i.getPropertyValue("padding-right"))+parseInt(i.getPropertyValue("padding-left")))-e._core.viewport.scrollBarWidth;return{cols:Math.floor(s/e._core.renderer.dimensions.actualCellWidth),rows:Math.floor(o/e._core.renderer.dimensions.actualCellHeight)}}function i(e){var t=n(e);t&&(e.rows===t.rows&&e.cols===t.cols||(e._core.renderer.clear(),e.resize(t.cols,t.rows)))}Object.defineProperty(t,"__esModule",{value:!0}),t.proposeGeometry=n,t.fit=i,t.apply=function(e){e.prototype.proposeGeometry=function(){return n(this)},e.prototype.fit=function(){i(this)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=function e(t,r){if(void 0===r&&(r=5),"object"!=typeof t)return t;if(null===t)return null;var n=Array.isArray(t)?[]:{};for(var i in t)n[i]=r<=1?t[i]:e(t[i],r-1);return n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(49),i={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(e,t,r,o){var s={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?s.key=t?n.C0.ESC+"OA":n.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?s.key=t?n.C0.ESC+"OD":n.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?s.key=t?n.C0.ESC+"OC":n.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(s.key=t?n.C0.ESC+"OB":n.C0.ESC+"[B");break;case 8:if(e.shiftKey){s.key=n.C0.BS;break}if(e.altKey){s.key=n.C0.ESC+n.C0.DEL;break}s.key=n.C0.DEL;break;case 9:if(e.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=t?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=t?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=t?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=t?n.C0.ESC+"OB":n.C0.ESC+"[B";break;case 45:e.shiftKey||e.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":t?n.C0.ESC+"OH":n.C0.ESC+"[H";break;case 35:s.key=a?n.C0.ESC+"[1;"+(a+1)+"F":t?n.C0.ESC+"OF":n.C0.ESC+"[F";break;case 33:e.shiftKey?s.type=2:s.key=n.C0.ESC+"[5~";break;case 34:e.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(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(r&&!o||!e.altKey||e.metaKey)r&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length&&(s.key=e.key);else{var l=i[e.keyCode],c=l&&l[e.shiftKey?1:0];if(c)s.key=n.C0.ESC+c;else if(e.keyCode>=65&&e.keyCode<=90){var h=e.ctrlKey?e.keyCode-64:e.keyCode+32;s.key=n.C0.ESC+String.fromCharCode(h)}}else e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?s.key=String.fromCharCode(0):e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?s.key=String.fromCharCode(127):219===e.keyCode?s.key=String.fromCharCode(27):220===e.keyCode?s.key=String.fromCharCode(28):221===e.keyCode&&(s.key=String.fromCharCode(29))}return s}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),i=r(14);t.BOLD_CLASS="xterm-bold",t.ITALIC_CLASS="xterm-italic",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var o=function(){function e(e){this._document=e}return e.prototype.createRow=function(e,r,o,s,a,l){for(var c=this._document.createDocumentFragment(),h=0,u=Math.min(e.length,l)-1;u>=0;u--){if((f=e.get(u))[n.CHAR_DATA_CODE_INDEX]!==n.NULL_CELL_CODE||r&&u===s){h=u+1;break}}for(u=0;u<h;u++){var f,_=(f=e.get(u))[n.CHAR_DATA_CHAR_INDEX]||n.WHITESPACE_CELL_CHAR,d=f[n.CHAR_DATA_ATTR_INDEX],p=f[n.CHAR_DATA_WIDTH_INDEX];if(0!==p){var m=this._document.createElement("span");p>1&&(m.style.width=a*p+"px");var y=d>>18,v=511&d,g=d>>9&511;if(r&&u===s)switch(m.classList.add(t.CURSOR_CLASS),o){case"bar":m.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":m.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:m.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}if(8&y){var b=v;v=g,(g=b)===i.DEFAULT_COLOR&&(g=i.INVERTED_DEFAULT_COLOR),v===i.DEFAULT_COLOR&&(v=i.INVERTED_DEFAULT_COLOR)}1&y&&(g<8&&(g+=8),m.classList.add(t.BOLD_CLASS)),64&y&&m.classList.add(t.ITALIC_CLASS),m.textContent=_,g!==i.DEFAULT_COLOR&&m.classList.add("xterm-fg-"+g),v!==i.DEFAULT_COLOR&&m.classList.add("xterm-bg-"+v),c.appendChild(m)}}return c},e}();t.DomRendererRowFactory=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(17),s=r(47),a=r(61),l=r(113),c=r(14),h="xterm-dom-renderer-owner-",u="xterm-rows",f="xterm-selection",_=1,d=function(e){function t(t,r){var n=e.call(this)||this;n._terminal=t,n._terminalClass=_++,n._rowElements=[];var i=n._terminal.options.allowTransparency;return n.colorManager=new s.ColorManager(document,i),n.setTheme(r),n._rowContainer=document.createElement("div"),n._rowContainer.classList.add(u),n._rowContainer.style.lineHeight="normal",n._rowContainer.setAttribute("aria-hidden","true"),n._refreshRowElements(n._terminal.cols,n._terminal.rows),n._selectionContainer=document.createElement("div"),n._selectionContainer.classList.add(f),n._selectionContainer.setAttribute("aria-hidden","true"),n.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},n._updateDimensions(),n._renderDebouncer=new a.RenderDebouncer(n._terminal,n._renderRows.bind(n)),n._rowFactory=new l.DomRendererRowFactory(document),n._terminal.element.classList.add(h+n._terminalClass),n._terminal.screenElement.appendChild(n._rowContainer),n._terminal.screenElement.appendChild(n._selectionContainer),n._terminal.linkifier.on("linkhover",function(e){return n._onLinkHover(e)}),n._terminal.linkifier.on("linkleave",function(e){return n._onLinkLeave(e)}),n}return i(t,e),t.prototype.dispose=function(){this._terminal.element.classList.remove(h+this._terminalClass),this._terminal.screenElement.removeChild(this._rowContainer),this._terminal.screenElement.removeChild(this._selectionContainer),this._terminal.screenElement.removeChild(this._themeStyleElement),this._terminal.screenElement.removeChild(this._dimensionsStyleElement),e.prototype.dispose.call(this)},t.prototype._updateDimensions=function(){var e=this;this.dimensions.scaledCharWidth=Math.floor(this._terminal.charMeasure.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._terminal.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._terminal.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows,this._rowElements.forEach(function(t){t.style.width=e.dimensions.canvasWidth+"px",t.style.height=e.dimensions.actualCellHeight+"px",t.style.lineHeight=e.dimensions.actualCellHeight+"px",t.style.overflow="hidden"}),this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._dimensionsStyleElement));var t=this._terminalSelector+" ."+u+" span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=t,this._selectionContainer.style.height=this._terminal._viewportElement.style.height,this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.setTheme=function(e){var t=this;e&&this.colorManager.setTheme(e),this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._themeStyleElement));var r=this._terminalSelector+" ."+u+" { color: "+this.colorManager.colors.foreground.css+"; background-color: "+this.colorManager.colors.background.css+"; font-family: "+this._terminal.getOption("fontFamily")+"; font-size: "+this._terminal.getOption("fontSize")+"px;}";return r+=this._terminalSelector+" span:not(."+l.BOLD_CLASS+") { font-weight: "+this._terminal.options.fontWeight+";}"+this._terminalSelector+" span."+l.BOLD_CLASS+" { font-weight: "+this._terminal.options.fontWeightBold+";}"+this._terminalSelector+" span."+l.ITALIC_CLASS+" { font-style: italic;}",r+=this._terminalSelector+" ."+u+":not(.xterm-focus) ."+l.CURSOR_CLASS+" { outline: 1px solid "+this.colorManager.colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" ."+u+".xterm-focus ."+l.CURSOR_CLASS+"."+l.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this.colorManager.colors.cursor.css+"; color: "+this.colorManager.colors.cursorAccent.css+";}"+this._terminalSelector+" ."+u+".xterm-focus ."+l.CURSOR_CLASS+"."+l.CURSOR_STYLE_BAR_CLASS+" { box-shadow: 1px 0 0 "+this.colorManager.colors.cursor.css+" inset;}"+this._terminalSelector+" ."+u+".xterm-focus ."+l.CURSOR_CLASS+"."+l.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this.colorManager.colors.cursor.css+" inset;}",r+=this._terminalSelector+" ."+f+" { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" ."+f+" div { position: absolute; background-color: "+this.colorManager.colors.selection.css+";}",this.colorManager.colors.ansi.forEach(function(e,n){r+=t._terminalSelector+" .xterm-fg-"+n+" { color: "+e.css+"; }"+t._terminalSelector+" .xterm-bg-"+n+" { background-color: "+e.css+"; }"}),r+=this._terminalSelector+" .xterm-fg-"+c.INVERTED_DEFAULT_COLOR+" { color: "+this.colorManager.colors.background.css+"; }"+this._terminalSelector+" .xterm-bg-"+c.INVERTED_DEFAULT_COLOR+" { background-color: "+this.colorManager.colors.foreground.css+"; }",this._themeStyleElement.innerHTML=r,this.colorManager.colors},t.prototype.onWindowResize=function(e){this._updateDimensions()},t.prototype._refreshRowElements=function(e,t){for(var r=this._rowElements.length;r<=t;r++){var n=document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())},t.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},t.prototype.onCharSizeChanged=function(){this._updateDimensions()},t.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},t.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},t.prototype.onSelectionChanged=function(e,t,r){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var n=e[1]-this._terminal.buffer.ydisp,i=t[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,e[0],t[0],s-o+1));else{var l=n===o?e[0]:0,c=o===s?t[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?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(s,0,u))}}this._selectionContainer.appendChild(a)}}},t.prototype._createSelectionElement=function(e,t,r,n){void 0===n&&(n=1);var i=document.createElement("div");return i.style.height=n*this.dimensions.actualCellHeight+"px",i.style.top=e*this.dimensions.actualCellHeight+"px",i.style.left=t*this.dimensions.actualCellWidth+"px",i.style.width=this.dimensions.actualCellWidth*(r-t)+"px",i},t.prototype.onCursorMove=function(){},t.prototype.onOptionsChanged=function(){this._updateDimensions(),this.setTheme(void 0),this._terminal.refresh(0,this._terminal.rows-1)},t.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},t.prototype.refreshRows=function(e,t){this._renderDebouncer.refresh(e,t)},t.prototype._renderRows=function(e,t){for(var r=this._terminal,n=r.buffer.ybase+r.buffer.y,i=this._terminal.buffer.x,o=e;o<=t;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:e,end:t})},Object.defineProperty(t.prototype,"_terminalSelector",{get:function(){return"."+h+this._terminalClass},enumerable:!0,configurable:!0}),t.prototype.registerCharacterJoiner=function(e){return-1},t.prototype.deregisterCharacterJoiner=function(e){return!1},t.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},t.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},t.prototype._setCellUnderline=function(e,t,r,n,i,o){for(;e!==t||r!==n;){var s=this._rowElements[r];if(!s)return;var a=s.children[e];a&&(a.style.textDecoration=o?"underline":"none"),++e>=i&&(e=0,r++)}},t}(o.EventEmitter);t.DomRenderer=d},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(60),s=r(36),a=r(61),l=r(50),c=function(e){function t(t){var r=e.call(this)||this;r._terminal=t,r._liveRegionLineCount=0,r._charsToConsume=[],r._accessibilityTreeRoot=document.createElement("div"),r._accessibilityTreeRoot.classList.add("xterm-accessibility"),r._rowContainer=document.createElement("div"),r._rowContainer.classList.add("xterm-accessibility-tree"),r._rowElements=[];for(var n=0;n<r._terminal.rows;n++)r._rowElements[n]=r._createAccessibilityTreeNode(),r._rowContainer.appendChild(r._rowElements[n]);return r._topBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,0)},r._bottomBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,1)},r._rowElements[0].addEventListener("focus",r._topBoundaryFocusListener),r._rowElements[r._rowElements.length-1].addEventListener("focus",r._bottomBoundaryFocusListener),r._refreshRowsDimensions(),r._accessibilityTreeRoot.appendChild(r._rowContainer),r._renderRowsDebouncer=new a.RenderDebouncer(r._terminal,r._renderRows.bind(r)),r._refreshRows(),r._liveRegion=document.createElement("div"),r._liveRegion.classList.add("live-region"),r._liveRegion.setAttribute("aria-live","assertive"),r._accessibilityTreeRoot.appendChild(r._liveRegion),r._terminal.element.insertAdjacentElement("afterbegin",r._accessibilityTreeRoot),r.register(r._renderRowsDebouncer),r.register(r._terminal.addDisposableListener("resize",function(e){return r._onResize(e.rows)})),r.register(r._terminal.addDisposableListener("refresh",function(e){return r._refreshRows(e.start,e.end)})),r.register(r._terminal.addDisposableListener("scroll",function(e){return r._refreshRows()})),r.register(r._terminal.addDisposableListener("a11y.char",function(e){return r._onChar(e)})),r.register(r._terminal.addDisposableListener("linefeed",function(){return r._onChar("\n")})),r.register(r._terminal.addDisposableListener("a11y.tab",function(e){return r._onTab(e)})),r.register(r._terminal.addDisposableListener("key",function(e){return r._onKey(e)})),r.register(r._terminal.addDisposableListener("blur",function(){return r._clearLiveRegion()})),r.register(r._terminal.addDisposableListener("dprchange",function(){return r._refreshRowsDimensions()})),r.register(r._terminal.renderer.addDisposableListener("resize",function(){return r._refreshRowsDimensions()})),r.register(l.addDisposableDomListener(window,"resize",function(){return r._refreshRowsDimensions()})),r}return i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._terminal.element.removeChild(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(e,t){var r=e.target,n=this._rowElements[0===t?1:this._rowElements.length-2];if(r.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===n){var i,o;if(0===t?(i=r,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(i=this._rowElements.shift(),o=r,this._rowContainer.removeChild(i)),i.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){var s=this._createAccessibilityTreeNode();this._rowElements.unshift(s),this._rowContainer.insertAdjacentElement("afterbegin",s)}else{s=this._createAccessibilityTreeNode();this._rowElements.push(s),this._rowContainer.appendChild(s)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}},t.prototype._onResize=function(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},t.prototype._onTab=function(e){for(var t=0;t<e;t++)this._onChar(" ")},t.prototype._onChar=function(e){var t=this;if(this._liveRegionLineCount<21){if(this._charsToConsume.length>0)this._charsToConsume.shift()!==e&&this._announceCharacter(e);else this._announceCharacter(e);"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=o.tooMuchOutput)),s.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){t._accessibilityTreeRoot.appendChild(t._liveRegion)},0)}},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,s.isMac&&this._liveRegion.parentNode&&this._accessibilityTreeRoot.removeChild(this._liveRegion)},t.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},t.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t)},t.prototype._renderRows=function(e,t){for(var r=this._terminal.buffer,n=r.lines.length.toString(),i=e;i<=t;i++){var s=r.translateBufferLineToString(r.ydisp+i,!0),a=(r.ydisp+i+1).toString(),l=this._rowElements[i];l.textContent=0===s.length?o.blankLine:s,l.setAttribute("aria-posinset",a),l.setAttribute("aria-setsize",n)}},t.prototype._refreshRowsDimensions=function(){if(this._terminal.renderer.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}},t.prototype._refreshRowDimensions=function(e){e.style.height=this._terminal.renderer.dimensions.actualCellHeight+"px"},t.prototype._announceCharacter=function(e){" "===e?this._liveRegion.innerHTML+="&nbsp;":this._liveRegion.textContent+=e},t}(r(26).Disposable);t.AccessibilityManager=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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 e(e){this._terminal=e}return Object.defineProperty(e,"audioContext",{get:function(){if(!e._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;e._audioContext=new t}return e._audioContext},enumerable:!0,configurable:!0}),e.prototype.playBellSound=function(){var t=e.audioContext;if(t){var r=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),function(e){r.buffer=e,r.connect(t.destination),r.start(0)})}},e.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),r=t.length,n=new Uint8Array(r),i=0;i<r;i++)n[i]=t.charCodeAt(i);return n.buffer},e.prototype._removeMimeType=function(e){return e.split(",")[1]},e}();t.SoundManager=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){var n=e.call(this)||this;return n._document=t,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(t,e),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.measure=function(e){this._measureElement.style.fontFamily=e.fontFamily,this._measureElement.style.fontSize=e.fontSize+"px";var t=this._measureElement.getBoundingClientRect();if(0!==t.width&&0!==t.height){var r=Math.ceil(t.height);this._width===t.width&&this._height===r||(this._width=t.width,this._height=r,this.emit("charsizechanged"))}},t}(r(17).EventEmitter);t.CharMeasure=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(49),i=function(){function e(e,t){var r;this._mouseEvent=e,this._terminal=t,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(e){return e-1}),this._endCol=r[0],this._endRow=r[1])}return e.prototype.move=function(){this._mouseEvent.altKey&&void 0!==this._endCol&&void 0!==this._endRow&&this._terminal.handler(this._arrowSequences())},e.prototype._arrowSequences=function(){return this._terminal.buffer.hasScrollback?this._moveHorizontallyOnly():this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()},e.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"))},e.prototype._moveToRequestedRow=function(){var e=this._startRow-this._wrappedRowsForRow(this._startRow),t=this._endRow-this._wrappedRowsForRow(this._endRow);return o(Math.abs(e-t)-this._wrappedRowsCount(),this._sequence(this._verticalDirection()))},e.prototype._moveToRequestedCol=function(){var e;e=this._moveToRequestedRow().length>0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow;var t=this._endRow,r=this._horizontalDirection();return o(this._bufferLine(this._startCol,e,this._endCol,t,"C"===r).length,this._sequence(r))},e.prototype._moveHorizontallyOnly=function(){var e=this._horizontalDirection();return o(Math.abs(this._startCol-this._endCol),this._sequence(e))},e.prototype._wrappedRowsCount=function(){for(var e=0,t=this._startRow-this._wrappedRowsForRow(this._startRow),r=this._endRow-this._wrappedRowsForRow(this._endRow),n=0;n<Math.abs(t-r);n++){var i="A"===this._verticalDirection()?-1:1;this._lines.get(t+i*n).isWrapped&&e++}return e},e.prototype._wrappedRowsForRow=function(e){for(var t=0,r=this._lines.get(e).isWrapped;r&&e>=0&&e<this._terminal.rows;)t++,e--,r=this._lines.get(e).isWrapped;return t},e.prototype._horizontalDirection=function(){var e;return e=this._moveToRequestedRow().length>0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow,this._startCol<this._endCol&&e<=this._endRow||this._startCol>=this._endCol&&e<this._endRow?"C":"D"},e.prototype._verticalDirection=function(){return this._startRow>this._endRow?"A":"B"},e.prototype._bufferLine=function(e,t,r,n,i){for(var o=e,s=t,a="";o!==r||s!==n;)o+=i?1:-1,i&&o>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(a+=this._terminal.buffer.translateBufferLineToString(s,!1,0,e+1),e=o=this._terminal.cols-1,s--);return a+this._terminal.buffer.translateBufferLineToString(s,!1,e,o)},e.prototype._sequence=function(e){var t=this._terminal.applicationCursor?"O":"[";return n.C0.ESC+t+e},e}();function o(e,t){e=Math.floor(e);for(var r="",n=0;n<e;n++)r+=t;return r}t.AltClickHandler=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._terminal=e,this.clearSelection()}return e.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(e.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(e.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()){var e=this.selectionStart[0]+this.selectionStartLength;return e>this._terminal.cols?[e%this._terminal.cols,this.selectionStart[1]+Math.floor(e/this._terminal.cols)]:[e,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd},enumerable:!0,configurable:!0}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();t.SelectionModel=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(82),s=r(36),a=r(17),l=r(119),c=r(9),h=r(118),u=String.fromCharCode(160),f=new RegExp(u,"g"),_=function(e){function t(t,r){var n=e.call(this)||this;return n._terminal=t,n._charMeasure=r,n._enabled=!0,n._initListeners(),n.enable(),n._model=new l.SelectionModel(t),n._activeSelectionMode=0,n}return i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._removeMouseDownListeners()},Object.defineProperty(t.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0}),t.prototype._initListeners=function(){var e=this;this._mouseMoveListener=function(t){return e._onMouseMove(t)},this._mouseUpListener=function(t){return e._onMouseUp(t)},this._trimListener=function(t){return e._onTrim(t)},this.initBuffersListeners()},t.prototype.initBuffersListeners=function(){var e=this;this._terminal.buffer.lines.on("trim",this._trimListener),this._terminal.buffers.on("activate",function(t){return e._onBufferActivate(t)})},t.prototype.disable=function(){this.clearSelection(),this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t)&&(e[0]!==t[0]||e[1]!==t[1])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var r=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var n=e[1];n<=t[1];n++){var i=this._buffer.translateBufferLineToString(n,!0,e[0],t[0]);r.push(i)}}else{var o=e[1]===t[1]?t[0]:void 0;r.push(this._buffer.translateBufferLineToString(e[1],!0,e[0],o));for(n=e[1]+1;n<=t[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(e[1]!==t[1]){a=this._buffer.lines.get(t[1]),i=this._buffer.translateBufferLineToString(t[1],!0,0,t[0]);a.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map(function(e){return e.replace(f," ")}).join(s.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),t.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh()},t.prototype.refresh=function(e){var t=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return t._refresh()})),s.isLinux&&e)&&(this.selectionText.length&&this.emit("newselection",this.selectionText))},t.prototype._refresh=function(){this._refreshAnimationFrame=null,this.emit("refresh",{start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},t.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!(!r||!n)&&this._areCoordsInSelection(t,r,n)},t.prototype._areCoordsInSelection=function(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]},t.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=null,this.refresh(!0))},t.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._terminal.emit("selection")},t.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._terminal.cols,t],this.refresh(),this._terminal.emit("selection")},t.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},t.prototype._getMouseBufferCoords=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);return t?(t[0]--,t[1]--,t[1]+=this._terminal.buffer.ydisp,t):null},t.prototype._getMouseEventScrollAmount=function(e){var t=o.MouseHelper.getCoordsRelativeToElement(e,this._terminal.screenElement)[1],r=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},t.prototype.shouldForceSelection=function(e){return s.isMac?e.altKey&&this._terminal.options.macOptionClickForcesSelection:e.shiftKey},t.prototype.onMouseDown=function(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}},t.prototype._addMouseDownListeners=function(){var e=this;this._terminal.element.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.addEventListener("mouseup",this._mouseUpListener),this._dragScrollIntervalTimer=setInterval(function(){return e._dragScroll()},50)},t.prototype._removeMouseDownListeners=function(){this._terminal.element.ownerDocument&&(this._terminal.element.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=null},t.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},t.prototype._onSingleClick=function(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart){this._model.selectionEnd=null;var t=this._buffer.lines.get(this._model.selectionStart[1]);if(t)if(!(t.length>=this._model.selectionStart[0]))0===t.get(this._model.selectionStart[0])[c.CHAR_DATA_WIDTH_INDEX]&&this._model.selectionStart[0]++}},t.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},t.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},t.prototype.shouldColumnSelect=function(e){return e.altKey&&!(s.isMac&&this._terminal.options.macOptionClickForcesSelection)},t.prototype._onMouseMove=function(e){e.stopImmediatePropagation();var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){if(2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._terminal.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._terminal.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0)),this._model.selectionEnd[1]<this._buffer.lines.length){var r=this._buffer.lines.get(this._model.selectionEnd[1]).get(this._model.selectionEnd[0]);r&&0===r[c.CHAR_DATA_WIDTH_INDEX]&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)},t.prototype._dragScroll=function(){this._dragScrollAmount&&(this._terminal.scrollLines(this._dragScrollAmount,!1),this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._terminal.cols),this._model.selectionEnd[1]=Math.min(this._terminal.buffer.ydisp+this._terminal.rows,this._terminal.buffer.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=this._terminal.buffer.ydisp),this.refresh())},t.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500?new h.AltClickHandler(e,this._terminal).move():this.hasSelection&&this._terminal.emit("selection")},t.prototype._onBufferActivate=function(e){this.clearSelection(),e.inactiveBuffer.lines.off("trim",this._trimListener),e.activeBuffer.lines.on("trim",this._trimListener)},t.prototype._convertViewportColToCharacterIndex=function(e,t){for(var r=t[0],n=0;t[0]>=n;n++){var i=e.get(n);0===i[c.CHAR_DATA_WIDTH_INDEX]?r--:i[c.CHAR_DATA_CHAR_INDEX].length>1&&t[0]!==n&&(r+=i[c.CHAR_DATA_CHAR_INDEX].length-1)}return r},t.prototype.setSelection=function(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh()},t.prototype._getWordAt=function(e,t,r,n){if(void 0===r&&(r=!0),void 0===n&&(n=!0),e[0]>=this._terminal.cols)return null;var i=this._buffer.lines.get(e[1]);if(!i)return null;var o=this._buffer.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(i,e),a=s,l=e[0]-s,h=0,u=0,f=0,_=0;if(" "===o.charAt(s)){for(;s>0&&" "===o.charAt(s-1);)s--;for(;a<o.length&&" "===o.charAt(a+1);)a++}else{var d=e[0],p=e[0];for(0===i.get(d)[c.CHAR_DATA_WIDTH_INDEX]&&(h++,d--),2===i.get(p)[c.CHAR_DATA_WIDTH_INDEX]&&(u++,p++),i.get(p)[c.CHAR_DATA_CHAR_INDEX].length>1&&(_+=i.get(p)[c.CHAR_DATA_CHAR_INDEX].length-1,a+=i.get(p)[c.CHAR_DATA_CHAR_INDEX].length-1);d>0&&s>0&&!this._isCharWordSeparator(i.get(d-1));){0===(m=i.get(d-1))[c.CHAR_DATA_WIDTH_INDEX]?(h++,d--):m[c.CHAR_DATA_CHAR_INDEX].length>1&&(f+=m[c.CHAR_DATA_CHAR_INDEX].length-1,s-=m[c.CHAR_DATA_CHAR_INDEX].length-1),s--,d--}for(;p<i.length&&a+1<o.length&&!this._isCharWordSeparator(i.get(p+1));){var m;2===(m=i.get(p+1))[c.CHAR_DATA_WIDTH_INDEX]?(u++,p++):m[c.CHAR_DATA_CHAR_INDEX].length>1&&(_+=m[c.CHAR_DATA_CHAR_INDEX].length-1,a+=m[c.CHAR_DATA_CHAR_INDEX].length-1),a++,p++}}a++;var y=s+l-h+f,v=Math.min(this._terminal.cols,a-s+h+u-f-_);if(!t&&""===o.slice(s,a).trim())return null;if(r&&0===y&&32!==i.get(0)[c.CHAR_DATA_CODE_INDEX]){var g=this._buffer.lines.get(e[1]-1);if(g&&i.isWrapped&&32!==g.get(this._terminal.cols-1)[c.CHAR_DATA_CODE_INDEX]){var b=this._getWordAt([this._terminal.cols-1,e[1]-1],!1,!0,!1);if(b){var C=this._terminal.cols-b.start;y-=C,v+=C}}}if(n&&y+v===this._terminal.cols&&32!==i.get(this._terminal.cols-1)[c.CHAR_DATA_CODE_INDEX]){var w=this._buffer.lines.get(e[1]+1);if(w&&w.isWrapped&&32!==w.get(0)[c.CHAR_DATA_CODE_INDEX]){var E=this._getWordAt([0,e[1]+1],!1,!1,!0);E&&(v+=E.length)}}return{start:y,length:v}},t.prototype._selectWordAt=function(e,t){var r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._terminal.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}},t.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var r=e[1];t.start<0;)t.start+=this._terminal.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._terminal.cols;)t.length-=this._terminal.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}},t.prototype._isCharWordSeparator=function(e){return 0!==e[c.CHAR_DATA_WIDTH_INDEX]&&" ()[]{}'\"".indexOf(e[c.CHAR_DATA_CHAR_INDEX])>=0},t.prototype._selectLineAt=function(e){var t=this._buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._terminal.cols,t.last],this._model.selectionStartLength=0},t}(a.EventEmitter);t.SelectionManager=_},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(83),s=r(17),a=r(9),l=r(89),c=function(e){function t(t){var r=e.call(this)||this;return r._terminal=t,r._linkMatchers=[],r._nextLinkMatcherId=0,r._rowsToLinkify={start:null,end:null},r}return i(t,e),t.prototype.attachToDom=function(e){this._mouseZoneManager=e},t.prototype.linkifyRows=function(e,r){var n=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=e,this._rowsToLinkify.end=r):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,e),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,r)),this._mouseZoneManager.clearAll(e,r),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return n._linkifyRows()},t.TIME_BEFORE_LINKIFY))},t.prototype._linkifyRows=function(){this._rowsTimeoutId=null;var e=this._terminal.buffer,r=e.ydisp+this._rowsToLinkify.start;if(!(r>=e.lines.length)){for(var n=e.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+1,i=Math.ceil(t.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<this._linkMatchers.length;a++)this._doLinkifyRow(s.range.first,s.content,this._linkMatchers[a]);this._rowsToLinkify.start=null,this._rowsToLinkify.end=null}},t.prototype.registerLinkMatcher=function(e,t,r){if(void 0===r&&(r={}),!t)throw new Error("handler must be defined");var n={id:this._nextLinkMatcherId++,regex:e,handler:t,matchIndex:r.matchIndex,validationCallback:r.validationCallback,hoverTooltipCallback:r.tooltipCallback,hoverLeaveCallback:r.leaveCallback,willLinkActivate:r.willLinkActivate,priority:r.priority||0};return this._addLinkMatcherToList(n),n.id},t.prototype._addLinkMatcherToList=function(e){if(0!==this._linkMatchers.length){for(var t=this._linkMatchers.length-1;t>=0;t--)if(e.priority<=this._linkMatchers[t].priority)return void this._linkMatchers.splice(t+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},t.prototype.deregisterLinkMatcher=function(e){for(var t=0;t<this._linkMatchers.length;t++)if(this._linkMatchers[t].id===e)return this._linkMatchers.splice(t,1),!0;return!1},t.prototype._doLinkifyRow=function(e,t,r){for(var n,i=this,o=new RegExp(r.regex.source,r.regex.flags+"g"),s=-1,l=function(){var l=n["number"!=typeof r.matchIndex?0:r.matchIndex];if(!l){if(c._terminal.debug)throw console.log({match:n,matcher:r}),new Error("match found without corresponding matchIndex");return"break"}if(s=t.indexOf(l,s+1),o.lastIndex=s+l.length,s<0)return"break";var h=c._terminal.buffer.stringIndexToBufferIndex(e,s);if(h[0]<0)return"break";var u,f=c._terminal.buffer.lines.get(h[0]).get(h[1]);if(f){var _=f[a.CHAR_DATA_ATTR_INDEX];u=_>>9&511}r.validationCallback?r.validationCallback(l,function(e){i._rowsTimeoutId||e&&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(t));){if("break"===l())break}},t.prototype._addLink=function(e,t,r,n,i){var s=this,a=l.getStringCellWidth(r),c=e%this._terminal.cols,h=t+Math.floor(e/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(e){if(n.handler)return n.handler(e,r);window.open(r,"_blank")},function(e){s.emit("linkhover",s._createLinkHoverEvent(c,h,u,f,i)),s._terminal.element.classList.add("xterm-cursor-pointer")},function(e){s.emit("linktooltip",s._createLinkHoverEvent(c,h,u,f,i)),n.hoverTooltipCallback&&n.hoverTooltipCallback(e,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(e){return!n.willLinkActivate||n.willLinkActivate(e,r)}))},t.prototype._createLinkHoverEvent=function(e,t,r,n,i){return{x1:e,y1:t,x2:r,y2:n,cols:this._terminal.cols,fg:i}},t.TIME_BEFORE_LINKIFY=200,t.OVERSCAN_CHAR_LIMIT=2e3,t}(s.EventEmitter);t.Linkifier=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),i=function(){function e(e){this._terminal=e,this._characterJoiners=[],this._nextCharacterJoinerId=0}return e.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},e.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1},e.prototype.getJoinedCharacters=function(e){if(0===this._characterJoiners.length)return[];var t=this._terminal.buffer.lines.get(e);if(0===t.length)return[];for(var r=[],i=this._terminal.buffer.translateBufferLineToString(e,!0),o=0,s=0,a=0,l=t.get(0)[n.CHAR_DATA_ATTR_INDEX]>>9,c=0;c<this._terminal.cols;c++){var h=t.get(c),u=h[n.CHAR_DATA_CHAR_INDEX],f=h[n.CHAR_DATA_WIDTH_INDEX],_=h[n.CHAR_DATA_ATTR_INDEX]>>9;if(0!==f){if(_!==l){if(c-o>1)for(var d=this._getJoinedRanges(i,a,s,t,o),p=0;p<d.length;p++)r.push(d[p]);o=c,a=s,l=_}s+=u.length}}if(this._terminal.cols-o>1)for(d=this._getJoinedRanges(i,a,s,t,o),p=0;p<d.length;p++)r.push(d[p]);return r},e.prototype._getJoinedRanges=function(t,r,n,i,o){for(var s=t.substring(r,n),a=this._characterJoiners[0].handler(s),l=1;l<this._characterJoiners.length;l++)for(var c=this._characterJoiners[l].handler(s),h=0;h<c.length;h++)e._mergeRanges(a,c[h]);return this._stringRangesToCellRanges(a,i,o),a},e.prototype._stringRangesToCellRanges=function(e,t,r){var i=0,o=!1,s=0,a=e[i];if(a){for(var l=r;l<this._terminal.cols;l++){var c=t.get(l),h=c[n.CHAR_DATA_WIDTH_INDEX],u=c[n.CHAR_DATA_CHAR_INDEX].length;if(0!==h){if(!o&&a[0]<=s&&(a[0]=l,o=!0),a[1]<=s){if(a[1]=l,!(a=e[++i]))break;a[0]<=s?(a[0]=l,o=!0):o=!1}s+=u}}a&&(a[1]=this._terminal.cols)}},e._mergeRanges=function(e,t){for(var r=!1,n=0;n<e.length;n++){var i=e[n];if(r){if(t[1]<=i[0])return e[n-1][1]=t[1],e;if(t[1]<=i[1])return e[n-1][1]=Math.max(t[1],i[1]),e.splice(n,1),r=!1,e;e.splice(n,1),n--}else{if(t[1]<=i[0])return e.splice(n,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),r=!0)}}return r?e[e.length-1][1]=t[1]:e.push(t),e},e}();t.CharacterJoinerRegistry=i},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(48),s=r(14),a=r(37),l=function(e){function t(t,r,n,i){var o=e.call(this,t,"link",r,!0,n)||this;return o._state=null,i.linkifier.on("linkhover",function(e){return o._onLinkHover(e)}),i.linkifier.on("linkleave",function(e){return o._onLinkLeave(e)}),o}return i(t,e),t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this._state=null},t.prototype.reset=function(e){this._clearCurrentLink()},t.prototype._clearCurrentLink=function(){if(this._state){this.clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var e=this._state.y2-this._state.y1-1;e>0&&this.clearCells(0,this._state.y1+1,this._state.cols,e),this.clearCells(0,this._state.y2,this._state.x2,1),this._state=null}},t.prototype._onLinkHover=function(e){if(e.fg===s.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:a.is256Color(e.fg)?this._ctx.fillStyle=this._colors.ansi[e.fg].css:this._ctx.fillStyle=this._colors.foreground.css,e.y1===e.y2)this.fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this.fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t<e.y2;t++)this.fillBottomLineAtCells(0,t,e.cols);this.fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e},t.prototype._onLinkLeave=function(e){this._clearCurrentLink()},t}(o.BaseRenderLayer);t.LinkRenderLayer=l},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(9),s=function(e){function t(t,r,n){var i=e.call(this,t,"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(t,e),t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this._state={x:null,y:null,isFocused:null,style:null,width:null}},t.prototype.reset=function(e){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null,this.onOptionsChanged(e))},t.prototype.onBlur=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),e.refresh(e.buffer.y,e.buffer.y)},t.prototype.onFocus=function(e){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(e):e.refresh(e.buffer.y,e.buffer.y)},t.prototype.onOptionsChanged=function(e){var t=this;e.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new a(e,function(){t._render(e,!0)})):(this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null),e.refresh(e.buffer.y,e.buffer.y))},t.prototype.onCursorMove=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype.onGridChanged=function(e,t,r){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(e,!1):this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype._render=function(e,t){if(e.cursorState&&!e.cursorHidden){var r=e.buffer.ybase+e.buffer.y,n=r-e.buffer.ydisp;if(n<0||n>=e.rows)this._clearCursor();else{var i=e.buffer.lines.get(r).get(e.buffer.x);if(i){if(!e.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(e,e.buffer.x,n,i),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=n,this._state.isFocused=!1,this._state.style=e.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===e.buffer.x&&this._state.y===n&&this._state.isFocused===e.isFocused&&this._state.style===e.options.cursorStyle&&this._state.width===i[o.CHAR_DATA_WIDTH_INDEX])return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[e.options.cursorStyle||"block"](e,e.buffer.x,n,i),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=n,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,this._state.width=i[o.CHAR_DATA_WIDTH_INDEX]}else this._clearCursor()}}}else this._clearCursor()},t.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})},t.prototype._renderBarCursor=function(e,t,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(t,r),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(t,r,n[o.CHAR_DATA_WIDTH_INDEX],1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(e,n,t,r),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(t,r),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,r,n){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(t,r,n[o.CHAR_DATA_WIDTH_INDEX],1),this._ctx.restore()},t}(r(48).BaseRenderLayer);t.CursorRenderLayer=s;var a=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e.isFocused&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),e.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)},e.prototype.restartBlinkAnimation=function(e){var t=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=null,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null}),t._blinkInterval=setInterval(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=null,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})},600)},e)},e.prototype.pause=function(){this.isCursorVisible=!0,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)},e.prototype.resume=function(e){this._animationTimeRestarted=null,this._restartInterval(),this.restartBlinkAnimation(e)},e}()},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r,n){var i=e.call(this,t,"selection",r,!0,n)||this;return i._clearState(),i}return i(t,e),t.prototype._clearState=function(){this._state={start:null,end:null,columnSelectMode:null,ydisp:null}},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this._clearState()},t.prototype.reset=function(e){this._state.start&&this._state.end&&(this._clearState(),this.clearAll())},t.prototype.onSelectionChanged=function(e,t,r,n){if(this._didStateChange(t,r,n,e.buffer.ydisp))if(this.clearAll(),t&&r){var i=t[1]-e.buffer.ydisp,o=r[1]-e.buffer.ydisp,s=Math.max(i,0),a=Math.min(o,e.rows-1);if(!(s>=e.rows||a<0)){if(this._ctx.fillStyle=this._colors.selection.css,n){var l=t[0],c=r[0]-l,h=a-s+1;this.fillCells(l,s,c,h)}else{l=i===s?t[0]:0;var u=s===a?r[0]:e.cols;this.fillCells(l,s,u-l,1);var f=Math.max(a-s-1,0);if(this.fillCells(0,s+1,e.cols,f),s!==a){var _=o===a?r[0]:e.cols;this.fillCells(0,a,_,1)}}this._state.start=[t[0],t[1]],this._state.end=[r[0],r[1]],this._state.columnSelectMode=n,this._state.ydisp=e.buffer.ydisp}}else this._clearState()},t.prototype._didStateChange=function(e,t,r,n){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||r!==this._state.columnSelectMode||n!==this._state.ydisp},t.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&(e[0]===t[0]&&e[1]===t[1])},t}(r(48).BaseRenderLayer);t.SelectionRenderLayer=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(14),s=r(85),a=r(62),l=r(37),c=function(e){function t(t,r){var n=e.call(this)||this;return n._document=t,n._config=r,n._canvasFactory=function(e,t){var r=n._document.createElement("canvas");return r.width=e,r.height=t,r},n}return i(t,e),t.prototype._doWarmUp=function(){var e=this,t=s.generateStaticCharAtlasTexture(window,this._canvasFactory,this._config);t instanceof HTMLCanvasElement?this._texture=t:t.then(function(t){e._texture=t})},t.prototype._isCached=function(e,t){var r=e.code<256,n=e.fg<16,i=e.fg===o.DEFAULT_COLOR,s=e.bg===o.DEFAULT_COLOR;return r&&(n||i)&&s&&!e.italic},t.prototype.draw=function(e,t,r,n){if(null===this._texture||void 0===this._texture)return!1;var i=0;if(l.is256Color(t.fg)?i=2+t.fg+(t.bold?16:0):t.fg===o.DEFAULT_COLOR&&t.bold&&(i=1),!this._isCached(t,i))return!1;e.save();var s=this._config.scaledCharWidth+o.CHAR_ATLAS_CELL_SPACING,a=this._config.scaledCharHeight+o.CHAR_ATLAS_CELL_SPACING;return t.dim&&(e.globalAlpha=o.DIM_OPACITY),e.drawImage(this._texture,t.code*s,i*a,s,this._config.scaledCharHeight,r,n,s,this._config.scaledCharHeight),e.restore(),!0},t}(a.default);t.default=c},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.draw=function(e,t,r,n){return!1},t}(r(62).default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.capacity=e,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return e.prototype._unlinkNode=function(e){var t=e.prev,r=e.next;e===this._head&&(this._head=r),e===this._tail&&(this._tail=t),null!==t&&(t.next=r),null!==r&&(r.prev=t)},e.prototype._appendNode=function(e){var t=this._tail;null!==t&&(t.next=e),e.prev=t,e.next=null,this._tail=e,null===this._head&&(this._head=e)},e.prototype.prealloc=function(e){for(var t=this._nodePool,r=0;r<e;r++)t.push({prev:null,next:null,key:null,value:null})},e.prototype.get=function(e){var t=this._map[e];return void 0!==t?(this._unlinkNode(t),this._appendNode(t),t.value):null},e.prototype.peekValue=function(e){var t=this._map[e];return void 0!==t?t.value:null},e.prototype.peek=function(){var e=this._head;return null===e?null:e.value},e.prototype.set=function(e,t){var r=this._map[e];if(void 0!==r)r=this._map[e],this._unlinkNode(r),r.value=t;else if(this.size>=this.capacity)r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=e,r.value=t,this._map[e]=r;else{var n=this._nodePool;n.length>0?((r=n.pop()).key=e,r.value=t):r={prev:null,next:null,key:e,value:t},this._map[e]=r,this.size++}this._appendNode(r)},e}();t.default=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(14),s=r(62),a=r(47),l=r(85),c=r(128),h=r(36),u=1024,f=1024,_={css:"rgba(0, 0, 0, 0)",rgba:0};function d(e){return e.code<<21|e.bg<<12|e.fg<<3|(e.bold?0:4)+(e.dim?0:2)+(e.italic?0:1)}t.getGlyphCacheKey=d;var p=function(e){function t(t,r){var n=e.call(this)||this;n._config=r,n._drawToCacheCount=0,n._glyphsWaitingOnBitmap=[],n._bitmapCommitTimeout=null,n._bitmap=null,n._cacheCanvas=t.createElement("canvas"),n._cacheCanvas.width=u,n._cacheCanvas.height=f,n._cacheCtx=n._cacheCanvas.getContext("2d",{alpha:!0});var i=t.createElement("canvas");i.width=n._config.scaledCharWidth,i.height=n._config.scaledCharHeight,n._tmpCtx=i.getContext("2d",{alpha:n._config.allowTransparency}),n._width=Math.floor(u/n._config.scaledCharWidth),n._height=Math.floor(f/n._config.scaledCharHeight);var o=n._width*n._height;return n._cacheMap=new c.default(o),n._cacheMap.prealloc(o),n}return i(t,e),t.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},t.prototype.beginFrame=function(){this._drawToCacheCount=0},t.prototype.draw=function(e,t,r,n){if(32===t.code)return!0;if(!this._canCache(t))return!1;var i=d(t),o=this._cacheMap.get(i);if(null!==o&&void 0!==o)return this._drawFromCache(e,o,r,n),!0;if(this._drawToCacheCount<100){var s=void 0;s=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var a=this._drawToCache(t,s);return this._cacheMap.set(i,a),this._drawFromCache(e,a,r,n),!0}return!1},t.prototype._canCache=function(e){return e.code<256},t.prototype._toCoordinateX=function(e){return e%this._width*this._config.scaledCharWidth},t.prototype._toCoordinateY=function(e){return Math.floor(e/this._width)*this._config.scaledCharHeight},t.prototype._drawFromCache=function(e,t,r,n){if(!t.isEmpty){var i=this._toCoordinateX(t.index),o=this._toCoordinateY(t.index);e.drawImage(t.inBitmap?this._bitmap:this._cacheCanvas,i,o,this._config.scaledCharWidth,this._config.scaledCharHeight,r,n,this._config.scaledCharWidth,this._config.scaledCharHeight)}},t.prototype._getColorFromAnsiIndex=function(e){return e<this._config.colors.ansi.length?this._config.colors.ansi[e]:a.DEFAULT_ANSI_COLORS[e]},t.prototype._getBackgroundColor=function(e){return this._config.allowTransparency?_:e.bg===o.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:e.bg<256?this._getColorFromAnsiIndex(e.bg):this._config.colors.background},t.prototype._getForegroundColor=function(e){return e.fg===o.INVERTED_DEFAULT_COLOR?this._config.colors.background:e.fg<256?this._getColorFromAnsiIndex(e.fg):this._config.colors.foreground},t.prototype._drawToCache=function(e,t){this._drawToCacheCount++,this._tmpCtx.save();var r=this._getBackgroundColor(e);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=r.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var n=e.bold?this._config.fontWeightBold:this._config.fontWeight,i=e.italic?"italic":"";this._tmpCtx.font=i+" "+n+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(e).css,e.dim&&(this._tmpCtx.globalAlpha=o.DIM_OPACITY),this._tmpCtx.fillText(e.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var s=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),a=!1;this._config.allowTransparency||(a=l.clearColor(s,r));var c=this._toCoordinateX(t),h=this._toCoordinateY(t);this._cacheCtx.putImageData(s,c,h);var u={index:t,isEmpty:a,inBitmap:!1};return this._addGlyphToBitmap(u),u},t.prototype._addGlyphToBitmap=function(e){var t=this;"createImageBitmap"in window&&!h.isFirefox&&!h.isSafari&&(this._glyphsWaitingOnBitmap.push(e),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout(function(){return t._generateBitmap()},100)))},t.prototype._generateBitmap=function(){var e=this,t=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(r){e._bitmap=r;for(var n=0;n<t.length;n++){t[n].inBitmap=!0}}),this._bitmapCommitTimeout=null},t}(s.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.cache=[]}return e.prototype.resize=function(e,t){for(var r=0;r<e;r++){this.cache.length<=r&&this.cache.push([]);for(var n=this.cache[r].length;n<t;n++)this.cache[r].push(null);this.cache[r].length=t}this.cache.length=e},e.prototype.clear=function(){for(var e=0;e<this.cache.length;e++)for(var t=0;t<this.cache[e].length;t++)this.cache[e][t]=null},e}();t.GridCache=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(9),s=r(14),a=r(130),l=r(48),c=r(37),h=function(e){function t(t,r,n,i,o){var s=e.call(this,t,"text",r,o,n)||this;return s._characterOverlapCache={},s._state=new a.GridCache,s._characterJoinerRegistry=i,s}return i(t,e),t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r);var n=this._getFont(t,!1,!1);this._characterWidth===r.scaledCharWidth&&this._characterFont===n||(this._characterWidth=r.scaledCharWidth,this._characterFont=n,this._characterOverlapCache={}),this._state.clear(),this._state.resize(t.cols,t.rows)},t.prototype.reset=function(e){this._state.clear(),this.clearAll()},t.prototype._forEachCell=function(e,t,r,n,i){for(var a=t;a<=r;a++)for(var l=a+e.buffer.ydisp,c=e.buffer.lines.get(l),h=n?n.getJoinedCharacters(l):[],u=0;u<e.cols;u++){var f=c.get(u),_=f[o.CHAR_DATA_CODE_INDEX]||o.WHITESPACE_CELL_CODE,d=f[o.CHAR_DATA_CHAR_INDEX]||o.WHITESPACE_CELL_CHAR,p=f[o.CHAR_DATA_ATTR_INDEX],m=f[o.CHAR_DATA_WIDTH_INDEX],y=!1,v=u;if(0!==m){if(h.length>0&&u===h[0][0]){y=!0;var g=h.shift();d=e.buffer.translateBufferLineToString(l,!0,g[0],g[1]),m=g[1]-g[0],_=1/0,v=g[1]-1}!y&&this._isOverlapping(f)&&v<c.length-1&&c.get(v+1)[o.CHAR_DATA_CODE_INDEX]===o.NULL_CELL_CODE&&(m=2);var b=p>>18,C=511&p,w=p>>9&511;if(8&b){var E=C;C=w,(w=E)===s.DEFAULT_COLOR&&(w=s.INVERTED_DEFAULT_COLOR),C===s.DEFAULT_COLOR&&(C=s.INVERTED_DEFAULT_COLOR)}i(_,d,m,u,a,w,C,b),u=v}}},t.prototype._drawBackground=function(e,t,r){var n=this,i=this._ctx,o=e.cols,a=0,l=0,h=null;i.save(),this._forEachCell(e,t,r,null,function(e,t,r,u,f,_,d,p){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()},t.prototype._drawForeground=function(e,t,r){var n=this;this._forEachCell(e,t,r,this._characterJoinerRegistry,function(t,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(e,r,t,i,o,a,l,h,!!(1&u),!!(32&u),!!(64&u)))})},t.prototype.onGridChanged=function(e,t,r){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this.clearCells(0,t,e.cols,r-t+1),this._drawBackground(e,t,r),this._drawForeground(e,t,r))},t.prototype.onOptionsChanged=function(e){this.setTransparency(e,e.options.allowTransparency)},t.prototype._isOverlapping=function(e){if(1!==e[o.CHAR_DATA_WIDTH_INDEX])return!1;if(e[o.CHAR_DATA_CODE_INDEX]<256)return!1;var t=e[o.CHAR_DATA_CHAR_INDEX];if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;var r=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=r,r},t}(l.BaseRenderLayer);t.TextRenderLayer=h},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(131),s=r(125),a=r(124),l=r(47),c=r(123),h=r(17),u=r(61),f=r(84),_=r(122),d=function(e){function t(t,r){var n=e.call(this)||this;n._terminal=t,n._isPaused=!1,n._needsFullRefresh=!1;var i=n._terminal.options.allowTransparency;if(n.colorManager=new l.ColorManager(document,i),n._characterJoinerRegistry=new _.CharacterJoinerRegistry(t),r&&n.colorManager.setTheme(r),n._renderLayers=[new o.TextRenderLayer(n._terminal.screenElement,0,n.colorManager.colors,n._characterJoinerRegistry,i),new s.SelectionRenderLayer(n._terminal.screenElement,1,n.colorManager.colors),new c.LinkRenderLayer(n._terminal.screenElement,2,n.colorManager.colors,n._terminal),new a.CursorRenderLayer(n._terminal.screenElement,3,n.colorManager.colors)],n.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},n._devicePixelRatio=window.devicePixelRatio,n._updateDimensions(),n.onOptionsChanged(),n._renderDebouncer=new u.RenderDebouncer(n._terminal,n._renderRows.bind(n)),n._screenDprMonitor=new f.ScreenDprMonitor,n._screenDprMonitor.setListener(function(){return n.onWindowResize(window.devicePixelRatio)}),n.register(n._screenDprMonitor),"IntersectionObserver"in window){var h=new IntersectionObserver(function(e){return n.onIntersectionChange(e[e.length-1])},{threshold:0});h.observe(n._terminal.element),n.register({dispose:function(){return h.disconnect()}})}return n}return i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._renderLayers.forEach(function(e){return e.dispose()})},t.prototype.onIntersectionChange=function(e){this._isPaused=0===e.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&this._terminal.refresh(0,this._terminal.rows-1)},t.prototype.onWindowResize=function(e){this._devicePixelRatio!==e&&(this._devicePixelRatio=e,this.onResize(this._terminal.cols,this._terminal.rows))},t.prototype.setTheme=function(e){var t=this;return this.colorManager.setTheme(e),this._renderLayers.forEach(function(e){e.onThemeChanged(t._terminal,t.colorManager.colors),e.reset(t._terminal)}),this._isPaused?this._needsFullRefresh=!0:this._terminal.refresh(0,this._terminal.rows-1),this.colorManager.colors},t.prototype.onResize=function(e,t){var r=this;this._updateDimensions(),this._renderLayers.forEach(function(e){return e.resize(r._terminal,r.dimensions)}),this._isPaused?this._needsFullRefresh=!0:this._terminal.refresh(0,this._terminal.rows-1),this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px",this.emit("resize",{width:this.dimensions.canvasWidth,height:this.dimensions.canvasHeight})},t.prototype.onCharSizeChanged=function(){this.onResize(this._terminal.cols,this._terminal.rows)},t.prototype.onBlur=function(){var e=this;this._runOperation(function(t){return t.onBlur(e._terminal)})},t.prototype.onFocus=function(){var e=this;this._runOperation(function(t){return t.onFocus(e._terminal)})},t.prototype.onSelectionChanged=function(e,t,r){var n=this;void 0===r&&(r=!1),this._runOperation(function(i){return i.onSelectionChanged(n._terminal,e,t,r)})},t.prototype.onCursorMove=function(){var e=this;this._runOperation(function(t){return t.onCursorMove(e._terminal)})},t.prototype.onOptionsChanged=function(){var e=this;this.colorManager.allowTransparency=this._terminal.options.allowTransparency,this._runOperation(function(t){return t.onOptionsChanged(e._terminal)})},t.prototype.clear=function(){var e=this;this._runOperation(function(t){return t.reset(e._terminal)})},t.prototype._runOperation=function(e){this._isPaused?this._needsFullRefresh=!0:this._renderLayers.forEach(function(t){return e(t)})},t.prototype.refreshRows=function(e,t){this._isPaused?this._needsFullRefresh=!0:this._renderDebouncer.refresh(e,t)},t.prototype._renderRows=function(e,t){var r=this;this._renderLayers.forEach(function(n){return n.onGridChanged(r._terminal,e,t)}),this._terminal.emit("refresh",{start:e,end:t})},t.prototype._updateDimensions=function(){this._terminal.charMeasure.width&&this._terminal.charMeasure.height&&(this.dimensions.scaledCharWidth=Math.floor(this._terminal.charMeasure.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=1===this._terminal.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols)},t.prototype.registerCharacterJoiner=function(e){return this._characterJoinerRegistry.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._characterJoinerRegistry.deregisterCharacterJoiner(e)},t}(h.EventEmitter);t.Renderer=d},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(26),s=r(87);function a(e,t){for(var r=t-e,n=new Array(r);r--;)n[r]=--t;return n}var l=function(){function e(e){this.table="undefined"==typeof Uint8Array?new Array(e):new Uint8Array(e)}return e.prototype.add=function(e,t,r,n){this.table[t<<8|e]=(0|r)<<4|(void 0===n?t:n)},e.prototype.addMany=function(e,t,r,n){for(var i=0;i<e.length;i++)this.add(e[i],t,r,n)},e}();t.TransitionTable=l;var c=a(32,127),h=a(0,24);h.push(25),h.push.apply(h,a(28,32));t.VT500_TRANSITION_TABLE=function(){var e,t=new l(4095),r=a(0,14);for(e in r)for(var n=0;n<=160;++n)t.add(n,e,1,0);for(e in t.addMany(c,0,2,0),r)t.addMany([24,26,153,154],e,3,0),t.addMany(a(128,144),e,3,0),t.addMany(a(144,152),e,3,0),t.add(156,e,0,0),t.add(27,e,11,1),t.add(157,e,4,8),t.addMany([152,158,159],e,0,7),t.add(155,e,11,3),t.add(144,e,11,9);return t.addMany(h,0,3,0),t.addMany(h,1,3,1),t.add(127,1,0,1),t.addMany(h,8,0,8),t.addMany(h,3,3,3),t.add(127,3,0,3),t.addMany(h,4,3,4),t.add(127,4,0,4),t.addMany(h,6,3,6),t.addMany(h,5,3,5),t.add(127,5,0,5),t.addMany(h,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(c,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(a(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(c,7,0,7),t.addMany(h,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(a(64,127),3,7,0),t.addMany(a(48,58),3,8,4),t.add(59,3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(a(48,58),4,8,4),t.add(59,4,8,4),t.addMany(a(64,127),4,7,0),t.addMany([58,60,61,62,63],4,0,6),t.addMany(a(32,64),6,0,6),t.add(127,6,0,6),t.addMany(a(64,127),6,0,0),t.add(58,3,0,6),t.addMany(a(32,48),3,9,5),t.addMany(a(32,48),5,9,5),t.addMany(a(48,64),5,0,6),t.addMany(a(64,127),5,7,0),t.addMany(a(32,48),4,9,5),t.addMany(a(32,48),1,9,2),t.addMany(a(32,48),2,9,2),t.addMany(a(48,127),2,10,0),t.addMany(a(48,80),1,10,0),t.addMany(a(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(a(96,127),1,10,0),t.add(80,1,11,9),t.addMany(h,9,0,9),t.add(127,9,0,9),t.addMany(a(28,32),9,0,9),t.addMany(a(32,48),9,9,12),t.add(58,9,0,11),t.addMany(a(48,58),9,8,10),t.add(59,9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(h,11,0,11),t.addMany(a(32,128),11,0,11),t.addMany(a(28,32),11,0,11),t.addMany(h,10,0,10),t.add(127,10,0,10),t.addMany(a(28,32),10,0,10),t.addMany(a(48,58),10,8,10),t.add(59,10,8,10),t.addMany([58,60,61,62,63],10,0,11),t.addMany(a(32,48),10,9,12),t.addMany(h,12,0,12),t.add(127,12,0,12),t.addMany(a(28,32),12,0,12),t.addMany(a(32,48),12,9,12),t.addMany(a(48,64),12,0,11),t.addMany(a(64,127),12,12,13),t.addMany(a(64,127),10,12,13),t.addMany(a(64,127),9,12,13),t.addMany(h,13,13,13),t.addMany(c,13,13,13),t.add(127,13,0,13),t.addMany([27,156],13,14,0),t.add(160,8,5,8),t}();var u=function(){function e(){}return e.prototype.hook=function(e,t,r){},e.prototype.put=function(e,t,r){},e.prototype.unhook=function(){},e}(),f=function(e){function r(r){void 0===r&&(r=t.VT500_TRANSITION_TABLE);var n=e.call(this)||this;return n.TRANSITIONS=r,n.initialState=0,n.currentState=n.initialState,n._osc="",n._params=[0],n._collect="",n._printHandlerFb=function(e,t,r){},n._executeHandlerFb=function(e){},n._csiHandlerFb=function(e,t,r){},n._escHandlerFb=function(e,t){},n._oscHandlerFb=function(e,t){},n._dcsHandlerFb=new u,n._errorHandlerFb=function(e){return e},n._printHandler=n._printHandlerFb,n._executeHandlers=Object.create(null),n._csiHandlers=Object.create(null),n._escHandlers=Object.create(null),n._oscHandlers=Object.create(null),n._dcsHandlers=Object.create(null),n._activeDcsHandler=null,n._errorHandler=n._errorHandlerFb,n.setEscHandler("\\",function(){}),n}return i(r,e),r.prototype.dispose=function(){this._printHandlerFb=null,this._executeHandlerFb=null,this._csiHandlerFb=null,this._escHandlerFb=null,this._oscHandlerFb=null,this._dcsHandlerFb=null,this._errorHandlerFb=null,this._printHandler=null,this._executeHandlers=null,this._escHandlers=null,this._csiHandlers=null,this._oscHandlers=null,this._dcsHandlers=null,this._activeDcsHandler=null,this._errorHandler=null},r.prototype.setPrintHandler=function(e){this._printHandler=e},r.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},r.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},r.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},r.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},r.prototype.addCsiHandler=function(e,t){var r=e.charCodeAt(0);void 0===this._csiHandlers[r]&&(this._csiHandlers[r]=[]);var n=this._csiHandlers[r];return n.push(t),{dispose:function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}}},r.prototype.setCsiHandler=function(e,t){this._csiHandlers[e.charCodeAt(0)]=[t]},r.prototype.clearCsiHandler=function(e){this._csiHandlers[e.charCodeAt(0)]&&delete this._csiHandlers[e.charCodeAt(0)]},r.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},r.prototype.setEscHandler=function(e,t){this._escHandlers[e]=t},r.prototype.clearEscHandler=function(e){this._escHandlers[e]&&delete this._escHandlers[e]},r.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},r.prototype.addOscHandler=function(e,t){void 0===this._oscHandlers[e]&&(this._oscHandlers[e]=[]);var r=this._oscHandlers[e];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},r.prototype.setOscHandler=function(e,t){this._oscHandlers[e]=[t]},r.prototype.clearOscHandler=function(e){this._oscHandlers[e]&&delete this._oscHandlers[e]},r.prototype.setOscHandlerFallback=function(e){this._oscHandlerFb=e},r.prototype.setDcsHandler=function(e,t){this._dcsHandlers[e]=t},r.prototype.clearDcsHandler=function(e){this._dcsHandlers[e]&&delete this._dcsHandlers[e]},r.prototype.setDcsHandlerFallback=function(e){this._dcsHandlerFb=e},r.prototype.setErrorHandler=function(e){this._errorHandler=e},r.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},r.prototype.reset=function(){this.currentState=this.initialState,this._osc="",this._params=[0],this._collect="",this._activeDcsHandler=null},r.prototype.parse=function(e,t){for(var r=0,n=0,i=!1,o=this.currentState,a=-1,l=-1,c=this._osc,h=this._collect,u=this._params,f=this.TRANSITIONS.table,_=this._activeDcsHandler,d=null,p=0;p<t;++p)if(r=e[p],0===o&&r>31&&r<128){a=~a?a:p;do{p++}while(p<t&&e[p]>31&&e[p]<128);p--}else if(4===o&&r>47&&r<57)u[u.length-1]=10*u[u.length-1]+r-48;else{switch((n=f[o<<8|(r<160?r:160)])>>4){case 2:a=~a?a:p;break;case 3:~a&&(this._printHandler(e,a,p),a=-1),(d=this._executeHandlers[r])?d():this._executeHandlerFb(r);break;case 0:~a?(this._printHandler(e,a,p),a=-1):~l&&(_.put(e,l,p),l=-1);break;case 1:if(r>159)switch(o){case 0:a=~a?a:p;break;case 6:n|=6;break;case 11:n|=11;break;case 13:l=~l?l:p,n|=13;break;default:i=!0}else i=!0;if(i){if(this._errorHandler({position:p,code:r,currentState:o,print:a,dcs:l,osc:c,collect:h,params:u,abort:!1}).abort)return;i=!1}break;case 7:for(var m=this._csiHandlers[r],y=m?m.length-1:-1;y>=0&&!m[y](u,h);y--);y<0&&this._csiHandlerFb(h,u,r);break;case 8:59===r?u.push(0):u[u.length-1]=10*u[u.length-1]+r-48;break;case 9:h+=String.fromCharCode(r);break;case 10:(d=this._escHandlers[h+String.fromCharCode(r)])?d(h,r):this._escHandlerFb(h,r);break;case 11:~a&&(this._printHandler(e,a,p),a=-1),c="",u=[0],h="",l=-1;break;case 12:(_=this._dcsHandlers[h+String.fromCharCode(r)])||(_=this._dcsHandlerFb),_.hook(h,u,r);break;case 13:l=~l?l:p;break;case 14:_&&(~l&&_.put(e,l,p),_.unhook(),_=null),27===r&&(n|=1),c="",u=[0],h="",l=-1;break;case 4:~a&&(this._printHandler(e,a,p),a=-1),c="";break;case 5:for(var v=p+1;;v++)if(v>=t||(r=e[v])<32||r>127&&r<=159){c+=s.utf32ToString(e,p,v),p=v-1;break}break;case 6:if(c&&24!==r&&26!==r){var g=c.indexOf(";");if(-1===g)this._oscHandlerFb(-1,c);else{for(var b=parseInt(c.substring(0,g)),C=c.substring(g+1),w=this._oscHandlers[b],E=w?w.length-1:-1;E>=0&&!w[E](C);E--);E<0&&this._oscHandlerFb(b,C)}}27===r&&(n|=1),c="",u=[0],h="",l=-1}o=15&n}0===o&&~a?this._printHandler(e,a,t):13===o&&~l&&_&&_.put(e,l,t),this._osc=c,this._collect=h,this._params=u,this._activeDcsHandler=_,this.currentState=o},r}(o.Disposable);t.EscapeSequenceParser=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"\t",c:"\f",d:"\r",e:"\n",f:"°",g:"±",h:"␤",i:"\v",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=null,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(49),s=r(134),a=r(9),l=r(89),c=r(133),h=r(26),u=r(88),f=r(87),_={"(":0,")":1,"*":2,"+":3,"-":1,".":2},d=function(){function e(e){this._terminal=e,this._data=new Uint32Array(0)}return e.prototype.hook=function(e,t,r){this._data=new Uint32Array(0)},e.prototype.put=function(e,t,r){this._data=u.concat(this._data,e.subarray(t,r))},e.prototype.unhook=function(){var e=f.utf32ToString(this._data);switch(this._data=new Uint32Array(0),e){case'"q':return this._terminal.handler(o.C0.ESC+'P1$r0"q'+o.C0.ESC+"\\");case'"p':return this._terminal.handler(o.C0.ESC+'P1$r61"p'+o.C0.ESC+"\\");case"r":var t=this._terminal.buffer.scrollTop+1+";"+(this._terminal.buffer.scrollBottom+1)+"r";return this._terminal.handler(o.C0.ESC+"P1$r"+t+o.C0.ESC+"\\");case"m":return this._terminal.handler(o.C0.ESC+"P1$r0m"+o.C0.ESC+"\\");case" q":var r={block:2,underline:4,bar:6}[this._terminal.getOption("cursorStyle")];return r-=this._terminal.getOption("cursorBlink"),this._terminal.handler(o.C0.ESC+"P1$r"+r+" q"+o.C0.ESC+"\\");default:this._terminal.error("Unknown DCS $q %s",e),this._terminal.handler(o.C0.ESC+"P0$r"+o.C0.ESC+"\\")}},e}(),p=function(e){function t(t,r){void 0===r&&(r=new c.EscapeSequenceParser);var n=e.call(this)||this;n._terminal=t,n._parser=r,n._parseBuffer=new Uint32Array(4096),n._stringDecoder=new f.StringToUtf32,n.register(n._parser),n._parser.setCsiHandlerFallback(function(e,t,r){n._terminal.error("Unknown CSI code: ",{collect:e,params:t,flag:String.fromCharCode(r)})}),n._parser.setEscHandlerFallback(function(e,t){n._terminal.error("Unknown ESC code: ",{collect:e,flag:String.fromCharCode(t)})}),n._parser.setExecuteHandlerFallback(function(e){n._terminal.error("Unknown EXECUTE code: ",{code:e})}),n._parser.setOscHandlerFallback(function(e,t){n._terminal.error("Unknown OSC code: ",{identifier:e,data:t})}),n._parser.setPrintHandler(function(e,t,r){return n.print(e,t,r)}),n._parser.setCsiHandler("@",function(e,t){return n.insertChars(e)}),n._parser.setCsiHandler("A",function(e,t){return n.cursorUp(e)}),n._parser.setCsiHandler("B",function(e,t){return n.cursorDown(e)}),n._parser.setCsiHandler("C",function(e,t){return n.cursorForward(e)}),n._parser.setCsiHandler("D",function(e,t){return n.cursorBackward(e)}),n._parser.setCsiHandler("E",function(e,t){return n.cursorNextLine(e)}),n._parser.setCsiHandler("F",function(e,t){return n.cursorPrecedingLine(e)}),n._parser.setCsiHandler("G",function(e,t){return n.cursorCharAbsolute(e)}),n._parser.setCsiHandler("H",function(e,t){return n.cursorPosition(e)}),n._parser.setCsiHandler("I",function(e,t){return n.cursorForwardTab(e)}),n._parser.setCsiHandler("J",function(e,t){return n.eraseInDisplay(e)}),n._parser.setCsiHandler("K",function(e,t){return n.eraseInLine(e)}),n._parser.setCsiHandler("L",function(e,t){return n.insertLines(e)}),n._parser.setCsiHandler("M",function(e,t){return n.deleteLines(e)}),n._parser.setCsiHandler("P",function(e,t){return n.deleteChars(e)}),n._parser.setCsiHandler("S",function(e,t){return n.scrollUp(e)}),n._parser.setCsiHandler("T",function(e,t){return n.scrollDown(e,t)}),n._parser.setCsiHandler("X",function(e,t){return n.eraseChars(e)}),n._parser.setCsiHandler("Z",function(e,t){return n.cursorBackwardTab(e)}),n._parser.setCsiHandler("`",function(e,t){return n.charPosAbsolute(e)}),n._parser.setCsiHandler("a",function(e,t){return n.hPositionRelative(e)}),n._parser.setCsiHandler("b",function(e,t){return n.repeatPrecedingCharacter(e)}),n._parser.setCsiHandler("c",function(e,t){return n.sendDeviceAttributes(e,t)}),n._parser.setCsiHandler("d",function(e,t){return n.linePosAbsolute(e)}),n._parser.setCsiHandler("e",function(e,t){return n.vPositionRelative(e)}),n._parser.setCsiHandler("f",function(e,t){return n.hVPosition(e)}),n._parser.setCsiHandler("g",function(e,t){return n.tabClear(e)}),n._parser.setCsiHandler("h",function(e,t){return n.setMode(e,t)}),n._parser.setCsiHandler("l",function(e,t){return n.resetMode(e,t)}),n._parser.setCsiHandler("m",function(e,t){return n.charAttributes(e)}),n._parser.setCsiHandler("n",function(e,t){return n.deviceStatus(e,t)}),n._parser.setCsiHandler("p",function(e,t){return n.softReset(e,t)}),n._parser.setCsiHandler("q",function(e,t){return n.setCursorStyle(e,t)}),n._parser.setCsiHandler("r",function(e,t){return n.setScrollRegion(e,t)}),n._parser.setCsiHandler("s",function(e,t){return n.saveCursor(e)}),n._parser.setCsiHandler("u",function(e,t){return n.restoreCursor(e)}),n._parser.setExecuteHandler(o.C0.BEL,function(){return n.bell()}),n._parser.setExecuteHandler(o.C0.LF,function(){return n.lineFeed()}),n._parser.setExecuteHandler(o.C0.VT,function(){return n.lineFeed()}),n._parser.setExecuteHandler(o.C0.FF,function(){return n.lineFeed()}),n._parser.setExecuteHandler(o.C0.CR,function(){return n.carriageReturn()}),n._parser.setExecuteHandler(o.C0.BS,function(){return n.backspace()}),n._parser.setExecuteHandler(o.C0.HT,function(){return n.tab()}),n._parser.setExecuteHandler(o.C0.SO,function(){return n.shiftOut()}),n._parser.setExecuteHandler(o.C0.SI,function(){return n.shiftIn()}),n._parser.setExecuteHandler(o.C1.IND,function(){return n.index()}),n._parser.setExecuteHandler(o.C1.NEL,function(){return n.nextLine()}),n._parser.setExecuteHandler(o.C1.HTS,function(){return n.tabSet()}),n._parser.setOscHandler(0,function(e){return n.setTitle(e)}),n._parser.setOscHandler(2,function(e){return n.setTitle(e)}),n._parser.setEscHandler("7",function(){return n.saveCursor([])}),n._parser.setEscHandler("8",function(){return n.restoreCursor([])}),n._parser.setEscHandler("D",function(){return n.index()}),n._parser.setEscHandler("E",function(){return n.nextLine()}),n._parser.setEscHandler("H",function(){return n.tabSet()}),n._parser.setEscHandler("M",function(){return n.reverseIndex()}),n._parser.setEscHandler("=",function(){return n.keypadApplicationMode()}),n._parser.setEscHandler(">",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(e){a._parser.setEscHandler("("+e,function(){return n.selectCharset("("+e)}),a._parser.setEscHandler(")"+e,function(){return n.selectCharset(")"+e)}),a._parser.setEscHandler("*"+e,function(){return n.selectCharset("*"+e)}),a._parser.setEscHandler("+"+e,function(){return n.selectCharset("+"+e)}),a._parser.setEscHandler("-"+e,function(){return n.selectCharset("-"+e)}),a._parser.setEscHandler("."+e,function(){return n.selectCharset("."+e)}),a._parser.setEscHandler("/"+e,function(){return n.selectCharset("/"+e)})},a=this;for(var l in s.CHARSETS)i(l);return n._parser.setErrorHandler(function(e){return n._terminal.error("Parsing error: ",e),e}),n._parser.setDcsHandler("$q",new d(n._terminal)),n}return i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._terminal=null},t.prototype.parse=function(e){if(this._terminal){var t=this._terminal.buffer,r=t.x,n=t.y;this._terminal.debug&&this._terminal.log("data: "+e),this._parseBuffer.length<e.length&&(this._parseBuffer=new Uint32Array(e.length));for(var i=0;i<e.length;++i)this._parseBuffer[i]=e.charCodeAt(i);this._parser.parse(this._parseBuffer,this._stringDecoder.decode(e,this._parseBuffer)),(t=this._terminal.buffer).x===r&&t.y===n||this._terminal.emit("cursormove")}},t.prototype.print=function(e,t,r){var n,i,o,s=this._terminal.buffer,c=this._terminal.charset,h=this._terminal.options.screenReaderMode,u=this._terminal.cols,_=this._terminal.wraparoundMode,d=this._terminal.insertMode,p=this._terminal.curAttr,m=s.lines.get(s.y+s.ybase);this._terminal.updateRange(s.y);for(var y=t;y<r;++y){if(n=e[y],i=f.stringFromCodePoint(n),o=l.wcwidth(n),n<127&&c){var v=c[i];v&&(n=v.charCodeAt(0),i=v)}if(h&&this._terminal.emit("a11y.char",i),o||!s.x){if(s.x+o-1>=u)if(_)s.x=0,s.y++,s.y>s.scrollBottom?(s.y--,this._terminal.scroll(!0)):s.lines.get(s.y).isWrapped=!0,m=s.lines.get(s.y+s.ybase);else if(2===o)continue;if(d)m.insertCells(s.x,o,[p,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),2===m.get(u-1)[a.CHAR_DATA_WIDTH_INDEX]&&m.set(u-1,[p,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);if(m.set(s.x++,[p,i,o,n]),o>0)for(;--o;)m.set(s.x++,[p,"",0,void 0])}else{var g=m.get(s.x-1);if(g)if(g[a.CHAR_DATA_WIDTH_INDEX])g[a.CHAR_DATA_CHAR_INDEX]+=i,g[a.CHAR_DATA_CODE_INDEX]=n,m.set(s.x-1,g);else{var b=m.get(s.x-2);b&&(b[a.CHAR_DATA_CHAR_INDEX]+=i,b[a.CHAR_DATA_CODE_INDEX]=n,m.set(s.x-2,b))}}}this._terminal.updateRange(s.y)},t.prototype.addCsiHandler=function(e,t){return this._parser.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._parser.addOscHandler(e,t)},t.prototype.bell=function(){this._terminal.bell()},t.prototype.lineFeed=function(){var e=this._terminal.buffer;this._terminal.options.convertEol&&(e.x=0),e.y++,e.y>e.scrollBottom&&(e.y--,this._terminal.scroll()),e.x>=this._terminal.cols&&e.x--,this._terminal.emit("linefeed")},t.prototype.carriageReturn=function(){this._terminal.buffer.x=0},t.prototype.backspace=function(){this._terminal.buffer.x>0&&this._terminal.buffer.x--},t.prototype.tab=function(){var e=this._terminal.buffer.x;this._terminal.buffer.x=this._terminal.buffer.nextStop(),this._terminal.options.screenReaderMode&&this._terminal.emit("a11y.tab",this._terminal.buffer.x-e)},t.prototype.shiftOut=function(){this._terminal.setgLevel(1)},t.prototype.shiftIn=function(){this._terminal.setgLevel(0)},t.prototype.insertChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).insertCells(this._terminal.buffer.x,e[0]||1,[this._terminal.eraseAttr(),a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.cursorUp=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0)},t.prototype.cursorDown=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,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--},t.prototype.cursorForward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.cursorBackward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.buffer.x-=t,this._terminal.buffer.x<0&&(this._terminal.buffer.x=0)},t.prototype.cursorNextLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},t.prototype.cursorPrecedingLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},t.prototype.cursorCharAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1},t.prototype.cursorPosition=function(e){var t,r=e[0]-1;t=e.length>=2?e[1]-1:0,r<0?r=0:r>=this._terminal.rows&&(r=this._terminal.rows-1),t<0?t=0:t>=this._terminal.cols&&(t=this._terminal.cols-1),this._terminal.buffer.x=t,this._terminal.buffer.y=r},t.prototype.cursorForwardTab=function(e){for(var t=e[0]||1;t--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},t.prototype._eraseInBufferLine=function(e,t,r,n){void 0===n&&(n=!1);var i=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+e);i.replaceCells(t,r,[this._terminal.eraseAttr(),a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),n&&(i.isWrapped=!1)},t.prototype._resetBufferLine=function(e){this._eraseInBufferLine(e,0,this._terminal.cols,!0)},t.prototype.eraseInDisplay=function(e){var t;switch(e[0]){case 0:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);t<this._terminal.rows;t++)this._resetBufferLine(t);this._terminal.updateRange(t);break;case 1:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t,0,this._terminal.buffer.x+1,!0),this._terminal.buffer.x+1>=this._terminal.cols&&(this._terminal.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 2:for(t=this._terminal.rows,this._terminal.updateRange(t-1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 3:var r=this._terminal.buffer.lines.length-this._terminal.rows;r>0&&(this._terminal.buffer.lines.trimStart(r),this._terminal.buffer.ybase=Math.max(this._terminal.buffer.ybase-r,0),this._terminal.buffer.ydisp=Math.max(this._terminal.buffer.ydisp-r,0),this._terminal.emit("scroll",0))}},t.prototype.eraseInLine=function(e){switch(e[0]){case 0:this._eraseInBufferLine(this._terminal.buffer.y,this._terminal.buffer.x,this._terminal.cols);break;case 1:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.buffer.x+1);break;case 2:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.cols)}this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.insertLines=function(e){var t=e[0];t<1&&(t=1);for(var r=this._terminal.buffer,n=r.y+r.ybase,i=this._terminal.rows-1-r.scrollBottom,o=this._terminal.rows-1+r.ybase-i+1;t--;)r.lines.splice(o-1,1),r.lines.splice(n,0,r.getBlankLine(this._terminal.eraseAttr()));this._terminal.updateRange(r.y),this._terminal.updateRange(r.scrollBottom)},t.prototype.deleteLines=function(e){var t=e[0];t<1&&(t=1);var r,n=this._terminal.buffer,i=n.y+n.ybase;for(r=this._terminal.rows-1-n.scrollBottom,r=this._terminal.rows-1+n.ybase-r;t--;)n.lines.splice(i,1),n.lines.splice(r,0,n.getBlankLine(this._terminal.eraseAttr()));this._terminal.updateRange(n.y),this._terminal.updateRange(n.scrollBottom)},t.prototype.deleteChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).deleteCells(this._terminal.buffer.x,e[0]||1,[this._terminal.eraseAttr(),a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.scrollUp=function(e){for(var t=e[0]||1,r=this._terminal.buffer;t--;)r.lines.splice(r.ybase+r.scrollTop,1),r.lines.splice(r.ybase+r.scrollBottom,0,r.getBlankLine(a.DEFAULT_ATTR));this._terminal.updateRange(r.scrollTop),this._terminal.updateRange(r.scrollBottom)},t.prototype.scrollDown=function(e,t){if(e.length<2&&!t){for(var r=e[0]||1,n=this._terminal.buffer;r--;)n.lines.splice(n.ybase+n.scrollBottom,1),n.lines.splice(n.ybase+n.scrollBottom,0,n.getBlankLine(a.DEFAULT_ATTR));this._terminal.updateRange(n.scrollTop),this._terminal.updateRange(n.scrollBottom)}},t.prototype.eraseChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).replaceCells(this._terminal.buffer.x,this._terminal.buffer.x+(e[0]||1),[this._terminal.eraseAttr(),a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE])},t.prototype.cursorBackwardTab=function(e){for(var t=e[0]||1,r=this._terminal.buffer;t--;)r.x=r.prevStop()},t.prototype.charPosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.hPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.repeatPrecedingCharacter=function(e){var t=this._terminal.buffer,r=t.lines.get(t.ybase+t.y);r.replaceCells(t.x,t.x+(e[0]||1),r.get(t.x-1)||[a.DEFAULT_ATTR,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE])},t.prototype.sendDeviceAttributes=function(e,t){e[0]>0||(t?">"===t&&(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(e[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"))},t.prototype.linePosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y=t-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},t.prototype.vPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,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--},t.prototype.hVPosition=function(e){e[0]<1&&(e[0]=1),e[1]<1&&(e[1]=1),this._terminal.buffer.y=e[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=e[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.tabClear=function(e){var t=e[0];t<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===t&&(this._terminal.buffer.tabs={})},t.prototype.setMode=function(e,t){if(e.length>1)for(var r=0;r<e.length;r++)this.setMode([e[r]]);else if(t){if("?"===t)switch(e[0]){case 1:this._terminal.applicationCursor=!0;break;case 2:this._terminal.setgCharset(0,s.DEFAULT_CHARSET),this._terminal.setgCharset(1,s.DEFAULT_CHARSET),this._terminal.setgCharset(2,s.DEFAULT_CHARSET),this._terminal.setgCharset(3,s.DEFAULT_CHARSET);break;case 3:this._terminal.savedCols=this._terminal.cols,this._terminal.resize(132,this._terminal.rows);break;case 6:this._terminal.originMode=!0;break;case 7:this._terminal.wraparoundMode=!0;break;case 12:break;case 66:this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=9===e[0],this._terminal.vt200Mouse=1e3===e[0],this._terminal.normalMouse=e[0]>1e3,this._terminal.mouseEvents=!0,this._terminal.element&&this._terminal.element.classList.add("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.disable(),this._terminal.log("Binding to mouse events.");break;case 1004:this._terminal.sendFocus=!0;break;case 1005:this._terminal.utfMouse=!0;break;case 1006:this._terminal.sgrMouse=!0;break;case 1015:this._terminal.urxvtMouse=!0;break;case 25:this._terminal.cursorHidden=!1;break;case 1048:this.saveCursor(e);break;case 1049:this.saveCursor(e);case 47:case 1047:this._terminal.buffers.activateAltBuffer(this._terminal.eraseAttr()),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!0}}else switch(e[0]){case 4:this._terminal.insertMode=!0}},t.prototype.resetMode=function(e,t){if(e.length>1)for(var r=0;r<e.length;r++)this.resetMode([e[r]]);else if(t){if("?"===t)switch(e[0]){case 1:this._terminal.applicationCursor=!1;break;case 3:132===this._terminal.cols&&this._terminal.savedCols&&this._terminal.resize(this._terminal.savedCols,this._terminal.rows),delete this._terminal.savedCols;break;case 6:this._terminal.originMode=!1;break;case 7:this._terminal.wraparoundMode=!1;break;case 12:break;case 66:this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=!1,this._terminal.vt200Mouse=!1,this._terminal.normalMouse=!1,this._terminal.mouseEvents=!1,this._terminal.element&&this._terminal.element.classList.remove("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.enable();break;case 1004:this._terminal.sendFocus=!1;break;case 1005:this._terminal.utfMouse=!1;break;case 1006:this._terminal.sgrMouse=!1;break;case 1015:this._terminal.urxvtMouse=!1;break;case 25:this._terminal.cursorHidden=!0;break;case 1048:this.restoreCursor(e);break;case 1049:case 47:case 1047:this._terminal.buffers.activateNormalBuffer(),1049===e[0]&&this.restoreCursor(e),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!1}}else switch(e[0]){case 4:this._terminal.insertMode=!1}},t.prototype.charAttributes=function(e){if(1!==e.length||0!==e[0]){for(var t,r=e.length,n=this._terminal.curAttr>>18,i=this._terminal.curAttr>>9&511,o=511&this._terminal.curAttr,s=0;s<r;s++)(t=e[s])>=30&&t<=37?i=t-30:t>=40&&t<=47?o=t-40:t>=90&&t<=97?i=(t+=8)-90:t>=100&&t<=107?o=(t+=8)-100:0===t?(n=a.DEFAULT_ATTR>>18,i=a.DEFAULT_ATTR>>9&511,o=511&a.DEFAULT_ATTR):1===t?n|=1:3===t?n|=64:4===t?n|=2:5===t?n|=4:7===t?n|=8:8===t?n|=16:2===t?n|=32:22===t?(n&=-2,n&=-33):23===t?n&=-65:24===t?n&=-3:25===t?n&=-5:27===t?n&=-9:28===t?n&=-17:39===t?i=a.DEFAULT_ATTR>>9&511:49===t?o=511&a.DEFAULT_ATTR:38===t?2===e[s+1]?(s+=2,-1===(i=this._terminal.matchColor(255&e[s],255&e[s+1],255&e[s+2]))&&(i=511),s+=2):5===e[s+1]&&(i=t=255&e[s+=2]):48===t?2===e[s+1]?(s+=2,-1===(o=this._terminal.matchColor(255&e[s],255&e[s+1],255&e[s+2]))&&(o=511),s+=2):5===e[s+1]&&(o=t=255&e[s+=2]):100===t?(i=a.DEFAULT_ATTR>>9&511,o=511&a.DEFAULT_ATTR):this._terminal.error("Unknown SGR attribute: %d.",t);this._terminal.curAttr=n<<18|i<<9|o}else this._terminal.curAttr=a.DEFAULT_ATTR},t.prototype.deviceStatus=function(e,t){if(t){if("?"===t)switch(e[0]){case 6:r=this._terminal.buffer.y+1,n=this._terminal.buffer.x+1;this._terminal.emit("data",o.C0.ESC+"[?"+r+";"+n+"R")}}else switch(e[0]){case 5:this._terminal.emit("data",o.C0.ESC+"[0n");break;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")}},t.prototype.softReset=function(e,t){"!"===t&&(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])},t.prototype.setCursorStyle=function(e,t){if(" "===t){var r=e[0]<1?1:e[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)}},t.prototype.setScrollRegion=function(e,t){t||(this._terminal.buffer.scrollTop=(e[0]||1)-1,this._terminal.buffer.scrollBottom=(e[1]&&e[1]<=this._terminal.rows?e[1]:this._terminal.rows)-1,this._terminal.buffer.x=0,this._terminal.buffer.y=0)},t.prototype.saveCursor=function(e){this._terminal.buffer.savedX=this._terminal.buffer.x,this._terminal.buffer.savedY=this._terminal.buffer.y,this._terminal.buffer.savedCurAttr=this._terminal.curAttr},t.prototype.restoreCursor=function(e){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},t.prototype.setTitle=function(e){this._terminal.handleTitle(e)},t.prototype.nextLine=function(){this._terminal.buffer.x=0,this.index()},t.prototype.keypadApplicationMode=function(){this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},t.prototype.keypadNumericMode=function(){this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},t.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0),this._terminal.setgCharset(0,s.DEFAULT_CHARSET)},t.prototype.selectCharset=function(e){if(2!==e.length)return this.selectDefaultCharset();"/"!==e[0]&&this._terminal.setgCharset(_[e[0]],s.CHARSETS[e[1]]||s.DEFAULT_CHARSET)},t.prototype.index=function(){this._terminal.index()},t.prototype.tabSet=function(){this._terminal.tabSet()},t.prototype.reverseIndex=function(){this._terminal.reverseIndex()},t.prototype.reset=function(){this._parser.reset(),this._terminal.reset()},t.prototype.setgLevel=function(e){this._terminal.setgLevel(e)},t}(h.Disposable);t.InputHandler=p},function(e,t,r){"use strict";function n(e){return e.replace(/\r?\n/g,"\r")}function i(e,t){return t?"\e[200~"+e+"\e[201~":e}function o(e,t){var r=t.screenElement.getBoundingClientRect(),n=e.clientX-r.left-10,i=e.clientY-r.top-10;t.textarea.style.position="absolute",t.textarea.style.width="20px",t.textarea.style.height="20px",t.textarea.style.left=n+"px",t.textarea.style.top=i+"px",t.textarea.style.zIndex="1000",t.textarea.focus(),setTimeout(function(){t.textarea.style.position=null,t.textarea.style.width=null,t.textarea.style.height=null,t.textarea.style.left=null,t.textarea.style.top=null,t.textarea.style.zIndex=null},200)}Object.defineProperty(t,"__esModule",{value:!0}),t.prepareTextForTerminal=n,t.bracketTextForPaste=i,t.copyHandler=function(e,t,r){t.browser.isMSIE?window.clipboardData.setData("Text",r.selectionText):e.clipboardData.setData("text/plain",r.selectionText),e.preventDefault()},t.pasteHandler=function(e,t){e.stopPropagation();var r=function(r){r=i(r=n(r),t.bracketedPasteMode),t.handler(r),t.textarea.value="",t.emit("paste",r),t.cancel(e)};t.browser.isMSIE?window.clipboardData&&r(window.clipboardData.getData("Text")):e.clipboardData&&r(e.clipboardData.getData("text/plain"))},t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(e,t,r,n){o(e,t),n&&!r.isClickInSelection(e)&&r.selectWordAtCursor(e),t.textarea.value=r.selectionText,t.textarea.select()}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(26),s=r(50),a=15,l=function(e){function t(t,r,n,i){var o=e.call(this)||this;return o._terminal=t,o._viewportElement=r,o._scrollArea=n,o._charMeasure=i,o.scrollBarWidth=0,o._currentRowHeight=0,o._lastRecordedBufferLength=0,o._lastRecordedViewportHeight=0,o._lastRecordedBufferHeight=0,o._lastScrollTop=0,o._wheelPartialScroll=0,o._refreshAnimationFrame=null,o._ignoreNextScrollEvent=!1,o.scrollBarWidth=o._viewportElement.offsetWidth-o._scrollArea.offsetWidth||a,o.register(s.addDisposableDomListener(o._viewportElement,"scroll",o._onScroll.bind(o))),setTimeout(function(){return o.syncScrollArea()},0),o}return i(t,e),t.prototype.onThemeChanged=function(e){this._viewportElement.style.backgroundColor=e.background.css},t.prototype._refresh=function(){var e=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return e._innerRefresh()}))},t.prototype._innerRefresh=function(){if(this._charMeasure.height>0){this._currentRowHeight=this._terminal.renderer.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._terminal.renderer.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._terminal.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},t.prototype.syncScrollArea=function(){if(this._lastRecordedBufferLength!==this._terminal.buffer.lines.length)return this._lastRecordedBufferLength=this._terminal.buffer.lines.length,void this._refresh();if(this._lastRecordedViewportHeight===this._terminal.renderer.dimensions.canvasHeight){var e=this._terminal.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===e&&this._lastScrollTop===this._viewportElement.scrollTop&&this._terminal.renderer.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh()}else this._refresh()},t.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._terminal.buffer.ydisp;this._terminal.scrollLines(t,!0)}},t.prototype.onWheel=function(e){var t=this._getPixelsScrolled(e);0!==t&&(this._viewportElement.scrollTop+=t,e.preventDefault())},t.prototype._getPixelsScrolled=function(e){if(0===e.deltaY)return 0;var t=e.deltaY;return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._terminal.rows),t},t.prototype.getLinesScrolled=function(e){if(0===e.deltaY)return 0;var t=e.deltaY;return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._terminal.rows),t},t.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},t.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,e.preventDefault())},t}(o.Disposable);t.Viewport=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t,r){this._textarea=e,this._compositionView=t,this._terminal=r,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}return e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),e){var r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(t._isSendingComposition){t._isSendingComposition=!1;var e=void 0;e=t._isComposing?t._textarea.value.substring(r.start,r.end):t._textarea.value.substring(r.start),t._terminal.handler(e)}},0)}else{this._isSendingComposition=!1;var n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._terminal.handler(n)}},e.prototype._handleAnyTextareaChanges=function(){var e=this,t=this._textarea.value;setTimeout(function(){if(!e._isComposing){var r=e._textarea.value.replace(t,"");r.length>0&&e._terminal.handler(r)}},0)},e.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._terminal.buffer.isCursorInViewport){var r=Math.ceil(this._terminal.charMeasure.height*this._terminal.options.lineHeight),n=this._terminal.buffer.y*r,i=this._terminal.buffer.x*this._terminal.charMeasure.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._terminal.options.fontFamily,this._compositionView.style.fontSize=this._terminal.options.fontSize+"px";var o=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=n+"px",this._textarea.style.width=o.width+"px",this._textarea.style.height=o.height+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(function(){return t.updateCompositionElements(!0)},0)}},e.prototype._clearTextareaPosition=function(){this._textarea.style.left="",this._textarea.style.top=""},e}();t.CompositionHelper=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var r=e.call(this)||this;return r._maxLength=t,r._array=new Array(r._maxLength),r._startIndex=0,r._length=0,r}return i(t,e),Object.defineProperty(t.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){if(this._maxLength!==e){for(var t=new Array(e),r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._length},set:function(e){if(e>this._length)for(var t=this._length;t<e;t++)this._array[t]=void 0;this._length=e},enumerable:!0,configurable:!0}),t.prototype.get=function(e){return this._array[this._getCyclicIndex(e)]},t.prototype.set=function(e,t){this._array[this._getCyclicIndex(e)]=t},t.prototype.push=function(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.emitMayRemoveListeners("trim",1)):this._length++},t.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.emitMayRemoveListeners("trim",1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(t.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!0,configurable:!0}),t.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},t.prototype.splice=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t){for(var i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t}for(i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+r.length)]=this._array[this._getCyclicIndex(i)];for(i=0;i<r.length;i++)this._array[this._getCyclicIndex(e+i)]=r[i];if(this._length+r.length>this._maxLength){var o=this._length+r.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.emitMayRemoveListeners("trim",o)}else this._length+=r.length},t.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.emitMayRemoveListeners("trim",e)},t.prototype.shiftElements=function(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(var n=t-1;n>=0;n--)this.set(e+n+r,this.get(e+n));var i=e+t+r-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.emitMayRemoveListeners("trim",1)}else for(n=0;n<t;n++)this.set(e+n+r,this.get(e+n))}},t.prototype._getCyclicIndex=function(e){return(this._startIndex+e)%this._maxLength},t}(r(17).EventEmitter);t.CircularList=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9);function i(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();var i=e[t].get(r-1),o=""===i[n.CHAR_DATA_CHAR_INDEX]&&1===i[n.CHAR_DATA_WIDTH_INDEX],s=2===e[t+1].getWidth(0);return o&&s?r-1:r}t.reflowLargerGetLinesToRemove=function(e,t,r,o){for(var s=[],a=0;a<e.length-1;a++){var l=a,c=e.get(++l);if(c.isWrapped){for(var h=[e.get(a)];l<e.length&&c.isWrapped;)h.push(c),c=e.get(++l);if(o>=a&&o<l)a+=h.length-1;else{for(var u=0,f=i(h,u,t),_=1,d=0;_<h.length;){var p=i(h,_,t),m=p-d,y=r-f,v=Math.min(m,y);h[u].copyCellsFrom(h[_],d,f,v,!1),(f+=v)===r&&(u++,f=0),(d+=v)===p&&(_++,d=0),0===f&&0!==u&&2===h[u-1].getWidth(r-1)&&(h[u].copyCellsFrom(h[u-1],r-1,f++,1,!1),h[u-1].set(r-1,n.FILL_CHAR_DATA))}h[u].replaceCells(f,r,n.FILL_CHAR_DATA);for(var g=0,b=h.length-1;b>0&&(b>u||0===h[b].getTrimmedLength());b--)g++;g>0&&(s.push(a+h.length-g),s.push(g)),a+=h.length-1}}}return s},t.reflowLargerCreateNewLayout=function(e,t){for(var r=[],n=0,i=t[n],o=0,s=0;s<e.length;s++)if(i===s){var a=t[++n];e.emit("delete",{index:s-o,amount:a}),s+=a-1,o+=a,i=t[++n]}else r.push(s);return{layout:r,countRemoved:o}},t.reflowLargerApplyNewLayout=function(e,t){for(var r=[],n=0;n<t.length;n++)r.push(e.get(t[n]));for(n=0;n<r.length;n++)e.set(n,r[n]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,r){for(var n=[],o=e.map(function(r,n){return i(e,n,t)}).reduce(function(e,t){return e+t}),s=0,a=0,l=0;l<o;){if(o-l<r){n.push(o-l);break}s+=r;var c=i(e,a,t);s>c&&(s-=c,a++);var h=2===e[a].getWidth(s-1);h&&s--;var u=h?r-1:r;n.push(u),l+=u}return n},t.getWrappedLineTrimmedLength=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),i=3,o=function(){function e(e,t,r){if(void 0===r&&(r=!1),this.isWrapped=r,this._data=null,this._combined={},t||(t=[0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),e){this._data=new Uint32Array(e*i);for(var o=0;o<e;++o)this.set(o,t)}this.length=e}return e.prototype.get=function(e){var t=this._data[e*i+1];return[this._data[e*i+0],2147483648&t?this._combined[e]:t?String.fromCharCode(t):"",this._data[e*i+2],2147483648&t?this._combined[e].charCodeAt(this._combined[e].length-1):t]},e.prototype.getWidth=function(e){return this._data[e*i+2]},e.prototype.set=function(e,t){this._data[e*i+0]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*i+1]=2147483648|e):this._data[e*i+1]=t[1].charCodeAt(0),this._data[e*i+2]=t[2]},e.prototype.insertCells=function(e,t,r){if(e%=this.length,t<this.length-e){for(var n=this.length-e-t-1;n>=0;--n)this.set(e+t+n,this.get(e+n));for(n=0;n<t;++n)this.set(e+n,r)}else for(n=e;n<this.length;++n)this.set(n,r)},e.prototype.deleteCells=function(e,t,r){if(e%=this.length,t<this.length-e){for(var n=0;n<this.length-e-t;++n)this.set(e+n,this.get(e+t+n));for(n=this.length-t;n<this.length;++n)this.set(n,r)}else for(n=e;n<this.length;++n)this.set(n,r)},e.prototype.replaceCells=function(e,t,r){for(;e<t&&e<this.length;)this.set(e++,r)},e.prototype.resize=function(e,t){if(e!==this.length){if(e>this.length){var r=new Uint32Array(e*i);this.length&&(e*i<this._data.length?r.set(this._data.subarray(0,e*i)):r.set(this._data)),this._data=r;for(var n=this.length;n<e;++n)this.set(n,t)}else if(e){(r=new Uint32Array(e*i)).set(this._data.subarray(0,e*i)),this._data=r;var o=Object.keys(this._combined);for(n=0;n<o.length;n++){var s=parseInt(o[n],10);s>=e&&delete this._combined[s]}}else this._data=null,this._combined={};this.length=e}},e.prototype.fill=function(e){this._combined={};for(var t=0;t<this.length;++t)this.set(t,e)},e.prototype.copyFrom=function(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];this.isWrapped=e.isWrapped},e.prototype.clone=function(){var t=new e(0);for(var r in t._data=new Uint32Array(this._data),t.length=this.length,this._combined)t._combined[r]=this._combined[r];return t.isWrapped=this.isWrapped,t},e.prototype.getTrimmedLength=function(){for(var e=this.length-1;e>=0;--e)if(0!==this._data[e*i+1])return e+this._data[e*i+2];return 0},e.prototype.copyCellsFrom=function(e,t,r,n,o){var s=e._data;if(o)for(var a=n-1;a>=0;a--)for(var l=0;l<i;l++)this._data[(r+a)*i+l]=s[(t+a)*i+l];else for(a=0;a<n;a++)for(l=0;l<i;l++)this._data[(r+a)*i+l]=s[(t+a)*i+l];var c=Object.keys(e._combined);for(l=0;l<c.length;l++){var h=parseInt(c[l],10);h>=t&&(this._combined[h-t+r]=e._combined[h])}},e.prototype.translateToString=function(e,t,r){void 0===e&&(e=!1),void 0===t&&(t=0),void 0===r&&(r=this.length),e&&(r=Math.min(r,this.getTrimmedLength()));for(var o="";t<r;){var s=this._data[t*i+1];o+=2147483648&s?this._combined[t]:s?String.fromCharCode(s):n.WHITESPACE_CELL_CHAR,t+=this._data[t*i+2]||1}return o},e}();t.BufferLine=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(9),s=function(e){function t(t){var r=e.call(this)||this;return r._terminal=t,r._normal=new o.Buffer(r._terminal,!0),r._normal.fillViewportRows(),r._alt=new o.Buffer(r._terminal,!1),r._activeBuffer=r._normal,r.setupTabStops(),r}return i(t,e),Object.defineProperty(t.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),t.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this.emit("activate",{activeBuffer:this._normal,inactiveBuffer:this._alt}))},t.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this.emit("activate",{activeBuffer:this._alt,inactiveBuffer:this._normal}))},t.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},t.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},t}(r(17).EventEmitter);t.BufferSet=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(142),s=r(9),a=r(138),l=r(17),c=r(137),h=r(136),u=r(49),f=r(135),_=r(132),d=r(121),p=r(120),m=r(117),y=r(36),v=r(50),g=r(60),b=r(82),C=r(116),w=r(47),E=r(83),S=r(115),A=r(84),L=r(86),x=r(114),k=r(112),T=r(111),O="undefined"!=typeof window?window.document:null,R=["cols","rows"],M={cols:80,rows:24,convertEol:!1,termName:"xterm",cursorBlink:!1,cursorStyle:"block",bellSound:C.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,enableBold:!0,experimentalCharAtlas:"static",fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,scrollback:1e3,screenKeys:!1,screenReaderMode:!1,debug:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,cancelEvents:!1,disableStdin:!1,useFlowControl:!1,allowTransparency:!1,tabStopWidth:8,theme:null,rightClickSelectsWord:y.isMac,rendererType:"canvas"},D=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.browser=y,r._blankLine=null,r.options=T.clone(t),r._setup(),r}return i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._customKeyEventHandler=null,L.removeTerminalFromCache(this),this.handler=function(){},this.write=function(){},this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},t.prototype.destroy=function(){this.dispose()},t.prototype._setup=function(){var e=this;Object.keys(M).forEach(function(t){null!==e.options[t]&&void 0!==e.options[t]||(e.options[t]=M[t])}),this._parent=O?O.body:null,this.cols=Math.max(this.options.cols,2),this.rows=Math.max(this.options.rows,1),this.options.handler&&this.on("data",this.options.handler),this.cursorState=0,this.cursorHidden=!1,this._customKeyEventHandler=null,this.applicationKeypad=!1,this.applicationCursor=!1,this.originMode=!1,this.insertMode=!1,this.wraparoundMode=!0,this.bracketedPasteMode=!1,this.charset=null,this.gcharset=null,this.glevel=0,this.charsets=[null],this.curAttr=s.DEFAULT_ATTR,this.params=[],this.currentParam=0,this.writeBuffer=[],this._writeInProgress=!1,this._xoffSentToCatchUp=!1,this._userScrolling=!1,this._inputHandler=new f.InputHandler(this),this.register(this._inputHandler),this.renderer=this.renderer||null,this.selectionManager=this.selectionManager||null,this.linkifier=this.linkifier||new d.Linkifier(this),this._mouseZoneManager=this._mouseZoneManager||null,this.soundManager=this.soundManager||new C.SoundManager(this),this.buffers=new o.BufferSet(this),this.selectionManager&&(this.selectionManager.clearSelection(),this.selectionManager.initBuffersListeners())},Object.defineProperty(t.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),t.prototype.eraseAttr=function(){return-512&s.DEFAULT_ATTR|511&this.curAttr},t.prototype.focus=function(){this.textarea&&this.textarea.focus()},Object.defineProperty(t.prototype,"isFocused",{get:function(){return O.activeElement===this.textarea&&O.hasFocus()},enumerable:!0,configurable:!0}),t.prototype.getOption=function(e){if(!(e in M))throw new Error('No option with key "'+e+'"');return this.options[e]},t.prototype.setOption=function(e,t){if(!(e in M))throw new Error('No option with key "'+e+'"');if(-1!==R.indexOf(e)&&console.error('Option "'+e+'" can only be set in the constructor'),this.options[e]!==t){switch(e){case"bellStyle":t||(t="none");break;case"cursorStyle":t||(t="block");break;case"fontWeight":t||(t="normal");break;case"fontWeightBold":t||(t="bold");break;case"lineHeight":if(t<1)return void console.warn(e+" cannot be less than 1, value: "+t);case"rendererType":t||(t="canvas");break;case"tabStopWidth":if(t<1)return void console.warn(e+" cannot be less than 1, value: "+t);break;case"theme":if(this.renderer)return void this._setTheme(t);break;case"scrollback":if((t=Math.min(t,s.MAX_BUFFER_SIZE))<0)return void console.warn(e+" cannot be less than 0, value: "+t);if(this.options[e]!==t){var r=this.rows+t;if(this.buffer.lines.length>r){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[e]=t,e){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":t?this._accessibilityManager||(this._accessibilityManager=new S.AccessibilityManager(this)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops()}this.renderer&&this.renderer.onOptionsChanged()}},t.prototype._onTextAreaFocus=function(e){this.sendFocus&&this.handler(u.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this.showCursor(),this.emit("focus")},t.prototype.blur=function(){return this.textarea.blur()},t.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")},t.prototype._initGlobal=function(){var e=this;this._bindKeys(),this.register(v.addDisposableDomListener(this.element,"copy",function(t){e.hasSelection()&&h.copyHandler(t,e,e.selectionManager)}));var t=function(t){return h.pasteHandler(t,e)};this.register(v.addDisposableDomListener(this.textarea,"paste",t)),this.register(v.addDisposableDomListener(this.element,"paste",t)),y.isFirefox?this.register(v.addDisposableDomListener(this.element,"mousedown",function(t){2===t.button&&h.rightClickHandler(t,e,e.selectionManager,e.options.rightClickSelectsWord)})):this.register(v.addDisposableDomListener(this.element,"contextmenu",function(t){h.rightClickHandler(t,e,e.selectionManager,e.options.rightClickSelectsWord)})),y.isLinux&&this.register(v.addDisposableDomListener(this.element,"auxclick",function(t){1===t.button&&h.moveTextAreaUnderMouseCursor(t,e)}))},t.prototype._bindKeys=function(){var e=this,t=this;this.register(v.addDisposableDomListener(this.element,"keydown",function(e){O.activeElement===this&&t._keyDown(e)},!0)),this.register(v.addDisposableDomListener(this.element,"keypress",function(e){O.activeElement===this&&t._keyPress(e)},!0)),this.register(v.addDisposableDomListener(this.element,"keyup",function(r){(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode})(r)||e.focus(),t._keyUp(r)},!0)),this.register(v.addDisposableDomListener(this.textarea,"keydown",function(t){return e._keyDown(t)},!0)),this.register(v.addDisposableDomListener(this.textarea,"keypress",function(t){return e._keyPress(t)},!0)),this.register(v.addDisposableDomListener(this.textarea,"compositionstart",function(){return e._compositionHelper.compositionstart()})),this.register(v.addDisposableDomListener(this.textarea,"compositionupdate",function(t){return e._compositionHelper.compositionupdate(t)})),this.register(v.addDisposableDomListener(this.textarea,"compositionend",function(){return e._compositionHelper.compositionend()})),this.register(this.addDisposableListener("refresh",function(){return e._compositionHelper.updateCompositionElements()})),this.register(this.addDisposableListener("refresh",function(t){return e._queueLinkification(t.start,t.end)}))},t.prototype.open=function(e){var t=this;if(this._parent=e||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 A.ScreenDprMonitor,this._screenDprMonitor.setListener(function(){return t.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=O.createDocumentFragment();this._viewportElement=O.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),r.appendChild(this._viewportElement),this._viewportScrollArea=O.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=O.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=O.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 t._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=O.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.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(v.addDisposableDomListener(this.textarea,"focus",function(e){return t._onTextAreaFocus(e)})),this.register(v.addDisposableDomListener(this.textarea,"blur",function(){return t._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea),this._compositionView=O.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(O,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 t.renderer.onCursorMove()})),this.register(this.addDisposableListener("resize",function(){return t.renderer.onResize(t.cols,t.rows)})),this.register(this.addDisposableListener("blur",function(){return t.renderer.onBlur()})),this.register(this.addDisposableListener("focus",function(){return t.renderer.onFocus()})),this.register(this.addDisposableListener("dprchange",function(){return t.renderer.onWindowResize(window.devicePixelRatio)})),this.register(v.addDisposableDomListener(window,"resize",function(){return t.renderer.onWindowResize(window.devicePixelRatio)})),this.register(this.charMeasure.addDisposableListener("charsizechanged",function(){return t.renderer.onCharSizeChanged()})),this.register(this.renderer.addDisposableListener("resize",function(e){return t.viewport.syncScrollArea()})),this.selectionManager=new p.SelectionManager(this,this.charMeasure),this.register(v.addDisposableDomListener(this.element,"mousedown",function(e){return t.selectionManager.onMouseDown(e)})),this.register(this.selectionManager.addDisposableListener("refresh",function(e){return t.renderer.onSelectionChanged(e.start,e.end,e.columnSelectMode)})),this.register(this.selectionManager.addDisposableListener("newselection",function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()})),this.register(this.addDisposableListener("scroll",function(){t.viewport.syncScrollArea(),t.selectionManager.refresh()})),this.register(v.addDisposableDomListener(this._viewportElement,"scroll",function(){return t.selectionManager.refresh()})),this.mouseHelper=new b.MouseHelper(this.renderer),this.element.classList.toggle("enable-mouse-events",this.mouseEvents),this.mouseEvents?this.selectionManager.disable():this.selectionManager.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new S.AccessibilityManager(this)),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},t.prototype._setupRenderer=function(){switch(this.options.rendererType){case"canvas":this.renderer=new _.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)},t.prototype._setTheme=function(e){this._theme=e;var t=this.renderer.setTheme(e);this.viewport&&this.viewport.onThemeChanged(t)},t.prototype.bindMouse=function(){var e=this,t=this.element,r=this,n=32;function i(e){var t,i;if(t=function(e){var t,n,i,o,s;switch(e.overrideType||e.type){case"mousedown":t=null!==e.button&&void 0!==e.button?+e.button:null!==e.which&&void 0!==e.which?e.which-1:null,y.isMSIE&&(t=1===t?0:4===t?1:t);break;case"mouseup":t=3;break;case"DOMMouseScroll":t=e.detail<0?64:65;break;case"wheel":t=e.deltaY<0?64:65}n=e.shiftKey?4:0,i=e.metaKey?8:0,o=e.ctrlKey?16:0,s=n|i|o,r.vt200Mouse?s&=o:r.normalMouse||(s=0);return t=32+(s<<2)+t}(e),i=r.mouseHelper.getRawByteCoords(e,r.screenElement,r.charMeasure,r.cols,r.rows))switch(s(t,i),e.overrideType||e.type){case"mousedown":n=t;break;case"mouseup":n=32}}function o(e,t){if(r.utfMouse){if(2047===t)return void e.push(0);t<127?e.push(t):(t>2047&&(t=2047),e.push(192|t>>6),e.push(128|63&t))}else{if(255===t)return void e.push(0);t>127&&(t=127),e.push(t)}}function s(e,t){if(r._vt300Mouse){e&=3,t.x-=32,t.y-=32;var n=u.C0.ESC+"[24";if(0===e)n+="1";else if(1===e)n+="3";else if(2===e)n+="5";else{if(3===e)return;n+="0"}return n+="~["+t.x+","+t.y+"]\r",void r.handler(n)}if(r._decLocator)return e&=3,t.x-=32,t.y-=32,0===e?e=2:1===e?e=4:2===e?e=6:3===e&&(e=3),void r.handler(u.C0.ESC+"["+e+";"+(3===e?4:0)+";"+t.y+";"+t.x+";"+t.page||"0&w");if(r.urxvtMouse)return t.x-=32,t.y-=32,t.x++,t.y++,void r.handler(u.C0.ESC+"["+e+";"+t.x+";"+t.y+"M");if(r.sgrMouse)return t.x-=32,t.y-=32,void r.handler(u.C0.ESC+"[<"+((3==(3&e)?-4&e:e)-32)+";"+t.x+";"+t.y+(3==(3&e)?"m":"M"));var i=[];o(i,e),o(i,t.x),o(i,t.y),r.handler(u.C0.ESC+"[M"+String.fromCharCode.apply(String,i))}this.register(v.addDisposableDomListener(t,"mousedown",function(t){if(t.preventDefault(),e.focus(),e.mouseEvents&&!e.selectionManager.shouldForceSelection(t)){if(i(t),e.vt200Mouse)return t.overrideType="mouseup",i(t),e.cancel(t);var o;e.normalMouse&&(o=function(t){var i,o,a;e.normalMouse&&(i=t,o=n,(a=r.mouseHelper.getRawByteCoords(i,r.screenElement,r.charMeasure,r.cols,r.rows))&&s(o+=32,a))},e._document.addEventListener("mousemove",o));var a=function(t){return e.normalMouse&&!e.x10Mouse&&i(t),o&&(e._document.removeEventListener("mousemove",o),o=null),e._document.removeEventListener("mouseup",a),e.cancel(t)};return e._document.addEventListener("mouseup",a),e.cancel(t)}})),this.register(v.addDisposableDomListener(t,"wheel",function(t){if(e.mouseEvents)e.x10Mouse||e._vt300Mouse||e._decLocator||(i(t),t.preventDefault());else if(!e.buffer.hasScrollback){var r=e.viewport.getLinesScrolled(t);if(0===r)return;for(var n=u.C0.ESC+(e.applicationCursor?"O":"[")+(t.deltaY<0?"A":"B"),o="",s=0;s<Math.abs(r);s++)o+=n;e.handler(o)}})),this.register(v.addDisposableDomListener(t,"wheel",function(t){if(!e.mouseEvents)return e.viewport.onWheel(t),e.cancel(t)})),this.register(v.addDisposableDomListener(t,"touchstart",function(t){if(!e.mouseEvents)return e.viewport.onTouchStart(t),e.cancel(t)})),this.register(v.addDisposableDomListener(t,"touchmove",function(t){if(!e.mouseEvents)return e.viewport.onTouchMove(t),e.cancel(t)}))},t.prototype.refresh=function(e,t){this.renderer&&this.renderer.refreshRows(e,t)},t.prototype._queueLinkification=function(e,t){this.linkifier&&this.linkifier.linkifyRows(e,t)},t.prototype.updateCursorStyle=function(e){this.selectionManager&&this.selectionManager.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},t.prototype.showCursor=function(){this.cursorState||(this.cursorState=1,this.refresh(this.buffer.y,this.buffer.y))},t.prototype.scroll=function(e){var t;void 0===e&&(e=!1),(t=this._blankLine)&&t.length===this.cols&&t.get(0)[s.CHAR_DATA_ATTR_INDEX]===this.eraseAttr()||(t=this.buffer.getBlankLine(this.eraseAttr(),e),this._blankLine=t),t.isWrapped=e;var r=this.buffer.ybase+this.buffer.scrollTop,n=this.buffer.ybase+this.buffer.scrollBottom;if(0===this.buffer.scrollTop){var i=this.buffer.lines.isFull;n===this.buffer.lines.length-1?i?this.buffer.lines.recycle().copyFrom(t):this.buffer.lines.push(t.clone()):this.buffer.lines.splice(n+1,0,t.clone()),i?this._userScrolling&&(this.buffer.ydisp=Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this._userScrolling||this.buffer.ydisp++)}else{var o=n-r+1;this.buffer.lines.shiftElements(r+1,o-1,-1),this.buffer.lines.set(n,t.clone())}this._userScrolling||(this.buffer.ydisp=this.buffer.ybase),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom),this.emit("scroll",this.buffer.ydisp)},t.prototype.scrollLines=function(e,t){if(e<0){if(0===this.buffer.ydisp)return;this._userScrolling=!0}else e+this.buffer.ydisp>=this.buffer.ybase&&(this._userScrolling=!1);var r=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+e,this.buffer.ybase),0),r!==this.buffer.ydisp&&(t||this.emit("scroll",this.buffer.ydisp),this.refresh(0,this.rows-1))},t.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},t.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},t.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},t.prototype.scrollToLine=function(e){var t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)},t.prototype.write=function(e){var t=this;this._isDisposed||e&&(this.writeBuffer.push(e),this.options.useFlowControl&&!this._xoffSentToCatchUp&&this.writeBuffer.length>=5&&(this.handler(u.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&this.writeBuffer.length>0&&(this._writeInProgress=!0,setTimeout(function(){t._innerWrite()})))},t.prototype._innerWrite=function(e){var t=this;void 0===e&&(e=0),this._isDisposed&&(this.writeBuffer=[]);for(var r=Date.now();this.writeBuffer.length>e;){var n=this.writeBuffer[e];if(e++,this._xoffSentToCatchUp&&this.writeBuffer.length===e&&(this.handler(u.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parse(n),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),Date.now()-r>=12)break}this.writeBuffer.length>e?setTimeout(function(){return t._innerWrite(e)},0):(this._writeInProgress=!1,this.writeBuffer=[])},t.prototype.writeln=function(e){this.write(e+"\r\n")},t.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},t.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},t.prototype.registerLinkMatcher=function(e,t,r){var n=this.linkifier.registerLinkMatcher(e,t,r);return this.refresh(0,this.rows-1),n},t.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},t.prototype.registerCharacterJoiner=function(e){var t=this.renderer.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},t.prototype.deregisterCharacterJoiner=function(e){this.renderer.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(t.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),t.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},t.prototype.hasSelection=function(){return!!this.selectionManager&&this.selectionManager.hasSelection},t.prototype.getSelection=function(){return this.selectionManager?this.selectionManager.selectionText:""},t.prototype.clearSelection=function(){this.selectionManager&&this.selectionManager.clearSelection()},t.prototype.selectAll=function(){this.selectionManager&&this.selectionManager.selectAll()},t.prototype.selectLines=function(e,t){this.selectionManager&&this.selectionManager.selectLines(e,t)},t.prototype._keyDown=function(e){if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t=k.evaluateKeyboardEvent(e,this.applicationCursor,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===t.type||2===t.type){var r=this.rows-1;return this.scrollLines(2===t.type?-r:r),this.cancel(e,!0)}return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(this.emit("keydown",e),this.emit("key",t.key,e),this.showCursor(),this.handler(t.key),this.cancel(e,!0)))},t.prototype._isThirdLevelShift=function(e,t){var r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isMSWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?r:r&&(!t.keyCode||t.keyCode>47)},t.prototype.setgLevel=function(e){this.glevel=e,this.charset=this.charsets[e]},t.prototype.setgCharset=function(e,t){this.charsets[e]=t,this.glevel===e&&(this.charset=t)},t.prototype._keyUp=function(e){this.updateCursorStyle(e)},t.prototype._keyPress=function(e){var t;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e))&&(t=String.fromCharCode(t),this.emit("keypress",t,e),this.emit("key",t,e),this.showCursor(),this.handler(t),!0)},t.prototype.bell=function(){var e=this;this.emit("bell"),this._soundBell()&&this.soundManager.playBellSound(),this._visualBell()&&(this.element.classList.add("visual-bell-active"),clearTimeout(this._visualBellTimer),this._visualBellTimer=window.setTimeout(function(){e.element.classList.remove("visual-bell-active")},200))},t.prototype.log=function(e,t){this.options.debug&&this._context.console&&this._context.console.log&&this._context.console.log(e,t)},t.prototype.error=function(e,t){this.options.debug&&this._context.console&&this._context.console.error&&this._context.console.error(e,t)},t.prototype.resize=function(e,t){isNaN(e)||isNaN(t)||(e!==this.cols||t!==this.rows?(e<2&&(e=2),t<1&&(t=1),this.buffers.resize(e,t),this.cols=e,this.rows=t,this.buffers.setupTabStops(this.cols),this.charMeasure&&this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this.emit("resize",{cols:e,rows:t})):!this.charMeasure||this.charMeasure.width&&this.charMeasure.height||this.charMeasure.measure(this.options))},t.prototype.updateRange=function(e){e<this._refreshStart&&(this._refreshStart=e),e>this._refreshEnd&&(this._refreshEnd=e)},t.prototype.maxRange=function(){this._refreshStart=0,this._refreshEnd=this.rows-1},t.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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(s.DEFAULT_ATTR));this.refresh(0,this.rows-1),this.emit("scroll",this.buffer.ydisp)}},t.prototype.ch=function(e){return e?[this.eraseAttr(),s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]:[s.DEFAULT_ATTR,s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]},t.prototype.is=function(e){return 0===(this.options.termName+"").indexOf(e)},t.prototype.handler=function(e){this.options.disableStdin||(this.selectionManager&&this.selectionManager.hasSelection&&this.selectionManager.clearSelection(),this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),this.emit("data",e))},t.prototype.handleTitle=function(e){this.emit("title",e)},t.prototype.index=function(){this.buffer.y++,this.buffer.y>this.buffer.scrollBottom&&(this.buffer.y--,this.scroll()),this.buffer.x>=this.cols&&this.buffer.x--},t.prototype.reverseIndex=function(){if(this.buffer.y===this.buffer.scrollTop){var e=this.buffer.scrollBottom-this.buffer.scrollTop;this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,e,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--},t.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var e=this._customKeyEventHandler,t=this._inputHandler,r=this.cursorState;this._setup(),this._customKeyEventHandler=e,this._inputHandler=t,this.cursorState=r,this.refresh(0,this.rows-1),this.viewport&&this.viewport.syncScrollArea()},t.prototype.tabSet=function(){this.buffer.tabs[this.buffer.x]=!0},t.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},t.prototype.matchColor=function(e,t,r){var n=e<<16|t<<8|r;if(null!==H[n]&&void 0!==H[n])return H[n];for(var i,o,s=1/0,a=-1,l=0;l<w.DEFAULT_ANSI_COLORS.length;l++){if(0===(o=I(e,t,r,(i=w.DEFAULT_ANSI_COLORS[l].rgba)>>>24,i>>>16&255,i>>>8&255))){a=l;break}o<s&&(s=o,a=l)}return H[n]=a},t.prototype._visualBell=function(){return!1},t.prototype._soundBell=function(){return"sound"===this.options.bellStyle},t}(l.EventEmitter);t.Terminal=D;var H={};function I(e,t,r,n,i,o){return Math.pow(30*(e-n),2)+Math.pow(59*(t-i),2)+Math.pow(11*(r-o),2)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(143),i=r(60),o=function(){function e(e){this._core=new n.Terminal(e)}return Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._core.markers},enumerable:!0,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.on=function(e,t){this._core.on(e,t)},e.prototype.off=function(e,t){this._core.off(e,t)},e.prototype.emit=function(e,t){this._core.emit(e,t)},e.prototype.addDisposableListener=function(e,t){return this._core.addDisposableListener(e,t)},e.prototype.resize=function(e,t){this._core.resize(e,t)},e.prototype.writeln=function(e){this._core.writeln(e)},e.prototype.open=function(e){this._core.open(e)},e.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},e.prototype.addCsiHandler=function(e,t){return this._core.addCsiHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this._core.addOscHandler(e,t)},e.prototype.registerLinkMatcher=function(e,t,r){return this._core.registerLinkMatcher(e,t,r)},e.prototype.deregisterLinkMatcher=function(e){this._core.deregisterLinkMatcher(e)},e.prototype.registerCharacterJoiner=function(e){return this._core.registerCharacterJoiner(e)},e.prototype.deregisterCharacterJoiner=function(e){this._core.deregisterCharacterJoiner(e)},e.prototype.addMarker=function(e){return this._core.addMarker(e)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.getSelection=function(){return this._core.getSelection()},e.prototype.clearSelection=function(){this._core.clearSelection()},e.prototype.selectAll=function(){this._core.selectAll()},e.prototype.selectLines=function(e,t){this._core.selectLines(e,t)},e.prototype.dispose=function(){this._core.dispose()},e.prototype.destroy=function(){this._core.destroy()},e.prototype.scrollLines=function(e){this._core.scrollLines(e)},e.prototype.scrollPages=function(e){this._core.scrollPages(e)},e.prototype.scrollToTop=function(){this._core.scrollToTop()},e.prototype.scrollToBottom=function(){this._core.scrollToBottom()},e.prototype.scrollToLine=function(e){this._core.scrollToLine(e)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(e){this._core.write(e)},e.prototype.getOption=function(e){return this._core.getOption(e)},e.prototype.setOption=function(e,t){this._core.setOption(e,t)},e.prototype.refresh=function(e,t){this._core.refresh(e,t)},e.prototype.reset=function(){this._core.reset()},e.applyAddon=function(t){t.apply(e)},Object.defineProperty(e,"strings",{get:function(){return i},enumerable:!0,configurable:!0}),e}();t.Terminal=o},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=e.exports;Object.assign(i,r(38));var o=/\*\x18[AC]|\*\*\x18B/;function s(e,t){if(t<0)throw new i.Error("validation","“"+e+"” ("+t+") must be nonnegative.");if(t!==Math.floor(t))throw new i.Error("validation","“"+e+"” ("+t+") must be an integer.")}i.Validation={offer_parameters:function(e){if(!e.name)throw new i.Error("validation","Need “name”!");if("string"!=typeof e.name)throw new i.Error("validation","“name” ("+e.name+") must be a string!");if(e=Object.assign({},e),o.test(e.name)&&console.warn("The filename "+JSON.stringify(name)+" contains characters that look like a ZMODEM header. This could corrupt the ZMODEM session; consider renaming it so that the filename doesn’t contain control characters."),null!==e.serial&&void 0!==e.serial)throw new i.Error("validation","“serial” is meaningless.");if(e.serial=null,["size","mode","files_remaining","bytes_remaining"].forEach(function(t){var r;switch(n(e[t])){case"object":r=null===e[t];break;case"undefined":e[t]=null,r=!0;break;case"number":s(t,e[t]),r=!0}if(!r)throw new i.Error("validation","“"+t+"” ("+e[t]+") must be null, undefined, or a number.")}),"number"==typeof e.mode&&(e.mode|=32768),0===e.files_remaining)throw new i.Error("validation","“files_remaining”, if given, must be positive.");var t;switch(n(e.mtime)){case"object":if(t=!0,e.mtime instanceof Date){var r=e.mtime;if(e.mtime=Math.floor(r.getTime()/1e3),e.mtime<0)throw new i.Error("validation","“mtime” ("+r+") must not be earlier than 1970.")}else null!==e.mtime&&(t=!1);break;case"undefined":e.mtime=null,t=!0;break;case"number":s("mtime",e.mtime),t=!0}if(!t)throw new i.Error("validation","“mtime” ("+e.mtime+") must be null, undefined, a Date, or a number.");return e}}},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=e.exports;Object.assign(a,r(90),r(63),r(39),r(38));var l;a.Subpacket=function(){function e(t){s(this,e),this._payload=t}return n(e,[{key:"encode16",value:function(e){return this._encode(e,a.CRC.crc16)}},{key:"encode32",value:function(e){return this._encode(e,a.CRC.crc32)}},{key:"get_payload",value:function(){return this._payload}}],[{key:"build",value:function(e,t){var r=l[t];if(!r)throw"No subpacket type “"+t+"” is defined! Try one of: "+Object.keys(l).join(", ");return new r(e)}},{key:"parse16",value:function(t){return e._parse(t,2)}},{key:"parse32",value:function(t){return e._parse(t,4)}}]),n(e,[{key:"_encode",value:function(e,t){return e.encode(this._payload.slice(0)).concat([a.ZMLIB.ZDLE,this._frameend_num],e.encode(t(this._payload.concat(this._frameend_num))))}}],[{key:"_parse",value:function(e,t){for(var r,n,i={104:u,105:_,106:d,107:f},o=0;o<e.length;){if(-1===(o=e.indexOf(a.ZMLIB.ZDLE,o)))return;if(n=i[e[o+1]]){r=o+1;break}o++}if(n){var s=e[r];if(e[r-1]!==a.ZMLIB.ZDLE)throw"Byte before frame end should be ZDLE, not "+e[r-1];var l=e.splice(0,r-1),c=a.ZDLE.splice(e,2,t);if(c){var h=a.ZDLE.decode(l);return a.CRC[2===t?"verify16":"verify32"](h.concat([s]),c),new n(h,c)}e.unshift.apply(e,l)}}}]),e}();var c=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Subpacket),n(t,[{key:"frame_end",value:function(){return!0}}]),t}(),h=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Subpacket),n(t,[{key:"frame_end",value:function(){return!1}}]),t}(),u=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,c),n(t,[{key:"ack_expected",value:function(){return!1}}]),t}();u.prototype._frameend_num=104;var f=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,c),n(t,[{key:"ack_expected",value:function(){return!0}}]),t}();f.prototype._frameend_num=107;var _=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,h),n(t,[{key:"ack_expected",value:function(){return!1}}]),t}();_.prototype._frameend_num=105;var d=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,h),n(t,[{key:"ack_expected",value:function(){return!0}}]),t}();d.prototype._frameend_num=106,l={end_no_ack:u,end_ack:f,no_end_no_ack:_,no_end_ack:d}},function(e,t,r){var n;n=function(e){e.version="1.1.1";var t=function(){for(var e=0,t=new Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}();e.table=t,e.bstr=function(e,r){for(var n=-1^r,i=e.length-1,o=0;o<i;)n=(n=n>>>8^t[255&(n^e.charCodeAt(o++))])>>>8^t[255&(n^e.charCodeAt(o++))];return o===i&&(n=n>>>8^t[255&(n^e.charCodeAt(o))]),-1^n},e.buf=function(e,r){if(e.length>1e4)return function(e,r){for(var n=-1^r,i=e.length-7,o=0;o<i;)n=(n=(n=(n=(n=(n=(n=(n=n>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])];for(;o<i+7;)n=n>>>8^t[255&(n^e[o++])];return-1^n}(e,r);for(var n=-1^r,i=e.length-3,o=0;o<i;)n=(n=(n=(n=n>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])];for(;o<i+3;)n=n>>>8^t[255&(n^e[o++])];return-1^n},e.str=function(e,r){for(var n,i,o=-1^r,s=0,a=e.length;s<a;)(n=e.charCodeAt(s++))<128?o=o>>>8^t[255&(o^n)]:n<2048?o=(o=o>>>8^t[255&(o^(192|n>>6&31))])>>>8^t[255&(o^(128|63&n))]:n>=55296&&n<57344?(n=64+(1023&n),i=1023&e.charCodeAt(s++),o=(o=(o=(o=o>>>8^t[255&(o^(240|n>>8&7))])>>>8^t[255&(o^(128|n>>2&63))])>>>8^t[255&(o^(128|i>>6&15|(3&n)<<4))])>>>8^t[255&(o^(128|63&i))]):o=(o=(o=o>>>8^t[255&(o^(224|n>>12&15))])>>>8^t[255&(o^(128|n>>6&63))])>>>8^t[255&(o^(128|63&n))];return-1^o}},"undefined"==typeof DO_NOT_EXPORT_CRC?n(t):n({})},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=e.exports;Object.assign(a,r(64),r(63),r(39),r(90),r(38));var l="*".charCodeAt(0),c="A".charCodeAt(0),h="B".charCodeAt(0),u="C".charCodeAt(0),f=[13,10],_=f.slice(0).concat([a.ZMLIB.XON]),d=[l,l,a.ZMLIB.ZDLE,h],p=[l,a.ZMLIB.ZDLE,c],m=[l,a.ZMLIB.ZDLE,u];a.Header=function(){function e(){s(this,e),this._bytes4||(this._bytes4=[0,0,0,0])}return n(e,[{key:"to_hex",value:function(){var e=this._crc_bytes();return d.concat(a.ENCODELIB.octets_to_hex(e.concat(a.CRC.crc16(e))),this._hex_header_ending)}},{key:"to_binary16",value:function(e){return this._to_binary(e,p,a.CRC.crc16)}},{key:"to_binary32",value:function(e){return this._to_binary(e,m,a.CRC.crc32)}}],[{key:"trim_leading_garbage",value:function(e){var t,r,n=[];e:for(;e.length&&!r;){var i=e.indexOf(l);if(-1===i){t=!0;break e}if(n.push.apply(n,e.splice(0,i)),e.length<2)break e;if(e[1]===l)if(e.length<d.length){if(e.join()===d.slice(0,e.length).join())break e}else e[2]===d[2]&&e[3]===d[3]&&(r=U);else if(e[1]===a.ZMLIB.ZDLE){if(e.length<p.length)break e;e[2]===p[2]?r=N:e[2]===m[2]&&(r=W)}r||n.push(e.shift())}return t&&n.push.apply(n,e.splice(0)),n}},{key:"parse",value:function(e){var t;if(e[1]===l)return(t=U(e))&&[t,16];if(e[2]===c)return(t=N(e))&&[t,16];if(e[2]===u)return(t=W(e))&&[t,32];if(!(e.length<3))throw"Unrecognized/unsupported octets: "+e.join()}},{key:"build",value:function(e){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),r=I[e];if(!r)throw"No frame class “"+e+"” is defined!";return t.shift(),new(r.bind.apply(r,[null].concat(t)))}}]),n(e,[{key:"_to_binary",value:function(e,t,r){var n=this._crc_bytes();return t.concat(e.encode(n.concat(r(n))))}},{key:"_crc_bytes",value:function(){return[this.TYPENUM].concat(this._bytes4)}}]),e}(),a.Header.prototype._hex_header_ending=_;var y=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}(),v={CANFDX:1,CANOVIO:2,CANBRK:4,CANCRY:8,CANLZW:16,CANFC32:32,ESCCTL:64,ESC8:128};var g=function(e){function t(e,r){s(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=0;return r||(r=0),e.forEach(function(e){o|=function(e){if(!v[e])throw new a.Error("Invalid ZRINIT flag: "+e);return v[e]}(e)}),n._bytes4=[255&r,r>>8,0,o],n}return o(t,a.Header),n(t,[{key:"get_buffer_size",value:function(){return a.ENCODELIB.unpack_u16_be(this._bytes4.slice(0,2))||void 0}},{key:"can_full_duplex",value:function(){return!!(this._bytes4[3]&v.CANFDX)}},{key:"can_overlap_io",value:function(){return!!(this._bytes4[3]&v.CANOVIO)}},{key:"can_break",value:function(){return!!(this._bytes4[3]&v.CANBRK)}},{key:"can_fcs_32",value:function(){return!!(this._bytes4[3]&v.CANFC32)}},{key:"escape_ctrl_chars",value:function(){return!!(this._bytes4[3]&v.ESCCTL)}},{key:"escape_8th_bit",value:function(){return!!(this._bytes4[3]&v.ESC8)}}]),t}(),b={ESCCTL:64,ESC8:128};var C=function(e){function t(e,r){s(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=0;if(e.forEach(function(e){o|=function(e){if(!b[e])throw"Invalid ZSINIT flag: "+e;return b[e]}(e)}),n._bytes4=[0,0,0,o],r){if(r.length>31)throw"Attn sequence must be <= 31 bytes";if(r.some(function(e){return e>255}))throw"Attn sequence ("+r+") must be <256";n._data=r.concat([0])}return n}return o(t,a.Header),n(t,[{key:"escape_ctrl_chars",value:function(){return!!(this._bytes4[3]&b.ESCCTL)}},{key:"escape_8th_bit",value:function(){return!!(this._bytes4[3]&b.ESC8)}}]),t}(),w=function(e){function t(e){s(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e&&(r._bytes4=e.slice()),r}return o(t,a.Header),t}();w.prototype._hex_header_ending=f;var E={extended:{sparse:64},transport:[void 0,"compress","encrypt","rle"],management:[void 0,"newer_or_longer","crc","append","clobber","newer","mtime_or_length","protect","rename"],conversion:[void 0,"binary","text","resume"]},S=["extended","transport","management","conversion"],A=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),n(t,[{key:"get_options",value:function(){var e={sparse:!!(64&this._bytes4[0])},t=this._bytes4.slice(0);return S.forEach(function(r,n){if(E[r]instanceof Array)"management"===r&&(e.skip_if_absent=!!(128&t[n]),t[n]&=31),e[r]=E[r][t[n]];else for(var i in E[r])e[i]=!!(t[n]&E[r][i]),e[i]&&(t[n]^=E[r][i]);!e[r]&&t[n]&&(e[r]="unknown:"+t[n])}),e}}]),t}(),L=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}(),x=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}(),k=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}(),T=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}();k.prototype._hex_header_ending=f;for(var O=function(e){function t(e){s(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r._bytes4=a.ENCODELIB.pack_u32_le(e),r}return o(t,a.Header),n(t,[{key:"get_offset",value:function(){return a.ENCODELIB.unpack_u32_le(this._bytes4)}}]),t}(),R=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,O),t}(),M=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,O),t}(),D=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,O),t}(),H=[[y,"ZRQINIT"],[g,"ZRINIT"],[C,"ZSINIT"],[w,"ZACK"],[A,"ZFILE"],[L,"ZSKIP"],void 0,[x,"ZABORT"],[k,"ZFIN"],[R,"ZRPOS"],[M,"ZDATA"],[D,"ZEOF"],[T,"ZFERR"],void 0,void 0,void 0,void 0,void 0,void 0,void 0],I={},P=0;P<H.length;P++)H[P]&&(I[H[P][1]]=H[P][0],Object.assign(H[P][0].prototype,{TYPENUM:P,NAME:H[P][1]}));var F=[y,g,C,w,A,L,"ZNAK",x,k,R,M,D,T,"ZCRC","ZCHALLENGE","ZCOMPL","ZCAN","ZFREECNT","ZCOMMAND","ZSTDERR"];function B(e){var t=F[e];if("string"==typeof t)throw"Received unsupported header: "+t;return function(e){if(e.prototype instanceof O)return new e(0);return new e([])}(t)}function N(e){var t=a.ZDLE.splice(e,p.length,7);return t&&j(t)}function j(e){a.CRC.verify16(e.slice(0,5),e.slice(5));var t=B(e[0]);return t._bytes4=e.slice(1,5),t}function W(e){var t=a.ZDLE.splice(e,m.length,9);if(t){a.CRC.verify32(t.slice(0,5),t.slice(5));var r=B(t[0]);return r._bytes4=t.slice(1,5),r}}function U(e){var t,r,n=e.indexOf(138);if(-1===n&&(n=e.indexOf(10)),-1!==n){if(r=e.splice(0,n),e.shift(),19===r.length){var i=r.pop();13!==i&&141!==i&&(t="Invalid hex header: (CR/)LF doesn’t have CR!")}else 18!==r.length&&(t="Invalid hex header: invalid number of bytes before LF!");if(t)throw t+=" ("+r.length+" bytes: "+r.join()+")";return r.splice(0,4),j(a.ENCODELIB.parse_hex_octets(r))}e.length>11&&(t="Invalid hex header - no LF detected within 12 bytes!")}a.Header.parse_hex=U},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(){i(this,e)}return n(e,[{key:"encode",value:function(e){e=unescape(encodeURIComponent(e));for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new Uint8Array(t)}}]),e}(),s=function(){function e(){i(this,e)}return n(e,[{key:"decode",value:function(e){return decodeURIComponent(escape(String.fromCharCode.apply(String,e)))}}]),e}();e.exports.Text={Encoder:"undefined"!=typeof TextEncoder?TextEncoder:o,Decoder:"undefined"!=typeof TextDecoder?TextDecoder:s}},function(e,t,r){"use strict";var n=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,n)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(n):void 0},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=e.exports;Object.assign(l,r(64),r(149),r(63),r(39),r(148),r(146),r(145),r(38));var c=["CANFDX","CANOVIO","CANFC32"],h=[79,79],u=l.ZMLIB.ABORT_SEQUENCE,f=function(){function e(){a(this,e),this._on_evt={},this._evt_once_index={}}return i(e,[{key:"_Add_event",value:function(e){this._on_evt[e]=[],this._evt_once_index[e]=[]}},{key:"_get_evt_queue",value:function(e){if(!this._on_evt[e])throw"Bad event: "+e;return this._on_evt[e]}},{key:"on",value:function(e,t){return this._get_evt_queue(e).push(t),this}},{key:"off",value:function(e,t){var r=this._get_evt_queue(e);if(t){var n=r.indexOf(t);if(-1===n)throw"“"+t+"” is not in the “"+e+"” queue.";r.splice(n,1)}else r.pop();return this}},{key:"_Happen",value:function(e){var t=this._get_evt_queue(e),r=Array.apply(null,arguments);r.shift();var n=this;return t.forEach(function(e){e.apply(n,r)}),t.length}}]),e}();l.Session=function(e){function t(){a(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._config={},e._input_buffer=[],e._Add_event("receive"),e._Add_event("garbage"),e._Add_event("session_end"),e}return s(t,f),i(t,[{key:"set_sender",value:function(e){return this._sender=e,this}},{key:"has_ended",value:function(){return this._has_ended()}},{key:"consume",value:function(e){if(this._before_consume(e),this._aborted)throw new l.Error("already_aborted");e.length&&(this._strip_and_enqueue_input(e),this._check_for_abort_sequence(e)||this._consume_first())}},{key:"aborted",value:function(){return!!this._aborted}}],[{key:"parse",value:function(e){var t;try{t=l.Header.parse_hex(e)}catch(e){return}if(t)switch(t.NAME){case"ZRQINIT":return new l.Session.Receive;case"ZRINIT":return new l.Session.Send(t)}}}]),i(t,[{key:"get_role",value:function(){return this.type}},{key:"_trim_leading_garbage_until_header",value:function(){var e=l.Header.trim_leading_garbage(this._input_buffer);e.length&&0===this._Happen("garbage",e)&&console.debug("Garbage: ",String.fromCharCode.apply(String,e),e)}},{key:"_parse_and_consume_header",value:function(){this._trim_leading_garbage_until_header();var e=l.Header.parse(this._input_buffer);if(e)return this._consume_header(e[0]),this._last_header_name=e[0].NAME,this._last_header_crc=e[1],e[0]}},{key:"_consume_header",value:function(e){this._on_receive(e);var t=this._next_header_handler[e.NAME];if(!t)throw console.error("Unhandled header!",e,this._next_header_handler),new l.Error("Unhandled header: "+e.NAME);this._next_header_handler=null,t.call(this,e)}},{key:"_check_for_abort_sequence",value:function(){var e=l.ZMLIB.find_subarray(this._input_buffer,u);if(-1!==e)throw this._input_buffer.splice(0,e+u.length),this._aborted=!0,this._on_session_end(),new l.Error("peer_aborted")}},{key:"_send_header",value:function(e){if(!this._sender)throw"Need sender!";var t=Array.apply(null,arguments),r=this._create_header_bytes(t);this._sender(r[0]),this._last_sent_header=r[1]}},{key:"_create_header_bytes",value:function(e){var t=l.Header.build.apply(l.Header,e);return[t[this._get_header_formatter(e[0])](this._zencoder),t]}},{key:"_strip_and_enqueue_input",value:function(e){l.ZMLIB.strip_ignored_bytes(e),this._input_buffer.push.apply(this._input_buffer,e)}},{key:"abort",value:function(){this._sender(u.concat([8,8,8,8,8])),this._aborted=!0,this._sender=function(){throw new l.Error("already_aborted")},this._on_session_end()}},{key:"_on_session_end",value:function(){this._Happen("session_end")}},{key:"_on_receive",value:function(e){this._Happen("receive",e)}},{key:"_before_consume",value:function(){}}]),t}(),l.Session.Receive=function(e){function t(){a(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._Add_event("offer"),e._Add_event("data_in"),e._Add_event("file_end"),e}return s(t,l.Session),i(t,[{key:"_before_consume",value:function(e){if(this._bytes_after_OO)throw"PROTOCOL: Session is completed!";this._bytes_being_consumed=e}},{key:"get_trailing_bytes",value:function(){if(this._aborted)return[];if(!this._bytes_after_OO)throw"PROTOCOL: Session is not completed!";return this._bytes_after_OO.slice(0)}},{key:"_has_ended",value:function(){return this.aborted()||!!this._bytes_after_OO}},{key:"_get_header_formatter",value:function(){return"to_hex"}},{key:"_parse_and_consume_subpacket",value:function(){var e;e=16===this._last_header_crc?"parse16":"parse32";var t=l.Subpacket[e](this._input_buffer);return t&&(this._consume_data(t),t.frame_end()&&(this._next_subpacket_handler=null)),t}},{key:"_consume_first",value:function(){if(this._got_ZFIN){if(this._input_buffer.length<2)return;if(0===l.ZMLIB.find_subarray(this._input_buffer,h))return this._bytes_after_OO=(e=this._bytes_being_consumed.slice(0),0===l.ZMLIB.find_subarray(e,h)?e.splice(0,h.length):e[0]===h[h.length-1]&&e.splice(0,1),e),void this._on_session_end();throw"PROTOCOL: Only thing after ZFIN should be “OO” (79,79), not: "+array_buf.join()}var e,t;do{t=this._next_subpacket_handler?this._parse_and_consume_subpacket():this._parse_and_consume_header()}while(t&&this._input_buffer.length)}},{key:"_consume_data",value:function(e){if(this._on_receive(e),!this._next_subpacket_handler)throw"PROTOCOL: Received unexpected data packet after "+this._last_header_name+" header: "+e.get_payload().join();this._next_subpacket_handler.call(this,e)}},{key:"_octets_to_string",value:function(e){return this._textdecoder||(this._textdecoder=new l.Text.Decoder),this._textdecoder.decode(new Uint8Array(e))}},{key:"_consume_ZFILE_data",value:function(e,t){if(this._file_info)throw"PROTOCOL: second ZFILE data subpacket received";var r=t.get_payload(),n=r.indexOf(0),i=this._octets_to_string(r.slice(0,n)),o=this._octets_to_string(r.slice(1+n)).split(" "),s=o[1]&&parseInt(o[1],8)||void 0;s&&(s=new Date(1e3*s)),this._file_info={name:i,size:o[0]?parseInt(o[0],10):null,mtime:s||null,mode:o[2]&&parseInt(o[2],8)||null,serial:o[3]&&parseInt(o[3],10)||null,files_remaining:o[4]?parseInt(o[4],10):null,bytes_remaining:o[5]?parseInt(o[5],10):null};var a=new p(e.get_options(),this._file_info,this._accept.bind(this),this._skip.bind(this));this._current_transfer=a}},{key:"_consume_ZDATA_data",value:function(e){if(!this._accepted_offer)throw"PROTOCOL: Received data without accepting!";if(!this._offset_ok)return console.warn("offset not ok!"),void _send_ZRPOS();this._file_offset+=e.get_payload().length,this._on_data_in(e),e.ack_expected()&&!e.frame_end()&&this._send_header("ZACK",l.ENCODELIB.pack_u32_le(this._file_offset))}},{key:"_make_promise_for_between_files",value:function(){var e=this;return new Promise(function(t){var r={ZFILE:function(e){this._next_subpacket_handler=function(r){this._next_subpacket_handler=null,this._consume_ZFILE_data(e,r),this._Happen("offer",this._current_transfer),t(this._current_transfer)}},ZSINIT:function(t){e._next_subpacket_handler=function(t){e._next_subpacket_handler=null,e._consume_ZSINIT_data(t),e._send_header("ZACK"),e._next_header_handler=r}},ZFIN:function(){this._consume_ZFIN(),t()}};e._next_header_handler=r})}},{key:"_consume_ZSINIT_data",value:function(e){this._attn=e.get_payload()}},{key:"start",value:function(){if(this._started)throw"Already started!";this._started=!0;var e=this._make_promise_for_between_files();return this._send_ZRINIT(),e}},{key:"_accept",value:function(e){this._accepted_offer=!0,this._file_offset=e||0;var t=this,r=new Promise(function(e){t._next_header_handler={ZDATA:function(t){this._consume_ZDATA(t),this._next_subpacket_handler=this._consume_ZDATA_data,this._next_header_handler={ZEOF:function(t){this._next_subpacket_handler=null,this._consume_ZEOF(t);var r=this._make_promise_for_between_files();e(r)}}}}});return this._send_ZRPOS(),r}},{key:"_skip",value:function(){var e=this._make_promise_for_between_files();if(this._accepted_offer){var t=function(){this._accepted_offer=!1,this._next_subpacket_handler=null,this._make_promise_for_between_files()}.bind(this);Object.assign(this._next_header_handler,{ZEOF:t,ZDATA:function(){t(),this._next_header_handler.ZEOF=t}.bind(this)})}return this._file_info=null,this._send_header("ZSKIP"),e}},{key:"_send_ZRINIT",value:function(){this._send_header("ZRINIT",c)}},{key:"_consume_ZFIN",value:function(){this._got_ZFIN=!0,this._send_header("ZFIN")}},{key:"_consume_ZEOF",value:function(e){if(this._file_offset!==e.get_offset())throw"ZEOF offset mismatch; unimplemented (local: "+this._file_offset+"; ZEOF: "+e.get_offset()+")";this._send_ZRINIT(),this._on_file_end(),this._file_info=null,this._current_transfer=null}},{key:"_consume_ZDATA",value:function(e){if(this._file_offset!==e.get_offset())throw"Error correction is unimplemented.";this._offset_ok=!0}},{key:"_send_ZRPOS",value:function(){this._send_header("ZRPOS",this._file_offset)}},{key:"_on_file_end",value:function(){this._Happen("file_end"),this._current_transfer&&(this._current_transfer._Happen("complete"),this._current_transfer=null)}},{key:"_on_data_in",value:function(e){this._Happen("data_in",e),this._current_transfer&&this._current_transfer._Happen("input",e.get_payload())}}]),t}(),Object.assign(l.Session.Receive.prototype,{type:"receive"});var _={get_details:function(){return Object.assign({},this._file_info)},get_options:function(){return Object.assign({},this._zfile_opts)},get_offset:function(){return this._file_offset}},d=function(){function e(t,r,n,i){a(this,e),this._file_info=t,this._file_offset=r||0,this._send=n,this._end=i}return i(e,[{key:"send",value:function(e){this._send(e),this._file_offset+=e.length}},{key:"end",value:function(e){var t=this._end(e||[]);return e&&(this._file_offset+=e.length),t}}]),e}();Object.assign(d.prototype,_);var p=function(e){function t(e,r,n,i){a(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return s._zfile_opts=e,s._file_info=r,s._accept_func=n,s._skip_func=i,s._Add_event("input"),s._Add_event("complete"),s.on("input",s._input_handler),s}return s(t,f),i(t,[{key:"_verify_not_skipped",value:function(){if(this._skipped)throw new l.Error("Already skipped!")}},{key:"skip",value:function(){return this._verify_not_skipped(),this._skipped=!0,this._skip_func.apply(this,arguments)}},{key:"accept",value:function(e){if(this._verify_not_skipped(),this._accepted)throw new l.Error("Already accepted!");switch(this._accepted=!0,e||(e={}),this._file_offset=e.offset||0,e.on_input){case null:case void 0:case"spool_array":case"spool_uint8array":this._spool=[];break;default:if("function"!=typeof e.on_input)throw"Invalid “on_input”: "+e.on_input}return this._input_handler_mode=e.on_input||"spool_uint8array",this._accept_func(this._file_offset).then(this._get_spool.bind(this))}},{key:"_input_handler",value:function(e){if(this._file_offset+=e.length,"function"==typeof this._input_handler_mode)this._input_handler_mode(e);else{if("spool_uint8array"===this._input_handler_mode)e=new Uint8Array(e);else if("spool_array"!==this._input_handler_mode)throw new l.Error("WTF?? _input_handler_mode = "+this._input_handler_mode);this._spool.push(e)}}},{key:"_get_spool",value:function(){return this._spool}}]),t}();Object.assign(p.prototype,_);var m={ZFILE:!0,ZDATA:!0};l.Session.Send=function(e){function t(e){a(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(!e)throw"Need first header!";if("ZRINIT"!==e.NAME)throw"First header should be ZRINIT, not "+e.NAME;r._last_header_name="ZRINIT",r._subpacket_encode_func="encode16",r._zencoder=new l.ZDLE,r._consume_ZRINIT(e),r._file_offset=0;return r._start_keepalive_on_set_sender=!0,r}return s(t,l.Session),i(t,[{key:"set_sender",value:function(e){return n(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"set_sender",this).call(this,e),this._start_keepalive_on_set_sender&&(this._start_keepalive_on_set_sender=!1,this._start_keepalive()),this}},{key:"_get_header_formatter",value:function(e){return m[e]?"to_binary16":"to_hex"}},{key:"_start_keepalive",value:function(){if(!this._keepalive_promise){var e=this;this._keepalive_promise=new Promise(function(t){e._keepalive_timeout=setTimeout(t,5e3)}).then(function(){e._next_header_handler={ZACK:function(){e._got_ZSINIT_ZACK=!0}},e._send_ZSINIT(),e._keepalive_promise=null,e._start_keepalive()})}}},{key:"_stop_keepalive",value:function(){this._keepalive_promise&&(clearTimeout(this._keepalive_timeout),this._keep_alive_promise=null)}},{key:"_send_ZSINIT",value:function(){var e=[];this._zencoder.escapes_ctrl_chars()&&e.push("ESCCTL"),this._send_header_and_data(["ZSINIT",e],[0],"end_ack")}},{key:"_consume_ZRINIT",value:function(e){if(this._last_ZRINIT=e,e.get_buffer_size())throw"Buffer size ("+e.get_buffer_size()+") is unsupported!";if(!e.can_full_duplex())throw"Half-duplex I/O is unsupported!";if(!e.can_overlap_io())throw"Non-overlap I/O is unsupported!";if(e.escape_8th_bit())throw"8-bit escaping is unsupported!";this._zencoder.set_escape_ctrl_chars(!0),e.escape_ctrl_chars()||console.debug("Peer didn’t request escape of all control characters. Will send ZSINIT to force recognition of escaped control characters.")}},{key:"_ensure_receiver_escapes_ctrl_chars",value:function(){var e;if(!this._last_ZRINIT.escape_ctrl_chars()&&!this._got_ZSINIT_ZACK){var t=this;e=new Promise(function(e){t._next_header_handler={ZACK:function(t){e()}},t._send_ZSINIT()})}else e=Promise.resolve();return e}},{key:"_convert_params_to_offer_payload_array",value:function(e){var t=(e=l.Validation.offer_parameters(e)).name+"\0",r=[(e.size||0).toString(10),e.mtime?e.mtime.toString(8):"0",e.mode?(32768|e.mode).toString(8):"0","0"];return e.files_remaining&&(r.push(e.files_remaining),e.bytes_remaining&&r.push(e.bytes_remaining)),t+=r.join(" "),this._string_to_octets(t)}},{key:"send_offer",value:function(e){if(!e)throw"need file params!";if(this._sending_file)throw"Already sending file!";var t=this._convert_params_to_offer_payload_array(e);this._stop_keepalive();var r=this,n=function(){var n=new Promise(function(t){r._next_header_handler={ZSKIP:function(){r._start_keepalive(),t()},ZRPOS:function(n){r._sending_file=!0,t(new d(e,n.get_offset(),r._send_interim_file_piece.bind(r),r._end_file.bind(r)))}}});return r._send_header_and_data(["ZFILE"],t,"end_ack"),delete r._sent_ZDATA,n};return this._ensure_receiver_escapes_ctrl_chars().then(n)}},{key:"_send_header_and_data",value:function(e,t,r){var n=this._create_header_bytes(e),i=this._build_subpacket_bytes(t,r);n[0].push.apply(n[0],i),this._sender(n[0]),this._last_sent_header=n[1]}},{key:"_build_subpacket_bytes",value:function(e,t){return l.Subpacket.build(e,t)[this._subpacket_encode_func](this._zencoder)}},{key:"_build_and_send_subpacket",value:function(e,t){this._sender(this._build_subpacket_bytes(e,t))}},{key:"_string_to_octets",value:function(e){this._textencoder||(this._textencoder=new l.Text.Encoder);var t=this._textencoder.encode(e);return Array.prototype.slice.call(t)}},{key:"_send_interim_file_piece",value:function(e){return this._send_file_part(e,"no_end_no_ack"),Promise.resolve()}},{key:"_ensure_we_are_sending",value:function(){if(!this._sending_file)throw"Not sending a file currently!"}},{key:"_end_file",value:function(e){this._ensure_we_are_sending(),this._send_file_part(e,"end_no_ack");var t=this,r=new Promise(function(e){t._sending_file=!1,t._prepare_to_receive_ZRINIT(e)});return this._send_header("ZEOF",this._file_offset),this._file_offset=0,r}},{key:"_prepare_to_receive_ZRINIT",value:function(e){this._next_header_handler={ZRINIT:function(t){this._consume_ZRINIT(t),e&&e()}}}},{key:"close",value:function(){var e="ZRINIT"===this._last_header_name;if(e||(e="ZSKIP"===this._last_header_name),e||(e="ZSINIT"===this._last_sent_header.name&&"ZACK"===this._last_header_name),!e)throw"Can’t close; last received header was “"+this._last_header_name+"”";var t=this,r=new Promise(function(e,r){t._next_header_handler={ZFIN:function(){t._sender(h),t._sent_OO=!0,t._on_session_end(),e()}}});return this._send_header("ZFIN"),r}},{key:"_has_ended",value:function(){return this.aborted()||!!this._sent_OO}},{key:"_send_file_part",value:function(e,t){this._sent_ZDATA||(this._send_header("ZDATA",this._file_offset),this._sent_ZDATA=!0);for(var r=0,n=e.length;;){var i=Math.min(r+8192,n)-r,o=i+r>=n,s=e.slice(r,r+i);if(s instanceof Array||(s=Array.prototype.slice.call(s)),this._build_and_send_subpacket(s,o?t:"no_end_no_ack"),this._file_offset+=i,(r+=i)>=n)break}}},{key:"_consume_first",value:function(){if(!this._parse_and_consume_header()&&"67"===this._input_buffer.join())throw"Receiver has fallen back to YMODEM."}},{key:"_on_session_end",value:function(){this._stop_keepalive(),n(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_on_session_end",this).call(this)}}]),t}(),Object.assign(l.Session.Send.prototype,{type:"send"})},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=e.exports;Object.assign(o,r(39),r(150));var s=[42,42,24,66,48],a=["to_terminal","on_detect","on_retract","sender"],l=function(){function e(t,r,n,o){i(this,e),this._confirmer=r,this._denier=n,this._is_valid=o,this._session_type=t}return n(e,[{key:"confirm",value:function(){return this._confirmer.apply(this,arguments)}},{key:"deny",value:function(){return this._denier.apply(this,arguments)}},{key:"is_valid",value:function(){return this._is_valid.apply(this,arguments)}},{key:"get_session_role",value:function(){return this._session_type}}]),e}();o.Sentry=function(){function e(t){if(i(this,e),!t)throw"Need options!";var r=this;a.forEach(function(e){if(!t[e])throw"Need “"+e+"”!";r["_"+e]=t[e]}),this._cache=[]}return n(e,[{key:"_after_session_end",value:function(){this._zsession=null}},{key:"consume",value:function(e){if(e instanceof Array||(e=Array.prototype.slice.call(new Uint8Array(e))),this._zsession){var t=this._zsession;if(t.consume(e),!t.has_ended())return;e="receive"===t.type?t.get_trailing_bytes():[]}var r=this._parse(e),n=e;if(r){!!this._parsed_session&&(this._parsed_session.type===r.type&&(n=[]),this._on_retract()),this._parsed_session=r;var i=this;this._on_detect(new l(r.type,function(){if(!this.is_valid())throw"Stale ZMODEM session!";return r.on("garbage",i._to_terminal),r.on("session_end",i._after_session_end.bind(i)),r.set_sender(i._sender),delete i._parsed_session,i._zsession=r},this._send_abort.bind(this),function(){return i._parsed_session===r}))}else{var o=this._parsed_session;this._parsed_session=null,o&&(1===n.length&&67===n[0]&&this._send_abort(),this._on_retract())}this._to_terminal(n)}},{key:"get_confirmed_session",value:function(){return this._zsession||null}},{key:"_send_abort",value:function(){this._sender(o.ZMLIB.ABORT_SEQUENCE)}},{key:"_parse",value:function(e){var t=this._cache;for(t.push.apply(t,e);;){var r=o.ZMLIB.find_subarray(t,s);if(-1===r)break;t.splice(0,r);var n=void 0;try{n=o.Session.parse(t)}catch(e){}if(!n)break;return 1===t.length&&t[0]===o.ZMLIB.XON&&t.shift(),t.length?null:n}return t.splice(21),null}}]),e}()},function(e,t,r){"use strict";Object.assign(e.exports,r(151))},function(e,t,r){"use strict";var n=e.exports;function i(e){if(e.aborted())throw new n.Error("aborted")}window.Zmodem=n,Object.assign(n,r(152)),n.Browser={send_files:function(e,t,r){r||(r={});for(var n=[],o=0,s=t.length-1;s>=0;s--){var a=t[s];o+=a.size,n[s]={obj:a,name:a.name,size:a.size,mtime:new Date(a.lastModified),files_remaining:t.length-s,bytes_remaining:o}}var l=0;return function t(){var o=n[l];return o?(l++,e.send_offer(o).then(function(n){return r.on_offer_response&&r.on_offer_response(o.obj,n),void 0===n?t():new Promise(function(s){var a,l=new FileReader;l.onerror=function(e){throw console.error("file read error",e),"File read error: "+e},l.onprogress=function(t){t.target.result&&(a=new Uint8Array(t.target.result,n.get_offset()),i(e),n.send(a),r.on_progress&&r.on_progress(o.obj,n,a))},l.onload=function(l){a=new Uint8Array(l.target.result,n,a),i(e),n.end(a).then(function(){r.on_progress&&a.length&&r.on_progress(o.obj,n,a),r.on_file_complete&&r.on_file_complete(o.obj,n),s(t())})},l.readAsArrayBuffer(o.obj)})})):Promise.resolve()}()},save_to_disk:function(e,t){var r=new Blob(e),n=URL.createObjectURL(r),i=document.createElement("a");i.style.display="none",i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){(function(e){!function(e){function t(e){if("utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+e+"') is invalid.")}function r(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,"utf-8"!==e)throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(e.TextEncoder&&e.TextDecoder)return!1;Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var r=e.length,n=0,i=Math.max(32,r+(r>>1)+7),o=new Uint8Array(i>>3<<3);t<r;){var s=e.charCodeAt(t++);if(55296<=s&&56319>=s){if(t<r){var a=e.charCodeAt(t);56320==(64512&a)&&(++t,s=((1023&s)<<10)+(1023&a)+65536)}if(55296<=s&&56319>=s)continue}if(n+4>o.length&&(i+=8,i=(i*=1+t/e.length*2)>>3<<3,(a=new Uint8Array(i)).set(o),o=a),0==(4294967168&s))o[n++]=s;else{if(0==(4294965248&s))o[n++]=s>>6&31|192;else if(0==(4294901760&s))o[n++]=s>>12&15|224,o[n++]=s>>6&63|128;else{if(0!=(4292870144&s))continue;o[n++]=s>>18&7|240,o[n++]=s>>12&63|128,o[n++]=s>>6&63|128}o[n++]=63&s|128}}return o.slice(0,n)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1}),r.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");t=0;for(var r=(e=new Uint8Array(e)).length,n=[];t<r;){var i=e[t++];if(0===i)break;if(0==(128&i))n.push(i);else if(192==(224&i)){var o=63&e[t++];n.push((31&i)<<6|o)}else if(224==(240&i)){o=63&e[t++];var s=63&e[t++];n.push((31&i)<<12|o<<6|s)}else if(240==(248&i)){65535<(i=(7&i)<<18|(o=63&e[t++])<<12|(s=63&e[t++])<<6|63&e[t++])&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i)}}return String.fromCharCode.apply(null,n)},e.TextEncoder=t,e.TextDecoder=r}("undefined"!=typeof window?window:void 0!==e?e:this)}).call(this,r(154))},function(e,t,r){var n=r(1)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,r){var n=r(2),i=r(27),o=r(1)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,r){var n=r(157),i=r(59);e.exports=function(e,t,r){if(n(t))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(e))}},function(e,t,r){"use strict";var n=r(0),i=r(5),o=r(158),s="".endsWith;n(n.P+n.F*r(156)("endsWith"),"String",{endsWith:function(e){var t=o(this,e,"endsWith"),r=arguments.length>1?arguments[1]:void 0,n=i(t.length),a=void 0===r?n:Math.min(i(r),n),l=String(e);return s?s.call(t,l,a):t.slice(a-l.length,a)===l}})},function(e,t,r){r(159),e.exports=r(11).String.endsWith},function(e,t,r){r(18)("Float64",8,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(18)("Float32",4,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(18)("Uint32",4,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(18)("Int32",4,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(18)("Uint16",2,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(18)("Int16",2,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(18)("Uint8",1,function(e){return function(t,r,n){return e(this,t,r,n)}},!0)},function(e,t,r){r(18)("Uint8",1,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(18)("Int8",1,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){var n=r(0);n(n.G+n.W+n.F*!r(51).ABV,{DataView:r(65).DataView})},function(e,t,r){"use strict";var n=r(0),i=r(51),o=r(65),s=r(13),a=r(31),l=r(5),c=r(2),h=r(3).ArrayBuffer,u=r(52),f=o.ArrayBuffer,_=o.DataView,d=i.ABV&&h.isView,p=f.prototype.slice,m=i.VIEW;n(n.G+n.W+n.F*(h!==f),{ArrayBuffer:f}),n(n.S+n.F*!i.CONSTR,"ArrayBuffer",{isView:function(e){return d&&d(e)||c(e)&&m in e}}),n(n.P+n.U+n.F*r(7)(function(){return!new f(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(e,t){if(void 0!==p&&void 0===t)return p.call(s(this),e);for(var r=s(this).byteLength,n=a(e,r),i=a(void 0===t?r:t,r),o=new(u(this,f))(l(i-n)),c=new _(this),h=new _(o),d=0;n<i;)h.setUint8(d++,c.getUint8(n++));return o}}),r(56)("ArrayBuffer")},function(e,t,r){r(171),r(170),r(169),r(168),r(167),r(166),r(165),r(164),r(163),r(162),r(161),r(69),e.exports=r(11)},function(e,t,r){"use strict";var n=r(0),i=r(67),o=r(93);n(n.S,"Promise",{try:function(e){var t=i.f(this),r=o(e);return(r.e?t.reject:t.resolve)(r.v),t.promise}})},function(e,t,r){"use strict";var n=r(0),i=r(11),o=r(3),s=r(52),a=r(92);n(n.P+n.R,"Promise",{finally:function(e){var t=s(this,i.Promise||o.Promise),r="function"==typeof e;return this.then(r?function(r){return a(t,e()).then(function(){return r})}:e,r?function(r){return a(t,e()).then(function(){throw r})}:e)}})},function(e,t,r){var n=r(3),i=r(94).set,o=n.MutationObserver||n.WebKitMutationObserver,s=n.process,a=n.Promise,l="process"==r(27)(s);e.exports=function(){var e,t,r,c=function(){var n,i;for(l&&(n=s.domain)&&n.exit();e;){i=e.fn,e=e.next;try{i()}catch(n){throw e?r():t=void 0,n}}t=void 0,n&&n.enter()};if(l)r=function(){s.nextTick(c)};else if(!o||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var h=a.resolve();r=function(){h.then(c)}}else r=function(){i.call(n,c)};else{var u=!0,f=document.createTextNode("");new o(c).observe(f,{characterData:!0}),r=function(){f.data=u=!u}}return function(n){var i={fn:n,next:void 0};t&&(t.next=i),e||(e=i,r()),t=i}}},function(e,t){e.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},function(e,t,r){var n=r(20),i=r(103),o=r(76),s=r(13),a=r(5),l=r(74),c={},h={};(t=e.exports=function(e,t,r,u,f){var _,d,p,m,y=f?function(){return e}:l(e),v=n(r,u,t?2:1),g=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(o(y)){for(_=a(e.length);_>g;g++)if((m=t?v(s(d=e[g])[0],d[1]):v(e[g]))===c||m===h)return m}else for(p=y.call(e);!(d=p.next()).done;)if((m=i(p,v,d.value,t))===c||m===h)return m}).BREAK=c,t.RETURN=h},function(e,t,r){"use strict";var n,i,o,s,a=r(30),l=r(3),c=r(20),h=r(42),u=r(0),f=r(2),_=r(19),d=r(68),p=r(177),m=r(52),y=r(94).set,v=r(175)(),g=r(67),b=r(93),C=r(92),w=l.TypeError,E=l.process,S=l.Promise,A="process"==h(E),L=function(){},x=i=g.f,k=!!function(){try{var e=S.resolve(1),t=(e.constructor={})[r(1)("species")]=function(e){e(L,L)};return(A||"function"==typeof PromiseRejectionEvent)&&e.then(L)instanceof t}catch(e){}}(),T=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},O=function(e,t){if(!e._n){e._n=!0;var r=e._c;v(function(){for(var n=e._v,i=1==e._s,o=0,s=function(t){var r,o,s=i?t.ok:t.fail,a=t.resolve,l=t.reject,c=t.domain;try{s?(i||(2==e._h&&D(e),e._h=1),!0===s?r=n:(c&&c.enter(),r=s(n),c&&c.exit()),r===t.promise?l(w("Promise-chain cycle")):(o=T(r))?o.call(r,a,l):a(r)):l(n)}catch(e){l(e)}};r.length>o;)s(r[o++]);e._c=[],e._n=!1,t&&!e._h&&R(e)})}},R=function(e){y.call(l,function(){var t,r,n,i=e._v,o=M(e);if(o&&(t=b(function(){A?E.emit("unhandledRejection",i,e):(r=l.onunhandledrejection)?r({promise:e,reason:i}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",i)}),e._h=A||M(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},M=function(e){return 1!==e._h&&0===(e._a||e._c).length},D=function(e){y.call(l,function(){var t;A?E.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},H=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),O(t,!0))},I=function(e){var t,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw w("Promise can't be resolved itself");(t=T(e))?v(function(){var n={_w:r,_d:!1};try{t.call(e,c(I,n,1),c(H,n,1))}catch(e){H.call(n,e)}}):(r._v=e,r._s=1,O(r,!1))}catch(e){H.call({_w:r,_d:!1},e)}}};k||(S=function(e){d(this,S,"Promise","_h"),_(e),n.call(this);try{e(c(I,this,1),c(H,this,1))}catch(e){H.call(this,e)}},(n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(66)(S.prototype,{then:function(e,t){var r=x(m(this,S));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=A?E.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&O(this,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n;this.promise=e,this.resolve=c(I,e,1),this.reject=c(H,e,1)},g.f=x=function(e){return e===S||e===s?new o(e):i(e)}),u(u.G+u.W+u.F*!k,{Promise:S}),r(44)(S,"Promise"),r(56)("Promise"),s=r(11).Promise,u(u.S+u.F*!k,"Promise",{reject:function(e){var t=x(this);return(0,t.reject)(e),t.promise}}),u(u.S+u.F*(a||!k),"Promise",{resolve:function(e){return C(a&&this===s?S:this,e)}}),u(u.S+u.F*!(k&&r(73)(function(e){S.all(e).catch(L)})),"Promise",{all:function(e){var t=this,r=x(t),n=r.resolve,i=r.reject,o=b(function(){var r=[],o=0,s=1;p(e,!1,function(e){var a=o++,l=!1;r.push(void 0),s++,t.resolve(e).then(function(e){l||(l=!0,r[a]=e,--s||n(r))},i)}),--s||n(r)});return o.e&&i(o.v),r.promise},race:function(e){var t=this,r=x(t),n=r.reject,i=b(function(){p(e,!1,function(e){t.resolve(e).then(r.resolve,n)})});return i.e&&n(i.v),r.promise}})},function(e,t,r){for(var n=r(70),i=r(28),o=r(33),s=r(3),a=r(16),l=r(32),c=r(1),h=c("iterator"),u=c("toStringTag"),f=l.Array,_={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(_),p=0;p<d.length;p++){var m,y=d[p],v=_[y],g=s[y],b=g&&g.prototype;if(b&&(b[h]||a(b,h,f),b[u]||a(b,u,y),l[y]=f,v))for(m in n)b[m]||o(b,m,n[m],!0)}},function(e,t,r){r(69),r(108),r(179),r(178),r(174),r(173),e.exports=r(11).Promise},function(e,t,r){var n=r(0),i=r(95),o=r(46);n(n.S+n.F,"Object",{make:function(e,t){return i(o(e),t)}})},function(e,t,r){var n=r(0),i=r(95);n(n.S+n.F,"Object",{define:i})},function(e,t,r){var n=r(0);n(n.S+n.F,"Object",{classof:r(42)})},function(e,t,r){var n=r(0);n(n.S+n.F,"Object",{isObject:r(2)})},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(35),s=r(43),a=r(22).f;r(6)&&n(n.P+r(53),"Object",{__lookupSetter__:function(e){var t,r=i(this),n=o(e,!0);do{if(t=a(r,n))return t.set}while(r=s(r))}})},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(35),s=r(43),a=r(22).f;r(6)&&n(n.P+r(53),"Object",{__lookupGetter__:function(e){var t,r=i(this),n=o(e,!0);do{if(t=a(r,n))return t.get}while(r=s(r))}})},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(19),s=r(8);r(6)&&n(n.P+r(53),"Object",{__defineSetter__:function(e,t){s.f(i(this),e,{set:o(t),enumerable:!0,configurable:!0})}})},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(19),s=r(8);r(6)&&n(n.P+r(53),"Object",{__defineGetter__:function(e,t){s.f(i(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},function(e,t,r){var n=r(0),i=r(96)(!0);n(n.S,"Object",{entries:function(e){return i(e)}})},function(e,t,r){var n=r(0),i=r(96)(!1);n(n.S,"Object",{values:function(e){return i(e)}})},function(e,t,r){var n=r(0),i=r(97),o=r(10),s=r(22),a=r(75);n(n.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,r,n=o(e),l=s.f,c=i(n),h={},u=0;c.length>u;)void 0!==(r=l(n,t=c[u++]))&&a(h,t,r);return h}})},function(e,t,r){var n=r(2),i=r(13),o=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=r(20)(Function.call,r(22).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return o(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:o}},function(e,t,r){var n=r(0);n(n.S,"Object",{setPrototypeOf:r(192).set})},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,r){var n=r(0);n(n.S,"Object",{is:r(194)})},function(e,t,r){"use strict";var n=r(28),i=r(54),o=r(41),s=r(4),a=r(45),l=Object.assign;e.exports=!l||r(7)(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=l({},e)[r]||Object.keys(l({},t)).join("")!=n})?function(e,t){for(var r=s(e),l=arguments.length,c=1,h=i.f,u=o.f;l>c;)for(var f,_=a(arguments[c++]),d=h?n(_).concat(h(_)):n(_),p=d.length,m=0;p>m;)u.call(_,f=d[m++])&&(r[f]=_[f]);return r}:l},function(e,t,r){var n=r(0);n(n.S+n.F,"Object",{assign:r(196)})},function(e,t,r){var n=r(2);r(15)("isExtensible",function(e){return function(t){return!!n(t)&&(!e||e(t))}})},function(e,t,r){var n=r(2);r(15)("isSealed",function(e){return function(t){return!n(t)||!!e&&e(t)}})},function(e,t,r){var n=r(2);r(15)("isFrozen",function(e){return function(t){return!n(t)||!!e&&e(t)}})},function(e,t,r){var n=r(2),i=r(55).onFreeze;r(15)("preventExtensions",function(e){return function(t){return e&&n(t)?e(i(t)):t}})},function(e,t,r){var n=r(2),i=r(55).onFreeze;r(15)("seal",function(e){return function(t){return e&&n(t)?e(i(t)):t}})},function(e,t,r){var n=r(2),i=r(55).onFreeze;r(15)("freeze",function(e){return function(t){return e&&n(t)?e(i(t)):t}})},function(e,t,r){r(15)("getOwnPropertyNames",function(){return r(98).f})},function(e,t,r){var n=r(4),i=r(28);r(15)("keys",function(){return function(e){return i(n(e))}})},function(e,t,r){var n=r(4),i=r(43);r(15)("getPrototypeOf",function(){return function(e){return i(n(e))}})},function(e,t,r){var n=r(10),i=r(22).f;r(15)("getOwnPropertyDescriptor",function(){return function(e,t){return i(n(e),t)}})},function(e,t,r){var n=r(0);n(n.S+n.F*!r(6),"Object",{defineProperties:r(105)})},function(e,t,r){var n=r(0);n(n.S+n.F*!r(6),"Object",{defineProperty:r(8).f})},function(e,t,r){var n=r(0);n(n.S,"Object",{create:r(46)})},function(e,t,r){var n=r(28),i=r(54),o=r(41);e.exports=function(e){var t=n(e),r=i.f;if(r)for(var s,a=r(e),l=o.f,c=0;a.length>c;)l.call(e,s=a[c++])&&t.push(s);return t}},function(e,t,r){var n=r(3),i=r(11),o=r(30),s=r(99),a=r(8).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}},function(e,t,r){"use strict";var n=r(3),i=r(21),o=r(6),s=r(0),a=r(33),l=r(55).KEY,c=r(7),h=r(79),u=r(44),f=r(29),_=r(1),d=r(99),p=r(212),m=r(211),y=r(57),v=r(13),g=r(2),b=r(10),C=r(35),w=r(34),E=r(46),S=r(98),A=r(22),L=r(8),x=r(28),k=A.f,T=L.f,O=S.f,R=n.Symbol,M=n.JSON,D=M&&M.stringify,H=_("_hidden"),I=_("toPrimitive"),P={}.propertyIsEnumerable,F=h("symbol-registry"),B=h("symbols"),N=h("op-symbols"),j=Object.prototype,W="function"==typeof R,U=n.QObject,Z=!U||!U.prototype||!U.prototype.findChild,z=o&&c(function(){return 7!=E(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=k(j,t);n&&delete j[t],T(e,t,r),n&&e!==j&&T(j,t,n)}:T,V=function(e){var t=B[e]=E(R.prototype);return t._k=e,t},K=W&&"symbol"==typeof R.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof R},X=function(e,t,r){return e===j&&X(N,t,r),v(e),t=C(t,!0),v(r),i(B,t)?(r.enumerable?(i(e,H)&&e[H][t]&&(e[H][t]=!1),r=E(r,{enumerable:w(0,!1)})):(i(e,H)||T(e,H,w(1,{})),e[H][t]=!0),z(e,t,r)):T(e,t,r)},G=function(e,t){v(e);for(var r,n=m(t=b(t)),i=0,o=n.length;o>i;)X(e,r=n[i++],t[r]);return e},Y=function(e){var t=P.call(this,e=C(e,!0));return!(this===j&&i(B,e)&&!i(N,e))&&(!(t||!i(this,e)||!i(B,e)||i(this,H)&&this[H][e])||t)},q=function(e,t){if(e=b(e),t=C(t,!0),e!==j||!i(B,t)||i(N,t)){var r=k(e,t);return!r||!i(B,t)||i(e,H)&&e[H][t]||(r.enumerable=!0),r}},J=function(e){for(var t,r=O(b(e)),n=[],o=0;r.length>o;)i(B,t=r[o++])||t==H||t==l||n.push(t);return n},Q=function(e){for(var t,r=e===j,n=O(r?N:b(e)),o=[],s=0;n.length>s;)!i(B,t=n[s++])||r&&!i(j,t)||o.push(B[t]);return o};W||(a((R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(r){this===j&&t.call(N,r),i(this,H)&&i(this[H],e)&&(this[H][e]=!1),z(this,e,w(1,r))};return o&&Z&&z(j,e,{configurable:!0,set:t}),V(e)}).prototype,"toString",function(){return this._k}),A.f=q,L.f=X,r(40).f=S.f=J,r(41).f=Y,r(54).f=Q,o&&!r(30)&&a(j,"propertyIsEnumerable",Y,!0),d.f=function(e){return V(_(e))}),s(s.G+s.W+s.F*!W,{Symbol:R});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;$.length>ee;)_($[ee++]);for(var te=x(_.store),re=0;te.length>re;)p(te[re++]);s(s.S+s.F*!W,"Symbol",{for:function(e){return i(F,e+="")?F[e]:F[e]=R(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var t in F)if(F[t]===e)return t},useSetter:function(){Z=!0},useSimple:function(){Z=!1}}),s(s.S+s.F*!W,"Object",{create:function(e,t){return void 0===t?E(e):G(E(e),t)},defineProperty:X,defineProperties:G,getOwnPropertyDescriptor:q,getOwnPropertyNames:J,getOwnPropertySymbols:Q}),M&&s(s.S+s.F*(!W||c(function(){var e=R();return"[null]"!=D([e])||"{}"!=D({a:e})||"{}"!=D(Object(e))})),"JSON",{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(g(t)||void 0!==e)&&!K(e))return y(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!K(t))return t}),n[1]=t,D.apply(M,n)}}),R.prototype[I]||r(16)(R.prototype,I,R.prototype.valueOf),u(R,"Symbol"),u(Math,"Math",!0),u(n.JSON,"JSON",!0)},function(e,t,r){r(213),r(210),r(209),r(208),r(207),r(206),r(205),r(204),r(203),r(202),r(201),r(200),r(199),r(198),r(197),r(195),r(193),r(69),r(191),r(190),r(189),r(188),r(187),r(186),r(185),r(184),r(183),r(182),r(181),e.exports=r(11).Object},function(e,t,r){"use strict";var n=r(0),i=r(100),o=r(4),s=r(5),a=r(25),l=r(72);n(n.P,"Array",{flatten:function(){var e=arguments[0],t=o(this),r=s(t.length),n=l(t,0);return i(n,t,t,r,0,void 0===e?1:a(e)),n}}),r(23)("flatten")},function(e,t,r){"use strict";var n=r(0),i=r(100),o=r(4),s=r(5),a=r(19),l=r(72);n(n.P,"Array",{flatMap:function(e){var t,r,n=o(this);return a(e),t=s(n.length),r=l(n,0),i(r,n,n,t,0,1,e,arguments[1]),r}}),r(23)("flatMap")},function(e,t,r){"use strict";var n=r(0),i=r(58)(!0);n(n.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(23)("includes")},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){r(56)("Array")},function(e,t,r){"use strict";var n=r(0),i=r(24)(6),o="findIndex",s=!0;o in[]&&Array(1)[o](function(){s=!1}),n(n.P+n.F*s,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(23)(o)},function(e,t,r){"use strict";var n=r(0),i=r(24)(5),o=!0;"find"in[]&&Array(1).find(function(){o=!1}),n(n.P+n.F*o,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(23)("find")},function(e,t,r){var n=r(0);n(n.P,"Array",{fill:r(71)}),r(23)("fill")},function(e,t,r){var n=r(0);n(n.P,"Array",{copyWithin:r(101)}),r(23)("copyWithin")},function(e,t,r){"use strict";var n=r(0),i=r(10),o=r(25),s=r(5),a=[].lastIndexOf,l=!!a&&1/[1].lastIndexOf(1,-0)<0;n(n.P+n.F*(l||!r(12)(a)),"Array",{lastIndexOf:function(e){if(l)return a.apply(this,arguments)||0;var t=i(this),r=s(t.length),n=r-1;for(arguments.length>1&&(n=Math.min(n,o(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}})},function(e,t,r){"use strict";var n=r(0),i=r(58)(!1),o=[].indexOf,s=!!o&&1/[1].indexOf(1,-0)<0;n(n.P+n.F*(s||!r(12)(o)),"Array",{indexOf:function(e){return s?o.apply(this,arguments)||0:i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(102);n(n.P+n.F*!r(12)([].reduceRight,!0),"Array",{reduceRight:function(e){return i(this,e,arguments.length,arguments[1],!0)}})},function(e,t,r){"use strict";var n=r(0),i=r(102);n(n.P+n.F*!r(12)([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},function(e,t,r){"use strict";var n=r(0),i=r(24)(4);n(n.P+n.F*!r(12)([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(24)(3);n(n.P+n.F*!r(12)([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(24)(2);n(n.P+n.F*!r(12)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(24)(1);n(n.P+n.F*!r(12)([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},function(e,t,r){var n=r(2),i=r(57),o=r(1)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),n(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,r){"use strict";var n=r(0),i=r(24)(0),o=r(12)([].forEach,!0);n(n.P+n.F*!o,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(19),o=r(4),s=r(7),a=[].sort,l=[1,2,3];n(n.P+n.F*(s(function(){l.sort(void 0)})||!s(function(){l.sort(null)})||!r(12)(a)),"Array",{sort:function(e){return void 0===e?a.call(o(this)):a.call(o(this),i(e))}})},function(e,t,r){"use strict";var n=r(0),i=r(77),o=r(27),s=r(31),a=r(5),l=[].slice;n(n.P+n.F*r(7)(function(){i&&l.call(i)}),"Array",{slice:function(e,t){var r=a(this.length),n=o(this);if(t=void 0===t?r:t,"Array"==n)return l.call(this,e,t);for(var i=s(e,r),c=s(t,r),h=a(c-i),u=new Array(h),f=0;f<h;f++)u[f]="String"==n?this.charAt(i+f):this[i+f];return u}})},function(e,t,r){"use strict";var n=r(0),i=r(10),o=[].join;n(n.P+n.F*(r(45)!=Object||!r(12)(o)),"Array",{join:function(e){return o.call(i(this),void 0===e?",":e)}})},function(e,t,r){"use strict";var n=r(0),i=r(75);n(n.S+n.F*r(7)(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,r=new("function"==typeof this?this:Array)(t);t>e;)i(r,e,arguments[e++]);return r.length=t,r}})},function(e,t,r){"use strict";var n=r(20),i=r(0),o=r(4),s=r(103),a=r(76),l=r(5),c=r(75),h=r(74);i(i.S+i.F*!r(73)(function(e){Array.from(e)}),"Array",{from:function(e){var t,r,i,u,f=o(e),_="function"==typeof this?this:Array,d=arguments.length,p=d>1?arguments[1]:void 0,m=void 0!==p,y=0,v=h(f);if(m&&(p=n(p,d>2?arguments[2]:void 0,2)),void 0==v||_==Array&&a(v))for(r=new _(t=l(f.length));t>y;y++)c(r,y,m?p(f[y],y):f[y]);else for(u=v.call(f),r=new _;!(i=u.next()).done;y++)c(r,y,m?s(u,p,[i.value,y],!0):i.value);return r.length=y,r}})},function(e,t,r){var n=r(0);n(n.S,"Array",{isArray:r(57)})},function(e,t,r){"use strict";var n=r(46),i=r(34),o=r(44),s={};r(16)(s,r(1)("iterator"),function(){return this}),e.exports=function(e,t,r){e.prototype=n(s,{next:i(1,r)}),o(e,t+" Iterator")}},function(e,t,r){var n=r(25),i=r(59);e.exports=function(e){return function(t,r){var o,s,a=String(i(t)),l=n(r),c=a.length;return l<0||l>=c?e?"":void 0:(o=a.charCodeAt(l))<55296||o>56319||l+1===c||(s=a.charCodeAt(l+1))<56320||s>57343?e?a.charAt(l):o:e?a.slice(l,l+2):s-56320+(o-55296<<10)+65536}}},function(e,t,r){r(108),r(239),r(238),r(237),r(236),r(235),r(234),r(233),r(231),r(230),r(229),r(228),r(227),r(226),r(225),r(224),r(223),r(222),r(221),r(220),r(219),r(70),r(217),r(216),r(215),e.exports=r(11).Array},,,function(e,t,r){},function(e,t,r){"use strict";r(245),r(242),r(214),r(180),r(172),r(160),r(155);var n=r(153),i=r(144).Terminal;i.applyAddon(r(110)),i.applyAddon(r(109));var o={self:document.getElementById("modal"),header:document.getElementById("header"),status:{self:document.getElementById("status"),filesRemaining:document.getElementById("files-remaining"),bytesRemaining:document.getElementById("bytes-remaining")},choose:{self:document.getElementById("choose"),files:document.getElementById("files"),filesNames:document.getElementById("file-names")},progress:{self:document.getElementById("progress"),fileName:document.getElementById("file-name"),progressBar:document.getElementById("progress-bar"),bytesReceived:document.getElementById("bytes-received"),bytesFile:document.getElementById("bytes-file"),percentReceived:document.getElementById("percent-received"),skip:document.getElementById("skip")}};function s(e){o.status.self.style.display="",o.choose.self.style.display="none",o.progress.self.style.display="",o.status.filesRemaining.textContent=e.files_remaining,o.status.bytesRemaining.textContent=h(e.bytes_remaining,2),o.progress.fileName.textContent=e.name}function a(){o.self.classList.remove("is-active")}function l(e){o.header.textContent=e,o.status.self.style.display="none",o.choose.self.style.display="none",o.progress.self.style.display="none",o.progress.bytesReceived.textContent="-",o.progress.percentReceived.textContent="-%",o.progress.progressBar.textContent="0%",o.progress.progressBar.value=0,o.progress.skip.style.display="none"}function c(e){var t=e.get_details().size,r=e.get_offset();o.progress.bytesReceived.textContent=h(r,2),o.progress.bytesFile.textContent=h(t,2);var n=(100*r/t).toFixed(2);o.progress.percentReceived.textContent=n+"%",o.progress.progressBar.textContent=n+"%",o.progress.progressBar.setAttribute("value",n)}function h(e,t){if(isNaN(parseFloat(e))||!isFinite(e))return"-";if(0===e)return 0;void 0===t&&(t=1);var r=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,Math.floor(r))).toFixed(t)+" "+["bytes","KB","MB","GB","TB","PB"][r]}function u(e){return new Promise(function(t){var r;r=function(r){n.Browser.send_files(e,r,{on_progress:function(e,t){s(t.get_details()),c(t)},on_file_complete:function(e){}}).then(e.close.bind(e),console.error.bind(console)).then(function(){t()})},l("Sending files"),o.choose.self.style.display="",o.choose.files.disabled=!1,o.choose.files.value="",o.choose.filesNames.textContent="",o.choose.files.onchange=function(){this.disabled=!0;for(var e=this.files,t="",n=0;n<e.length;n++)0===n?t=e[n].name:t+=", "+e[n].name;o.choose.filesNames.textContent=t,r(e)},o.self.classList.add("is-active")})}function f(e){e.on("offer",function(e){!function(e){l("Receiving files"),s(e.get_details()),o.progress.skip.disabled=!1,o.progress.skip.onclick=function(){this.disabled=!0,e.skip()},o.progress.skip.style.display="",o.self.classList.add("is-active")}(e);var t=[];e.on("input",function(r){c(e),t.push(new Uint8Array(r))}),e.accept().then(function(){n.Browser.save_to_disk(t,e.get_details().name)},console.error.bind(console))});var t=new Promise(function(t){e.on("session_end",function(){t()})});return e.start(),t}var _,d,p,m,y=document.getElementById("terminal-container"),v=("https:"===window.location.protocol?"wss://":"ws://")+window.location.host+window.location.pathname+(window.location.pathname.endsWith("/")?"":"/")+"ws"+window.location.search,g=new TextDecoder,b=new TextEncoder,C="undefined"!=typeof tty_auth_token?tty_auth_token:null,w=-1,E=function e(){var t=new WebSocket(v,["tty"]),r=function(e){t.readyState===WebSocket.OPEN&&t.send(b.encode(e))},o=function(e){r("0"+e)},s=function(e){var t="Close terminal? this will also terminate the command.";return(e||window.event).returnValue=t,t},l=new n.Sentry({to_terminal:function(e){var t=new Uint8Array(e).buffer;d.write(g.decode(t))},sender:function(e){for(;e.length;){var r=e.splice(0,4095),n=new Uint8Array(r.length+1);n[0]="0".charCodeAt(0),n.set(r,1),t.send(n)}},on_retract:function(){},on_detect:function(e){d.setOption("disableStdin",!0);var t=e.confirm();("send"===t.type?u(t):f(t)).catch(console.error.bind(console)).then(function(){a(),d.setOption("disableStdin",!1)})}});t.binaryType="arraybuffer",t.onopen=function(e){for(console.log("[ttyd] websocket opened"),m=!1,r(JSON.stringify({AuthToken:C})),void 0!==d&&d.dispose(),(d=window.term=new i({fontSize:13,fontFamily:'"Menlo for Powerline", Menlo, Consolas, "Liberation Mono", Courier, monospace',theme:{foreground:"#d2d2d2",background:"#2b2b2b",cursor:"#adadad",black:"#000000",red:"#d81e00",green:"#5ea702",yellow:"#cfae00",blue:"#427ab3",magenta:"#89658e",cyan:"#00a7aa",white:"#dbded8",brightBlack:"#686a66",brightRed:"#f54235",brightGreen:"#99e343",brightYellow:"#fdeb61",brightBlue:"#84b0d8",brightMagenta:"#bc94b7",brightCyan:"#37e6e8",brightWhite:"#f1f1f0"}})).on("resize",function(e){t.readyState===WebSocket.OPEN&&r("1"+JSON.stringify({columns:e.cols,rows:e.rows})),setTimeout(function(){d.showOverlay(e.cols+"x"+e.rows)},500)}),d.on("title",function(e){e&&""!==e&&(document.title=e+" | "+p)}),d.on("data",o);y.firstChild;)y.removeChild(y.firstChild);window.addEventListener("resize",function(){clearTimeout(window.resizedFinished),window.resizedFinished=setTimeout(function(){d.fit()},250)}),window.addEventListener("beforeunload",s),d.open(y,!0),d.fit(),d.focus()},t.onmessage=function(r){var n=new Uint8Array(r.data),i=String.fromCharCode(n[0]),o=n.slice(1).buffer;switch(i){case"0":try{l.consume(o)}catch(r){console.error(r),a(),clearTimeout(_),t.readyState!==WebSocket.CLOSED&&t.close(),e()}break;case"1":p=g.decode(o),document.title=p;break;case"2":var s=JSON.parse(g.decode(o));Object.keys(s).forEach(function(e){console.log("[ttyd] xterm option: "+e+"="+s[e]),d.setOption(e,s[e])});break;case"3":w=JSON.parse(g.decode(o)),console.log("[ttyd] reconnect: "+w+" seconds");break;default:console.log("[ttyd] unknown command: "+i)}},t.onclose=function(t){console.log("[ttyd] websocket closed, code: "+t.code),d&&(d.off("data"),d.off("resize"),m||d.showOverlay("Connection Closed",null)),window.removeEventListener("beforeunload",s),1e3!==t.code&&w>0&&(_=setTimeout(e,1e3*w))}};"complete"===document.readyState||"loading"!==document.readyState?E():document.addEventListener("DOMContentLoaded",E)}]);</script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><title>ttyd - Terminal</title><link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA0xpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTgyRjc1RjA3MTZEMTFFNjg2M0NCOEY3RjJBMEY3N0EiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTgyRjc1RUY3MTZEMTFFNjg2M0NCOEY3RjJBMEY3N0EiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjU3YmQxNjhjLWI5ZDctMTE3OS1hM2RlLWZmNjQyYTM4NTJmMCIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjU3YmQxNjhjLWI5ZDctMTE3OS1hM2RlLWZmNjQyYTM4NTJmMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhsssMYAAALDSURBVHjaxFa9jxJBFH8zDMdCYrhIAppgIjaG5C5RQ+zO2Gty5gpbY2KsbOyu1MrGGEtj/A9stLPXs6CjJ5GYIF6AE5IDBHZmfG92F4ZzvQAnyyO7O8zX+73f+5gRd3bvvSgffN4/l948YgASFhQ9aWhqM6+pYfrVjD5WH9NK8f7x8ebNnVtvWC6b/RaPxy8zxsxmbB5lIfNsIDMggreezqG1o9GIGj8E45zFNzYgnU4D5xyUUkBglpFAKfgWa5gFY89rNVvgJJMgSBkpjcViIISA4XAI4/EYkBXTdyYQ9LOUU9sw7bmG2lqgPwwAKSV9D/P5/G2csNtoNJ71+32HFjqOszyQkDY9xLbrjkEorSe+wYGc67o72Wz2dSqV+tjr9e4iiAfdbnfL+G4B10wtDV/nBSYAN5O053eivVqtvq1UKr/RDaVCofCyVCo9ogXE0qISppgsJ3GlCzzGkQHcOEgT8n2xWLyfy+XeDwaDK7Va7Xm73X4YUHaaRfMwcbIPdTNBGWBSwkP3Ewdr9Xr9FcbAUwpICkyKAXuTRdkIAxH4QThOEn61W2YSKruAVpeJiUQiYRQjqHImk9nDjDiPijnO+d7pdN5hXOwRuGXdYRggANIdM9sy2tTeGPsuNpvNJwgkRVUMpYPdV5dJURsIZZ9WBEB6aRhKkeeWSzi2j9kxk8vLFqsABFkvlWSYhoqdni6zY2dRfHJfYoErvxBFLb5expVUDFlYCwDpM8CU0pEDoADUGH9YCf8dgKuQSRagXoo/Lg0Da3CBVwm9syBKBv46FfHNIlc+BYFZQHe0yBnQPgN0HFtV8H8VmXko8ABgEOo1uIDZMbCWALRiQAR/gkvpqsU+Rcl4gW9zR6JLCXXQ5XTVAKR/sqIvGODl89BnJfLHcRJNceP6tQ9fDr4+RmRHmAUqoiLEkOnM1vb2pz8CDACUMgcHE3VMqAAAAABJRU5ErkJggg==" /><style type="text/css">.xterm{font-feature-settings:"liga" 0;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:10}.xterm .xterm-helper-textarea{position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-10;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm{cursor:text}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:100;color:transparent}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:.5}.xterm-underline{text-decoration:underline}.box{background-color:#fff;border-radius:5px;box-shadow:0 2px 3px hsla(0,0%,4%,.1),0 0 0 1px hsla(0,0%,4%,.1);color:#4a4a4a;display:block;padding:1.25rem}.progress{border:none;border-radius:290486px;display:block;height:1rem;overflow:hidden;padding:0;width:100%}.progress:not(:last-child){margin-bottom:1.5rem}.progress::-webkit-progress-bar{background-color:#dbdbdb}.progress::-webkit-progress-value{background-color:#3273dc}.progress::-moz-progress-bar{background-color:#3273dc}.progress::-ms-fill{background-color:#3273dc;border:none}.modal{bottom:0;left:0;right:0;top:0;align-items:center;display:none;overflow:hidden;position:fixed;z-index:40}.modal.is-active{display:flex}.file-input{height:.01em;left:0;outline:none;position:absolute;top:0;width:.01em}.file-cta,.file-name{align-items:center;box-shadow:none;display:inline-flex;height:2.25em;justify-content:flex-start;line-height:1.5;position:relative;vertical-align:top;border-color:#dbdbdb;border-radius:3px;font-size:1em;padding:calc(.375em - 1px) 1em;white-space:nowrap}.file-name{border-color:#dbdbdb;border-style:solid;border-width:1px 1px 1px 0;display:block;max-width:16em;overflow:hidden;text-align:left;text-overflow:ellipsis}.file-name:active,.file-name:focus{outline:none}.file-cta{background-color:#f5f5f5;color:#4a4a4a}.file-cta:active,.file-cta:focus{outline:none}.button{float:right;align-items:center;border-radius:2px;display:inline-flex;font-size:.75rem;height:2em;line-height:1.5;position:relative;vertical-align:top;background-color:#3273dc;border-color:transparent;color:#fff;cursor:pointer;justify-content:center;padding:calc(.375em - 1px) .75em;text-align:center;white-space:nowrap}.button:active,.button:focus{outline:none}.button:hover{background-color:#276cda;border-color:transparent;color:#fff}.modal-background{bottom:0;left:0;position:absolute;right:0;top:0;background-color:hsla(0,0%,4%,.86)}.modal-content{margin:0 20px;max-height:calc(100vh - 160px);overflow:auto;position:relative;width:100%}@media print,screen and (min-width:769px){.modal-content{margin:0 auto;max-height:calc(100vh - 40px);width:640px}}body,html{height:100%;min-height:100%;margin:0;overflow:hidden}#terminal-container{width:auto;height:100%;margin:0 auto;padding:0;background-color:#2b2b2b}#terminal-container .terminal{padding:5px}#modal strong{color:#268bd2}#modal span{color:#2aa198}#modal header{font-weight:700;text-align:center;padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid #ddd}#progress{padding-top:10px;color:#93a1a1}#progress progress{margin:10px 0}#progress span{font-weight:700}#status{margin-top:10px;text-align:center}#choose{padding-top:10px}#choose .file-name{border-color:transparent}#file-name{background-color:#fafffd;text-align:center}</style></head><body><div id="terminal-container"></div><div class="modal" id="modal"><div class="modal-background"></div><div class="modal-content"><div class="box"><header id="header"></header><div id="status"><strong>Files remaining: </strong><span id="files-remaining"></span>, <strong>Bytes remaining: </strong><span id="bytes-remaining"></span></div><div id="choose" class="file has-name is-fullwidth"><label class="file-label"><input id="files" class="file-input" type="file" multiple="multiple"> <span class="file-cta"><strong class="file-label">Choose file(s)… </strong></span><span id="file-names" class="file-name"></span></label></div><div id="progress"><p id="file-name"></p><progress id="progress-bar" class="progress" max="100"></progress><p id="progress-info"><span id="bytes-received">-</span>/<span id="bytes-file">-</span> (<span id="percent-received"></span>) transferred <a id="skip" class="button">Skip</a></p></div></div></div></div><script src="auth_token.js"></script><script type="text/javascript">!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=248)}([function(e,t,r){var n=r(3),i=r(10),o=r(16),s=r(34),a=r(21),l=function(e,t,r){var c,h,u,f,_=e&l.F,d=e&l.G,p=e&l.S,y=e&l.P,m=e&l.B,g=d?n:p?n[t]||(n[t]={}):(n[t]||{}).prototype,v=d?i:i[t]||(i[t]={}),b=v.prototype||(v.prototype={});for(c in d&&(r=t),r)u=((h=!_&&g&&void 0!==g[c])?g:r)[c],f=m&&h?a(u,n):y&&"function"==typeof u?a(Function.call,u):u,g&&s(g,c,u,e&l.U),v[c]!=u&&o(v,c,f),y&&b[c]!=u&&(b[c]=u)};n.core=i,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,r){var n=r(82)("wks"),i=r(30),o=r(3).Symbol,s="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=s&&o[e]||(s?o:i)("Symbol."+e))}).store=n},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){var n=r(58);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(27),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){e.exports=!r(7)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n=r(12),i=r(108),o=r(36),s=Object.defineProperty;t.f=r(6)?Object.defineProperty:function(e,t,r){if(n(e),t=o(t,!0),n(r),i)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(45),i=r(58);e.exports=function(e){return n(i(e))}},function(e,t){var r=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=r)},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t){return!!e&&n(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,r){var n=r(2);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._disposables=[],this._isDisposed=!1}return e.prototype.dispose=function(){this._isDisposed=!0,this._disposables.forEach(function(e){return e.dispose()}),this._disposables.length=0},e.prototype.register=function(e){this._disposables.push(e)},e.prototype.unregister=function(e){var t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)},e}();t.Disposable=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._listeners=[]}return Object.defineProperty(e.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(t){return e._listeners.push(t),{dispose:function(){for(var r=0;r<e._listeners.length;r++)if(e._listeners[r]===t)return void e._listeners.splice(r,1)}}}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){for(var t=[],r=0;r<this._listeners.length;r++)t.push(this._listeners[r]);for(r=0;r<t.length;r++)t[r].call(void 0,e)},e}();t.EventEmitter2=n},function(e,t,r){var n=r(0),i=r(10),o=r(7);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],s={};s[e]=t(r),n(n.S+n.F*o(function(){r(1)}),"Object",s)}},function(e,t,r){var n=r(8),i=r(35);e.exports=r(6)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_COLOR=256,t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(143),s=r(23),a=r(142),l=r(17),c=r(14),h=r(13);t.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,t.DEFAULT_ATTR_DATA=new s.AttributeData,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.MAX_BUFFER_SIZE=4294967295,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32;var u=function(){function e(e,r){this._terminal=e,this._hasScrollback=r,this.savedCurAttrData=t.DEFAULT_ATTR_DATA.clone(),this.markers=[],this._nullCell=s.CellData.fromCharData([0,t.NULL_CELL_CHAR,t.NULL_CELL_WIDTH,t.NULL_CELL_CODE]),this._whitespaceCell=s.CellData.fromCharData([0,t.WHITESPACE_CELL_CHAR,t.WHITESPACE_CELL_WIDTH,t.WHITESPACE_CELL_CODE]),this._cols=this._terminal.cols,this._rows=this._terminal.rows,this.clear()}return e.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg):(this._nullCell.fg=0,this._nullCell.bg=0),this._nullCell},e.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0),this._whitespaceCell},e.prototype.getBlankLine=function(e,t){return new s.BufferLine(this._terminal.cols,this.getNullCell(e),t)},Object.defineProperty(e.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows},enumerable:!0,configurable:!0}),e.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;var r=e+this._terminal.options.scrollback;return r>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:r},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=t.DEFAULT_ATTR_DATA);for(var r=this._rows;r--;)this.lines.push(this.getBlankLine(e))}},e.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new o.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,r){var n=this.getNullCell(t.DEFAULT_ATTR_DATA),i=this._getCorrectBufferLength(r);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(var o=0;o<this.lines.length;o++)this.lines.get(o).resize(e,n);var a=0;if(this._rows<r)for(var l=this._rows;l<r;l++)this.lines.length<r+this.ybase&&(this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new s.BufferLine(e,n)));else for(l=this._rows;l>r;l--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){var c=this.lines.length-i;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,r-1),a&&(this.y+=a),this.savedY=Math.min(this.savedY,r-1),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(e,r),this._cols>e))for(o=0;o<this.lines.length;o++)this.lines.get(o).resize(e,n);this._cols=e,this._rows=r},Object.defineProperty(e.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._terminal.options.windowsMode},enumerable:!0,configurable:!0}),e.prototype._reflow=function(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,r){var n=a.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(t.DEFAULT_ATTR_DATA));if(n.length>0){var i=a.reflowLargerCreateNewLayout(this.lines,n);a.reflowLargerApplyNewLayout(this.lines,i.layout),this._reflowLargerAdjustViewport(e,r,i.countRemoved)}},e.prototype._reflowLargerAdjustViewport=function(e,r,n){for(var i=this.getNullCell(t.DEFAULT_ATTR_DATA),o=n;o-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new s.BufferLine(e,i))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--)},e.prototype._reflowSmaller=function(e,r){for(var n=this.getNullCell(t.DEFAULT_ATTR_DATA),i=[],o=0,s=this.lines.length-1;s>=0;s--){var l=this.lines.get(s);if(l.isWrapped||!(l.getTrimmedLength()<=e)){for(var c=[l];l.isWrapped&&s>0;)l=this.lines.get(--s),c.unshift(l);var h=this.ybase+this.y;if(!(h>=s&&h<s+c.length)){var u=c[c.length-1].getTrimmedLength(),f=a.reflowSmallerGetNewLineLengths(c,this._cols,e),_=f.length-c.length,d=void 0;d=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+_):Math.max(0,this.lines.length-this.lines.maxLength+_);for(var p=[],y=0;y<_;y++){var m=this.getBlankLine(t.DEFAULT_ATTR_DATA,!0);p.push(m)}p.length>0&&(i.push({start:s+c.length+o,newLines:p}),o+=p.length),c.push.apply(c,p);var g=f.length-1,v=f[g];0===v&&(v=f[--g]);for(var b=c.length-_-1,C=u;b>=0;){var w=Math.min(C,v);if(c[g].copyCellsFrom(c[b],C-w,v-w,w,!0),0===(v-=w)&&(v=f[--g]),0===(C-=w)){b--;var S=Math.max(b,0);C=a.getWrappedLineTrimmedLength(c,S,this._cols)}}for(y=0;y<c.length;y++)f[y]<e&&c[y].setCell(f[y],n);for(var E=_-d;E-- >0;)0===this.ybase?this.y<r-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+o)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++)}}}if(i.length>0){var x=[],A=[];for(y=0;y<this.lines.length;y++)A.push(this.lines.get(y));var k=this.lines.length,L=k-1,T=0,O=i[T];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);var R=0;for(y=Math.min(this.lines.maxLength-1,k+o-1);y>=0;y--)if(O&&O.start>L+R){for(var M=O.newLines.length-1;M>=0;M--)this.lines.set(y--,O.newLines[M]);y++,x.push({index:L+1,amount:O.newLines.length}),R+=O.newLines.length,O=i[++T]}else this.lines.set(y,A[L--]);var D=0;for(y=x.length-1;y>=0;y--)x[y].index+=D,this.lines.onInsertEmitter.fire(x[y]),D+=x[y].amount;var P=Math.max(0,k+o-this.lines.maxLength);P>0&&this.lines.onTrimEmitter.fire(P)}},e.prototype.stringIndexToBufferIndex=function(e,r,n){for(void 0===n&&(n=!1);r;){var i=this.lines.get(e);if(!i)return[-1,-1];for(var o=n?i.getTrimmedLength():i.length,s=0;s<o;++s)if(i.get(s)[t.CHAR_DATA_WIDTH_INDEX]&&(r-=i.get(s)[t.CHAR_DATA_CHAR_INDEX].length||1),r<0)return[e,s];e++}return[e,0]},e.prototype.translateBufferLineToString=function(e,t,r,n){void 0===r&&(r=0);var i=this.lines.get(e);return i?i.translateToString(t,r,n):""},e.prototype.getWrappedRangeForLine=function(e){for(var t=e,r=e;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}},e.prototype.setupTabStops=function(e){for(null!==e&&void 0!==e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._terminal.options.tabStopWidth)this.tabs[e]=!0},e.prototype.prevStop=function(e){for(null!==e&&void 0!==e||(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null!==e&&void 0!==e||(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,r=new f(e);return this.markers.push(r),r.register(this.lines.onTrim(function(e){r.line-=e,r.line<0&&r.dispose()})),r.register(this.lines.onInsert(function(e){r.line>=e.index&&(r.line+=e.amount)})),r.register(this.lines.onDelete(function(e){r.line>=e.index&&r.line<e.index+e.amount&&r.dispose(),r.line>e.index&&(r.line-=e.amount)})),r.register(r.onDispose(function(){return t._removeMarker(r)})),r},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,r,n,i){return new _(this,e,t,r,n,i)},e}();t.Buffer=u;var f=function(e){function t(r){var n=e.call(this)||this;return n.line=r,n._id=t._nextId++,n.isDisposed=!1,n._onDispose=new c.EventEmitter2,n}return i(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._onDispose.fire())},t._nextId=1,t}(h.Disposable);t.Marker=f;var _=function(){function e(e,t,r,n,i,o){void 0===r&&(r=0),void 0===n&&(n=e.lines.length),void 0===i&&(i=0),void 0===o&&(o=0),this._buffer=e,this._trimRight=t,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 e.prototype.hasNext=function(){return this._current<this._endIndex},e.prototype.next=function(){var e=this._buffer.getWrappedRangeForLine(this._current);e.first<this._startIndex-this._startOverscan&&(e.first=this._startIndex-this._startOverscan),e.last>this._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",r=e.first;r<=e.last;++r)t+=this._buffer.translateBufferLineToString(r,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();t.BufferStringIterator=_},function(e,t,r){"use strict";if(r(6)){var n=r(31),i=r(3),o=r(7),s=r(0),a=r(50),l=r(68),c=r(21),h=r(71),u=r(35),f=r(16),_=r(69),d=r(27),p=r(5),y=r(93),m=r(32),g=r(36),v=r(22),b=r(42),C=r(2),w=r(4),S=r(79),E=r(46),x=r(43),A=r(40).f,k=r(77),L=r(30),T=r(1),O=r(26),R=r(57),M=r(51),D=r(73),P=r(33),H=r(76),I=r(55),B=r(74),F=r(103),j=r(8),N=r(24),W=j.f,U=N.f,Z=i.RangeError,z=i.TypeError,K=i.Uint8Array,V=Array.prototype,G=l.ArrayBuffer,q=l.DataView,Y=O(0),X=O(2),J=O(3),Q=O(4),$=O(5),ee=O(6),te=R(!0),re=R(!1),ne=D.values,ie=D.keys,oe=D.entries,se=V.lastIndexOf,ae=V.reduce,le=V.reduceRight,ce=V.join,he=V.sort,ue=V.slice,fe=V.toString,_e=V.toLocaleString,de=T("iterator"),pe=T("toStringTag"),ye=L("typed_constructor"),me=L("def_constructor"),ge=a.CONSTR,ve=a.TYPED,be=a.VIEW,Ce=O(1,function(e,t){return Ae(M(e,e[me]),t)}),we=o(function(){return 1===new K(new Uint16Array([1]).buffer)[0]}),Se=!!K&&!!K.prototype.set&&o(function(){new K(1).set({})}),Ee=function(e,t){var r=d(e);if(r<0||r%t)throw Z("Wrong offset!");return r},xe=function(e){if(C(e)&&ve in e)return e;throw z(e+" is not a typed array!")},Ae=function(e,t){if(!(C(e)&&ye in e))throw z("It is not a typed array constructor!");return new e(t)},ke=function(e,t){return Le(M(e,e[me]),t)},Le=function(e,t){for(var r=0,n=t.length,i=Ae(e,n);n>r;)i[r]=t[r++];return i},Te=function(e,t,r){W(e,t,{get:function(){return this._d[r]}})},Oe=function(e){var t,r,n,i,o,s,a=w(e),l=arguments.length,h=l>1?arguments[1]:void 0,u=void 0!==h,f=k(a);if(void 0!=f&&!S(f)){for(s=f.call(a),n=[],t=0;!(o=s.next()).done;t++)n.push(o.value);a=n}for(u&&l>2&&(h=c(h,arguments[2],2)),t=0,r=p(a.length),i=Ae(this,r);r>t;t++)i[t]=u?h(a[t],t):a[t];return i},Re=function(){for(var e=0,t=arguments.length,r=Ae(this,t);t>e;)r[e]=arguments[e++];return r},Me=!!K&&o(function(){_e.call(new K(1))}),De=function(){return _e.apply(Me?ue.call(xe(this)):xe(this),arguments)},Pe={copyWithin:function(e,t){return F.call(xe(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Q(xe(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return B.apply(xe(this),arguments)},filter:function(e){return ke(this,X(xe(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return $(xe(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(xe(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){Y(xe(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return re(xe(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(xe(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ce.apply(xe(this),arguments)},lastIndexOf:function(e){return se.apply(xe(this),arguments)},map:function(e){return Ce(xe(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ae.apply(xe(this),arguments)},reduceRight:function(e){return le.apply(xe(this),arguments)},reverse:function(){for(var e,t=xe(this).length,r=Math.floor(t/2),n=0;n<r;)e=this[n],this[n++]=this[--t],this[t]=e;return this},some:function(e){return J(xe(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return he.call(xe(this),e)},subarray:function(e,t){var r=xe(this),n=r.length,i=m(e,n);return new(M(r,r[me]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,p((void 0===t?n:m(t,n))-i))}},He=function(e,t){return ke(this,ue.call(xe(this),e,t))},Ie=function(e){xe(this);var t=Ee(arguments[1],1),r=this.length,n=w(e),i=p(n.length),o=0;if(i+t>r)throw Z("Wrong length!");for(;o<i;)this[t+o]=n[o++]},Be={entries:function(){return oe.call(xe(this))},keys:function(){return ie.call(xe(this))},values:function(){return ne.call(xe(this))}},Fe=function(e,t){return C(e)&&e[ve]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},je=function(e,t){return Fe(e,t=g(t,!0))?u(2,e[t]):U(e,t)},Ne=function(e,t,r){return!(Fe(e,t=g(t,!0))&&C(r)&&v(r,"value"))||v(r,"get")||v(r,"set")||r.configurable||v(r,"writable")&&!r.writable||v(r,"enumerable")&&!r.enumerable?W(e,t,r):(e[t]=r.value,e)};ge||(N.f=je,j.f=Ne),s(s.S+s.F*!ge,"Object",{getOwnPropertyDescriptor:je,defineProperty:Ne}),o(function(){fe.call({})})&&(fe=_e=function(){return ce.call(this)});var We=_({},Pe);_(We,Be),f(We,de,Be.values),_(We,{slice:He,set:Ie,constructor:function(){},toString:fe,toLocaleString:De}),Te(We,"buffer","b"),Te(We,"byteOffset","o"),Te(We,"byteLength","l"),Te(We,"length","e"),W(We,pe,{get:function(){return this[ve]}}),e.exports=function(e,t,r,l){var c=e+((l=!!l)?"Clamped":"")+"Array",u="get"+e,_="set"+e,d=i[c],m=d||{},g=d&&x(d),v=!d||!a.ABV,w={},S=d&&d.prototype,k=function(e,r){W(e,r,{get:function(){return function(e,r){var n=e._d;return n.v[u](r*t+n.o,we)}(this,r)},set:function(e){return function(e,r,n){var i=e._d;l&&(n=(n=Math.round(n))<0?0:n>255?255:255&n),i.v[_](r*t+i.o,n,we)}(this,r,e)},enumerable:!0})};v?(d=r(function(e,r,n,i){h(e,d,c,"_d");var o,s,a,l,u=0,_=0;if(C(r)){if(!(r instanceof G||"ArrayBuffer"==(l=b(r))||"SharedArrayBuffer"==l))return ve in r?Le(d,r):Oe.call(d,r);o=r,_=Ee(n,t);var m=r.byteLength;if(void 0===i){if(m%t)throw Z("Wrong length!");if((s=m-_)<0)throw Z("Wrong length!")}else if((s=p(i)*t)+_>m)throw Z("Wrong length!");a=s/t}else a=y(r),o=new G(s=a*t);for(f(e,"_d",{b:o,o:_,l:s,e:a,v:new q(o)});u<a;)k(e,u++)}),S=d.prototype=E(We),f(S,"constructor",d)):o(function(){d(1)})&&o(function(){new d(-1)})&&H(function(e){new d,new d(null),new d(1.5),new d(e)},!0)||(d=r(function(e,r,n,i){var o;return h(e,d,c),C(r)?r instanceof G||"ArrayBuffer"==(o=b(r))||"SharedArrayBuffer"==o?void 0!==i?new m(r,Ee(n,t),i):void 0!==n?new m(r,Ee(n,t)):new m(r):ve in r?Le(d,r):Oe.call(d,r):new m(y(r))}),Y(g!==Function.prototype?A(m).concat(A(g)):A(m),function(e){e in d||f(d,e,m[e])}),d.prototype=S,n||(S.constructor=d));var L=S[de],T=!!L&&("values"==L.name||void 0==L.name),O=Be.values;f(d,ye,!0),f(S,ve,c),f(S,be,!0),f(S,me,d),(l?new d(1)[pe]==c:pe in S)||W(S,pe,{get:function(){return c}}),w[c]=d,s(s.G+s.W+s.F*(d!=m),w),s(s.S,c,{BYTES_PER_ELEMENT:t}),s(s.S+s.F*o(function(){m.of.call(d,1)}),c,{from:Oe,of:Re}),"BYTES_PER_ELEMENT"in S||f(S,"BYTES_PER_ELEMENT",t),s(s.P,c,Pe),I(c),s(s.P+s.F*Se,c,{set:Ie}),s(s.P+s.F*!T,c,Be),n||S.toString==fe||(S.toString=fe),s(s.P+s.F*o(function(){new d(1).slice()}),c,{slice:He}),s(s.P+s.F*(o(function(){return[1,2].toLocaleString()!=new d([1,2]).toLocaleString()})||!o(function(){S.toLocaleString.call([1,2])})),c,{toLocaleString:De}),P[c]=T?L:O,n||T||f(S,de,O)}}else e.exports=function(){}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){var n=r(20);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(18),s=r(65),a=3,l=function(){function e(){this.fg=0,this.bg=0}return e.toColorRGB=function(e){return[e>>>16&255,e>>>8&255,255&e]},e.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},e.prototype.clone=function(){var t=new e;return t.fg=this.fg,t.bg=this.bg,t},e.prototype.isInverse=function(){return 67108864&this.fg},e.prototype.isBold=function(){return 134217728&this.fg},e.prototype.isUnderline=function(){return 268435456&this.fg},e.prototype.isBlink=function(){return 536870912&this.fg},e.prototype.isInvisible=function(){return 1073741824&this.fg},e.prototype.isItalic=function(){return 67108864&this.bg},e.prototype.isDim=function(){return 134217728&this.bg},e.prototype.getFgColorMode=function(){return 50331648&this.fg},e.prototype.getBgColorMode=function(){return 50331648&this.bg},e.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},e.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},e.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},e.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},e.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},e.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},e.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},e.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},e}();t.AttributeData=l;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.combinedData="",t}return i(t,e),t.fromCharData=function(e){var r=new t;return r.setFromCharData(e),r},t.prototype.isCombined=function(){return 2097152&this.content},t.prototype.getWidth=function(){return this.content>>22},t.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?s.stringFromCodePoint(2097151&this.content):""},t.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},t.prototype.setFromCharData=function(e){this.fg=e[o.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(e[o.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[o.CHAR_DATA_CHAR_INDEX].length){var r=e[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){var n=e[o.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=n&&n<=57343?this.content=1024*(r-55296)+n-56320+65536|e[o.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[o.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[o.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[o.CHAR_DATA_WIDTH_INDEX]<<22)},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(l);t.CellData=c;var h=function(){function e(e,t,r){if(void 0===r&&(r=!1),this.isWrapped=r,this._data=null,this._combined={},e){this._data=new Uint32Array(e*a);for(var n=t||c.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),i=0;i<e;++i)this.setCell(i,n)}this.length=e}return e.prototype.get=function(e){var t=this._data[e*a+0],r=2097151&t;return[this._data[e*a+1],2097152&t?this._combined[e]:r?s.stringFromCodePoint(r):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):r]},e.prototype.set=function(e,t){this._data[e*a+1]=t[o.CHAR_DATA_ATTR_INDEX],t[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[e*a+0]=2097152|e|t[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[e*a+0]=t[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[o.CHAR_DATA_WIDTH_INDEX]<<22},e.prototype.getWidth=function(e){return this._data[e*a+0]>>22},e.prototype.hasWidth=function(e){return 12582912&this._data[e*a+0]},e.prototype.getFg=function(e){return this._data[e*a+1]},e.prototype.getBg=function(e){return this._data[e*a+2]},e.prototype.hasContent=function(e){return 4194303&this._data[e*a+0]},e.prototype.getCodePoint=function(e){var t=this._data[e*a+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},e.prototype.isCombined=function(e){return 2097152&this._data[e*a+0]},e.prototype.getString=function(e){var t=this._data[e*a+0];return 2097152&t?this._combined[e]:2097151&t?s.stringFromCodePoint(2097151&t):""},e.prototype.loadCell=function(e,t){var r=e*a;return t.content=this._data[r+0],t.fg=this._data[r+1],t.bg=this._data[r+2],2097152&t.content&&(t.combinedData=this._combined[e]),t},e.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),this._data[e*a+0]=t.content,this._data[e*a+1]=t.fg,this._data[e*a+2]=t.bg},e.prototype.setCellFromCodePoint=function(e,t,r,n,i){this._data[e*a+0]=t|r<<22,this._data[e*a+1]=n,this._data[e*a+2]=i},e.prototype.addCodepointToCell=function(e,t){var r=this._data[e*a+0];2097152&r?this._combined[e]+=s.stringFromCodePoint(t):(2097151&r?(this._combined[e]=s.stringFromCodePoint(2097151&r)+s.stringFromCodePoint(t),r&=-2097152,r|=2097152):r=t|1<<22,this._data[e*a+0]=r)},e.prototype.insertCells=function(e,t,r){if(e%=this.length,t<this.length-e){for(var n=new c,i=this.length-e-t-1;i>=0;--i)this.setCell(e+t+i,this.loadCell(e+i,n));for(i=0;i<t;++i)this.setCell(e+i,r)}else for(i=e;i<this.length;++i)this.setCell(i,r)},e.prototype.deleteCells=function(e,t,r){if(e%=this.length,t<this.length-e){for(var n=new c,i=0;i<this.length-e-t;++i)this.setCell(e+i,this.loadCell(e+t+i,n));for(i=this.length-t;i<this.length;++i)this.setCell(i,r)}else for(i=e;i<this.length;++i)this.setCell(i,r)},e.prototype.replaceCells=function(e,t,r){for(;e<t&&e<this.length;)this.setCell(e++,r)},e.prototype.resize=function(e,t){if(e!==this.length){if(e>this.length){var r=new Uint32Array(e*a);this.length&&(e*a<this._data.length?r.set(this._data.subarray(0,e*a)):r.set(this._data)),this._data=r;for(var n=this.length;n<e;++n)this.setCell(n,t)}else if(e){(r=new Uint32Array(e*a)).set(this._data.subarray(0,e*a)),this._data=r;var i=Object.keys(this._combined);for(n=0;n<i.length;n++){var o=parseInt(i[n],10);o>=e&&delete this._combined[o]}}else this._data=null,this._combined={};this.length=e}},e.prototype.fill=function(e){this._combined={};for(var t=0;t<this.length;++t)this.setCell(t,e)},e.prototype.copyFrom=function(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];this.isWrapped=e.isWrapped},e.prototype.clone=function(){var t=new e(0);for(var r in t._data=new Uint32Array(this._data),t.length=this.length,this._combined)t._combined[r]=this._combined[r];return t.isWrapped=this.isWrapped,t},e.prototype.getTrimmedLength=function(){for(var e=this.length-1;e>=0;--e)if(4194303&this._data[e*a+0])return e+(this._data[e*a+0]>>22);return 0},e.prototype.copyCellsFrom=function(e,t,r,n,i){var o=e._data;if(i)for(var s=n-1;s>=0;s--)for(var l=0;l<a;l++)this._data[(r+s)*a+l]=o[(t+s)*a+l];else for(s=0;s<n;s++)for(l=0;l<a;l++)this._data[(r+s)*a+l]=o[(t+s)*a+l];var c=Object.keys(e._combined);for(l=0;l<c.length;l++){var h=parseInt(c[l],10);h>=t&&(this._combined[h-t+r]=e._combined[h])}},e.prototype.translateToString=function(e,t,r){void 0===e&&(e=!1),void 0===t&&(t=0),void 0===r&&(r=this.length),e&&(r=Math.min(r,this.getTrimmedLength()));for(var n="";t<r;){var i=this._data[t*a+0],l=2097151&i;n+=2097152&i?this._combined[t]:l?s.stringFromCodePoint(l):o.WHITESPACE_CELL_CHAR,t+=i>>22||1}return n},e}();t.BufferLine=h},function(e,t,r){var n=r(41),i=r(35),o=r(9),s=r(36),a=r(22),l=r(108),c=Object.getOwnPropertyDescriptor;t.f=r(6)?c:function(e,t){if(e=o(e),t=s(t,!0),l)try{return c(e,t)}catch(e){}if(a(e,t))return i(!n.f.call(e,t),e[t])}},function(e,t,r){var n=r(1)("unscopables"),i=Array.prototype;void 0==i[n]&&r(16)(i,n,{}),e.exports=function(e){i[n][e]=!0}},function(e,t,r){var n=r(21),i=r(45),o=r(4),s=r(5),a=r(75);e.exports=function(e,t){var r=1==e,l=2==e,c=3==e,h=4==e,u=6==e,f=5==e||u,_=t||a;return function(t,a,d){for(var p,y,m=o(t),g=i(m),v=n(a,d,3),b=s(g.length),C=0,w=r?_(t,b):l?_(t,0):void 0;b>C;C++)if((f||C in g)&&(y=v(p=g[C],C,m),e))if(r)w[C]=y;else if(y)switch(e){case 3:return!0;case 5:return p;case 6:return C;case 2:w.push(p)}else if(h)return!1;return u?-1:c||h?h:w}}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n=r(106),i=r(81);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t){e.exports=!1},function(e,t,r){var n=r(27),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):o(e,t)}},function(e,t){e.exports={}},function(e,t,r){var n=r(3),i=r(16),o=r(22),s=r(30)("src"),a=Function.toString,l=(""+a).split("toString");r(10).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,r,a){var c="function"==typeof r;c&&(o(r,"name")||i(r,"name",t)),e[t]!==r&&(c&&(o(r,s)||i(r,s,e[t]?""+e[t]:l.join(String(t)))),e===n?e[t]=r:a?e[t]?e[t]=r:i(e,t,r):(delete e[t],i(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n=r(2);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="undefined"==typeof navigator,i=n?"node":navigator.userAgent,o=n?"node":navigator.platform;function s(e,t){return e.indexOf(t)>=0}t.isFirefox=!!~i.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.isMSIE=!!~i.indexOf("MSIE")||!!~i.indexOf("Trident"),t.isMac=s(["Macintosh","MacIntel","MacPPC","Mac68K"],o),t.isIpad="iPad"===o,t.isIphone="iPhone"===o,t.isMSWindows=s(["Windows","Win16","Win32","WinCE"],o),t.isLinux=o.indexOf("Linux")>=0},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i={aborted:"Session aborted",peer_aborted:"Peer aborted session",already_aborted:"Session already aborted",crc:function(e,t){return this.got=e.slice(0),this.expected=t.slice(0),"CRC check failed! (got: "+e.join()+"; expected: "+t.join()+")"},validation:function(e){return e}};e.exports.Error=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=function(e){var t=i[e];switch(void 0===t?"undefined":n(t)){case"string":return t;case"function":var r=[].slice.call(arguments).slice(1);return t.apply(this,r)}return null}.apply(r,arguments);return o?(r.type=e,r.message=o):r.message=e,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Error),t}()},function(e,t,r){"use strict";e.exports.ZMLIB={ZDLE:24,XON:17,XOFF:19,ABORT_SEQUENCE:[24,24,24,24,24],strip_ignored_bytes:function(e){for(var t=e.length-1;t>=0;t--)switch(e[t]){case 17:case 145:case 19:case 147:e.splice(t,1);continue}return e},find_subarray:function(e,t){var r,n=0;Date.now();e:for(;-1!==n&&-1!==(n=e.indexOf(t[0],n));){for(r=1;r<t.length;r++)if(e[n+r]!==t[r]){n++;continue e}return n}return-1}}},function(e,t,r){var n=r(106),i=r(81).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){var n=r(28),i=r(1)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,r,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:o?n(t):"Object"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,r){var n=r(22),i=r(4),o=r(83)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,r){var n=r(8).f,i=r(22),o=r(1)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,r){var n=r(28);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){var n=r(12),i=r(107),o=r(81),s=r(83)("IE_PROTO"),a=function(){},l=function(){var e,t=r(84)("iframe"),n=o.length;for(t.style.display="none",r(80).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;n--;)delete l.prototype[o[n]];return l()};e.exports=Object.create||function(e,t){var r;return null!==e?(a.prototype=n(e),r=new a,a.prototype=null,r[s]=e):r=l(),void 0===t?r:i(r,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(17),i=r(89),o=r(23),s=r(18),a=r(61),l=function(){function e(e,t,r,n,i){this._container=e,this._alpha=n,this._colors=i,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+t+"-layer"),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return e.prototype.dispose=function(){this._container.removeChild(this._canvas),this._charAtlas&&this._charAtlas.dispose()},e.prototype._initCanvas=function(){this._ctx=this._canvas.getContext("2d",{alpha:this._alpha}),this._alpha||this.clearAll()},e.prototype.onOptionsChanged=function(e){},e.prototype.onBlur=function(e){},e.prototype.onFocus=function(e){},e.prototype.onCursorMove=function(e){},e.prototype.onGridChanged=function(e,t,r){},e.prototype.onSelectionChanged=function(e,t,r,n){void 0===n&&(n=!1)},e.prototype.onThemeChanged=function(e,t){this._refreshCharAtlas(e,t)},e.prototype.setTransparency=function(e,t){if(t!==this._alpha){var r=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._colors),this.onGridChanged(e,0,e.rows-1)}},e.prototype._refreshCharAtlas=function(e,t){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=i.acquireCharAtlas(e,t,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},e.prototype.resize=function(e,t){this._scaledCellWidth=t.scaledCellWidth,this._scaledCellHeight=t.scaledCellHeight,this._scaledCharWidth=t.scaledCharWidth,this._scaledCharHeight=t.scaledCharHeight,this._scaledCharLeft=t.scaledCharLeft,this._scaledCharTop=t.scaledCharTop,this._canvas.width=t.scaledCanvasWidth,this._canvas.height=t.scaledCanvasHeight,this._canvas.style.width=t.canvasWidth+"px",this._canvas.style.height=t.canvasHeight+"px",this._alpha||this.clearAll(),this._refreshCharAtlas(e,this._colors)},e.prototype.fillCells=function(e,t,r,n){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight)},e.prototype.fillBottomLineAtCells=function(e,t,r){void 0===r&&(r=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,r*this._scaledCellWidth,window.devicePixelRatio)},e.prototype.fillLeftLineAtCell=function(e,t){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)},e.prototype.strokeRectAtCell=function(e,t,r,n){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,r*this._scaledCellWidth-window.devicePixelRatio,n*this._scaledCellHeight-window.devicePixelRatio)},e.prototype.clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},e.prototype.clearCells=function(e,t,r,n){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight))},e.prototype.fillCharTrueColor=function(e,t,r,n){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline="middle",this._clipRow(e,n),this._ctx.fillText(t.getChars(),r*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},e.prototype.drawChars=function(e,t,r,i){var o,l;t.isFgRGB()||t.isBgRGB()||t instanceof a.JoinedCellData?this._drawUncachedChars(e,t,r,i):(t.isInverse()?(o=t.isBgDefault()?n.INVERTED_DEFAULT_COLOR:t.getBgColor(),l=t.isFgDefault()?n.INVERTED_DEFAULT_COLOR:t.getFgColor()):(l=t.isBgDefault()?n.DEFAULT_COLOR:t.getBgColor(),o=t.isFgDefault()?n.DEFAULT_COLOR:t.getFgColor()),o+=e.options.drawBoldTextInBrightColors&&t.isBold()&&o<8&&o!==n.INVERTED_DEFAULT_COLOR?8:0,this._currentGlyphIdentifier.chars=t.getChars()||s.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=t.getCode()||s.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=l,this._currentGlyphIdentifier.fg=o,this._currentGlyphIdentifier.bold=t.isBold()&&e.options.enableBold,this._currentGlyphIdentifier.dim=!!t.isDim(),this._currentGlyphIdentifier.italic=!!t.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,r*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,r,i))},e.prototype._drawUncachedChars=function(e,t,r,i){if(this._ctx.save(),this._ctx.font=this._getFont(e,t.isBold()&&e.options.enableBold,!!t.isItalic()),this._ctx.textBaseline="middle",t.isInverse())t.isBgDefault()?this._ctx.fillStyle=this._colors.background.css:t.isBgRGB()?this._ctx.fillStyle="rgb("+o.AttributeData.toColorRGB(t.getBgColor()).join(",")+")":this._ctx.fillStyle=this._colors.ansi[t.getBgColor()].css;else if(t.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(t.isFgRGB())this._ctx.fillStyle="rgb("+o.AttributeData.toColorRGB(t.getFgColor()).join(",")+")";else{var s=t.getFgColor();e.options.drawBoldTextInBrightColors&&t.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}this._clipRow(e,i),t.isDim()&&(this._ctx.globalAlpha=n.DIM_OPACITY),this._ctx.fillText(t.getChars(),r*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},e.prototype._clipRow=function(e,t){this._ctx.beginPath(),this._ctx.rect(0,t*this._scaledCellHeight,e.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},e.prototype._getFont=function(e,t,r){var n=t?e.options.fontWeightBold:e.options.fontWeight;return(r?"italic":"")+" "+n+" "+e.options.fontSize*window.devicePixelRatio+"px "+e.options.fontFamily},e}();t.BaseRenderLayer=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.NUL="\0",e.SOH="\ 1",e.STX="\ 2",e.ETX="\ 3",e.EOT="\ 4",e.ENQ="\ 5",e.ACK="\ 6",e.BEL="\a",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="\ e",e.SI="\ f",e.DLE="\10",e.DC1="\11",e.DC2="\12",e.DC3="\13",e.DC4="\14",e.NAK="\15",e.SYN="\16",e.ETB="\17",e.CAN="\18",e.EM="\19",e.SUB="\1a",e.ESC="\e",e.FS="\1c",e.GS="\1d",e.RS="\1e",e.US="\1f",e.SP=" ",e.DEL="\7f"}(t.C0||(t.C0={})),function(e){e.PAD="\80",e.HOP="\81",e.BPH="\82",e.NBH="\83",e.IND="\84",e.NEL="\85",e.SSA="\86",e.ESA="\87",e.HTS="\88",e.HTJ="\89",e.VTS="\8a",e.PLD="\8b",e.PLU="\8c",e.RI="\8d",e.SS2="\8e",e.SS3="\8f",e.DCS="\90",e.PU1="\91",e.PU2="\92",e.STS="\93",e.CCH="\94",e.MW="\95",e.SPA="\96",e.EPA="\97",e.SOS="\98",e.SGCI="\99",e.SCI="\9a",e.CSI="\9b",e.ST="\9c",e.OSC="\9d",e.PM="\9e",e.APC="\9f"}(t.C1||(t.C1={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=function(e,t,r,n){return e.addEventListener(t,r,n),{dispose:function(){r&&e.removeEventListener(t,r,n)}}}},function(e,t,r){for(var n,i=r(3),o=r(16),s=r(30),a=s("typed_array"),l=s("view"),c=!(!i.ArrayBuffer||!i.DataView),h=c,u=0,f="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");u<9;)(n=i[f[u++]])?(o(n.prototype,a,!0),o(n.prototype,l,!0)):h=!1;e.exports={ABV:c,CONSTR:h,TYPED:a,VIEW:l}},function(e,t,r){var n=r(12),i=r(20),o=r(1)("species");e.exports=function(e,t){var r,s=n(e).constructor;return void 0===s||void 0==(r=n(s)[o])?t:i(r)}},function(e,t,r){"use strict";e.exports=r(31)||!r(7)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete r(3)[e]})},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(30)("meta"),i=r(2),o=r(22),s=r(8).f,a=0,l=Object.isExtensible||function(){return!0},c=!r(7)(function(){return l(Object.preventExtensions({}))}),h=function(e){s(e,n,{value:{i:"O"+ ++a,w:{}}})},u=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,n)){if(!l(e))return"F";if(!t)return"E";h(e)}return e[n].i},getWeak:function(e,t){if(!o(e,n)){if(!l(e))return!0;if(!t)return!1;h(e)}return e[n].w},onFreeze:function(e){return c&&u.NEED&&l(e)&&!o(e,n)&&h(e),e}}},function(e,t,r){"use strict";var n=r(3),i=r(8),o=r(6),s=r(1)("species");e.exports=function(e){var t=n[e];o&&t&&!t[s]&&i.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,r){var n=r(28);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){var n=r(9),i=r(5),o=r(32);e.exports=function(e){return function(t,r,s){var a,l=n(t),c=i(l.length),h=o(s,c);if(e&&r!=r){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((e||h in l)&&l[h]===r)return e||h||0;return!e&&-1}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on  "+e);return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blankLine="Blank line",t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._renderCallback=e}return e.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.refresh=function(e,t,r){var n=this;this._rowCount=r,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return n._innerRefresh()}))},e.prototype._innerRefresh=function(){void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(this._rowStart=Math.max(this._rowStart,0),this._rowEnd=Math.min(this._rowEnd,this._rowCount-1),this._renderCallback(this._rowStart,this._rowEnd),this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0)},e}();t.RenderDebouncer=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(23),s=r(18),a=function(e){function t(t,r,n){var i=e.call(this)||this;return i.content=0,i.combinedData="",i.fg=t.fg,i.bg=t.bg,i.combinedData=r,i._width=n,i}return i(t,e),t.prototype.isCombined=function(){return 2097152},t.prototype.getWidth=function(){return this._width},t.prototype.getChars=function(){return this.combinedData},t.prototype.getCode=function(){return 2097151},t.prototype.setFromCharData=function(e){throw new Error("not implemented")},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(o.AttributeData);t.JoinedCellData=a;var l=function(){function e(e){this._terminal=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new o.CellData}return e.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},e.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1},e.prototype.getJoinedCharacters=function(e){if(0===this._characterJoiners.length)return[];var t=this._terminal.buffer.lines.get(e);if(0===t.length)return[];for(var r=[],n=t.translateToString(!0),i=0,o=0,a=0,l=t.getFg(0),c=t.getBg(0),h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==l||this._workCell.bg!==c){if(h-i>1)for(var u=this._getJoinedRanges(n,a,o,t,i),f=0;f<u.length;f++)r.push(u[f]);i=h,a=o,l=this._workCell.fg,c=this._workCell.bg}o+=this._workCell.getChars().length||s.WHITESPACE_CELL_CHAR.length}if(this._terminal.cols-i>1)for(u=this._getJoinedRanges(n,a,o,t,i),f=0;f<u.length;f++)r.push(u[f]);return r},e.prototype._getJoinedRanges=function(t,r,n,i,o){for(var s=t.substring(r,n),a=this._characterJoiners[0].handler(s),l=1;l<this._characterJoiners.length;l++)for(var c=this._characterJoiners[l].handler(s),h=0;h<c.length;h++)e._mergeRanges(a,c[h]);return this._stringRangesToCellRanges(a,i,o),a},e.prototype._stringRangesToCellRanges=function(e,t,r){var n=0,i=!1,o=0,a=e[n];if(a){for(var l=r;l<this._terminal.cols;l++){var c=t.getWidth(l),h=t.getString(l).length||s.WHITESPACE_CELL_CHAR.length;if(0!==c){if(!i&&a[0]<=o&&(a[0]=l,i=!0),a[1]<=o){if(a[1]=l,!(a=e[++n]))break;a[0]<=o?(a[0]=l,i=!0):i=!1}o+=h}}a&&(a[1]=this._terminal.cols)}},e._mergeRanges=function(e,t){for(var r=!1,n=0;n<e.length;n++){var i=e[n];if(r){if(t[1]<=i[0])return e[n-1][1]=t[1],e;if(t[1]<=i[1])return e[n-1][1]=Math.max(t[1],i[1]),e.splice(n,1),r=!1,e;e.splice(n,1),n--}else{if(t[1]<=i[0])return e.splice(n,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),r=!0)}}return r?e[e.length-1][1]=t[1]:e.push(t),e},e}();t.CharacterJoinerRegistry=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=l("#ffffff"),i=l("#000000"),o=l("#ffffff"),s=l("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967159};function l(e){return{css:e,rgba:parseInt(e.slice(1),16)<<8|255}}function c(e){var t=e.toString(16);return t.length<2?"0"+t:t}t.DEFAULT_ANSI_COLORS=function(){for(var e=[l("#2e3436"),l("#cc0000"),l("#4e9a06"),l("#c4a000"),l("#3465a4"),l("#75507b"),l("#06989a"),l("#d3d7cf"),l("#555753"),l("#ef2929"),l("#8ae234"),l("#fce94f"),l("#729fcf"),l("#ad7fa8"),l("#34e2e2"),l("#eeeeec")],t=[0,95,135,175,215,255],r=0;r<216;r++){var n=t[r/36%6|0],i=t[r/6%6|0],o=t[r%6];e.push({css:"#"+c(n)+c(i)+c(o),rgba:(n<<24|i<<16|o<<8|255)>>>0})}for(r=0;r<24;r++){var s=8+10*r,a=c(s);e.push({css:"#"+a+a+a,rgba:(s<<24|s<<16|s<<8|255)>>>0})}return e}();var h=function(){function e(e,r){this.allowTransparency=r;var l=e.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:t.DEFAULT_ANSI_COLORS.slice()}}return e.prototype.setTheme=function(e){this.colors.foreground=this._parseColor(e.foreground,n),this.colors.background=this._parseColor(e.background,i),this.colors.cursor=this._parseColor(e.cursor,o,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,s,!0),this.colors.selection=this._parseColor(e.selection,a,!0),this.colors.ansi[0]=this._parseColor(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15])},e.prototype._parseColor=function(e,t,r){if(void 0===r&&(r=this.allowTransparency),!e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var n=this._ctx.getImageData(0,0,1,1).data;return r||255===n[3]?{css:e,rgba:(n[0]<<24|n[1]<<16|n[2]<<8|n[3])>>>0}:(console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t)},e}();t.ColorManager=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(17);t.generateConfig=function(e,t,r,n){var i={foreground:n.foreground,background:n.background,cursor:null,cursorAccent:null,selection:null,ansi:n.ansi.slice(0,16)};return{type:r.options.experimentalCharAtlas,devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:r.options.fontFamily,fontSize:r.options.fontSize,fontWeight:r.options.fontWeight,fontWeightBold:r.options.fontWeightBold,allowTransparency:r.options.allowTransparency,colors:i}},t.configEquals=function(e,t){for(var r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==t.colors.ansi[r].rgba)return!1;return e.type===t.type&&e.devicePixelRatio===t.devicePixelRatio&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.scaledCharWidth===t.scaledCharWidth&&e.scaledCharHeight===t.scaledCharHeight&&e.colors.foreground===t.colors.foreground&&e.colors.background===t.colors.background},t.is256Color=function(e){return e<n.DEFAULT_COLOR}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var n=0,i=0;this._interim&&(56320<=(a=e.charCodeAt(i++))&&a<=57343?t[n++]=1024*(this._interim-55296)+a-56320+65536:(t[n++]=this._interim,t[n++]=a),this._interim=0);for(var o=i;o<r;++o){var s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,n;var a;56320<=(a=e.charCodeAt(o))&&a<=57343?t[n++]=1024*(s-55296)+a-56320+65536:(t[n++]=s,t[n++]=a)}else t[n++]=s}return n},e}();t.StringToUtf32=n,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=e.length);for(var n="",i=t;i<r;++i){var o=e[i];o>65535?(o-=65536,n+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):n+=String.fromCharCode(o)}return n}},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,o,s=e.exports;Object.assign(s,r(39));var a=s.ZMLIB.ZDLE;s.ZDLE=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config={},t&&this.set_escape_ctrl_chars(!!t.escape_ctrl_chars)}return n(e,[{key:"set_escape_ctrl_chars",value:function(e){if("boolean"!=typeof e)throw"need boolean!";e!==this._config.escape_ctrl_chars&&(this._config.escape_ctrl_chars=e,this._setup_zdle_table())}},{key:"escapes_ctrl_chars",value:function(){return!!this._config.escape_ctrl_chars}},{key:"encode",value:function(e){if(!this._zdle_table)throw"No ZDLE encode table configured!";var t=this._zdle_table,r=this._lastcode,n=new ArrayBuffer(2*e.length),s=new Uint8Array(n),l=this._config.escape_ctrl_chars,c=0;for(i=0;i<e.length;i++){if(!(o=t[e[i]]))throw console.trace(),console.error("bad encode() call:",JSON.stringify(e)),this._lastcode=r,"Invalid octet: "+e[i];r=e[i],1===o||(l||2===o||64==(127&r))&&(s[c]=a,c++,r^=64),s[c]=r,c++}return this._lastcode=r,e.splice(0),e.push.apply(e,new Uint8Array(n,0,c)),e}},{key:"_setup_zdle_table",value:function(){for(var e=new Array(256),t=0;t<e.length;t++)if(96&t)e[t]=1;else switch(t){case a:case s.ZMLIB.XOFF:case s.ZMLIB.XON:case 128|s.ZMLIB.XOFF:case 128|s.ZMLIB.XON:e[t]=2;break;case 16:case 144:e[t]=this._config.turbo_escape?1:2;break;case 13:case 141:e[t]=this._config.escape_ctrl_chars?2:this._config.turbo_escape?1:3;break;default:e[t]=this._config.escape_ctrl_chars?2:1}this._zdle_table=e}}],[{key:"decode",value:function(e){for(var t=e.length-1;t>=0;t--)e[t]===a&&e.splice(t,2,e[t+1]-64);return e}},{key:"splice",value:function(t,r,n){var i=0;r||(r=0);for(var o=r;o<t.length&&i<n;o++)i++,t[o]===a&&o++;if(i===n){if(t.length===o-1)return;return t.splice(0,r),e.decode(t.splice(0,o-r))}}}]),e}()},function(e,t,r){"use strict";for(var n=e.exports,i=[48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102],o={},s=0;s<i.length;s++)o[i[s]]=s;n.ENCODELIB={pack_u16_be:function(e){if(e>65535)throw"Number cannot exceed 16 bits: "+e;return[e>>8,255&e]},pack_u32_le:function(e){var t=e/65536;return[255&e,(65535&e)>>8,255&t,t>>8]},unpack_u16_be:function(e){return(e[0]<<8)+e[1]},unpack_u32_le:function(e){return e[0]+(e[1]<<8)+(e[2]<<16)+16777216*e[3]},octets_to_hex:function(e){for(var t=[],r=0;r<e.length;r++)t.push(i[e[r]>>4],i[15&e[r]]);return t},parse_hex_octets:function(e){for(var t=new Array(e.length/2),r=0;r<t.length;r++)t[r]=(o[e[2*r]]<<4)+o[e[1+2*r]];return t}}},function(e,t,r){"use strict";var n=r(3),i=r(6),o=r(31),s=r(50),a=r(16),l=r(69),c=r(7),h=r(71),u=r(27),f=r(5),_=r(93),d=r(40).f,p=r(8).f,y=r(74),m=r(44),g="prototype",v="Wrong index!",b=n.ArrayBuffer,C=n.DataView,w=n.Math,S=n.RangeError,E=n.Infinity,x=b,A=w.abs,k=w.pow,L=w.floor,T=w.log,O=w.LN2,R=i?"_b":"buffer",M=i?"_l":"byteLength",D=i?"_o":"byteOffset";function P(e,t,r){var n,i,o,s=new Array(r),a=8*r-t-1,l=(1<<a)-1,c=l>>1,h=23===t?k(2,-24)-k(2,-77):0,u=0,f=e<0||0===e&&1/e<0?1:0;for((e=A(e))!=e||e===E?(i=e!=e?1:0,n=l):(n=L(T(e)/O),e*(o=k(2,-n))<1&&(n--,o*=2),(e+=n+c>=1?h/o:h*k(2,1-c))*o>=2&&(n++,o/=2),n+c>=l?(i=0,n=l):n+c>=1?(i=(e*o-1)*k(2,t),n+=c):(i=e*k(2,c-1)*k(2,t),n=0));t>=8;s[u++]=255&i,i/=256,t-=8);for(n=n<<t|i,a+=t;a>0;s[u++]=255&n,n/=256,a-=8);return s[--u]|=128*f,s}function H(e,t,r){var n,i=8*r-t-1,o=(1<<i)-1,s=o>>1,a=i-7,l=r-1,c=e[l--],h=127&c;for(c>>=7;a>0;h=256*h+e[l],l--,a-=8);for(n=h&(1<<-a)-1,h>>=-a,a+=t;a>0;n=256*n+e[l],l--,a-=8);if(0===h)h=1-s;else{if(h===o)return n?NaN:c?-E:E;n+=k(2,t),h-=s}return(c?-1:1)*n*k(2,h-t)}function I(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function B(e){return[255&e]}function F(e){return[255&e,e>>8&255]}function j(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function N(e){return P(e,52,8)}function W(e){return P(e,23,4)}function U(e,t,r){p(e[g],t,{get:function(){return this[r]}})}function Z(e,t,r,n){var i=_(+r);if(i+t>e[M])throw S(v);var o=e[R]._b,s=i+e[D],a=o.slice(s,s+t);return n?a:a.reverse()}function z(e,t,r,n,i,o){var s=_(+r);if(s+t>e[M])throw S(v);for(var a=e[R]._b,l=s+e[D],c=n(+i),h=0;h<t;h++)a[l+h]=c[o?h:t-h-1]}if(s.ABV){if(!c(function(){b(1)})||!c(function(){new b(-1)})||c(function(){return new b,new b(1.5),new b(NaN),"ArrayBuffer"!=b.name})){for(var K,V=(b=function(e){return h(this,b),new x(_(e))})[g]=x[g],G=d(x),q=0;G.length>q;)(K=G[q++])in b||a(b,K,x[K]);o||(V.constructor=b)}var Y=new C(new b(2)),X=C[g].setInt8;Y.setInt8(0,2147483648),Y.setInt8(1,2147483649),!Y.getInt8(0)&&Y.getInt8(1)||l(C[g],{setInt8:function(e,t){X.call(this,e,t<<24>>24)},setUint8:function(e,t){X.call(this,e,t<<24>>24)}},!0)}else b=function(e){h(this,b,"ArrayBuffer");var t=_(e);this._b=y.call(new Array(t),0),this[M]=t},C=function(e,t,r){h(this,C,"DataView"),h(e,b,"DataView");var n=e[M],i=u(t);if(i<0||i>n)throw S("Wrong offset!");if(i+(r=void 0===r?n-i:f(r))>n)throw S("Wrong length!");this[R]=e,this[D]=i,this[M]=r},i&&(U(b,"byteLength","_l"),U(C,"buffer","_b"),U(C,"byteLength","_l"),U(C,"byteOffset","_o")),l(C[g],{getInt8:function(e){return Z(this,1,e)[0]<<24>>24},getUint8:function(e){return Z(this,1,e)[0]},getInt16:function(e){var t=Z(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Z(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return I(Z(this,4,e,arguments[1]))},getUint32:function(e){return I(Z(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return H(Z(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return H(Z(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){z(this,1,e,B,t)},setUint8:function(e,t){z(this,1,e,B,t)},setInt16:function(e,t){z(this,2,e,F,t,arguments[2])},setUint16:function(e,t){z(this,2,e,F,t,arguments[2])},setInt32:function(e,t){z(this,4,e,j,t,arguments[2])},setUint32:function(e,t){z(this,4,e,j,t,arguments[2])},setFloat32:function(e,t){z(this,4,e,W,t,arguments[2])},setFloat64:function(e,t){z(this,8,e,N,t,arguments[2])}});m(b,"ArrayBuffer"),m(C,"DataView"),a(C[g],s.VIEW,!0),t.ArrayBuffer=b,t.DataView=C},function(e,t,r){var n=r(34);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},function(e,t,r){"use strict";var n=r(20);e.exports.f=function(e){return new function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)}(e)}},function(e,t){e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){"use strict";var n=r(42),i={};i[r(1)("toStringTag")]="z",i+""!="[object z]"&&r(34)(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},function(e,t,r){"use strict";var n=r(25),i=r(220),o=r(33),s=r(9);e.exports=r(109)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},function(e,t,r){"use strict";var n=r(4),i=r(32),o=r(5);e.exports=function(e){for(var t=n(this),r=o(t.length),s=arguments.length,a=i(s>1?arguments[1]:void 0,r),l=s>2?arguments[2]:void 0,c=void 0===l?r:i(l,r);c>a;)t[a++]=e;return t}},function(e,t,r){var n=r(234);e.exports=function(e,t){return new(n(e))(t)}},function(e,t,r){var n=r(1)("iterator"),i=!1;try{var o=[7][n]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o=[7],s=o[n]();s.next=function(){return{done:r=!0}},o[n]=function(){return s},e(o)}catch(e){}return r}},function(e,t,r){var n=r(42),i=r(1)("iterator"),o=r(33);e.exports=r(10).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[n(e)]}},function(e,t,r){"use strict";var n=r(8),i=r(35);e.exports=function(e,t,r){t in e?n.f(e,t,i(0,r)):e[t]=r}},function(e,t,r){var n=r(33),i=r(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||o[i]===e)}},function(e,t,r){var n=r(3).document;e.exports=n&&n.documentElement},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(3),i=n["__core-js_shared__"]||(n["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t,r){var n=r(82)("keys"),i=r(30);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(2),i=r(3).document,o=n(i)&&n(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._renderer=e}return e.prototype.setRenderer=function(e){this._renderer=e},e.getCoordsRelativeToElement=function(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left,e.clientY-r.top]},e.prototype.getCoords=function(t,r,n,i,o,s){if(!n.width||!n.height)return null;var a=e.getCoordsRelativeToElement(t,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},e.prototype.getRawByteCoords=function(e,t,r,n,i){var o=this.getCoords(e,t,r,n,i),s=o[0],a=o[1];return{x:s+=32,y:a+=32}},e}();t.MouseHelper=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(13),s=r(49),a=function(e){function t(t){var r=e.call(this)||this;return r._terminal=t,r._zones=[],r._areZonesActive=!1,r._tooltipTimeout=null,r._currentZone=null,r._lastHoverCoords=[null,null],r.register(s.addDisposableDomListener(r._terminal.element,"mousedown",function(e){return r._onMouseDown(e)})),r._mouseMoveListener=function(e){return r._onMouseMove(e)},r._mouseLeaveListener=function(e){return r._onMouseLeave(e)},r._clickListener=function(e){return r._onClick(e)},r}return i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._deactivate()},t.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},t.prototype.clearAll=function(e,t){if(0!==this._zones.length){t||(e=0,t=this._terminal.rows-1);for(var r=0;r<this._zones.length;r++){var n=this._zones[r];(n.y1>e&&n.y1<=t+1||n.y2>e&&n.y2<=t+1||n.y1<e&&n.y2>t+1)&&(this._currentZone&&this._currentZone===n&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(r--,1))}0===this._zones.length&&this._deactivate()}},t.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._terminal.element.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.addEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.addEventListener("click",this._clickListener))},t.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._terminal.element.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.removeEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.removeEventListener("click",this._clickListener))},t.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},t.prototype._onHover=function(e){var t=this,r=this._findZoneEventAt(e);r!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),r&&(this._currentZone=r,r.hoverCallback&&r.hoverCallback(e),this._tooltipTimeout=setTimeout(function(){return t._onTooltip(e)},500)))},t.prototype._onTooltip=function(e){this._tooltipTimeout=null;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},t.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._terminal.getSelection().length,this._areZonesActive){var t=this._findZoneEventAt(e);t&&t.willLinkActivate(e)&&(e.preventDefault(),e.stopImmediatePropagation())}},t.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},t.prototype._onClick=function(e){var t=this._findZoneEventAt(e),r=this._terminal.getSelection().length;t&&r===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._findZoneEventAt=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows);if(!t)return null;for(var r=t[0],n=t[1],i=0;i<this._zones.length;i++){var o=this._zones[i];if(o.y1===o.y2){if(n===o.y1&&r>=o.x1&&r<o.x2)return o}else if(n===o.y1&&r>=o.x1||n===o.y2&&r<o.x2||n>o.y1&&n<o.y2)return o}return null},t}(o.Disposable);t.MouseZoneManager=a;var l=function(){return function(e,t,r,n,i,o,s,a,l){this.x1=e,this.y1=t,this.x2=r,this.y2=n,this.clickCallback=i,this.hoverCallback=o,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=l}}();t.MouseZone=l},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._currentDevicePixelRatio=window.devicePixelRatio,t}return i(t,e),t.prototype.setListener=function(e){var t=this;this._listener&&this.clearListener(),this._listener=e,this._outerListener=function(){t._listener&&(t._listener(window.devicePixelRatio,t._currentDevicePixelRatio),t._updateDpr())},this._updateDpr()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.clearListener()},t.prototype._updateDpr=function(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},t.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},t}(r(13).Disposable);t.ScreenDprMonitor=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(37),i=r(17);function o(e,t){for(var r=!0,n=t.rgba>>>24,i=t.rgba>>>16&255,o=t.rgba>>>8&255,s=0;s<e.data.length;s+=4)e.data[s]===n&&e.data[s+1]===i&&e.data[s+2]===o?e.data[s+3]=0:r=!1;return r}function s(e,t){return e+" "+t.fontSize*t.devicePixelRatio+"px "+t.fontFamily}t.generateStaticCharAtlasTexture=function(e,t,r){var a=r.scaledCharWidth+i.CHAR_ATLAS_CELL_SPACING,l=r.scaledCharHeight+i.CHAR_ATLAS_CELL_SPACING,c=t(255*a,34*l),h=c.getContext("2d",{alpha:r.allowTransparency});h.fillStyle=r.colors.background.css,h.fillRect(0,0,c.width,c.height),h.save(),h.fillStyle=r.colors.foreground.css,h.font=s(r.fontWeight,r),h.textBaseline="middle";for(var u=0;u<256;u++)h.save(),h.beginPath(),h.rect(u*a,0,a,l),h.clip(),h.fillText(String.fromCharCode(u),u*a,l/2),h.restore();for(h.save(),h.font=s(r.fontWeightBold,r),u=0;u<256;u++)h.save(),h.beginPath(),h.rect(u*a,l,a,l),h.clip(),h.fillText(String.fromCharCode(u),u*a,1.5*l),h.restore();h.restore(),h.font=s(r.fontWeight,r);for(var f=0;f<16;f++){var _=(f+2)*l;for(u=0;u<256;u++)h.save(),h.beginPath(),h.rect(u*a,_,a,l),h.clip(),h.fillStyle=r.colors.ansi[f].css,h.fillText(String.fromCharCode(u),u*a,_+l/2),h.restore()}for(h.font=s(r.fontWeightBold,r),f=0;f<16;f++)for(_=(f+2+16)*l,u=0;u<256;u++)h.save(),h.beginPath(),h.rect(u*a,_,a,l),h.clip(),h.fillStyle=r.colors.ansi[f].css,h.fillText(String.fromCharCode(u),u*a,_+l/2),h.restore();if(h.restore(),!("createImageBitmap"in e)||n.isFirefox||n.isSafari)return c;var d=h.getImageData(0,0,c.width,c.height);return o(d,r.colors.background),e.createImageBitmap(d)},t.clearColor=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(64),i=r(131),o=r(129),s=r(128),a={none:o.default,static:s.default,dynamic:i.default},l=[];t.acquireCharAtlas=function(e,t,r,i){for(var o=n.generateConfig(r,i,e,t),s=0;s<l.length;s++){var c=(h=l[s]).ownedBy.indexOf(e);if(c>=0){if(n.configEquals(h.config,o))return h.atlas;1===h.ownedBy.length?(h.atlas.dispose(),l.splice(s,1)):h.ownedBy.splice(c,1);break}}for(s=0;s<l.length;s++){var h=l[s];if(n.configEquals(h.config,o))return h.ownedBy.push(e),h.atlas}var u={atlas:new a[e.options.experimentalCharAtlas](document,o),config:o,ownedBy:[e]};return l.push(u),u.atlas},t.removeTerminalFromCache=function(e){for(var t=0;t<l.length;t++){var r=l[t].ownedBy.indexOf(e);if(-1!==r){1===l[t].ownedBy.length?(l[t].atlas.dispose(),l.splice(t,1)):l[t].ownedBy.splice(r,1);break}}}},function(e,t,r){"use strict";function n(e,t,r,n){if(void 0===r&&(r=0),void 0===n&&(n=e.length),r>=e.length)return e;r=(e.length+r)%e.length,n=n>=e.length?e.length:(e.length+n)%e.length;for(var i=r;i<n;++i)e[i]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.fill=function(e,t,r,i){return e.fill?e.fill(t,r,i):n(e,t,r,i)},t.fillFallback=n,t.concat=function(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(90);t.wcwidth=function(e){var t=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],r=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];var i=0|e.control,o=new Uint8Array(65536);n.fill(o,1),o[0]=e.nul,n.fill(o,e.control,1,32),n.fill(o,e.control,127,160),n.fill(o,2,4352,4448),o[9001]=2,o[9002]=2,n.fill(o,2,11904,42192),o[12351]=1,n.fill(o,2,44032,55204),n.fill(o,2,63744,64256),n.fill(o,2,65040,65050),n.fill(o,2,65072,65136),n.fill(o,2,65280,65377),n.fill(o,2,65504,65511);for(var s=0;s<t.length;++s)n.fill(o,0,t[s][0],t[s][1]+1);return function(e){return e<32?0|i:e<127?1:e<65536?o[e]:function(e,t){var r,n=0,i=t.length-1;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=n;)if(e>t[r=n+i>>1][1])n=r+1;else{if(!(e<t[r][0]))return!0;i=r-1}return!1}(t=e,r)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1;var t}}({nul:0,control:0}),t.getStringCellWidth=function(e){for(var r=0,n=e.length,i=0;i<n;++i){var o=e.charCodeAt(i);if(55296<=o&&o<=56319){if(++i>=n)return r+t.wcwidth(o);var s=e.charCodeAt(i);56320<=s&&s<=57343?o=1024*(o-55296)+s-56320+65536:r+=t.wcwidth(s)}r+=t.wcwidth(o)}return r}},function(e,t,r){"use strict";var n,i=r(149),o=e.exports;Object.assign(o,r(38),r(67));var s=16,a=4129,l=65535,c=1<<s-1;function h(e,t){return n||function(){n=new Array(256);for(var e=s-8,t=0;t<256;t++){for(var r=t<<e&l,i=0;i<8;i++)0!=(r&c)?(r<<=1,r^=a):r<<=1;n[t]=r&l}}(),n[t>>8&255]^(255&t)<<8^e}function u(e,t){if(e.join()!==t.join())throw new o.Error("crc",t,e)}o.CRC={crc16:function(e){for(var t=e[0],r=1;r<e.length;r++)t=h(e[r],t);return t=h(0,h(0,t)),o.ENCODELIB.pack_u16_be(t)},crc32:function(e){return o.ENCODELIB.pack_u32_le(i.buf(e)>>>0)},verify16:function(e,t){return u(this.crc16(e),t)},verify32:function(e,t){try{u(this.crc32(e),t)}catch(t){throw t.input=e.slice(0),t}}}},function(e,t,r){var n=r(27),i=r(5);e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=i(t);if(t!==r)throw RangeError("Wrong length!");return r}},function(e,t,r){var n=r(12),i=r(2),o=r(70);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,r){var n,i,o,s=r(21),a=r(178),l=r(80),c=r(84),h=r(3),u=h.process,f=h.setImmediate,_=h.clearImmediate,d=h.MessageChannel,p=h.Dispatch,y=0,m={},g=function(){var e=+this;if(m.hasOwnProperty(e)){var t=m[e];delete m[e],t()}},v=function(e){g.call(e.data)};f&&_||(f=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return m[++y]=function(){a("function"==typeof e?e:Function(e),t)},n(y),y},_=function(e){delete m[e]},"process"==r(28)(u)?n=function(e){u.nextTick(s(g,e,1))}:p&&p.now?n=function(e){p.now(s(g,e,1))}:d?(o=(i=new d).port2,i.port1.onmessage=v,n=s(o.postMessage,o,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(n=function(e){h.postMessage(e+"","*")},h.addEventListener("message",v,!1)):n="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),g.call(e)}}:function(e){setTimeout(s(g,e,1),0)}),e.exports={set:f,clear:_}},function(e,t,r){var n=r(8),i=r(24),o=r(99),s=r(9);e.exports=function(e,t){for(var r,a=o(s(t)),l=a.length,c=0;l>c;)n.f(e,r=a[c++],i.f(t,r));return e}},function(e,t,r){var n=r(29),i=r(9),o=r(41).f;e.exports=function(e){return function(t){for(var r,s=i(t),a=n(s),l=a.length,c=0,h=[];l>c;)o.call(s,r=a[c++])&&h.push(e?[r,s[r]]:s[r]);return h}}},function(e,t,r){var n=r(40),i=r(53),o=r(12),s=r(3).Reflect;e.exports=s&&s.ownKeys||function(e){var t=n.f(o(e)),r=i.f;return r?t.concat(r(e)):t}},function(e,t,r){var n=r(9),i=r(40).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return s.slice()}}(e):i(n(e))}},function(e,t,r){t.f=r(1)},function(e,t,r){"use strict";var n=r(56),i=r(2),o=r(5),s=r(21),a=r(1)("isConcatSpreadable");e.exports=function e(t,r,l,c,h,u,f,_){for(var d,p,y=h,m=0,g=!!f&&s(f,_,3);m<c;){if(m in l){if(d=g?g(l[m],m,r):l[m],p=!1,i(d)&&(p=void 0!==(p=d[a])?!!p:n(d)),p&&u>0)y=e(t,r,d,o(d.length),y,u-1)-1;else{if(y>=9007199254740991)throw TypeError();t[y]=d}y++}m++}return y}},function(e,t,r){"use strict";var n=r(4),i=r(32),o=r(5);e.exports=[].copyWithin||function(e,t){var r=n(this),s=o(r.length),a=i(e,s),l=i(t,s),c=arguments.length>2?arguments[2]:void 0,h=Math.min((void 0===c?s:i(c,s))-l,s-a),u=1;for(l<a&&a<l+h&&(u=-1,l+=h-1,a+=h-1);h-- >0;)l in r?r[a]=r[l]:delete r[a],a+=u,l+=u;return r}},function(e,t,r){var n=r(20),i=r(4),o=r(45),s=r(5);e.exports=function(e,t,r,a,l){n(t);var c=i(e),h=o(c),u=s(c.length),f=l?u-1:0,_=l?-1:1;if(r<2)for(;;){if(f in h){a=h[f],f+=_;break}if(f+=_,l?f<0:u<=f)throw TypeError("Reduce of empty array with no initial value")}for(;l?f>=0:u>f;f+=_)f in h&&(a=t(a,h[f],f,c));return a}},function(e,t,r){var n=r(12);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&n(o.call(e)),t}}},function(e,t,r){var n=r(22),i=r(9),o=r(57)(!1),s=r(83)("IE_PROTO");e.exports=function(e,t){var r,a=i(e),l=0,c=[];for(r in a)r!=s&&n(a,r)&&c.push(r);for(;t.length>l;)n(a,r=t[l++])&&(~o(c,r)||c.push(r));return c}},function(e,t,r){var n=r(8),i=r(12),o=r(29);e.exports=r(6)?Object.defineProperties:function(e,t){i(e);for(var r,s=o(t),a=s.length,l=0;a>l;)n.f(e,r=s[l++],t[r]);return e}},function(e,t,r){e.exports=!r(6)&&!r(7)(function(){return 7!=Object.defineProperty(r(84)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";var n=r(31),i=r(0),o=r(34),s=r(16),a=r(22),l=r(33),c=r(242),h=r(44),u=r(43),f=r(1)("iterator"),_=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,r,p,y,m,g){c(r,t,p);var v,b,C,w=function(e){if(!_&&e in A)return A[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},S=t+" Iterator",E="values"==y,x=!1,A=e.prototype,k=A[f]||A["@@iterator"]||y&&A[y],L=!_&&k||w(y),T=y?E?w("entries"):L:void 0,O="Array"==t&&A.entries||k;if(O&&(C=u(O.call(new e)))!==Object.prototype&&C.next&&(h(C,S,!0),n||a(C,f)||s(C,f,d)),E&&k&&"values"!==k.name&&(x=!0,L=function(){return k.call(this)}),n&&!g||!_&&!x&&A[f]||s(A,f,L),l[t]=L,l[S]=d,y)if(v={values:E?L:w("values"),keys:m?L:w("keys"),entries:T},g)for(b in v)b in A||o(A,b,v[b]);else i(i.P+i.F*(_||x),t,v);return v}},function(e,t,r){"use strict";var n=r(243)(!0);r(109)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t,r){"use strict";function n(e,t,r){if(!e.overlayNode_){if(!e.element)return;e.overlayNode_=document.createElement("div"),e.overlayNode_.style.cssText="border-radius: 15px;font-size: xx-large;opacity: 0.75;padding: 0.2em 0.5em 0.2em 0.5em;position: absolute;-webkit-user-select: none;-webkit-transition: opacity 180ms ease-in;-moz-user-select: none;-moz-transition: opacity 180ms ease-in;",e.overlayNode_.addEventListener("mousedown",function(e){e.preventDefault(),e.stopPropagation()},!0)}e.overlayNode_.style.color="#101010",e.overlayNode_.style.backgroundColor="#f0f0f0",e.overlayNode_.textContent=t,e.overlayNode_.style.opacity="0.75",e.overlayNode_.parentNode||e.element.appendChild(e.overlayNode_);var n=e.element.getBoundingClientRect(),i=e.overlayNode_.getBoundingClientRect();e.overlayNode_.style.top=(n.height-i.height)/2+"px",e.overlayNode_.style.left=(n.width-i.width)/2+"px",e.overlayTimeout_&&clearTimeout(e.overlayTimeout_),null!==r&&(e.overlayTimeout_=setTimeout(function(){e.overlayNode_.style.opacity="0",e.overlayTimeout_=setTimeout(function(){e.overlayNode_.parentNode&&e.overlayNode_.parentNode.removeChild(e.overlayNode_),e.overlayTimeout_=null,e.overlayNode_.style.opacity="0.75"},200)},r||1500))}Object.defineProperty(t,"__esModule",{value:!0}),t.showOverlay=n,t.apply=function(e){e.prototype.showOverlay=function(e,t){return n(this,e,t)}}},function(e,t,r){"use strict";function n(e){if(!e.element.parentElement)return null;var t=window.getComputedStyle(e.element.parentElement),r=parseInt(t.getPropertyValue("height")),n=Math.max(0,parseInt(t.getPropertyValue("width"))),i=window.getComputedStyle(e.element),o=r-(parseInt(i.getPropertyValue("padding-top"))+parseInt(i.getPropertyValue("padding-bottom"))),s=n-(parseInt(i.getPropertyValue("padding-right"))+parseInt(i.getPropertyValue("padding-left")))-e._core.viewport.scrollBarWidth;return{cols:Math.floor(s/e._core.renderer.dimensions.actualCellWidth),rows:Math.floor(o/e._core.renderer.dimensions.actualCellHeight)}}function i(e){var t=n(e);t&&(e.rows===t.rows&&e.cols===t.cols||(e._core.renderer.clear(),e.resize(t.cols,t.rows)))}Object.defineProperty(t,"__esModule",{value:!0}),t.proposeGeometry=n,t.fit=i,t.apply=function(e){e.prototype.proposeGeometry=function(){return n(this)},e.prototype.fit=function(){i(this)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(18);t.applyWindowsMode=function(e){return e.onLineFeed(function(){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1).get(e.cols-1);t[n.CHAR_DATA_CODE_INDEX]!==n.NULL_CELL_CODE&&t[n.CHAR_DATA_CODE_INDEX]!==n.WHITESPACE_CELL_CODE&&(e.buffer.lines.get(e.buffer.ybase+e.buffer.y).isWrapped=!0)})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=function e(t,r){if(void 0===r&&(r=5),"object"!=typeof t)return t;if(null===t)return null;var n=Array.isArray(t)?[]:{};for(var i in t)n[i]=r<=1?t[i]:e(t[i],r-1);return n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(48),i={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(e,t,r,o){var s={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?s.key=t?n.C0.ESC+"OA":n.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?s.key=t?n.C0.ESC+"OD":n.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?s.key=t?n.C0.ESC+"OC":n.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(s.key=t?n.C0.ESC+"OB":n.C0.ESC+"[B");break;case 8:if(e.shiftKey){s.key=n.C0.BS;break}if(e.altKey){s.key=n.C0.ESC+n.C0.DEL;break}s.key=n.C0.DEL;break;case 9:if(e.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=t?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=t?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=t?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=t?n.C0.ESC+"OB":n.C0.ESC+"[B";break;case 45:e.shiftKey||e.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":t?n.C0.ESC+"OH":n.C0.ESC+"[H";break;case 35:s.key=a?n.C0.ESC+"[1;"+(a+1)+"F":t?n.C0.ESC+"OF":n.C0.ESC+"[F";break;case 33:e.shiftKey?s.type=2:s.key=n.C0.ESC+"[5~";break;case 34:e.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(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(r&&!o||!e.altKey||e.metaKey)r&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?s.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(s.key=n.C0.US);else{var l=i[e.keyCode],c=l&&l[e.shiftKey?1:0];if(c)s.key=n.C0.ESC+c;else if(e.keyCode>=65&&e.keyCode<=90){var h=e.ctrlKey?e.keyCode-64:e.keyCode+32;s.key=n.C0.ESC+String.fromCharCode(h)}}else e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?s.key=String.fromCharCode(0):e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?s.key=String.fromCharCode(127):219===e.keyCode?s.key=String.fromCharCode(27):220===e.keyCode?s.key=String.fromCharCode(28):221===e.keyCode&&(s.key=String.fromCharCode(29))}return s}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(18),i=r(17),o=r(23);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var s=function(){function e(e,t){this._terminalOptions=e,this._document=t,this._workCell=new o.CellData}return e.prototype.createRow=function(e,r,s,a,l,c,h){for(var u=this._document.createDocumentFragment(),f=0,_=Math.min(e.length,h)-1;_>=0;_--)if(e.loadCell(_,this._workCell).getCode()!==n.NULL_CELL_CODE||r&&_===a){f=_+1;break}for(_=0;_<f;_++){e.loadCell(_,this._workCell);var d=this._workCell.getWidth();if(0!==d){var p=this._document.createElement("span");if(d>1&&(p.style.width=c*d+"px"),r&&_===a)switch(p.classList.add(t.CURSOR_CLASS),l&&p.classList.add(t.CURSOR_BLINK_CLASS),s){case"bar":p.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":p.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:p.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&this._terminalOptions.enableBold&&p.classList.add(t.BOLD_CLASS),this._workCell.isItalic()&&p.classList.add(t.ITALIC_CLASS),this._workCell.isDim()&&p.classList.add(t.DIM_CLASS),this._workCell.isUnderline()&&p.classList.add(t.UNDERLINE_CLASS),p.textContent=this._workCell.getChars()||n.WHITESPACE_CELL_CHAR;var y=this._workCell.isInverse();if(this._workCell.isFgRGB()){var m=p.getAttribute("style")||"";m+=(y?"background-":"")+"color:rgb("+o.AttributeData.toColorRGB(this._workCell.getFgColor()).join(",")+");",p.setAttribute("style",m)}else if(this._workCell.isFgPalette()){var g=this._workCell.getFgColor();this._workCell.isBold()&&g<8&&!y&&this._terminalOptions.enableBold&&this._terminalOptions.drawBoldTextInBrightColors&&(g+=8),p.classList.add("xterm-"+(y?"b":"f")+"g-"+g)}else y&&p.classList.add("xterm-bg-"+i.INVERTED_DEFAULT_COLOR);if(this._workCell.isBgRGB()){m=p.getAttribute("style")||"";m+=(y?"":"background-")+"color:rgb("+o.AttributeData.toColorRGB(this._workCell.getBgColor()).join(",")+");",p.setAttribute("style",m)}else this._workCell.isBgPalette()?p.classList.add("xterm-"+(y?"f":"b")+"g-"+this._workCell.getBgColor()):y&&p.classList.add("xterm-fg-"+i.INVERTED_DEFAULT_COLOR);u.appendChild(p)}}return u},e}();t.DomRendererRowFactory=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(62),s=r(60),a=r(116),l=r(17),c=r(14),h="xterm-dom-renderer-owner-",u="xterm-rows",f="xterm-selection",_=1,d=function(e){function t(t,r){var n=e.call(this)||this;n._terminal=t,n._terminalClass=_++,n._rowElements=[],n._onCanvasResize=new c.EventEmitter2,n._onRender=new c.EventEmitter2;var i=n._terminal.options.allowTransparency;return n.colorManager=new o.ColorManager(document,i),n.setTheme(r),n._rowContainer=document.createElement("div"),n._rowContainer.classList.add(u),n._rowContainer.style.lineHeight="normal",n._rowContainer.setAttribute("aria-hidden","true"),n._refreshRowElements(n._terminal.cols,n._terminal.rows),n._selectionContainer=document.createElement("div"),n._selectionContainer.classList.add(f),n._selectionContainer.setAttribute("aria-hidden","true"),n.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},n._updateDimensions(),n._renderDebouncer=new s.RenderDebouncer(n._renderRows.bind(n)),n._rowFactory=new a.DomRendererRowFactory(t.options,document),n._terminal.element.classList.add(h+n._terminalClass),n._terminal.screenElement.appendChild(n._rowContainer),n._terminal.screenElement.appendChild(n._selectionContainer),n._terminal.linkifier.onLinkHover(function(e){return n._onLinkHover(e)}),n._terminal.linkifier.onLinkLeave(function(e){return n._onLinkLeave(e)}),n}return i(t,e),Object.defineProperty(t.prototype,"onCanvasResize",{get:function(){return this._onCanvasResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._terminal.element.classList.remove(h+this._terminalClass),this._terminal.screenElement.removeChild(this._rowContainer),this._terminal.screenElement.removeChild(this._selectionContainer),this._terminal.screenElement.removeChild(this._themeStyleElement),this._terminal.screenElement.removeChild(this._dimensionsStyleElement),e.prototype.dispose.call(this)},t.prototype._updateDimensions=function(){var e=this;this.dimensions.scaledCharWidth=Math.floor(this._terminal.charMeasure.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._terminal.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._terminal.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows,this._rowElements.forEach(function(t){t.style.width=e.dimensions.canvasWidth+"px",t.style.height=e.dimensions.actualCellHeight+"px",t.style.lineHeight=e.dimensions.actualCellHeight+"px",t.style.overflow="hidden"}),this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._dimensionsStyleElement));var t=this._terminalSelector+" ."+u+" span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=t,this._selectionContainer.style.height=this._terminal._viewportElement.style.height,this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.setTheme=function(e){var t=this;e&&this.colorManager.setTheme(e),this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._themeStyleElement));var r=this._terminalSelector+" ."+u+" { color: "+this.colorManager.colors.foreground.css+"; background-color: "+this.colorManager.colors.background.css+"; font-family: "+this._terminal.getOption("fontFamily")+"; font-size: "+this._terminal.getOption("fontSize")+"px;}";return r+=this._terminalSelector+" span:not(."+a.BOLD_CLASS+") { font-weight: "+this._terminal.options.fontWeight+";}"+this._terminalSelector+" span."+a.BOLD_CLASS+" { font-weight: "+this._terminal.options.fontWeightBold+";}"+this._terminalSelector+" span."+a.ITALIC_CLASS+" { font-style: italic;}",r+="@keyframes blink { 0% { opacity: 1.0; } 50% { opacity: 0.0; } 100% { opacity: 1.0; }}",r+=this._terminalSelector+" ."+u+":not(.xterm-focus) ."+a.CURSOR_CLASS+" { outline: 1px solid "+this.colorManager.colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" ."+u+".xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_BLINK_CLASS+" { animation: blink 1s step-end infinite;}"+this._terminalSelector+" ."+u+".xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this.colorManager.colors.cursor.css+"; color: "+this.colorManager.colors.cursorAccent.css+";}"+this._terminalSelector+" ."+u+".xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BAR_CLASS+" { box-shadow: 1px 0 0 "+this.colorManager.colors.cursor.css+" inset;}"+this._terminalSelector+" ."+u+".xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this.colorManager.colors.cursor.css+" inset;}",r+=this._terminalSelector+" ."+f+" { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" ."+f+" div { position: absolute; background-color: "+this.colorManager.colors.selection.css+";}",this.colorManager.colors.ansi.forEach(function(e,n){r+=t._terminalSelector+" .xterm-fg-"+n+" { color: "+e.css+"; }"+t._terminalSelector+" .xterm-bg-"+n+" { background-color: "+e.css+"; }"}),r+=this._terminalSelector+" .xterm-fg-"+l.INVERTED_DEFAULT_COLOR+" { color: "+this.colorManager.colors.background.css+"; }"+this._terminalSelector+" .xterm-bg-"+l.INVERTED_DEFAULT_COLOR+" { background-color: "+this.colorManager.colors.foreground.css+"; }",this._themeStyleElement.innerHTML=r,this.colorManager.colors},t.prototype.onWindowResize=function(e){this._updateDimensions()},t.prototype._refreshRowElements=function(e,t){for(var r=this._rowElements.length;r<=t;r++){var n=document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())},t.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this._onCanvasResize.fire({width:this.dimensions.canvasWidth,height:this.dimensions.canvasHeight})},t.prototype.onCharSizeChanged=function(){this._updateDimensions()},t.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},t.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},t.prototype.onSelectionChanged=function(e,t,r){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var n=e[1]-this._terminal.buffer.ydisp,i=t[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,e[0],t[0],s-o+1));else{var l=n===o?e[0]:0,c=o===s?t[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?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(s,0,u))}}this._selectionContainer.appendChild(a)}}},t.prototype._createSelectionElement=function(e,t,r,n){void 0===n&&(n=1);var i=document.createElement("div");return i.style.height=n*this.dimensions.actualCellHeight+"px",i.style.top=e*this.dimensions.actualCellHeight+"px",i.style.left=t*this.dimensions.actualCellWidth+"px",i.style.width=this.dimensions.actualCellWidth*(r-t)+"px",i},t.prototype.onCursorMove=function(){},t.prototype.onOptionsChanged=function(){this._updateDimensions(),this.setTheme(void 0),this._terminal.refresh(0,this._terminal.rows-1)},t.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},t.prototype.refreshRows=function(e,t){this._renderDebouncer.refresh(e,t,this._terminal.rows)},t.prototype._renderRows=function(e,t){for(var r=this._terminal,n=r.buffer.ybase+r.buffer.y,i=this._terminal.buffer.x,o=this._terminal.options.cursorBlink,s=e;s<=t;s++){var a=this._rowElements[s];a.innerHTML="";var l=s+r.buffer.ydisp,c=r.buffer.lines.get(l),h=r.options.cursorStyle;a.appendChild(this._rowFactory.createRow(c,l===n,h,i,o,this.dimensions.actualCellWidth,r.cols))}this._onRender.fire({start:e,end:t})},Object.defineProperty(t.prototype,"_terminalSelector",{get:function(){return"."+h+this._terminalClass},enumerable:!0,configurable:!0}),t.prototype.registerCharacterJoiner=function(e){return-1},t.prototype.deregisterCharacterJoiner=function(e){return!1},t.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},t.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},t.prototype._setCellUnderline=function(e,t,r,n,i,o){for(;e!==t||r!==n;){var s=this._rowElements[r];if(!s)return;var a=s.children[e];a&&(a.style.textDecoration=o?"underline":"none"),++e>=i&&(e=0,r++)}},t}(r(13).Disposable);t.DomRenderer=d},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(59),s=r(37),a=r(60),l=r(49),c=function(e){function t(t){var r=e.call(this)||this;r._terminal=t,r._liveRegionLineCount=0,r._charsToConsume=[],r._accessibilityTreeRoot=document.createElement("div"),r._accessibilityTreeRoot.classList.add("xterm-accessibility"),r._rowContainer=document.createElement("div"),r._rowContainer.classList.add("xterm-accessibility-tree"),r._rowElements=[];for(var n=0;n<r._terminal.rows;n++)r._rowElements[n]=r._createAccessibilityTreeNode(),r._rowContainer.appendChild(r._rowElements[n]);return r._topBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,0)},r._bottomBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,1)},r._rowElements[0].addEventListener("focus",r._topBoundaryFocusListener),r._rowElements[r._rowElements.length-1].addEventListener("focus",r._bottomBoundaryFocusListener),r._refreshRowsDimensions(),r._accessibilityTreeRoot.appendChild(r._rowContainer),r._renderRowsDebouncer=new a.RenderDebouncer(r._renderRows.bind(r)),r._refreshRows(),r._liveRegion=document.createElement("div"),r._liveRegion.classList.add("live-region"),r._liveRegion.setAttribute("aria-live","assertive"),r._accessibilityTreeRoot.appendChild(r._liveRegion),r._terminal.element.insertAdjacentElement("afterbegin",r._accessibilityTreeRoot),r.register(r._renderRowsDebouncer),r.register(r._terminal.onResize(function(e){return r._onResize(e.rows)})),r.register(r._terminal.onRender(function(e){return r._refreshRows(e.start,e.end)})),r.register(r._terminal.onScroll(function(){return r._refreshRows()})),r.register(r._terminal.addDisposableListener("a11y.char",function(e){return r._onChar(e)})),r.register(r._terminal.onLineFeed(function(){return r._onChar("\n")})),r.register(r._terminal.addDisposableListener("a11y.tab",function(e){return r._onTab(e)})),r.register(r._terminal.onKey(function(e){return r._onKey(e.key)})),r.register(r._terminal.addDisposableListener("blur",function(){return r._clearLiveRegion()})),r.register(r._terminal.addDisposableListener("dprchange",function(){return r._refreshRowsDimensions()})),r.register(r._terminal.renderer.onCanvasResize(function(){return r._refreshRowsDimensions()})),r.register(l.addDisposableDomListener(window,"resize",function(){return r._refreshRowsDimensions()})),r}return i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._terminal.element.removeChild(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(e,t){var r=e.target,n=this._rowElements[0===t?1:this._rowElements.length-2];if(r.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===n){var i,o;if(0===t?(i=r,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(i=this._rowElements.shift(),o=r,this._rowContainer.removeChild(i)),i.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){var s=this._createAccessibilityTreeNode();this._rowElements.unshift(s),this._rowContainer.insertAdjacentElement("afterbegin",s)}else{s=this._createAccessibilityTreeNode();this._rowElements.push(s),this._rowContainer.appendChild(s)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}},t.prototype._onResize=function(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},t.prototype._onTab=function(e){for(var t=0;t<e;t++)this._onChar(" ")},t.prototype._onChar=function(e){var t=this;if(this._liveRegionLineCount<21){if(this._charsToConsume.length>0)this._charsToConsume.shift()!==e&&this._announceCharacter(e);else this._announceCharacter(e);"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=o.tooMuchOutput)),s.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){t._accessibilityTreeRoot.appendChild(t._liveRegion)},0)}},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,s.isMac&&this._liveRegion.parentNode&&this._accessibilityTreeRoot.removeChild(this._liveRegion)},t.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},t.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)},t.prototype._renderRows=function(e,t){for(var r=this._terminal.buffer,n=r.lines.length.toString(),i=e;i<=t;i++){var s=r.translateBufferLineToString(r.ydisp+i,!0),a=(r.ydisp+i+1).toString(),l=this._rowElements[i];l.textContent=0===s.length?o.blankLine:s,l.setAttribute("aria-posinset",a),l.setAttribute("aria-setsize",n)}},t.prototype._refreshRowsDimensions=function(){if(this._terminal.renderer.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}},t.prototype._refreshRowDimensions=function(e){e.style.height=this._terminal.renderer.dimensions.actualCellHeight+"px"},t.prototype._announceCharacter=function(e){" "===e?this._liveRegion.innerHTML+="&nbsp;":this._liveRegion.textContent+=e},t}(r(13).Disposable);t.AccessibilityManager=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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 e(e){this._terminal=e}return Object.defineProperty(e,"audioContext",{get:function(){if(!e._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;e._audioContext=new t}return e._audioContext},enumerable:!0,configurable:!0}),e.prototype.playBellSound=function(){var t=e.audioContext;if(t){var r=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),function(e){r.buffer=e,r.connect(t.destination),r.start(0)})}},e.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),r=t.length,n=new Uint8Array(r),i=0;i<r;i++)n[i]=t.charCodeAt(i);return n.buffer},e.prototype._removeMimeType=function(e){return e.split(",")[1]},e}();t.SoundManager=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),i=function(){function e(e,t){this._onCharSizeChanged=new n.EventEmitter2,this._document=e,this._parentElement=t,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return Object.defineProperty(e.prototype,"onCharSizeChanged",{get:function(){return this._onCharSizeChanged.event},enumerable:!0,configurable:!0}),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(e){this._measureElement.style.fontFamily=e.fontFamily,this._measureElement.style.fontSize=e.fontSize+"px";var t=this._measureElement.getBoundingClientRect();if(0!==t.width&&0!==t.height){var r=Math.ceil(t.height);this._width===t.width&&this._height===r||(this._width=t.width,this._height=r,this._onCharSizeChanged.fire())}},e}();t.CharMeasure=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(48),i=function(){function e(e,t){var r;this._mouseEvent=e,this._terminal=t,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(e){return e-1}),this._endCol=r[0],this._endRow=r[1])}return e.prototype.move=function(){this._mouseEvent.altKey&&void 0!==this._endCol&&void 0!==this._endRow&&this._terminal.handler(this._arrowSequences())},e.prototype._arrowSequences=function(){return this._terminal.buffer.hasScrollback?this._moveHorizontallyOnly():this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()},e.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"))},e.prototype._moveToRequestedRow=function(){var e=this._startRow-this._wrappedRowsForRow(this._startRow),t=this._endRow-this._wrappedRowsForRow(this._endRow);return o(Math.abs(e-t)-this._wrappedRowsCount(),this._sequence(this._verticalDirection()))},e.prototype._moveToRequestedCol=function(){var e;e=this._moveToRequestedRow().length>0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow;var t=this._endRow,r=this._horizontalDirection();return o(this._bufferLine(this._startCol,e,this._endCol,t,"C"===r).length,this._sequence(r))},e.prototype._moveHorizontallyOnly=function(){var e=this._horizontalDirection();return o(Math.abs(this._startCol-this._endCol),this._sequence(e))},e.prototype._wrappedRowsCount=function(){for(var e=0,t=this._startRow-this._wrappedRowsForRow(this._startRow),r=this._endRow-this._wrappedRowsForRow(this._endRow),n=0;n<Math.abs(t-r);n++){var i="A"===this._verticalDirection()?-1:1;this._lines.get(t+i*n).isWrapped&&e++}return e},e.prototype._wrappedRowsForRow=function(e){for(var t=0,r=this._lines.get(e).isWrapped;r&&e>=0&&e<this._terminal.rows;)t++,e--,r=this._lines.get(e).isWrapped;return t},e.prototype._horizontalDirection=function(){var e;return e=this._moveToRequestedRow().length>0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow,this._startCol<this._endCol&&e<=this._endRow||this._startCol>=this._endCol&&e<this._endRow?"C":"D"},e.prototype._verticalDirection=function(){return this._startRow>this._endRow?"A":"B"},e.prototype._bufferLine=function(e,t,r,n,i){for(var o=e,s=t,a="";o!==r||s!==n;)o+=i?1:-1,i&&o>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(a+=this._terminal.buffer.translateBufferLineToString(s,!1,0,e+1),e=o=this._terminal.cols-1,s--);return a+this._terminal.buffer.translateBufferLineToString(s,!1,e,o)},e.prototype._sequence=function(e){var t=this._terminal.applicationCursor?"O":"[";return n.C0.ESC+t+e},e}();function o(e,t){e=Math.floor(e);for(var r="",n=0;n<e;n++)r+=t;return r}t.AltClickHandler=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._terminal=e,this.clearSelection()}return e.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(e.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(e.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()){var e=this.selectionStart[0]+this.selectionStartLength;return e>this._terminal.cols?[e%this._terminal.cols,this.selectionStart[1]+Math.floor(e/this._terminal.cols)]:[e,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd},enumerable:!0,configurable:!0}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();t.SelectionModel=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(85),i=r(37),o=r(122),s=r(121),a=r(23),l=r(14),c=String.fromCharCode(160),h=new RegExp(c,"g"),u=function(){function e(e,t){this._terminal=e,this._charMeasure=t,this._enabled=!0,this._workCell=new a.CellData,this._onLinuxMouseSelection=new l.EventEmitter2,this._onRedrawRequest=new l.EventEmitter2,this._onSelectionChange=new l.EventEmitter2,this._initListeners(),this.enable(),this._model=new o.SelectionModel(e),this._activeSelectionMode=0}return Object.defineProperty(e.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onRedrawRequest",{get:function(){return this._onRedrawRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._removeMouseDownListeners()},Object.defineProperty(e.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0}),e.prototype._initListeners=function(){var e=this;this._mouseMoveListener=function(t){return e._onMouseMove(t)},this._mouseUpListener=function(t){return e._onMouseUp(t)},this.initBuffersListeners()},e.prototype.initBuffersListeners=function(){var e=this;this._trimListener=this._terminal.buffer.lines.onTrim(function(t){return e._onTrim(t)}),this._terminal.buffers.onBufferActivate(function(t){return e._onBufferActivate(t)})},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 e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t)&&(e[0]!==t[0]||e[1]!==t[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var r=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var n=e[1];n<=t[1];n++){var o=this._buffer.translateBufferLineToString(n,!0,e[0],t[0]);r.push(o)}}else{var s=e[1]===t[1]?t[0]:void 0;r.push(this._buffer.translateBufferLineToString(e[1],!0,e[0],s));for(n=e[1]+1;n<=t[1]-1;n++){var a=this._buffer.lines.get(n);o=this._buffer.translateBufferLineToString(n,!0);a.isWrapped?r[r.length-1]+=o:r.push(o)}if(e[1]!==t[1]){a=this._buffer.lines.get(t[1]),o=this._buffer.translateBufferLineToString(t[1],!0,0,t[0]);a.isWrapped?r[r.length-1]+=o:r.push(o)}}return r.map(function(e){return e.replace(h," ")}).join(i.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),e.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh()},e.prototype.refresh=function(e){var t=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return t._refresh()})),i.isLinux&&e)&&(this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText))},e.prototype._refresh=function(){this._refreshAnimationFrame=null,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},e.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!(!r||!n)&&this._areCoordsInSelection(t,r,n)},e.prototype._areCoordsInSelection=function(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]},e.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=null,this.refresh(!0))},e.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},e.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._terminal.cols,t],this.refresh(),this._onSelectionChange.fire()},e.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},e.prototype._getMouseBufferCoords=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);return t?(t[0]--,t[1]--,t[1]+=this._terminal.buffer.ydisp,t):null},e.prototype._getMouseEventScrollAmount=function(e){var t=n.MouseHelper.getCoordsRelativeToElement(e,this._terminal.screenElement)[1],r=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},e.prototype.shouldForceSelection=function(e){return i.isMac?e.altKey&&this._terminal.options.macOptionClickForcesSelection:e.shiftKey},e.prototype.onMouseDown=function(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}},e.prototype._addMouseDownListeners=function(){var e=this;this._terminal.element.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.addEventListener("mouseup",this._mouseUpListener),this._dragScrollIntervalTimer=setInterval(function(){return e._dragScroll()},50)},e.prototype._removeMouseDownListeners=function(){this._terminal.element.ownerDocument&&(this._terminal.element.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=null},e.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},e.prototype._onSingleClick=function(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart){this._model.selectionEnd=null;var t=this._buffer.lines.get(this._model.selectionStart[1]);t&&(t.length>=this._model.selectionStart[0]||0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++)}},e.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},e.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},e.prototype.shouldColumnSelect=function(e){return e.altKey&&!(i.isMac&&this._terminal.options.macOptionClickForcesSelection)},e.prototype._onMouseMove=function(e){e.stopImmediatePropagation();var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd?(2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._terminal.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._terminal.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0)),this._model.selectionEnd[1]<this._buffer.lines.length&&0===this._buffer.lines.get(this._model.selectionEnd[1]).hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++,t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)):this.refresh(!0)},e.prototype._dragScroll=function(){this._dragScrollAmount&&(this._terminal.scrollLines(this._dragScrollAmount,!1),this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._terminal.cols),this._model.selectionEnd[1]=Math.min(this._terminal.buffer.ydisp+this._terminal.rows,this._terminal.buffer.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=this._terminal.buffer.ydisp),this.refresh())},e.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500?new s.AltClickHandler(e,this._terminal).move():this.hasSelection&&this._onSelectionChange.fire()},e.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener&&this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(function(e){return t._onTrim(e)})},e.prototype._convertViewportColToCharacterIndex=function(e,t){for(var r=t[0],n=0;t[0]>=n;n++){var i=e.loadCell(n,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:i>1&&t[0]!==n&&(r+=i-1)}return r},e.prototype.setSelection=function(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh()},e.prototype._getWordAt=function(e,t,r,n){if(void 0===r&&(r=!0),void 0===n&&(n=!0),e[0]>=this._terminal.cols)return null;var i=this._buffer.lines.get(e[1]);if(!i)return null;var o=this._buffer.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(i,e),a=s,l=e[0]-s,c=0,h=0,u=0,f=0;if(" "===o.charAt(s)){for(;s>0&&" "===o.charAt(s-1);)s--;for(;a<o.length&&" "===o.charAt(a+1);)a++}else{var _=e[0],d=e[0];0===i.getWidth(_)&&(c++,_--),2===i.getWidth(d)&&(h++,d++);var p=i.getString(d).length;for(p>1&&(f+=p-1,a+=p-1);_>0&&s>0&&!this._isCharWordSeparator(i.loadCell(_-1,this._workCell));){i.loadCell(_-1,this._workCell);var y=this._workCell.getChars().length;0===this._workCell.getWidth()?(c++,_--):y>1&&(u+=y-1,s-=y-1),s--,_--}for(;d<i.length&&a+1<o.length&&!this._isCharWordSeparator(i.loadCell(d+1,this._workCell));){i.loadCell(d+1,this._workCell);var m=this._workCell.getChars().length;2===this._workCell.getWidth()?(h++,d++):m>1&&(f+=m-1,a+=m-1),a++,d++}}a++;var g=s+l-c+u,v=Math.min(this._terminal.cols,a-s+c+h-u-f);if(!t&&""===o.slice(s,a).trim())return null;if(r&&0===g&&32!==i.getCodePoint(0)){var b=this._buffer.lines.get(e[1]-1);if(b&&i.isWrapped&&32!==b.getCodePoint(this._terminal.cols-1)){var C=this._getWordAt([this._terminal.cols-1,e[1]-1],!1,!0,!1);if(C){var w=this._terminal.cols-C.start;g-=w,v+=w}}}if(n&&g+v===this._terminal.cols&&32!==i.getCodePoint(this._terminal.cols-1)){var S=this._buffer.lines.get(e[1]+1);if(S&&S.isWrapped&&32!==S.getCodePoint(0)){var E=this._getWordAt([0,e[1]+1],!1,!1,!0);E&&(v+=E.length)}}return{start:g,length:v}},e.prototype._selectWordAt=function(e,t){var r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._terminal.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}},e.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var r=e[1];t.start<0;)t.start+=this._terminal.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._terminal.cols;)t.length-=this._terminal.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}},e.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&" ()[]{}'\"".indexOf(e.getChars())>=0},e.prototype._selectLineAt=function(e){var t=this._buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._terminal.cols,t.last],this._model.selectionStartLength=0},e}();t.SelectionManager=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(86),i=r(91),o=r(14),s=function(){function e(e){this._terminal=e,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onLinkHover=new o.EventEmitter2,this._onLinkLeave=new o.EventEmitter2,this._onLinkTooltip=new o.EventEmitter2,this._rowsToLinkify={start:null,end:null}}return Object.defineProperty(e.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0}),e.prototype.attachToDom=function(e){this._mouseZoneManager=e},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<this._linkMatchers.length;a++)this._doLinkifyRow(s.range.first,s.content,this._linkMatchers[a]);this._rowsToLinkify.start=null,this._rowsToLinkify.end=null}},e.prototype.registerLinkMatcher=function(e,t,r){if(void 0===r&&(r={}),!t)throw new Error("handler must be defined");var n={id:this._nextLinkMatcherId++,regex:e,handler:t,matchIndex:r.matchIndex,validationCallback:r.validationCallback,hoverTooltipCallback:r.tooltipCallback,hoverLeaveCallback:r.leaveCallback,willLinkActivate:r.willLinkActivate,priority:r.priority||0};return this._addLinkMatcherToList(n),n.id},e.prototype._addLinkMatcherToList=function(e){if(0!==this._linkMatchers.length){for(var t=this._linkMatchers.length-1;t>=0;t--)if(e.priority<=this._linkMatchers[t].priority)return void this._linkMatchers.splice(t+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},e.prototype.deregisterLinkMatcher=function(e){for(var t=0;t<this._linkMatchers.length;t++)if(this._linkMatchers[t].id===e)return this._linkMatchers.splice(t,1),!0;return!1},e.prototype._doLinkifyRow=function(e,t,r){for(var n,i=this,o=new RegExp(r.regex.source,r.regex.flags+"g"),s=-1,a=function(){var a=n["number"!=typeof r.matchIndex?0:r.matchIndex];if(!a){if(l._terminal.debug)throw console.log({match:n,matcher:r}),new Error("match found without corresponding matchIndex");return"break"}if(s=t.indexOf(a,s+1),o.lastIndex=s+a.length,s<0)return"break";var c=l._terminal.buffer.stringIndexToBufferIndex(e,s);if(c[0]<0)return"break";var h,u=l._terminal.buffer.lines.get(c[0]).getFg(c[1]);u&&(h=u>>9&511),r.validationCallback?r.validationCallback(a,function(e){i._rowsTimeoutId||e&&i._addLink(c[1],c[0]-i._terminal.buffer.ydisp,a,r,h)}):l._addLink(c[1],c[0]-l._terminal.buffer.ydisp,a,r,h)},l=this;null!==(n=o.exec(t));){if("break"===a())break}},e.prototype._addLink=function(e,t,r,o,s){var a=this,l=i.getStringCellWidth(r),c=e%this._terminal.cols,h=t+Math.floor(e/this._terminal.cols),u=(c+l)%this._terminal.cols,f=h+Math.floor((c+l)/this._terminal.cols);0===u&&(u=this._terminal.cols,f--),this._mouseZoneManager.add(new n.MouseZone(c+1,h+1,u+1,f+1,function(e){if(o.handler)return o.handler(e,r);window.open(r,"_blank")},function(){a._onLinkHover.fire(a._createLinkHoverEvent(c,h,u,f,s)),a._terminal.element.classList.add("xterm-cursor-pointer")},function(e){a._onLinkTooltip.fire(a._createLinkHoverEvent(c,h,u,f,s)),o.hoverTooltipCallback&&o.hoverTooltipCallback(e,r)},function(){a._onLinkLeave.fire(a._createLinkHoverEvent(c,h,u,f,s)),a._terminal.element.classList.remove("xterm-cursor-pointer"),o.hoverLeaveCallback&&o.hoverLeaveCallback()},function(e){return!o.willLinkActivate||o.willLinkActivate(e,r)}))},e.prototype._createLinkHoverEvent=function(e,t,r,n,i){return{x1:e,y1:t,x2:r,y2:n,cols:this._terminal.cols,fg:i}},e.TIME_BEFORE_LINKIFY=200,e.OVERSCAN_CHAR_LIMIT=2e3,e}();t.Linkifier=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(47),s=r(17),a=r(64),l=function(e){function t(t,r,n,i){var o=e.call(this,t,"link",r,!0,n)||this;return o._state=null,i.linkifier.onLinkHover(function(e){return o._onLinkHover(e)}),i.linkifier.onLinkLeave(function(e){return o._onLinkLeave(e)}),o}return i(t,e),t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this._state=null},t.prototype.reset=function(e){this._clearCurrentLink()},t.prototype._clearCurrentLink=function(){if(this._state){this.clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var e=this._state.y2-this._state.y1-1;e>0&&this.clearCells(0,this._state.y1+1,this._state.cols,e),this.clearCells(0,this._state.y2,this._state.x2,1),this._state=null}},t.prototype._onLinkHover=function(e){if(e.fg===s.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:a.is256Color(e.fg)?this._ctx.fillStyle=this._colors.ansi[e.fg].css:this._ctx.fillStyle=this._colors.foreground.css,e.y1===e.y2)this.fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this.fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t<e.y2;t++)this.fillBottomLineAtCells(0,t,e.cols);this.fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e},t.prototype._onLinkLeave=function(e){this._clearCurrentLink()},t}(o.BaseRenderLayer);t.LinkRenderLayer=l},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(47),s=r(23),a=function(e){function t(t,r,n){var i=e.call(this,t,"cursor",r,!0,n)||this;return i._cell=new s.CellData,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(t,e),t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this._state={x:null,y:null,isFocused:null,style:null,width:null}},t.prototype.reset=function(e){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null,this.onOptionsChanged(e))},t.prototype.onBlur=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),e.refresh(e.buffer.y,e.buffer.y)},t.prototype.onFocus=function(e){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(e):e.refresh(e.buffer.y,e.buffer.y)},t.prototype.onOptionsChanged=function(e){var t=this;e.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new l(e,function(){t._render(e,!0)})):(this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null),e.refresh(e.buffer.y,e.buffer.y))},t.prototype.onCursorMove=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype.onGridChanged=function(e,t,r){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(e,!1):this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype._render=function(e,t){if(e.cursorState&&!e.cursorHidden){var r=e.buffer.ybase+e.buffer.y,n=r-e.buffer.ydisp;if(n<0||n>=e.rows)this._clearCursor();else if(e.buffer.lines.get(r).loadCell(e.buffer.x,this._cell),void 0!==this._cell.content){if(!e.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(e,e.buffer.x,n,this._cell),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=n,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,void(this._state.width=this._cell.getWidth());if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===e.buffer.x&&this._state.y===n&&this._state.isFocused===e.isFocused&&this._state.style===e.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[e.options.cursorStyle||"block"](e,e.buffer.x,n,this._cell),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=n,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}else this._clearCursor()},t.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})},t.prototype._renderBarCursor=function(e,t,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(t,r),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(t,r,n.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(e,n,t,r),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(t,r),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,r,n){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(t,r,n.getWidth(),1),this._ctx.restore()},t}(o.BaseRenderLayer);t.CursorRenderLayer=a;var l=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e.isFocused&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),e.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)},e.prototype.restartBlinkAnimation=function(e){var t=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=null,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null}),t._blinkInterval=setInterval(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=null,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})},600)},e)},e.prototype.pause=function(){this.isCursorVisible=!0,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)},e.prototype.resume=function(e){this._animationTimeRestarted=null,this._restartInterval(),this.restartBlinkAnimation(e)},e}()},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r,n){var i=e.call(this,t,"selection",r,!0,n)||this;return i._clearState(),i}return i(t,e),t.prototype._clearState=function(){this._state={start:null,end:null,columnSelectMode:null,ydisp:null}},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this._clearState()},t.prototype.reset=function(e){this._state.start&&this._state.end&&(this._clearState(),this.clearAll())},t.prototype.onSelectionChanged=function(e,t,r,n){if(this._didStateChange(t,r,n,e.buffer.ydisp))if(this.clearAll(),t&&r){var i=t[1]-e.buffer.ydisp,o=r[1]-e.buffer.ydisp,s=Math.max(i,0),a=Math.min(o,e.rows-1);if(!(s>=e.rows||a<0)){if(this._ctx.fillStyle=this._colors.selection.css,n){var l=t[0],c=r[0]-l,h=a-s+1;this.fillCells(l,s,c,h)}else{l=i===s?t[0]:0;var u=s===a?r[0]:e.cols;this.fillCells(l,s,u-l,1);var f=Math.max(a-s-1,0);if(this.fillCells(0,s+1,e.cols,f),s!==a){var _=o===a?r[0]:e.cols;this.fillCells(0,a,_,1)}}this._state.start=[t[0],t[1]],this._state.end=[r[0],r[1]],this._state.columnSelectMode=n,this._state.ydisp=e.buffer.ydisp}}else this._clearState()},t.prototype._didStateChange=function(e,t,r,n){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||r!==this._state.columnSelectMode||n!==this._state.ydisp},t.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&(e[0]===t[0]&&e[1]===t[1])},t}(r(47).BaseRenderLayer);t.SelectionRenderLayer=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(17),s=r(88),a=r(63),l=r(64),c=function(e){function t(t,r){var n=e.call(this)||this;return n._document=t,n._config=r,n._canvasFactory=function(e,t){var r=n._document.createElement("canvas");return r.width=e,r.height=t,r},n}return i(t,e),t.prototype._doWarmUp=function(){var e=this,t=s.generateStaticCharAtlasTexture(window,this._canvasFactory,this._config);t instanceof HTMLCanvasElement?this._texture=t:t.then(function(t){e._texture=t})},t.prototype._isCached=function(e,t){var r=e.code<256,n=e.fg<16,i=e.fg===o.DEFAULT_COLOR,s=e.bg===o.DEFAULT_COLOR;return r&&(n||i)&&s&&!e.italic},t.prototype.draw=function(e,t,r,n){if(null===this._texture||void 0===this._texture)return!1;var i=0;if(l.is256Color(t.fg)?i=2+t.fg+(t.bold?16:0):t.fg===o.DEFAULT_COLOR&&t.bold&&(i=1),!this._isCached(t,i))return!1;e.save();var s=this._config.scaledCharWidth+o.CHAR_ATLAS_CELL_SPACING,a=this._config.scaledCharHeight+o.CHAR_ATLAS_CELL_SPACING;return t.dim&&(e.globalAlpha=o.DIM_OPACITY),e.drawImage(this._texture,t.code*s,i*a,s,this._config.scaledCharHeight,r,n,s,this._config.scaledCharHeight),e.restore(),!0},t}(a.default);t.default=c},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.draw=function(e,t,r,n){return!1},t}(r(63).default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.capacity=e,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return e.prototype._unlinkNode=function(e){var t=e.prev,r=e.next;e===this._head&&(this._head=r),e===this._tail&&(this._tail=t),null!==t&&(t.next=r),null!==r&&(r.prev=t)},e.prototype._appendNode=function(e){var t=this._tail;null!==t&&(t.next=e),e.prev=t,e.next=null,this._tail=e,null===this._head&&(this._head=e)},e.prototype.prealloc=function(e){for(var t=this._nodePool,r=0;r<e;r++)t.push({prev:null,next:null,key:null,value:null})},e.prototype.get=function(e){var t=this._map[e];return void 0!==t?(this._unlinkNode(t),this._appendNode(t),t.value):null},e.prototype.peekValue=function(e){var t=this._map[e];return void 0!==t?t.value:null},e.prototype.peek=function(){var e=this._head;return null===e?null:e.value},e.prototype.set=function(e,t){var r=this._map[e];if(void 0!==r)r=this._map[e],this._unlinkNode(r),r.value=t;else if(this.size>=this.capacity)r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=e,r.value=t,this._map[e]=r;else{var n=this._nodePool;n.length>0?((r=n.pop()).key=e,r.value=t):r={prev:null,next:null,key:e,value:t},this._map[e]=r,this.size++}this._appendNode(r)},e}();t.default=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(17),s=r(63),a=r(62),l=r(88),c=r(130),h=r(37),u=1024,f=1024,_={css:"rgba(0, 0, 0, 0)",rgba:0};function d(e){return e.code<<21|e.bg<<12|e.fg<<3|(e.bold?0:4)+(e.dim?0:2)+(e.italic?0:1)}t.getGlyphCacheKey=d;var p=function(e){function t(t,r){var n=e.call(this)||this;n._config=r,n._drawToCacheCount=0,n._glyphsWaitingOnBitmap=[],n._bitmapCommitTimeout=null,n._bitmap=null,n._cacheCanvas=t.createElement("canvas"),n._cacheCanvas.width=u,n._cacheCanvas.height=f,n._cacheCtx=n._cacheCanvas.getContext("2d",{alpha:!0});var i=t.createElement("canvas");i.width=n._config.scaledCharWidth,i.height=n._config.scaledCharHeight,n._tmpCtx=i.getContext("2d",{alpha:n._config.allowTransparency}),n._width=Math.floor(u/n._config.scaledCharWidth),n._height=Math.floor(f/n._config.scaledCharHeight);var o=n._width*n._height;return n._cacheMap=new c.default(o),n._cacheMap.prealloc(o),n}return i(t,e),t.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},t.prototype.beginFrame=function(){this._drawToCacheCount=0},t.prototype.draw=function(e,t,r,n){if(32===t.code)return!0;if(!this._canCache(t))return!1;var i=d(t),o=this._cacheMap.get(i);if(null!==o&&void 0!==o)return this._drawFromCache(e,o,r,n),!0;if(this._drawToCacheCount<100){var s=void 0;s=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var a=this._drawToCache(t,s);return this._cacheMap.set(i,a),this._drawFromCache(e,a,r,n),!0}return!1},t.prototype._canCache=function(e){return e.code<256},t.prototype._toCoordinateX=function(e){return e%this._width*this._config.scaledCharWidth},t.prototype._toCoordinateY=function(e){return Math.floor(e/this._width)*this._config.scaledCharHeight},t.prototype._drawFromCache=function(e,t,r,n){if(!t.isEmpty){var i=this._toCoordinateX(t.index),o=this._toCoordinateY(t.index);e.drawImage(t.inBitmap?this._bitmap:this._cacheCanvas,i,o,this._config.scaledCharWidth,this._config.scaledCharHeight,r,n,this._config.scaledCharWidth,this._config.scaledCharHeight)}},t.prototype._getColorFromAnsiIndex=function(e){return e<this._config.colors.ansi.length?this._config.colors.ansi[e]:a.DEFAULT_ANSI_COLORS[e]},t.prototype._getBackgroundColor=function(e){return this._config.allowTransparency?_:e.bg===o.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:e.bg<256?this._getColorFromAnsiIndex(e.bg):this._config.colors.background},t.prototype._getForegroundColor=function(e){return e.fg===o.INVERTED_DEFAULT_COLOR?this._config.colors.background:e.fg<256?this._getColorFromAnsiIndex(e.fg):this._config.colors.foreground},t.prototype._drawToCache=function(e,t){this._drawToCacheCount++,this._tmpCtx.save();var r=this._getBackgroundColor(e);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=r.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var n=e.bold?this._config.fontWeightBold:this._config.fontWeight,i=e.italic?"italic":"";this._tmpCtx.font=i+" "+n+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(e).css,e.dim&&(this._tmpCtx.globalAlpha=o.DIM_OPACITY),this._tmpCtx.fillText(e.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var s=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),a=!1;this._config.allowTransparency||(a=l.clearColor(s,r));var c=this._toCoordinateX(t),h=this._toCoordinateY(t);this._cacheCtx.putImageData(s,c,h);var u={index:t,isEmpty:a,inBitmap:!1};return this._addGlyphToBitmap(u),u},t.prototype._addGlyphToBitmap=function(e){var t=this;"createImageBitmap"in window&&!h.isFirefox&&!h.isSafari&&(this._glyphsWaitingOnBitmap.push(e),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout(function(){return t._generateBitmap()},100)))},t.prototype._generateBitmap=function(){var e=this,t=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(r){e._bitmap=r;for(var n=0;n<t.length;n++){t[n].inBitmap=!0}}),this._bitmapCommitTimeout=null},t}(s.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.cache=[]}return e.prototype.resize=function(e,t){for(var r=0;r<e;r++){this.cache.length<=r&&this.cache.push([]);for(var n=this.cache[r].length;n<t;n++)this.cache[r].push(null);this.cache[r].length=t}this.cache.length=e},e.prototype.clear=function(){for(var e=0;e<this.cache.length;e++)for(var t=0;t<this.cache[e].length;t++)this.cache[e][t]=null},e}();t.GridCache=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(18),s=r(132),a=r(47),l=r(23),c=r(61),h=function(e){function t(t,r,n,i,o){var a=e.call(this,t,"text",r,o,n)||this;return a._characterOverlapCache={},a._workCell=new l.CellData,a._state=new s.GridCache,a._characterJoinerRegistry=i,a}return i(t,e),t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r);var n=this._getFont(t,!1,!1);this._characterWidth===r.scaledCharWidth&&this._characterFont===n||(this._characterWidth=r.scaledCharWidth,this._characterFont=n,this._characterOverlapCache={}),this._state.clear(),this._state.resize(t.cols,t.rows)},t.prototype.reset=function(e){this._state.clear(),this.clearAll()},t.prototype._forEachCell=function(e,t,r,n,i){for(var s=t;s<=r;s++)for(var a=s+e.buffer.ydisp,l=e.buffer.lines.get(a),h=n?n.getJoinedCharacters(a):[],u=0;u<e.cols;u++){l.loadCell(u,this._workCell);var f=this._workCell,_=!1,d=u;if(0!==f.getWidth()){if(h.length>0&&u===h[0][0]){_=!0;var p=h.shift();f=new c.JoinedCellData(this._workCell,l.translateToString(!0,p[0],p[1]),p[1]-p[0]),d=p[1]-1}!_&&this._isOverlapping(f)&&d<l.length-1&&l.getCodePoint(d+1)===o.NULL_CELL_CODE&&(f.content&=-12582913,f.content|=2<<22),i(f,u,s),u=d}}},t.prototype._drawBackground=function(e,t,r){var n=this,i=this._ctx,o=e.cols,s=0,a=0,c=null;i.save(),this._forEachCell(e,t,r,null,function(e,t,r){var h=null;e.isInverse()?h=e.isFgDefault()?n._colors.foreground.css:e.isFgRGB()?"rgb("+l.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":n._colors.ansi[e.getFgColor()].css:e.isBgRGB()?h="rgb("+l.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":e.isBgPalette()&&(h=n._colors.ansi[e.getBgColor()].css),null===c&&(s=t,a=r),r!==a?(i.fillStyle=c,n.fillCells(s,a,o-s,1),s=t,a=r):c!==h&&(i.fillStyle=c,n.fillCells(s,a,t-s,1),s=t,a=r),c=h}),null!==c&&(i.fillStyle=c,this.fillCells(s,a,o-s,1)),i.restore()},t.prototype._drawForeground=function(e,t,r){var n=this;this._forEachCell(e,t,r,this._characterJoinerRegistry,function(t,r,i){if(!t.isInvisible()){if(t.isUnderline()){if(n._ctx.save(),t.isInverse())t.isBgDefault()?n._ctx.fillStyle=n._colors.background.css:t.isBgRGB()?n._ctx.fillStyle="rgb("+l.AttributeData.toColorRGB(t.getBgColor()).join(",")+")":n._ctx.fillStyle=n._colors.ansi[t.getBgColor()].css;else if(t.isFgDefault())n._ctx.fillStyle=n._colors.foreground.css;else if(t.isFgRGB())n._ctx.fillStyle="rgb("+l.AttributeData.toColorRGB(t.getFgColor()).join(",")+")";else{var o=t.getFgColor();e.options.drawBoldTextInBrightColors&&t.isBold()&&o<8&&(o+=8),n._ctx.fillStyle=n._colors.ansi[o].css}n.fillBottomLineAtCells(r,i,t.getWidth()),n._ctx.restore()}n.drawChars(e,t,r,i)}})},t.prototype.onGridChanged=function(e,t,r){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this.clearCells(0,t,e.cols,r-t+1),this._drawBackground(e,t,r),this._drawForeground(e,t,r))},t.prototype.onOptionsChanged=function(e){this.setTransparency(e,e.options.allowTransparency)},t.prototype._isOverlapping=function(e){if(1!==e.getWidth())return!1;if(e.getCode()<256)return!1;var t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;var r=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=r,r},t}(a.BaseRenderLayer);t.TextRenderLayer=h},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(133),s=r(127),a=r(126),l=r(62),c=r(125),h=r(60),u=r(87),f=r(61),_=r(14),d=function(e){function t(t,r){var n=e.call(this)||this;n._terminal=t,n._isPaused=!1,n._needsFullRefresh=!1,n._onCanvasResize=new _.EventEmitter2,n._onRender=new _.EventEmitter2;var i=n._terminal.options.allowTransparency;if(n.colorManager=new l.ColorManager(document,i),n._characterJoinerRegistry=new f.CharacterJoinerRegistry(t),r&&n.colorManager.setTheme(r),n._renderLayers=[new o.TextRenderLayer(n._terminal.screenElement,0,n.colorManager.colors,n._characterJoinerRegistry,i),new s.SelectionRenderLayer(n._terminal.screenElement,1,n.colorManager.colors),new c.LinkRenderLayer(n._terminal.screenElement,2,n.colorManager.colors,n._terminal),new a.CursorRenderLayer(n._terminal.screenElement,3,n.colorManager.colors)],n.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},n._devicePixelRatio=window.devicePixelRatio,n._updateDimensions(),n.onOptionsChanged(),n._renderDebouncer=new h.RenderDebouncer(n._renderRows.bind(n)),n._screenDprMonitor=new u.ScreenDprMonitor,n._screenDprMonitor.setListener(function(){return n.onWindowResize(window.devicePixelRatio)}),n.register(n._screenDprMonitor),"IntersectionObserver"in window){var d=new IntersectionObserver(function(e){return n.onIntersectionChange(e[e.length-1])},{threshold:0});d.observe(n._terminal.element),n.register({dispose:function(){return d.disconnect()}})}return n}return i(t,e),Object.defineProperty(t.prototype,"onCanvasResize",{get:function(){return this._onCanvasResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._renderLayers.forEach(function(e){return e.dispose()})},t.prototype.onIntersectionChange=function(e){this._isPaused=0===e.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&(this._terminal.refresh(0,this._terminal.rows-1),this._needsFullRefresh=!1)},t.prototype.onWindowResize=function(e){this._devicePixelRatio!==e&&(this._devicePixelRatio=e,this.onResize(this._terminal.cols,this._terminal.rows))},t.prototype.setTheme=function(e){var t=this;return this.colorManager.setTheme(e),this._renderLayers.forEach(function(e){e.onThemeChanged(t._terminal,t.colorManager.colors),e.reset(t._terminal)}),this._isPaused?this._needsFullRefresh=!0:this._terminal.refresh(0,this._terminal.rows-1),this.colorManager.colors},t.prototype.onResize=function(e,t){var r=this;this._updateDimensions(),this._renderLayers.forEach(function(e){return e.resize(r._terminal,r.dimensions)}),this._isPaused?this._needsFullRefresh=!0:this._terminal.refresh(0,this._terminal.rows-1),this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px",this._onCanvasResize.fire({width:this.dimensions.canvasWidth,height:this.dimensions.canvasHeight})},t.prototype.onCharSizeChanged=function(){this.onResize(this._terminal.cols,this._terminal.rows)},t.prototype.onBlur=function(){var e=this;this._runOperation(function(t){return t.onBlur(e._terminal)})},t.prototype.onFocus=function(){var e=this;this._runOperation(function(t){return t.onFocus(e._terminal)})},t.prototype.onSelectionChanged=function(e,t,r){var n=this;void 0===r&&(r=!1),this._runOperation(function(i){return i.onSelectionChanged(n._terminal,e,t,r)})},t.prototype.onCursorMove=function(){var e=this;this._runOperation(function(t){return t.onCursorMove(e._terminal)})},t.prototype.onOptionsChanged=function(){var e=this;this.colorManager.allowTransparency=this._terminal.options.allowTransparency,this._runOperation(function(t){return t.onOptionsChanged(e._terminal)})},t.prototype.clear=function(){var e=this;this._runOperation(function(t){return t.reset(e._terminal)})},t.prototype._runOperation=function(e){this._isPaused?this._needsFullRefresh=!0:this._renderLayers.forEach(function(t){return e(t)})},t.prototype.refreshRows=function(e,t){this._isPaused?this._needsFullRefresh=!0:this._renderDebouncer.refresh(e,t,this._terminal.rows)},t.prototype._renderRows=function(e,t){var r=this;this._renderLayers.forEach(function(n){return n.onGridChanged(r._terminal,e,t)}),this._onRender.fire({start:e,end:t})},t.prototype._updateDimensions=function(){this._terminal.charMeasure.width&&this._terminal.charMeasure.height&&(this.dimensions.scaledCharWidth=Math.floor(this._terminal.charMeasure.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=1===this._terminal.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols)},t.prototype.registerCharacterJoiner=function(e){return this._characterJoinerRegistry.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._characterJoinerRegistry.deregisterCharacterJoiner(e)},t}(r(13).Disposable);t.Renderer=d},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(13),s=r(65);function a(e,t){for(var r=t-e,n=new Array(r);r--;)n[r]=--t;return n}var l=function(){function e(e){this.table="undefined"==typeof Uint8Array?new Array(e):new Uint8Array(e)}return e.prototype.add=function(e,t,r,n){this.table[t<<8|e]=(0|r)<<4|(void 0===n?t:n)},e.prototype.addMany=function(e,t,r,n){for(var i=0;i<e.length;i++)this.add(e[i],t,r,n)},e}();t.TransitionTable=l;var c=a(32,127),h=a(0,24);h.push(25),h.push.apply(h,a(28,32));t.VT500_TRANSITION_TABLE=function(){var e,t=new l(4095),r=a(0,14);for(e in r)for(var n=0;n<=160;++n)t.add(n,e,1,0);for(e in t.addMany(c,0,2,0),r)t.addMany([24,26,153,154],e,3,0),t.addMany(a(128,144),e,3,0),t.addMany(a(144,152),e,3,0),t.add(156,e,0,0),t.add(27,e,11,1),t.add(157,e,4,8),t.addMany([152,158,159],e,0,7),t.add(155,e,11,3),t.add(144,e,11,9);return t.addMany(h,0,3,0),t.addMany(h,1,3,1),t.add(127,1,0,1),t.addMany(h,8,0,8),t.addMany(h,3,3,3),t.add(127,3,0,3),t.addMany(h,4,3,4),t.add(127,4,0,4),t.addMany(h,6,3,6),t.addMany(h,5,3,5),t.add(127,5,0,5),t.addMany(h,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(c,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(a(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(c,7,0,7),t.addMany(h,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(a(64,127),3,7,0),t.addMany(a(48,58),3,8,4),t.add(59,3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(a(48,58),4,8,4),t.add(59,4,8,4),t.addMany(a(64,127),4,7,0),t.addMany([58,60,61,62,63],4,0,6),t.addMany(a(32,64),6,0,6),t.add(127,6,0,6),t.addMany(a(64,127),6,0,0),t.add(58,3,0,6),t.addMany(a(32,48),3,9,5),t.addMany(a(32,48),5,9,5),t.addMany(a(48,64),5,0,6),t.addMany(a(64,127),5,7,0),t.addMany(a(32,48),4,9,5),t.addMany(a(32,48),1,9,2),t.addMany(a(32,48),2,9,2),t.addMany(a(48,127),2,10,0),t.addMany(a(48,80),1,10,0),t.addMany(a(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(a(96,127),1,10,0),t.add(80,1,11,9),t.addMany(h,9,0,9),t.add(127,9,0,9),t.addMany(a(28,32),9,0,9),t.addMany(a(32,48),9,9,12),t.add(58,9,0,11),t.addMany(a(48,58),9,8,10),t.add(59,9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(h,11,0,11),t.addMany(a(32,128),11,0,11),t.addMany(a(28,32),11,0,11),t.addMany(h,10,0,10),t.add(127,10,0,10),t.addMany(a(28,32),10,0,10),t.addMany(a(48,58),10,8,10),t.add(59,10,8,10),t.addMany([58,60,61,62,63],10,0,11),t.addMany(a(32,48),10,9,12),t.addMany(h,12,0,12),t.add(127,12,0,12),t.addMany(a(28,32),12,0,12),t.addMany(a(32,48),12,9,12),t.addMany(a(48,64),12,0,11),t.addMany(a(64,127),12,12,13),t.addMany(a(64,127),10,12,13),t.addMany(a(64,127),9,12,13),t.addMany(h,13,13,13),t.addMany(c,13,13,13),t.add(127,13,0,13),t.addMany([27,156],13,14,0),t.add(160,8,5,8),t}();var u=function(){function e(){}return e.prototype.hook=function(e,t,r){},e.prototype.put=function(e,t,r){},e.prototype.unhook=function(){},e}(),f=function(e){function r(r){void 0===r&&(r=t.VT500_TRANSITION_TABLE);var n=e.call(this)||this;return n.TRANSITIONS=r,n.initialState=0,n.currentState=n.initialState,n._osc="",n._params=[0],n._collect="",n._printHandlerFb=function(e,t,r){},n._executeHandlerFb=function(e){},n._csiHandlerFb=function(e,t,r){},n._escHandlerFb=function(e,t){},n._oscHandlerFb=function(e,t){},n._dcsHandlerFb=new u,n._errorHandlerFb=function(e){return e},n._printHandler=n._printHandlerFb,n._executeHandlers=Object.create(null),n._csiHandlers=Object.create(null),n._escHandlers=Object.create(null),n._oscHandlers=Object.create(null),n._dcsHandlers=Object.create(null),n._activeDcsHandler=null,n._errorHandler=n._errorHandlerFb,n.setEscHandler("\\",function(){}),n}return i(r,e),r.prototype.dispose=function(){this._printHandlerFb=null,this._executeHandlerFb=null,this._csiHandlerFb=null,this._escHandlerFb=null,this._oscHandlerFb=null,this._dcsHandlerFb=null,this._errorHandlerFb=null,this._printHandler=null,this._executeHandlers=null,this._escHandlers=null,this._csiHandlers=null,this._oscHandlers=null,this._dcsHandlers=null,this._activeDcsHandler=null,this._errorHandler=null},r.prototype.setPrintHandler=function(e){this._printHandler=e},r.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},r.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},r.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},r.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},r.prototype.addCsiHandler=function(e,t){var r=e.charCodeAt(0);void 0===this._csiHandlers[r]&&(this._csiHandlers[r]=[]);var n=this._csiHandlers[r];return n.push(t),{dispose:function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}}},r.prototype.setCsiHandler=function(e,t){this._csiHandlers[e.charCodeAt(0)]=[t]},r.prototype.clearCsiHandler=function(e){this._csiHandlers[e.charCodeAt(0)]&&delete this._csiHandlers[e.charCodeAt(0)]},r.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},r.prototype.setEscHandler=function(e,t){this._escHandlers[e]=t},r.prototype.clearEscHandler=function(e){this._escHandlers[e]&&delete this._escHandlers[e]},r.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},r.prototype.addOscHandler=function(e,t){void 0===this._oscHandlers[e]&&(this._oscHandlers[e]=[]);var r=this._oscHandlers[e];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},r.prototype.setOscHandler=function(e,t){this._oscHandlers[e]=[t]},r.prototype.clearOscHandler=function(e){this._oscHandlers[e]&&delete this._oscHandlers[e]},r.prototype.setOscHandlerFallback=function(e){this._oscHandlerFb=e},r.prototype.setDcsHandler=function(e,t){this._dcsHandlers[e]=t},r.prototype.clearDcsHandler=function(e){this._dcsHandlers[e]&&delete this._dcsHandlers[e]},r.prototype.setDcsHandlerFallback=function(e){this._dcsHandlerFb=e},r.prototype.setErrorHandler=function(e){this._errorHandler=e},r.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},r.prototype.reset=function(){this.currentState=this.initialState,this._osc="",this._params=[0],this._collect="",this._activeDcsHandler=null},r.prototype.parse=function(e,t){for(var r=0,n=0,i=!1,o=this.currentState,a=-1,l=-1,c=this._osc,h=this._collect,u=this._params,f=this.TRANSITIONS.table,_=this._activeDcsHandler,d=null,p=0;p<t;++p)if(r=e[p],0===o&&r>31&&r<128){a=~a?a:p;do{p++}while(p<t&&e[p]>31&&e[p]<128);p--}else if(4===o&&r>47&&r<57)u[u.length-1]=10*u[u.length-1]+r-48;else{switch((n=f[o<<8|(r<160?r:160)])>>4){case 2:a=~a?a:p;break;case 3:~a&&(this._printHandler(e,a,p),a=-1),(d=this._executeHandlers[r])?d():this._executeHandlerFb(r);break;case 0:~a?(this._printHandler(e,a,p),a=-1):~l&&(_.put(e,l,p),l=-1);break;case 1:if(r>159)switch(o){case 0:a=~a?a:p;break;case 6:n|=6;break;case 11:n|=11;break;case 13:l=~l?l:p,n|=13;break;default:i=!0}else i=!0;if(i){if(this._errorHandler({position:p,code:r,currentState:o,print:a,dcs:l,osc:c,collect:h,params:u,abort:!1}).abort)return;i=!1}break;case 7:for(var y=this._csiHandlers[r],m=y?y.length-1:-1;m>=0&&!1===y[m](u,h);m--);m<0&&this._csiHandlerFb(h,u,r);break;case 8:59===r?u.push(0):u[u.length-1]=10*u[u.length-1]+r-48;break;case 9:h+=String.fromCharCode(r);break;case 10:(d=this._escHandlers[h+String.fromCharCode(r)])?d(h,r):this._escHandlerFb(h,r);break;case 11:~a&&(this._printHandler(e,a,p),a=-1),c="",u=[0],h="",l=-1;break;case 12:(_=this._dcsHandlers[h+String.fromCharCode(r)])||(_=this._dcsHandlerFb),_.hook(h,u,r);break;case 13:l=~l?l:p;break;case 14:_&&(~l&&_.put(e,l,p),_.unhook(),_=null),27===r&&(n|=1),c="",u=[0],h="",l=-1;break;case 4:~a&&(this._printHandler(e,a,p),a=-1),c="";break;case 5:for(var g=p+1;;g++)if(g>=t||(r=e[g])<32||r>127&&r<=159){c+=s.utf32ToString(e,p,g),p=g-1;break}break;case 6:if(c&&24!==r&&26!==r){var v=c.indexOf(";");if(-1===v)this._oscHandlerFb(-1,c);else{for(var b=parseInt(c.substring(0,v)),C=c.substring(v+1),w=this._oscHandlers[b],S=w?w.length-1:-1;S>=0&&!1===w[S](C);S--);S<0&&this._oscHandlerFb(b,C)}}27===r&&(n|=1),c="",u=[0],h="",l=-1}o=15&n}0===o&&~a?this._printHandler(e,a,t):13===o&&~l&&_&&_.put(e,l,t),this._osc=c,this._collect=h,this._params=u,this._activeDcsHandler=_,this.currentState=o},r}(o.Disposable);t.EscapeSequenceParser=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"\t",c:"\f",d:"\r",e:"\n",f:"°",g:"±",h:"␤",i:"\v",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=null,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(48),s=r(136),a=r(18),l=r(91),c=r(135),h=r(13),u=r(90),f=r(65),_=r(23),d=r(14),p={"(":0,")":1,"*":2,"+":3,"-":1,".":2},y=function(){function e(e){this._terminal=e,this._data=new Uint32Array(0)}return e.prototype.hook=function(e,t,r){this._data=new Uint32Array(0)},e.prototype.put=function(e,t,r){this._data=u.concat(this._data,e.subarray(t,r))},e.prototype.unhook=function(){var e=f.utf32ToString(this._data);switch(this._data=new Uint32Array(0),e){case'"q':return this._terminal.handler(o.C0.ESC+'P1$r0"q'+o.C0.ESC+"\\");case'"p':return this._terminal.handler(o.C0.ESC+'P1$r61"p'+o.C0.ESC+"\\");case"r":var t=this._terminal.buffer.scrollTop+1+";"+(this._terminal.buffer.scrollBottom+1)+"r";return this._terminal.handler(o.C0.ESC+"P1$r"+t+o.C0.ESC+"\\");case"m":return this._terminal.handler(o.C0.ESC+"P1$r0m"+o.C0.ESC+"\\");case" q":var r={block:2,underline:4,bar:6}[this._terminal.getOption("cursorStyle")];return r-=this._terminal.getOption("cursorBlink"),this._terminal.handler(o.C0.ESC+"P1$r"+r+" q"+o.C0.ESC+"\\");default:this._terminal.error("Unknown DCS $q %s",e),this._terminal.handler(o.C0.ESC+"P0$r"+o.C0.ESC+"\\")}},e}(),m=function(e){function t(t,r){void 0===r&&(r=new c.EscapeSequenceParser);var n=e.call(this)||this;n._terminal=t,n._parser=r,n._parseBuffer=new Uint32Array(4096),n._stringDecoder=new f.StringToUtf32,n._workCell=new _.CellData,n._onCursorMove=new d.EventEmitter2,n._onData=new d.EventEmitter2,n._onLineFeed=new d.EventEmitter2,n._onScroll=new d.EventEmitter2,n.register(n._parser),n._parser.setCsiHandlerFallback(function(e,t,r){n._terminal.error("Unknown CSI code: ",{collect:e,params:t,flag:String.fromCharCode(r)})}),n._parser.setEscHandlerFallback(function(e,t){n._terminal.error("Unknown ESC code: ",{collect:e,flag:String.fromCharCode(t)})}),n._parser.setExecuteHandlerFallback(function(e){n._terminal.error("Unknown EXECUTE code: ",{code:e})}),n._parser.setOscHandlerFallback(function(e,t){n._terminal.error("Unknown OSC code: ",{identifier:e,data:t})}),n._parser.setPrintHandler(function(e,t,r){return n.print(e,t,r)}),n._parser.setCsiHandler("@",function(e,t){return n.insertChars(e)}),n._parser.setCsiHandler("A",function(e,t){return n.cursorUp(e)}),n._parser.setCsiHandler("B",function(e,t){return n.cursorDown(e)}),n._parser.setCsiHandler("C",function(e,t){return n.cursorForward(e)}),n._parser.setCsiHandler("D",function(e,t){return n.cursorBackward(e)}),n._parser.setCsiHandler("E",function(e,t){return n.cursorNextLine(e)}),n._parser.setCsiHandler("F",function(e,t){return n.cursorPrecedingLine(e)}),n._parser.setCsiHandler("G",function(e,t){return n.cursorCharAbsolute(e)}),n._parser.setCsiHandler("H",function(e,t){return n.cursorPosition(e)}),n._parser.setCsiHandler("I",function(e,t){return n.cursorForwardTab(e)}),n._parser.setCsiHandler("J",function(e,t){return n.eraseInDisplay(e)}),n._parser.setCsiHandler("K",function(e,t){return n.eraseInLine(e)}),n._parser.setCsiHandler("L",function(e,t){return n.insertLines(e)}),n._parser.setCsiHandler("M",function(e,t){return n.deleteLines(e)}),n._parser.setCsiHandler("P",function(e,t){return n.deleteChars(e)}),n._parser.setCsiHandler("S",function(e,t){return n.scrollUp(e)}),n._parser.setCsiHandler("T",function(e,t){return n.scrollDown(e,t)}),n._parser.setCsiHandler("X",function(e,t){return n.eraseChars(e)}),n._parser.setCsiHandler("Z",function(e,t){return n.cursorBackwardTab(e)}),n._parser.setCsiHandler("`",function(e,t){return n.charPosAbsolute(e)}),n._parser.setCsiHandler("a",function(e,t){return n.hPositionRelative(e)}),n._parser.setCsiHandler("b",function(e,t){return n.repeatPrecedingCharacter(e)}),n._parser.setCsiHandler("c",function(e,t){return n.sendDeviceAttributes(e,t)}),n._parser.setCsiHandler("d",function(e,t){return n.linePosAbsolute(e)}),n._parser.setCsiHandler("e",function(e,t){return n.vPositionRelative(e)}),n._parser.setCsiHandler("f",function(e,t){return n.hVPosition(e)}),n._parser.setCsiHandler("g",function(e,t){return n.tabClear(e)}),n._parser.setCsiHandler("h",function(e,t){return n.setMode(e,t)}),n._parser.setCsiHandler("l",function(e,t){return n.resetMode(e,t)}),n._parser.setCsiHandler("m",function(e,t){return n.charAttributes(e)}),n._parser.setCsiHandler("n",function(e,t){return n.deviceStatus(e,t)}),n._parser.setCsiHandler("p",function(e,t){return n.softReset(e,t)}),n._parser.setCsiHandler("q",function(e,t){return n.setCursorStyle(e,t)}),n._parser.setCsiHandler("r",function(e,t){return n.setScrollRegion(e,t)}),n._parser.setCsiHandler("s",function(e,t){return n.saveCursor(e)}),n._parser.setCsiHandler("u",function(e,t){return n.restoreCursor(e)}),n._parser.setExecuteHandler(o.C0.BEL,function(){return n.bell()}),n._parser.setExecuteHandler(o.C0.LF,function(){return n.lineFeed()}),n._parser.setExecuteHandler(o.C0.VT,function(){return n.lineFeed()}),n._parser.setExecuteHandler(o.C0.FF,function(){return n.lineFeed()}),n._parser.setExecuteHandler(o.C0.CR,function(){return n.carriageReturn()}),n._parser.setExecuteHandler(o.C0.BS,function(){return n.backspace()}),n._parser.setExecuteHandler(o.C0.HT,function(){return n.tab()}),n._parser.setExecuteHandler(o.C0.SO,function(){return n.shiftOut()}),n._parser.setExecuteHandler(o.C0.SI,function(){return n.shiftIn()}),n._parser.setExecuteHandler(o.C1.IND,function(){return n.index()}),n._parser.setExecuteHandler(o.C1.NEL,function(){return n.nextLine()}),n._parser.setExecuteHandler(o.C1.HTS,function(){return n.tabSet()}),n._parser.setOscHandler(0,function(e){return n.setTitle(e)}),n._parser.setOscHandler(2,function(e){return n.setTitle(e)}),n._parser.setEscHandler("7",function(){return n.saveCursor([])}),n._parser.setEscHandler("8",function(){return n.restoreCursor([])}),n._parser.setEscHandler("D",function(){return n.index()}),n._parser.setEscHandler("E",function(){return n.nextLine()}),n._parser.setEscHandler("H",function(){return n.tabSet()}),n._parser.setEscHandler("M",function(){return n.reverseIndex()}),n._parser.setEscHandler("=",function(){return n.keypadApplicationMode()}),n._parser.setEscHandler(">",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(e){a._parser.setEscHandler("("+e,function(){return n.selectCharset("("+e)}),a._parser.setEscHandler(")"+e,function(){return n.selectCharset(")"+e)}),a._parser.setEscHandler("*"+e,function(){return n.selectCharset("*"+e)}),a._parser.setEscHandler("+"+e,function(){return n.selectCharset("+"+e)}),a._parser.setEscHandler("-"+e,function(){return n.selectCharset("-"+e)}),a._parser.setEscHandler("."+e,function(){return n.selectCharset("."+e)}),a._parser.setEscHandler("/"+e,function(){return n.selectCharset("/"+e)})},a=this;for(var l in s.CHARSETS)i(l);return n._parser.setErrorHandler(function(e){return n._terminal.error("Parsing error: ",e),e}),n._parser.setDcsHandler("$q",new y(n._terminal)),n}return i(t,e),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._terminal=null},t.prototype.parse=function(e){if(this._terminal){var t=this._terminal.buffer,r=t.x,n=t.y;this._terminal.debug&&this._terminal.log("data: "+e),this._parseBuffer.length<e.length&&(this._parseBuffer=new Uint32Array(e.length)),this._parser.parse(this._parseBuffer,this._stringDecoder.decode(e,this._parseBuffer)),(t=this._terminal.buffer).x===r&&t.y===n||this._onCursorMove.fire()}},t.prototype.print=function(e,t,r){var n,i,o=this._terminal.buffer,s=this._terminal.charset,c=this._terminal.options.screenReaderMode,h=this._terminal.cols,u=this._terminal.wraparoundMode,_=this._terminal.insertMode,d=this._terminal.curAttrData,p=o.lines.get(o.y+o.ybase);this._terminal.updateRange(o.y);for(var y=t;y<r;++y){if(n=e[y],i=l.wcwidth(n),n<127&&s){var m=s[String.fromCharCode(n)];m&&(n=m.charCodeAt(0))}if(c&&this._terminal.emit("a11y.char",f.stringFromCodePoint(n)),i||!o.x){if(o.x+i-1>=h)if(u)o.x=0,o.y++,o.y>o.scrollBottom?(o.y--,this._terminal.scroll(!0)):o.lines.get(o.y).isWrapped=!0,p=o.lines.get(o.y+o.ybase);else if(2===i)continue;if(_&&(p.insertCells(o.x,i,o.getNullCell(d)),2===p.getWidth(h-1)&&p.setCellFromCodePoint(h-1,a.NULL_CELL_CODE,a.NULL_CELL_WIDTH,d.fg,d.bg)),p.setCellFromCodePoint(o.x++,n,i,d.fg,d.bg),i>0)for(;--i;)p.setCellFromCodePoint(o.x++,0,0,d.fg,d.bg)}else p.getWidth(o.x-1)?p.addCodepointToCell(o.x-1,n):p.addCodepointToCell(o.x-2,n)}this._terminal.updateRange(o.y)},t.prototype.addCsiHandler=function(e,t){return this._parser.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._parser.addOscHandler(e,t)},t.prototype.bell=function(){this._terminal.bell()},t.prototype.lineFeed=function(){var e=this._terminal.buffer;this._terminal.options.convertEol&&(e.x=0),e.y++,e.y>e.scrollBottom&&(e.y--,this._terminal.scroll()),e.x>=this._terminal.cols&&e.x--,this._onLineFeed.fire()},t.prototype.carriageReturn=function(){this._terminal.buffer.x=0},t.prototype.backspace=function(){this._terminal.buffer.x>0&&this._terminal.buffer.x--},t.prototype.tab=function(){var e=this._terminal.buffer.x;this._terminal.buffer.x=this._terminal.buffer.nextStop(),this._terminal.options.screenReaderMode&&this._terminal.emit("a11y.tab",this._terminal.buffer.x-e)},t.prototype.shiftOut=function(){this._terminal.setgLevel(1)},t.prototype.shiftIn=function(){this._terminal.setgLevel(0)},t.prototype.insertChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).insertCells(this._terminal.buffer.x,e[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.cursorUp=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0)},t.prototype.cursorDown=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,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--},t.prototype.cursorForward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.cursorBackward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.buffer.x-=t,this._terminal.buffer.x<0&&(this._terminal.buffer.x=0)},t.prototype.cursorNextLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},t.prototype.cursorPrecedingLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},t.prototype.cursorCharAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1},t.prototype.cursorPosition=function(e){var t,r=e[0]-1;t=e.length>=2?e[1]-1:0,r<0?r=0:r>=this._terminal.rows&&(r=this._terminal.rows-1),t<0?t=0:t>=this._terminal.cols&&(t=this._terminal.cols-1),this._terminal.buffer.x=t,this._terminal.buffer.y=r},t.prototype.cursorForwardTab=function(e){for(var t=e[0]||1;t--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},t.prototype._eraseInBufferLine=function(e,t,r,n){void 0===n&&(n=!1);var i=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+e);i.replaceCells(t,r,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),n&&(i.isWrapped=!1)},t.prototype._resetBufferLine=function(e){this._eraseInBufferLine(e,0,this._terminal.cols,!0)},t.prototype.eraseInDisplay=function(e){var t;switch(e[0]){case 0:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);t<this._terminal.rows;t++)this._resetBufferLine(t);this._terminal.updateRange(t);break;case 1:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t,0,this._terminal.buffer.x+1,!0),this._terminal.buffer.x+1>=this._terminal.cols&&(this._terminal.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 2:for(t=this._terminal.rows,this._terminal.updateRange(t-1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 3:var r=this._terminal.buffer.lines.length-this._terminal.rows;r>0&&(this._terminal.buffer.lines.trimStart(r),this._terminal.buffer.ybase=Math.max(this._terminal.buffer.ybase-r,0),this._terminal.buffer.ydisp=Math.max(this._terminal.buffer.ydisp-r,0),this._onScroll.fire(0))}},t.prototype.eraseInLine=function(e){switch(e[0]){case 0:this._eraseInBufferLine(this._terminal.buffer.y,this._terminal.buffer.x,this._terminal.cols);break;case 1:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.buffer.x+1);break;case 2:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.cols)}this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.insertLines=function(e){var t=e[0];t<1&&(t=1);for(var r=this._terminal.buffer,n=r.y+r.ybase,i=this._terminal.rows-1-r.scrollBottom,o=this._terminal.rows-1+r.ybase-i+1;t--;)r.lines.splice(o-1,1),r.lines.splice(n,0,r.getBlankLine(this._terminal.eraseAttrData()));this._terminal.updateRange(r.y),this._terminal.updateRange(r.scrollBottom)},t.prototype.deleteLines=function(e){var t=e[0];t<1&&(t=1);var r,n=this._terminal.buffer,i=n.y+n.ybase;for(r=this._terminal.rows-1-n.scrollBottom,r=this._terminal.rows-1+n.ybase-r;t--;)n.lines.splice(i,1),n.lines.splice(r,0,n.getBlankLine(this._terminal.eraseAttrData()));this._terminal.updateRange(n.y),this._terminal.updateRange(n.scrollBottom)},t.prototype.deleteChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).deleteCells(this._terminal.buffer.x,e[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.scrollUp=function(e){for(var t=e[0]||1,r=this._terminal.buffer;t--;)r.lines.splice(r.ybase+r.scrollTop,1),r.lines.splice(r.ybase+r.scrollBottom,0,r.getBlankLine(a.DEFAULT_ATTR_DATA));this._terminal.updateRange(r.scrollTop),this._terminal.updateRange(r.scrollBottom)},t.prototype.scrollDown=function(e,t){if(e.length<2&&!t){for(var r=e[0]||1,n=this._terminal.buffer;r--;)n.lines.splice(n.ybase+n.scrollBottom,1),n.lines.splice(n.ybase+n.scrollTop,0,n.getBlankLine(a.DEFAULT_ATTR_DATA));this._terminal.updateRange(n.scrollTop),this._terminal.updateRange(n.scrollBottom)}},t.prototype.eraseChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).replaceCells(this._terminal.buffer.x,this._terminal.buffer.x+(e[0]||1),this._terminal.buffer.getNullCell(this._terminal.eraseAttrData()))},t.prototype.cursorBackwardTab=function(e){for(var t=e[0]||1,r=this._terminal.buffer;t--;)r.x=r.prevStop()},t.prototype.charPosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.hPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.repeatPrecedingCharacter=function(e){var t=this._terminal.buffer,r=t.lines.get(t.ybase+t.y);r.loadCell(t.x-1,this._workCell),r.replaceCells(t.x,t.x+(e[0]||1),void 0!==this._workCell.content?this._workCell:t.getNullCell(a.DEFAULT_ATTR_DATA))},t.prototype.sendDeviceAttributes=function(e,t){e[0]>0||(t?">"===t&&(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(e[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"))},t.prototype.linePosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y=t-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},t.prototype.vPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,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--},t.prototype.hVPosition=function(e){e[0]<1&&(e[0]=1),e[1]<1&&(e[1]=1),this._terminal.buffer.y=e[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=e[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.tabClear=function(e){var t=e[0];t<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===t&&(this._terminal.buffer.tabs={})},t.prototype.setMode=function(e,t){if(e.length>1)for(var r=0;r<e.length;r++)this.setMode([e[r]]);else if(t){if("?"===t)switch(e[0]){case 1:this._terminal.applicationCursor=!0;break;case 2:this._terminal.setgCharset(0,s.DEFAULT_CHARSET),this._terminal.setgCharset(1,s.DEFAULT_CHARSET),this._terminal.setgCharset(2,s.DEFAULT_CHARSET),this._terminal.setgCharset(3,s.DEFAULT_CHARSET);break;case 3:this._terminal.savedCols=this._terminal.cols,this._terminal.resize(132,this._terminal.rows);break;case 6:this._terminal.originMode=!0;break;case 7:this._terminal.wraparoundMode=!0;break;case 12:break;case 66:this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=9===e[0],this._terminal.vt200Mouse=1e3===e[0],this._terminal.normalMouse=e[0]>1e3,this._terminal.mouseEvents=!0,this._terminal.element&&this._terminal.element.classList.add("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.disable(),this._terminal.log("Binding to mouse events.");break;case 1004:this._terminal.sendFocus=!0;break;case 1005:this._terminal.utfMouse=!0;break;case 1006:this._terminal.sgrMouse=!0;break;case 1015:this._terminal.urxvtMouse=!0;break;case 25:this._terminal.cursorHidden=!1;break;case 1048:this.saveCursor(e);break;case 1049:this.saveCursor(e);case 47:case 1047:this._terminal.buffers.activateAltBuffer(this._terminal.eraseAttrData()),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!0}}else switch(e[0]){case 4:this._terminal.insertMode=!0}},t.prototype.resetMode=function(e,t){if(e.length>1)for(var r=0;r<e.length;r++)this.resetMode([e[r]]);else if(t){if("?"===t)switch(e[0]){case 1:this._terminal.applicationCursor=!1;break;case 3:132===this._terminal.cols&&this._terminal.savedCols&&this._terminal.resize(this._terminal.savedCols,this._terminal.rows),delete this._terminal.savedCols;break;case 6:this._terminal.originMode=!1;break;case 7:this._terminal.wraparoundMode=!1;break;case 12:break;case 66:this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=!1,this._terminal.vt200Mouse=!1,this._terminal.normalMouse=!1,this._terminal.mouseEvents=!1,this._terminal.element&&this._terminal.element.classList.remove("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.enable();break;case 1004:this._terminal.sendFocus=!1;break;case 1005:this._terminal.utfMouse=!1;break;case 1006:this._terminal.sgrMouse=!1;break;case 1015:this._terminal.urxvtMouse=!1;break;case 25:this._terminal.cursorHidden=!0;break;case 1048:this.restoreCursor(e);break;case 1049:case 47:case 1047:this._terminal.buffers.activateNormalBuffer(),1049===e[0]&&this.restoreCursor(e),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!1}}else switch(e[0]){case 4:this._terminal.insertMode=!1}},t.prototype.charAttributes=function(e){if(1===e.length&&0===e[0])return this._terminal.curAttrData.fg=a.DEFAULT_ATTR_DATA.fg,void(this._terminal.curAttrData.bg=a.DEFAULT_ATTR_DATA.bg);for(var t,r=e.length,n=this._terminal.curAttrData,i=0;i<r;i++)(t=e[i])>=30&&t<=37?(n.fg&=-50331904,n.fg|=16777216|t-30):t>=40&&t<=47?(n.bg&=-50331904,n.bg|=16777216|t-40):t>=90&&t<=97?(n.fg&=-50331904,n.fg|=16777224|t-90):t>=100&&t<=107?(n.bg&=-50331904,n.bg|=16777224|t-100):0===t?(n.fg=a.DEFAULT_ATTR_DATA.fg,n.bg=a.DEFAULT_ATTR_DATA.bg):1===t?n.fg|=134217728:3===t?n.bg|=67108864:4===t?n.fg|=268435456:5===t?n.fg|=536870912:7===t?n.fg|=67108864:8===t?n.fg|=1073741824:2===t?n.bg|=134217728:22===t?(n.fg&=-134217729,n.bg&=-134217729):23===t?n.bg&=-67108865:24===t?n.fg&=-268435457:25===t?n.fg&=-536870913:27===t?n.fg&=-67108865:28===t?n.fg&=-1073741825:39===t?(n.fg&=-67108864,n.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):49===t?(n.bg&=-67108864,n.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):38===t?2===e[i+1]?(i+=2,n.fg|=50331648,n.fg&=-16777216,n.fg|=_.AttributeData.fromColorRGB([e[i],e[i+1],e[i+2]]),i+=2):5===e[i+1]&&(t=255&e[i+=2],n.fg&=-256,n.fg|=33554432|t):48===t?2===e[i+1]?(i+=2,n.bg|=50331648,n.bg&=-16777216,n.bg|=_.AttributeData.fromColorRGB([e[i],e[i+1],e[i+2]]),i+=2):5===e[i+1]&&(t=255&e[i+=2],n.bg&=-256,n.bg|=33554432|t):100===t?(n.fg&=-67108864,n.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,n.bg&=-67108864,n.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):this._terminal.error("Unknown SGR attribute: %d.",t)},t.prototype.deviceStatus=function(e,t){if(t){if("?"===t)switch(e[0]){case 6:r=this._terminal.buffer.y+1,n=this._terminal.buffer.x+1;this._onData.fire(o.C0.ESC+"[?"+r+";"+n+"R")}}else switch(e[0]){case 5:this._onData.fire(o.C0.ESC+"[0n");break;case 6:var r=this._terminal.buffer.y+1,n=this._terminal.buffer.x+1;this._onData.fire(o.C0.ESC+"["+r+";"+n+"R")}},t.prototype.softReset=function(e,t){"!"===t&&(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.curAttrData=a.DEFAULT_ATTR_DATA,this._terminal.buffer.x=this._terminal.buffer.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null])},t.prototype.setCursorStyle=function(e,t){if(" "===t){var r=e[0]<1?1:e[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)}},t.prototype.setScrollRegion=function(e,t){t||(this._terminal.buffer.scrollTop=(e[0]||1)-1,this._terminal.buffer.scrollBottom=(e[1]&&e[1]<=this._terminal.rows?e[1]:this._terminal.rows)-1,this._terminal.buffer.x=0,this._terminal.buffer.y=0)},t.prototype.saveCursor=function(e){this._terminal.buffer.savedX=this._terminal.buffer.x,this._terminal.buffer.savedY=this._terminal.buffer.y,this._terminal.buffer.savedCurAttrData.fg=this._terminal.curAttrData.fg,this._terminal.buffer.savedCurAttrData.bg=this._terminal.curAttrData.bg},t.prototype.restoreCursor=function(e){this._terminal.buffer.x=this._terminal.buffer.savedX||0,this._terminal.buffer.y=this._terminal.buffer.savedY||0,this._terminal.curAttrData.fg=this._terminal.buffer.savedCurAttrData.fg,this._terminal.curAttrData.bg=this._terminal.buffer.savedCurAttrData.bg},t.prototype.setTitle=function(e){this._terminal.handleTitle(e)},t.prototype.nextLine=function(){this._terminal.buffer.x=0,this.index()},t.prototype.keypadApplicationMode=function(){this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},t.prototype.keypadNumericMode=function(){this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},t.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0),this._terminal.setgCharset(0,s.DEFAULT_CHARSET)},t.prototype.selectCharset=function(e){2===e.length?"/"!==e[0]&&this._terminal.setgCharset(p[e[0]],s.CHARSETS[e[1]]||s.DEFAULT_CHARSET):this.selectDefaultCharset()},t.prototype.index=function(){this._terminal.index()},t.prototype.tabSet=function(){this._terminal.tabSet()},t.prototype.reverseIndex=function(){this._terminal.reverseIndex()},t.prototype.reset=function(){this._parser.reset(),this._terminal.reset()},t.prototype.setgLevel=function(e){this._terminal.setgLevel(e)},t}(h.Disposable);t.InputHandler=m},function(e,t,r){"use strict";function n(e){return e.replace(/\r?\n/g,"\r")}function i(e,t){return t?"\e[200~"+e+"\e[201~":e}function o(e,t){var r=t.screenElement.getBoundingClientRect(),n=e.clientX-r.left-10,i=e.clientY-r.top-10;t.textarea.style.position="absolute",t.textarea.style.width="20px",t.textarea.style.height="20px",t.textarea.style.left=n+"px",t.textarea.style.top=i+"px",t.textarea.style.zIndex="1000",t.textarea.focus(),setTimeout(function(){t.textarea.style.position=null,t.textarea.style.width=null,t.textarea.style.height=null,t.textarea.style.left=null,t.textarea.style.top=null,t.textarea.style.zIndex=null},200)}Object.defineProperty(t,"__esModule",{value:!0}),t.prepareTextForTerminal=n,t.bracketTextForPaste=i,t.copyHandler=function(e,t,r){t.browser.isMSIE?window.clipboardData.setData("Text",r.selectionText):e.clipboardData.setData("text/plain",r.selectionText),e.preventDefault()},t.pasteHandler=function(e,t){e.stopPropagation();var r=function(r){r=i(r=n(r),t.bracketedPasteMode),t.handler(r),t.textarea.value="",t.emit("paste",r),t.cancel(e)};t.browser.isMSIE?window.clipboardData&&r(window.clipboardData.getData("Text")):e.clipboardData&&r(e.clipboardData.getData("text/plain"))},t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(e,t,r,n){o(e,t),n&&!r.isClickInSelection(e)&&r.selectWordAtCursor(e),t.textarea.value=r.selectionText,t.textarea.select()}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(13),s=r(49),a=15,l=function(e){function t(t,r,n,i){var o=e.call(this)||this;return o._terminal=t,o._viewportElement=r,o._scrollArea=n,o._charMeasure=i,o.scrollBarWidth=0,o._currentRowHeight=0,o._lastRecordedBufferLength=0,o._lastRecordedViewportHeight=0,o._lastRecordedBufferHeight=0,o._lastScrollTop=0,o._wheelPartialScroll=0,o._refreshAnimationFrame=null,o._ignoreNextScrollEvent=!1,o.scrollBarWidth=o._viewportElement.offsetWidth-o._scrollArea.offsetWidth||a,o.register(s.addDisposableDomListener(o._viewportElement,"scroll",o._onScroll.bind(o))),setTimeout(function(){return o.syncScrollArea()},0),o}return i(t,e),t.prototype.onThemeChanged=function(e){this._viewportElement.style.backgroundColor=e.background.css},t.prototype._refresh=function(){var e=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return e._innerRefresh()}))},t.prototype._innerRefresh=function(){if(this._charMeasure.height>0){this._currentRowHeight=this._terminal.renderer.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._terminal.renderer.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._terminal.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},t.prototype.syncScrollArea=function(){if(this._lastRecordedBufferLength!==this._terminal.buffer.lines.length)return this._lastRecordedBufferLength=this._terminal.buffer.lines.length,void this._refresh();if(this._lastRecordedViewportHeight===this._terminal.renderer.dimensions.canvasHeight){var e=this._terminal.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===e&&this._lastScrollTop===this._viewportElement.scrollTop&&this._terminal.renderer.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh()}else this._refresh()},t.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._terminal.buffer.ydisp;this._terminal.scrollLines(t,!0)}},t.prototype.onWheel=function(e){var t=this._getPixelsScrolled(e);0!==t&&(this._viewportElement.scrollTop+=t,e.preventDefault())},t.prototype._getPixelsScrolled=function(e){if(0===e.deltaY)return 0;var t=e.deltaY;return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._terminal.rows),t},t.prototype.getLinesScrolled=function(e){if(0===e.deltaY)return 0;var t=e.deltaY;return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._terminal.rows),t},t.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},t.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,e.preventDefault())},t}(o.Disposable);t.Viewport=l},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){var t=e.call(this)||this;return t._events=t._events||{},t}return i(t,e),t.prototype.on=function(e,t){this._events[e]=this._events[e]||[],this._events[e].push(t)},t.prototype.addDisposableListener=function(e,t){var r=this;this.on(e,t);var n=!1;return{dispose:function(){n||(r.off(e,t),n=!0)}}},t.prototype.off=function(e,t){if(this._events[e])for(var r=this._events[e],n=r.length;n--;)if(r[n]===t)return void r.splice(n,1)},t.prototype.removeAllListeners=function(e){this._events[e]&&delete this._events[e]},t.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(this._events[e])for(var n=this._events[e],i=0;i<n.length;i++)n[i].apply(this,t)},t.prototype.emitMayRemoveListeners=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(this._events[e])for(var n=this._events[e],i=n.length,o=0;o<n.length;o++)n[o].apply(this,t),o-=i-n.length,i=n.length},t.prototype.listeners=function(e){return this._events[e]||[]},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._events={}},t}(r(13).Disposable);t.EventEmitter=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t,r){this._textarea=e,this._compositionView=t,this._terminal=r,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}return e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),e){var r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(t._isSendingComposition){t._isSendingComposition=!1;var e=void 0;e=t._isComposing?t._textarea.value.substring(r.start,r.end):t._textarea.value.substring(r.start),t._terminal.handler(e)}},0)}else{this._isSendingComposition=!1;var n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._terminal.handler(n)}},e.prototype._handleAnyTextareaChanges=function(){var e=this,t=this._textarea.value;setTimeout(function(){if(!e._isComposing){var r=e._textarea.value.replace(t,"");r.length>0&&e._terminal.handler(r)}},0)},e.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._terminal.buffer.isCursorInViewport){var r=Math.ceil(this._terminal.charMeasure.height*this._terminal.options.lineHeight),n=this._terminal.buffer.y*r,i=this._terminal.buffer.x*this._terminal.charMeasure.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._terminal.options.fontFamily,this._compositionView.style.fontSize=this._terminal.options.fontSize+"px";var o=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=n+"px",this._textarea.style.width=o.width+"px",this._textarea.style.height=o.height+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(function(){return t.updateCompositionElements(!0)},0)}},e.prototype._clearTextareaPosition=function(){this._textarea.style.left="",this._textarea.style.top=""},e}();t.CompositionHelper=n},function(e,t,r){"use strict";function n(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();var n=!e[t].hasContent(r-1)&&1===e[t].getWidth(r-1),i=2===e[t+1].getWidth(0);return n&&i?r-1:r}Object.defineProperty(t,"__esModule",{value:!0}),t.reflowLargerGetLinesToRemove=function(e,t,r,i,o){for(var s=[],a=0;a<e.length-1;a++){var l=a,c=e.get(++l);if(c.isWrapped){for(var h=[e.get(a)];l<e.length&&c.isWrapped;)h.push(c),c=e.get(++l);if(i>=a&&i<l)a+=h.length-1;else{for(var u=0,f=n(h,u,t),_=1,d=0;_<h.length;){var p=n(h,_,t),y=p-d,m=r-f,g=Math.min(y,m);h[u].copyCellsFrom(h[_],d,f,g,!1),(f+=g)===r&&(u++,f=0),(d+=g)===p&&(_++,d=0),0===f&&0!==u&&2===h[u-1].getWidth(r-1)&&(h[u].copyCellsFrom(h[u-1],r-1,f++,1,!1),h[u-1].setCell(r-1,o))}h[u].replaceCells(f,r,o);for(var v=0,b=h.length-1;b>0&&(b>u||0===h[b].getTrimmedLength());b--)v++;v>0&&(s.push(a+h.length-v),s.push(v)),a+=h.length-1}}}return s},t.reflowLargerCreateNewLayout=function(e,t){for(var r=[],n=0,i=t[n],o=0,s=0;s<e.length;s++)if(i===s){var a=t[++n];e.onDeleteEmitter.fire({index:s-o,amount:a}),s+=a-1,o+=a,i=t[++n]}else r.push(s);return{layout:r,countRemoved:o}},t.reflowLargerApplyNewLayout=function(e,t){for(var r=[],n=0;n<t.length;n++)r.push(e.get(t[n]));for(n=0;n<r.length;n++)e.set(n,r[n]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,r){for(var i=[],o=e.map(function(r,i){return n(e,i,t)}).reduce(function(e,t){return e+t}),s=0,a=0,l=0;l<o;){if(o-l<r){i.push(o-l);break}s+=r;var c=n(e,a,t);s>c&&(s-=c,a++);var h=2===e[a].getWidth(s-1);h&&s--;var u=h?r-1:r;i.push(u),l+=u}return i},t.getWrappedLineTrimmedLength=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),i=function(){function e(e){this._maxLength=e,this.onDeleteEmitter=new n.EventEmitter2,this.onInsertEmitter=new n.EventEmitter2,this.onTrimEmitter=new n.EventEmitter2,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(e.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){if(this._maxLength!==e){for(var t=new Array(e),r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},set:function(e){if(e>this._length)for(var t=this._length;t<e;t++)this._array[t]=void 0;this._length=e},enumerable:!0,configurable:!0}),e.prototype.get=function(e){return this._array[this._getCyclicIndex(e)]},e.prototype.set=function(e,t){this._array[this._getCyclicIndex(e)]=t},e.prototype.push=function(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},e.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(e.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!0,configurable:!0}),e.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},e.prototype.splice=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t){for(var i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t}for(i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+r.length)]=this._array[this._getCyclicIndex(i)];for(i=0;i<r.length;i++)this._array[this._getCyclicIndex(e+i)]=r[i];if(this._length+r.length>this._maxLength){var o=this._length+r.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=r.length},e.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},e.prototype.shiftElements=function(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(var n=t-1;n>=0;n--)this.set(e+n+r,this.get(e+n));var i=e+t+r-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(n=0;n<t;n++)this.set(e+n+r,this.get(e+n))}},e.prototype._getCyclicIndex=function(e){return(this._startIndex+e)%this._maxLength},e}();t.CircularList=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(18),i=r(14),o=function(){function e(e){this._terminal=e,this._onBufferActivate=new i.EventEmitter2,this._normal=new n.Buffer(this._terminal,!0),this._normal.fillViewportRows(),this._alt=new n.Buffer(this._terminal,!1),this._activeBuffer=this._normal,this.setupTabStops()}return Object.defineProperty(e.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),e.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},e.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},e.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},e.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},e}();t.BufferSet=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(144),s=r(18),a=r(141),l=r(140),c=r(139),h=r(138),u=r(48),f=r(137),_=r(134),d=r(124),p=r(123),y=r(120),m=r(37),g=r(49),v=r(59),b=r(85),C=r(119),w=r(86),S=r(118),E=r(87),x=r(89),A=r(117),k=r(115),L=r(114),T=r(14),O=r(113),R="undefined"!=typeof window?window.document:null,M=["cols","rows"],D={cols:80,rows:24,convertEol:!1,termName:"xterm",cursorBlink:!1,cursorStyle:"block",bellSound:C.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,enableBold:!0,experimentalCharAtlas:"static",fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,scrollback:1e3,screenKeys:!1,screenReaderMode:!1,debug:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,cancelEvents:!1,disableStdin:!1,useFlowControl:!1,allowTransparency:!1,tabStopWidth:8,theme:null,rightClickSelectsWord:m.isMac,rendererType:"canvas",windowsMode:!1},P=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.browser=m,r._blankLine=null,r._onCursorMove=new T.EventEmitter2,r._onData=new T.EventEmitter2,r._onKey=new T.EventEmitter2,r._onLineFeed=new T.EventEmitter2,r._onRender=new T.EventEmitter2,r._onResize=new T.EventEmitter2,r._onScroll=new T.EventEmitter2,r._onSelectionChange=new T.EventEmitter2,r._onTitleChange=new T.EventEmitter2,r.options=L.clone(t),r._setup(),r.onCursorMove(function(){return r.emit("cursormove")}),r.onData(function(e){return r.emit("data",e)}),r.onKey(function(e){return r.emit("key",e.key,e.domEvent)}),r.onLineFeed(function(){return r.emit("linefeed")}),r.onRender(function(e){return r.emit("refresh",e)}),r.onResize(function(e){return r.emit("resize",e)}),r.onSelectionChange(function(){return r.emit("selection")}),r.onScroll(function(e){return r.emit("scroll",e)}),r.onTitleChange(function(e){return r.emit("title",e)}),r}return i(t,e),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0),this._customKeyEventHandler=null,x.removeTerminalFromCache(this),this.handler=function(){},this.write=function(){},this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},t.prototype.destroy=function(){this.dispose()},t.prototype._setup=function(){var e=this;Object.keys(D).forEach(function(t){null!==e.options[t]&&void 0!==e.options[t]||(e.options[t]=D[t])}),this._parent=R?R.body:null,this.cols=Math.max(this.options.cols,2),this.rows=Math.max(this.options.rows,1),this.options.handler&&this.onData(this.options.handler),this.cursorState=0,this.cursorHidden=!1,this._customKeyEventHandler=null,this.applicationKeypad=!1,this.applicationCursor=!1,this.originMode=!1,this.insertMode=!1,this.wraparoundMode=!0,this.bracketedPasteMode=!1,this.charset=null,this.gcharset=null,this.glevel=0,this.charsets=[null],this.curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrData=s.DEFAULT_ATTR_DATA.clone(),this.params=[],this.currentParam=0,this.writeBuffer=[],this._writeInProgress=!1,this._xoffSentToCatchUp=!1,this._userScrolling=!1,this._inputHandler=new f.InputHandler(this),this._inputHandler.onCursorMove(function(){return e._onCursorMove.fire()}),this._inputHandler.onLineFeed(function(){return e._onLineFeed.fire()}),this.register(this._inputHandler),this.renderer=this.renderer||null,this.selectionManager=this.selectionManager||null,this.linkifier=this.linkifier||new d.Linkifier(this),this._mouseZoneManager=this._mouseZoneManager||null,this.soundManager=this.soundManager||new C.SoundManager(this),this.buffers=new o.BufferSet(this),this.selectionManager&&(this.selectionManager.clearSelection(),this.selectionManager.initBuffersListeners()),this.options.windowsMode&&(this._windowsMode=O.applyWindowsMode(this))},Object.defineProperty(t.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),t.prototype.eraseAttrData=function(){return this._eraseAttrData.bg&=-67108864,this._eraseAttrData.bg|=67108863&this.curAttrData.bg,this._eraseAttrData},t.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},Object.defineProperty(t.prototype,"isFocused",{get:function(){return R.activeElement===this.textarea&&R.hasFocus()},enumerable:!0,configurable:!0}),t.prototype.getOption=function(e){if(!(e in D))throw new Error('No option with key "'+e+'"');return this.options[e]},t.prototype.setOption=function(e,t){if(!(e in D))throw new Error('No option with key "'+e+'"');if(-1!==M.indexOf(e)&&console.error('Option "'+e+'" can only be set in the constructor'),this.options[e]!==t){switch(e){case"bellStyle":t||(t="none");break;case"cursorStyle":t||(t="block");break;case"fontWeight":t||(t="normal");break;case"fontWeightBold":t||(t="bold");break;case"lineHeight":if(t<1)return void console.warn(e+" cannot be less than 1, value: "+t);case"rendererType":t||(t="canvas");break;case"tabStopWidth":if(t<1)return void console.warn(e+" cannot be less than 1, value: "+t);break;case"theme":if(this.renderer)return void this._setTheme(t);break;case"scrollback":if((t=Math.min(t,s.MAX_BUFFER_SIZE))<0)return void console.warn(e+" cannot be less than 0, value: "+t);if(this.options[e]!==t){var r=this.rows+t;if(this.buffer.lines.length>r){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[e]=t,e){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":t?this._accessibilityManager||(this._accessibilityManager=new S.AccessibilityManager(this)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"windowsMode":t?this._windowsMode||(this._windowsMode=O.applyWindowsMode(this)):this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0)}this.renderer&&this.renderer.onOptionsChanged()}},t.prototype._onTextAreaFocus=function(e){this.sendFocus&&this.handler(u.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this.showCursor(),this.emit("focus")},t.prototype.blur=function(){return this.textarea.blur()},t.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")},t.prototype._initGlobal=function(){var e=this;this._bindKeys(),this.register(g.addDisposableDomListener(this.element,"copy",function(t){e.hasSelection()&&h.copyHandler(t,e,e.selectionManager)}));var t=function(t){return h.pasteHandler(t,e)};this.register(g.addDisposableDomListener(this.textarea,"paste",t)),this.register(g.addDisposableDomListener(this.element,"paste",t)),m.isFirefox?this.register(g.addDisposableDomListener(this.element,"mousedown",function(t){2===t.button&&h.rightClickHandler(t,e,e.selectionManager,e.options.rightClickSelectsWord)})):this.register(g.addDisposableDomListener(this.element,"contextmenu",function(t){h.rightClickHandler(t,e,e.selectionManager,e.options.rightClickSelectsWord)})),m.isLinux&&this.register(g.addDisposableDomListener(this.element,"auxclick",function(t){1===t.button&&h.moveTextAreaUnderMouseCursor(t,e)}))},t.prototype._bindKeys=function(){var e=this,t=this;this.register(g.addDisposableDomListener(this.element,"keydown",function(e){R.activeElement===this&&t._keyDown(e)},!0)),this.register(g.addDisposableDomListener(this.element,"keypress",function(e){R.activeElement===this&&t._keyPress(e)},!0)),this.register(g.addDisposableDomListener(this.element,"keyup",function(r){(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode})(r)||e.focus(),t._keyUp(r)},!0)),this.register(g.addDisposableDomListener(this.textarea,"keydown",function(t){return e._keyDown(t)},!0)),this.register(g.addDisposableDomListener(this.textarea,"keypress",function(t){return e._keyPress(t)},!0)),this.register(g.addDisposableDomListener(this.textarea,"compositionstart",function(){return e._compositionHelper.compositionstart()})),this.register(g.addDisposableDomListener(this.textarea,"compositionupdate",function(t){return e._compositionHelper.compositionupdate(t)})),this.register(g.addDisposableDomListener(this.textarea,"compositionend",function(){return e._compositionHelper.compositionend()})),this.register(this.onRender(function(){return e._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(t){return e._queueLinkification(t.start,t.end)}))},t.prototype.open=function(e){var t=this;if(this._parent=e||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 E.ScreenDprMonitor,this._screenDprMonitor.setListener(function(){return t.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 w.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return t._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(e){return t._onTextAreaFocus(e)})),this.register(g.addDisposableDomListener(this.textarea,"blur",function(){return t._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 y.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.onCursorMove(function(){return t.renderer.onCursorMove()})),this.register(this.onResize(function(){return t.renderer.onResize(t.cols,t.rows)})),this.register(this.addDisposableListener("blur",function(){return t.renderer.onBlur()})),this.register(this.addDisposableListener("focus",function(){return t.renderer.onFocus()})),this.register(this.addDisposableListener("dprchange",function(){return t.renderer.onWindowResize(window.devicePixelRatio)})),this.register(g.addDisposableDomListener(window,"resize",function(){return t.renderer.onWindowResize(window.devicePixelRatio)})),this.register(this.charMeasure.onCharSizeChanged(function(){return t.renderer.onCharSizeChanged()})),this.register(this.renderer.onCanvasResize(function(){return t.viewport.syncScrollArea()})),this.selectionManager=new p.SelectionManager(this,this.charMeasure),this.register(this.selectionManager.onSelectionChange(function(){return t._onSelectionChange.fire()})),this.register(g.addDisposableDomListener(this.element,"mousedown",function(e){return t.selectionManager.onMouseDown(e)})),this.register(this.selectionManager.onRedrawRequest(function(e){return t.renderer.onSelectionChanged(e.start,e.end,e.columnSelectMode)})),this.register(this.selectionManager.onLinuxMouseSelection(function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()})),this.register(this.onScroll(function(){t.viewport.syncScrollArea(),t.selectionManager.refresh()})),this.register(g.addDisposableDomListener(this._viewportElement,"scroll",function(){return t.selectionManager.refresh()})),this.mouseHelper=new b.MouseHelper(this.renderer),this.element.classList.toggle("enable-mouse-events",this.mouseEvents),this.mouseEvents?this.selectionManager.disable():this.selectionManager.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new S.AccessibilityManager(this)),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},t.prototype._setupRenderer=function(){var e=this;switch(this.options.rendererType){case"canvas":this.renderer=new _.Renderer(this,this.options.theme);break;case"dom":this.renderer=new A.DomRenderer(this,this.options.theme);break;default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}this.renderer.onRender(function(t){return e._onRender.fire(t)}),this.register(this.renderer)},t.prototype._setTheme=function(e){this._theme=e;var t=this.renderer.setTheme(e);this.viewport&&this.viewport.onThemeChanged(t)},t.prototype.bindMouse=function(){var e=this,t=this.element,r=this,n=32;function i(e){var t,i;if(t=function(e){var t,n,i,o,s;switch(e.overrideType||e.type){case"mousedown":t=null!==e.button&&void 0!==e.button?+e.button:null!==e.which&&void 0!==e.which?e.which-1:null,m.isMSIE&&(t=1===t?0:4===t?1:t);break;case"mouseup":t=3;break;case"DOMMouseScroll":t=e.detail<0?64:65;break;case"wheel":t=e.deltaY<0?64:65}n=e.shiftKey?4:0,i=e.metaKey?8:0,o=e.ctrlKey?16:0,s=n|i|o,r.vt200Mouse?s&=o:r.normalMouse||(s=0);return t=32+(s<<2)+t}(e),i=r.mouseHelper.getRawByteCoords(e,r.screenElement,r.charMeasure,r.cols,r.rows))switch(s(t,i),e.overrideType||e.type){case"mousedown":n=t;break;case"mouseup":n=32}}function o(e,t){if(r.utfMouse){if(t>2047)return void e.push(2047);e.push(t)}else{if(255===t)return void e.push(0);t>127&&(t=127),e.push(t)}}function s(e,t){if(r._vt300Mouse){e&=3,t.x-=32,t.y-=32;var n=u.C0.ESC+"[24";if(0===e)n+="1";else if(1===e)n+="3";else if(2===e)n+="5";else{if(3===e)return;n+="0"}return n+="~["+t.x+","+t.y+"]\r",void r.handler(n)}if(r._decLocator)return e&=3,t.x-=32,t.y-=32,0===e?e=2:1===e?e=4:2===e?e=6:3===e&&(e=3),void r.handler(u.C0.ESC+"["+e+";"+(3===e?4:0)+";"+t.y+";"+t.x+";"+t.page||"0&w");if(r.urxvtMouse)return t.x-=32,t.y-=32,t.x++,t.y++,void r.handler(u.C0.ESC+"["+e+";"+t.x+";"+t.y+"M");if(r.sgrMouse)return t.x-=32,t.y-=32,void r.handler(u.C0.ESC+"[<"+((3==(3&e)?-4&e:e)-32)+";"+t.x+";"+t.y+(3==(3&e)?"m":"M"));var i=[];o(i,e),o(i,t.x),o(i,t.y),r.handler(u.C0.ESC+"[M"+String.fromCharCode.apply(String,i))}this.register(g.addDisposableDomListener(t,"mousedown",function(t){if(t.preventDefault(),e.focus(),e.mouseEvents&&!e.selectionManager.shouldForceSelection(t)){if(i(t),e.vt200Mouse)return t.overrideType="mouseup",i(t),e.cancel(t);var o;e.normalMouse&&(o=function(t){var i,o,a;e.normalMouse&&(i=t,o=n,(a=r.mouseHelper.getRawByteCoords(i,r.screenElement,r.charMeasure,r.cols,r.rows))&&s(o+=32,a))},e._document.addEventListener("mousemove",o));var a=function(t){return e.normalMouse&&!e.x10Mouse&&i(t),o&&(e._document.removeEventListener("mousemove",o),o=null),e._document.removeEventListener("mouseup",a),e.cancel(t)};return e._document.addEventListener("mouseup",a),e.cancel(t)}})),this.register(g.addDisposableDomListener(t,"wheel",function(t){if(e.mouseEvents)e.x10Mouse||e._vt300Mouse||e._decLocator||(i(t),t.preventDefault());else if(!e.buffer.hasScrollback){var r=e.viewport.getLinesScrolled(t);if(0===r)return;for(var n=u.C0.ESC+(e.applicationCursor?"O":"[")+(t.deltaY<0?"A":"B"),o="",s=0;s<Math.abs(r);s++)o+=n;e.handler(o)}})),this.register(g.addDisposableDomListener(t,"wheel",function(t){if(!e.mouseEvents)return e.viewport.onWheel(t),e.cancel(t)})),this.register(g.addDisposableDomListener(t,"touchstart",function(t){if(!e.mouseEvents)return e.viewport.onTouchStart(t),e.cancel(t)})),this.register(g.addDisposableDomListener(t,"touchmove",function(t){if(!e.mouseEvents)return e.viewport.onTouchMove(t),e.cancel(t)}))},t.prototype.refresh=function(e,t){this.renderer&&this.renderer.refreshRows(e,t)},t.prototype._queueLinkification=function(e,t){this.linkifier&&this.linkifier.linkifyRows(e,t)},t.prototype.updateCursorStyle=function(e){this.selectionManager&&this.selectionManager.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},t.prototype.showCursor=function(){this.cursorState||(this.cursorState=1,this.refresh(this.buffer.y,this.buffer.y))},t.prototype.scroll=function(e){var t;void 0===e&&(e=!1),t=this._blankLine;var r=this.eraseAttrData();t&&t.length===this.cols&&t.getFg(0)===r.fg&&t.getBg(0)===r.bg||(t=this.buffer.getBlankLine(r,e),this._blankLine=t),t.isWrapped=e;var n=this.buffer.ybase+this.buffer.scrollTop,i=this.buffer.ybase+this.buffer.scrollBottom;if(0===this.buffer.scrollTop){var o=this.buffer.lines.isFull;i===this.buffer.lines.length-1?o?this.buffer.lines.recycle().copyFrom(t):this.buffer.lines.push(t.clone()):this.buffer.lines.splice(i+1,0,t.clone()),o?this._userScrolling&&(this.buffer.ydisp=Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this._userScrolling||this.buffer.ydisp++)}else{var s=i-n+1;this.buffer.lines.shiftElements(n+1,s-1,-1),this.buffer.lines.set(i,t.clone())}this._userScrolling||(this.buffer.ydisp=this.buffer.ybase),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom),this._onScroll.fire(this.buffer.ydisp)},t.prototype.scrollLines=function(e,t){if(e<0){if(0===this.buffer.ydisp)return;this._userScrolling=!0}else e+this.buffer.ydisp>=this.buffer.ybase&&(this._userScrolling=!1);var r=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+e,this.buffer.ybase),0),r!==this.buffer.ydisp&&(t||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},t.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},t.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},t.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},t.prototype.scrollToLine=function(e){var t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)},t.prototype.write=function(e){var t=this;this._isDisposed||e&&(this.writeBuffer.push(e),this.options.useFlowControl&&!this._xoffSentToCatchUp&&this.writeBuffer.length>=5&&(this.handler(u.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&this.writeBuffer.length>0&&(this._writeInProgress=!0,setTimeout(function(){t._innerWrite()})))},t.prototype._innerWrite=function(e){var t=this;void 0===e&&(e=0),this._isDisposed&&(this.writeBuffer=[]);for(var r=Date.now();this.writeBuffer.length>e;){var n=this.writeBuffer[e];if(e++,this._xoffSentToCatchUp&&this.writeBuffer.length===e&&(this.handler(u.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parse(n),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),Date.now()-r>=12)break}this.writeBuffer.length>e?setTimeout(function(){return t._innerWrite(e)},0):(this._writeInProgress=!1,this.writeBuffer=[])},t.prototype.writeln=function(e){this.write(e+"\r\n")},t.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},t.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},t.prototype.registerLinkMatcher=function(e,t,r){var n=this.linkifier.registerLinkMatcher(e,t,r);return this.refresh(0,this.rows-1),n},t.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},t.prototype.registerCharacterJoiner=function(e){var t=this.renderer.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},t.prototype.deregisterCharacterJoiner=function(e){this.renderer.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(t.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),t.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},t.prototype.hasSelection=function(){return!!this.selectionManager&&this.selectionManager.hasSelection},t.prototype.getSelection=function(){return this.selectionManager?this.selectionManager.selectionText:""},t.prototype.clearSelection=function(){this.selectionManager&&this.selectionManager.clearSelection()},t.prototype.selectAll=function(){this.selectionManager&&this.selectionManager.selectAll()},t.prototype.selectLines=function(e,t){this.selectionManager&&this.selectionManager.selectLines(e,t)},t.prototype._keyDown=function(e){if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t=k.evaluateKeyboardEvent(e,this.applicationCursor,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===t.type||2===t.type){var r=this.rows-1;return this.scrollLines(2===t.type?-r:r),this.cancel(e,!0)}return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(this.emit("keydown",e),this._onKey.fire({key:t.key,domEvent:e}),this.showCursor(),this.handler(t.key),this.cancel(e,!0)))},t.prototype._isThirdLevelShift=function(e,t){var r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isMSWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?r:r&&(!t.keyCode||t.keyCode>47)},t.prototype.setgLevel=function(e){this.glevel=e,this.charset=this.charsets[e]},t.prototype.setgCharset=function(e,t){this.charsets[e]=t,this.glevel===e&&(this.charset=t)},t.prototype._keyUp=function(e){this.updateCursorStyle(e)},t.prototype._keyPress=function(e){var t;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e))&&(t=String.fromCharCode(t),this.emit("keypress",t,e),this._onKey.fire({key:t,domEvent:e}),this.showCursor(),this.handler(t),!0)},t.prototype.bell=function(){var e=this;this.emit("bell"),this._soundBell()&&this.soundManager.playBellSound(),this._visualBell()&&(this.element.classList.add("visual-bell-active"),clearTimeout(this._visualBellTimer),this._visualBellTimer=window.setTimeout(function(){e.element.classList.remove("visual-bell-active")},200))},t.prototype.log=function(e,t){this.options.debug&&this._context.console&&this._context.console.log&&this._context.console.log(e,t)},t.prototype.error=function(e,t){this.options.debug&&this._context.console&&this._context.console.error&&this._context.console.error(e,t)},t.prototype.resize=function(e,t){isNaN(e)||isNaN(t)||(e!==this.cols||t!==this.rows?(e<2&&(e=2),t<1&&(t=1),this.buffers.resize(e,t),this.cols=e,this.rows=t,this.buffers.setupTabStops(this.cols),this.charMeasure&&this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._onResize.fire({cols:e,rows:t})):!this.charMeasure||this.charMeasure.width&&this.charMeasure.height||this.charMeasure.measure(this.options))},t.prototype.updateRange=function(e){e<this._refreshStart&&(this._refreshStart=e),e>this._refreshEnd&&(this._refreshEnd=e)},t.prototype.maxRange=function(){this._refreshStart=0,this._refreshEnd=this.rows-1},t.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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(s.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},t.prototype.is=function(e){return 0===(this.options.termName+"").indexOf(e)},t.prototype.handler=function(e){this.options.disableStdin||(this.selectionManager&&this.selectionManager.hasSelection&&this.selectionManager.clearSelection(),this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),this._onData.fire(e))},t.prototype.handleTitle=function(e){this._onTitleChange.fire(e)},t.prototype.index=function(){this.buffer.y++,this.buffer.y>this.buffer.scrollBottom&&(this.buffer.y--,this.scroll()),this.buffer.x>=this.cols&&this.buffer.x--},t.prototype.reverseIndex=function(){if(this.buffer.y===this.buffer.scrollTop){var e=this.buffer.scrollBottom-this.buffer.scrollTop;this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,e,1),this.buffer.lines.set(this.buffer.y+this.buffer.ybase,this.buffer.getBlankLine(this.eraseAttrData())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)}else this.buffer.y--},t.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var e=this._customKeyEventHandler,t=this._inputHandler,r=this.cursorState;this._setup(),this._customKeyEventHandler=e,this._inputHandler=t,this.cursorState=r,this.refresh(0,this.rows-1),this.viewport&&this.viewport.syncScrollArea()},t.prototype.tabSet=function(){this.buffer.tabs[this.buffer.x]=!0},t.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},t.prototype._visualBell=function(){return!1},t.prototype._soundBell=function(){return"sound"===this.options.bellStyle},t}(l.EventEmitter);t.Terminal=P},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(145),i=r(59),o=function(){function e(e){this._core=new n.Terminal(e)}return Object.defineProperty(e.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._core.onData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._core.markers},enumerable:!0,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.on=function(e,t){this._core.on(e,t)},e.prototype.off=function(e,t){this._core.off(e,t)},e.prototype.emit=function(e,t){this._core.emit(e,t)},e.prototype.addDisposableListener=function(e,t){return this._core.addDisposableListener(e,t)},e.prototype.resize=function(e,t){this._core.resize(e,t)},e.prototype.writeln=function(e){this._core.writeln(e)},e.prototype.open=function(e){this._core.open(e)},e.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},e.prototype.addCsiHandler=function(e,t){return this._core.addCsiHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this._core.addOscHandler(e,t)},e.prototype.registerLinkMatcher=function(e,t,r){return this._core.registerLinkMatcher(e,t,r)},e.prototype.deregisterLinkMatcher=function(e){this._core.deregisterLinkMatcher(e)},e.prototype.registerCharacterJoiner=function(e){return this._core.registerCharacterJoiner(e)},e.prototype.deregisterCharacterJoiner=function(e){this._core.deregisterCharacterJoiner(e)},e.prototype.addMarker=function(e){return this._core.addMarker(e)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.getSelection=function(){return this._core.getSelection()},e.prototype.clearSelection=function(){this._core.clearSelection()},e.prototype.selectAll=function(){this._core.selectAll()},e.prototype.selectLines=function(e,t){this._core.selectLines(e,t)},e.prototype.dispose=function(){this._core.dispose()},e.prototype.destroy=function(){this._core.destroy()},e.prototype.scrollLines=function(e){this._core.scrollLines(e)},e.prototype.scrollPages=function(e){this._core.scrollPages(e)},e.prototype.scrollToTop=function(){this._core.scrollToTop()},e.prototype.scrollToBottom=function(){this._core.scrollToBottom()},e.prototype.scrollToLine=function(e){this._core.scrollToLine(e)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(e){this._core.write(e)},e.prototype.getOption=function(e){return this._core.getOption(e)},e.prototype.setOption=function(e,t){this._core.setOption(e,t)},e.prototype.refresh=function(e,t){this._core.refresh(e,t)},e.prototype.reset=function(){this._core.reset()},e.applyAddon=function(t){t.apply(e)},Object.defineProperty(e,"strings",{get:function(){return i},enumerable:!0,configurable:!0}),e}();t.Terminal=o},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=e.exports;Object.assign(i,r(38));var o=/\*\x18[AC]|\*\*\x18B/;function s(e,t){if(t<0)throw new i.Error("validation","“"+e+"” ("+t+") must be nonnegative.");if(t!==Math.floor(t))throw new i.Error("validation","“"+e+"” ("+t+") must be an integer.")}i.Validation={offer_parameters:function(e){if(!e.name)throw new i.Error("validation","Need “name”!");if("string"!=typeof e.name)throw new i.Error("validation","“name” ("+e.name+") must be a string!");if(e=Object.assign({},e),o.test(e.name)&&console.warn("The filename "+JSON.stringify(name)+" contains characters that look like a ZMODEM header. This could corrupt the ZMODEM session; consider renaming it so that the filename doesn’t contain control characters."),null!==e.serial&&void 0!==e.serial)throw new i.Error("validation","“serial” is meaningless.");if(e.serial=null,["size","mode","files_remaining","bytes_remaining"].forEach(function(t){var r;switch(n(e[t])){case"object":r=null===e[t];break;case"undefined":e[t]=null,r=!0;break;case"number":s(t,e[t]),r=!0}if(!r)throw new i.Error("validation","“"+t+"” ("+e[t]+") must be null, undefined, or a number.")}),"number"==typeof e.mode&&(e.mode|=32768),0===e.files_remaining)throw new i.Error("validation","“files_remaining”, if given, must be positive.");var t;switch(n(e.mtime)){case"object":if(t=!0,e.mtime instanceof Date){var r=e.mtime;if(e.mtime=Math.floor(r.getTime()/1e3),e.mtime<0)throw new i.Error("validation","“mtime” ("+r+") must not be earlier than 1970.")}else null!==e.mtime&&(t=!1);break;case"undefined":e.mtime=null,t=!0;break;case"number":s("mtime",e.mtime),t=!0}if(!t)throw new i.Error("validation","“mtime” ("+e.mtime+") must be null, undefined, a Date, or a number.");return e}}},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=e.exports;Object.assign(a,r(92),r(66),r(39),r(38));var l;a.Subpacket=function(){function e(t){s(this,e),this._payload=t}return n(e,[{key:"encode16",value:function(e){return this._encode(e,a.CRC.crc16)}},{key:"encode32",value:function(e){return this._encode(e,a.CRC.crc32)}},{key:"get_payload",value:function(){return this._payload}}],[{key:"build",value:function(e,t){var r=l[t];if(!r)throw"No subpacket type “"+t+"” is defined! Try one of: "+Object.keys(l).join(", ");return new r(e)}},{key:"parse16",value:function(t){return e._parse(t,2)}},{key:"parse32",value:function(t){return e._parse(t,4)}}]),n(e,[{key:"_encode",value:function(e,t){return e.encode(this._payload.slice(0)).concat([a.ZMLIB.ZDLE,this._frameend_num],e.encode(t(this._payload.concat(this._frameend_num))))}}],[{key:"_parse",value:function(e,t){for(var r,n,i={104:u,105:_,106:d,107:f},o=0;o<e.length;){if(-1===(o=e.indexOf(a.ZMLIB.ZDLE,o)))return;if(n=i[e[o+1]]){r=o+1;break}o++}if(n){var s=e[r];if(e[r-1]!==a.ZMLIB.ZDLE)throw"Byte before frame end should be ZDLE, not "+e[r-1];var l=e.splice(0,r-1),c=a.ZDLE.splice(e,2,t);if(c){var h=a.ZDLE.decode(l);return a.CRC[2===t?"verify16":"verify32"](h.concat([s]),c),new n(h,c)}e.unshift.apply(e,l)}}}]),e}();var c=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Subpacket),n(t,[{key:"frame_end",value:function(){return!0}}]),t}(),h=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Subpacket),n(t,[{key:"frame_end",value:function(){return!1}}]),t}(),u=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,c),n(t,[{key:"ack_expected",value:function(){return!1}}]),t}();u.prototype._frameend_num=104;var f=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,c),n(t,[{key:"ack_expected",value:function(){return!0}}]),t}();f.prototype._frameend_num=107;var _=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,h),n(t,[{key:"ack_expected",value:function(){return!1}}]),t}();_.prototype._frameend_num=105;var d=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,h),n(t,[{key:"ack_expected",value:function(){return!0}}]),t}();d.prototype._frameend_num=106,l={end_no_ack:u,end_ack:f,no_end_no_ack:_,no_end_ack:d}},function(e,t,r){var n;n=function(e){e.version="1.1.1";var t=function(){for(var e=0,t=new Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}();e.table=t,e.bstr=function(e,r){for(var n=-1^r,i=e.length-1,o=0;o<i;)n=(n=n>>>8^t[255&(n^e.charCodeAt(o++))])>>>8^t[255&(n^e.charCodeAt(o++))];return o===i&&(n=n>>>8^t[255&(n^e.charCodeAt(o))]),-1^n},e.buf=function(e,r){if(e.length>1e4)return function(e,r){for(var n=-1^r,i=e.length-7,o=0;o<i;)n=(n=(n=(n=(n=(n=(n=(n=n>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])];for(;o<i+7;)n=n>>>8^t[255&(n^e[o++])];return-1^n}(e,r);for(var n=-1^r,i=e.length-3,o=0;o<i;)n=(n=(n=(n=n>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])])>>>8^t[255&(n^e[o++])];for(;o<i+3;)n=n>>>8^t[255&(n^e[o++])];return-1^n},e.str=function(e,r){for(var n,i,o=-1^r,s=0,a=e.length;s<a;)(n=e.charCodeAt(s++))<128?o=o>>>8^t[255&(o^n)]:n<2048?o=(o=o>>>8^t[255&(o^(192|n>>6&31))])>>>8^t[255&(o^(128|63&n))]:n>=55296&&n<57344?(n=64+(1023&n),i=1023&e.charCodeAt(s++),o=(o=(o=(o=o>>>8^t[255&(o^(240|n>>8&7))])>>>8^t[255&(o^(128|n>>2&63))])>>>8^t[255&(o^(128|i>>6&15|(3&n)<<4))])>>>8^t[255&(o^(128|63&i))]):o=(o=(o=o>>>8^t[255&(o^(224|n>>12&15))])>>>8^t[255&(o^(128|n>>6&63))])>>>8^t[255&(o^(128|63&n))];return-1^o}},"undefined"==typeof DO_NOT_EXPORT_CRC?n(t):n({})},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=e.exports;Object.assign(a,r(67),r(66),r(39),r(92),r(38));var l="*".charCodeAt(0),c="A".charCodeAt(0),h="B".charCodeAt(0),u="C".charCodeAt(0),f=[13,10],_=f.slice(0).concat([a.ZMLIB.XON]),d=[l,l,a.ZMLIB.ZDLE,h],p=[l,a.ZMLIB.ZDLE,c],y=[l,a.ZMLIB.ZDLE,u];a.Header=function(){function e(){s(this,e),this._bytes4||(this._bytes4=[0,0,0,0])}return n(e,[{key:"to_hex",value:function(){var e=this._crc_bytes();return d.concat(a.ENCODELIB.octets_to_hex(e.concat(a.CRC.crc16(e))),this._hex_header_ending)}},{key:"to_binary16",value:function(e){return this._to_binary(e,p,a.CRC.crc16)}},{key:"to_binary32",value:function(e){return this._to_binary(e,y,a.CRC.crc32)}}],[{key:"trim_leading_garbage",value:function(e){var t,r,n=[];e:for(;e.length&&!r;){var i=e.indexOf(l);if(-1===i){t=!0;break e}if(n.push.apply(n,e.splice(0,i)),e.length<2)break e;if(e[1]===l)if(e.length<d.length){if(e.join()===d.slice(0,e.length).join())break e}else e[2]===d[2]&&e[3]===d[3]&&(r=U);else if(e[1]===a.ZMLIB.ZDLE){if(e.length<p.length)break e;e[2]===p[2]?r=j:e[2]===y[2]&&(r=W)}r||n.push(e.shift())}return t&&n.push.apply(n,e.splice(0)),n}},{key:"parse",value:function(e){var t;if(e[1]===l)return(t=U(e))&&[t,16];if(e[2]===c)return(t=j(e))&&[t,16];if(e[2]===u)return(t=W(e))&&[t,32];if(!(e.length<3))throw"Unrecognized/unsupported octets: "+e.join()}},{key:"build",value:function(e){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),r=H[e];if(!r)throw"No frame class “"+e+"” is defined!";return t.shift(),new(r.bind.apply(r,[null].concat(t)))}}]),n(e,[{key:"_to_binary",value:function(e,t,r){var n=this._crc_bytes();return t.concat(e.encode(n.concat(r(n))))}},{key:"_crc_bytes",value:function(){return[this.TYPENUM].concat(this._bytes4)}}]),e}(),a.Header.prototype._hex_header_ending=_;var m=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}(),g={CANFDX:1,CANOVIO:2,CANBRK:4,CANCRY:8,CANLZW:16,CANFC32:32,ESCCTL:64,ESC8:128};var v=function(e){function t(e,r){s(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=0;return r||(r=0),e.forEach(function(e){o|=function(e){if(!g[e])throw new a.Error("Invalid ZRINIT flag: "+e);return g[e]}(e)}),n._bytes4=[255&r,r>>8,0,o],n}return o(t,a.Header),n(t,[{key:"get_buffer_size",value:function(){return a.ENCODELIB.unpack_u16_be(this._bytes4.slice(0,2))||void 0}},{key:"can_full_duplex",value:function(){return!!(this._bytes4[3]&g.CANFDX)}},{key:"can_overlap_io",value:function(){return!!(this._bytes4[3]&g.CANOVIO)}},{key:"can_break",value:function(){return!!(this._bytes4[3]&g.CANBRK)}},{key:"can_fcs_32",value:function(){return!!(this._bytes4[3]&g.CANFC32)}},{key:"escape_ctrl_chars",value:function(){return!!(this._bytes4[3]&g.ESCCTL)}},{key:"escape_8th_bit",value:function(){return!!(this._bytes4[3]&g.ESC8)}}]),t}(),b={ESCCTL:64,ESC8:128};var C=function(e){function t(e,r){s(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=0;if(e.forEach(function(e){o|=function(e){if(!b[e])throw"Invalid ZSINIT flag: "+e;return b[e]}(e)}),n._bytes4=[0,0,0,o],r){if(r.length>31)throw"Attn sequence must be <= 31 bytes";if(r.some(function(e){return e>255}))throw"Attn sequence ("+r+") must be <256";n._data=r.concat([0])}return n}return o(t,a.Header),n(t,[{key:"escape_ctrl_chars",value:function(){return!!(this._bytes4[3]&b.ESCCTL)}},{key:"escape_8th_bit",value:function(){return!!(this._bytes4[3]&b.ESC8)}}]),t}(),w=function(e){function t(e){s(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e&&(r._bytes4=e.slice()),r}return o(t,a.Header),t}();w.prototype._hex_header_ending=f;var S={extended:{sparse:64},transport:[void 0,"compress","encrypt","rle"],management:[void 0,"newer_or_longer","crc","append","clobber","newer","mtime_or_length","protect","rename"],conversion:[void 0,"binary","text","resume"]},E=["extended","transport","management","conversion"],x=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),n(t,[{key:"get_options",value:function(){var e={sparse:!!(64&this._bytes4[0])},t=this._bytes4.slice(0);return E.forEach(function(r,n){if(S[r]instanceof Array)"management"===r&&(e.skip_if_absent=!!(128&t[n]),t[n]&=31),e[r]=S[r][t[n]];else for(var i in S[r])e[i]=!!(t[n]&S[r][i]),e[i]&&(t[n]^=S[r][i]);!e[r]&&t[n]&&(e[r]="unknown:"+t[n])}),e}}]),t}(),A=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}(),k=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}(),L=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}(),T=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,a.Header),t}();L.prototype._hex_header_ending=f;for(var O=function(e){function t(e){s(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r._bytes4=a.ENCODELIB.pack_u32_le(e),r}return o(t,a.Header),n(t,[{key:"get_offset",value:function(){return a.ENCODELIB.unpack_u32_le(this._bytes4)}}]),t}(),R=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,O),t}(),M=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,O),t}(),D=function(e){function t(){return s(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,O),t}(),P=[[m,"ZRQINIT"],[v,"ZRINIT"],[C,"ZSINIT"],[w,"ZACK"],[x,"ZFILE"],[A,"ZSKIP"],void 0,[k,"ZABORT"],[L,"ZFIN"],[R,"ZRPOS"],[M,"ZDATA"],[D,"ZEOF"],[T,"ZFERR"],void 0,void 0,void 0,void 0,void 0,void 0,void 0],H={},I=0;I<P.length;I++)P[I]&&(H[P[I][1]]=P[I][0],Object.assign(P[I][0].prototype,{TYPENUM:I,NAME:P[I][1]}));var B=[m,v,C,w,x,A,"ZNAK",k,L,R,M,D,T,"ZCRC","ZCHALLENGE","ZCOMPL","ZCAN","ZFREECNT","ZCOMMAND","ZSTDERR"];function F(e){var t=B[e];if("string"==typeof t)throw"Received unsupported header: "+t;return function(e){if(e.prototype instanceof O)return new e(0);return new e([])}(t)}function j(e){var t=a.ZDLE.splice(e,p.length,7);return t&&N(t)}function N(e){a.CRC.verify16(e.slice(0,5),e.slice(5));var t=F(e[0]);return t._bytes4=e.slice(1,5),t}function W(e){var t=a.ZDLE.splice(e,y.length,9);if(t){a.CRC.verify32(t.slice(0,5),t.slice(5));var r=F(t[0]);return r._bytes4=t.slice(1,5),r}}function U(e){var t,r,n=e.indexOf(138);if(-1===n&&(n=e.indexOf(10)),-1!==n){if(r=e.splice(0,n),e.shift(),19===r.length){var i=r.pop();13!==i&&141!==i&&(t="Invalid hex header: (CR/)LF doesn’t have CR!")}else 18!==r.length&&(t="Invalid hex header: invalid number of bytes before LF!");if(t)throw t+=" ("+r.length+" bytes: "+r.join()+")";return r.splice(0,4),N(a.ENCODELIB.parse_hex_octets(r))}e.length>11&&(t="Invalid hex header - no LF detected within 12 bytes!")}a.Header.parse_hex=U},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(){i(this,e)}return n(e,[{key:"encode",value:function(e){e=unescape(encodeURIComponent(e));for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new Uint8Array(t)}}]),e}(),s=function(){function e(){i(this,e)}return n(e,[{key:"decode",value:function(e){return decodeURIComponent(escape(String.fromCharCode.apply(String,e)))}}]),e}();e.exports.Text={Encoder:"undefined"!=typeof TextEncoder?TextEncoder:o,Decoder:"undefined"!=typeof TextDecoder?TextDecoder:s}},function(e,t,r){"use strict";var n=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,n)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(n):void 0},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=e.exports;Object.assign(l,r(67),r(151),r(66),r(39),r(150),r(148),r(147),r(38));var c=["CANFDX","CANOVIO","CANFC32"],h=[79,79],u=l.ZMLIB.ABORT_SEQUENCE,f=function(){function e(){a(this,e),this._on_evt={},this._evt_once_index={}}return i(e,[{key:"_Add_event",value:function(e){this._on_evt[e]=[],this._evt_once_index[e]=[]}},{key:"_get_evt_queue",value:function(e){if(!this._on_evt[e])throw"Bad event: "+e;return this._on_evt[e]}},{key:"on",value:function(e,t){return this._get_evt_queue(e).push(t),this}},{key:"off",value:function(e,t){var r=this._get_evt_queue(e);if(t){var n=r.indexOf(t);if(-1===n)throw"“"+t+"” is not in the “"+e+"” queue.";r.splice(n,1)}else r.pop();return this}},{key:"_Happen",value:function(e){var t=this._get_evt_queue(e),r=Array.apply(null,arguments);r.shift();var n=this;return t.forEach(function(e){e.apply(n,r)}),t.length}}]),e}();l.Session=function(e){function t(){a(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._config={},e._input_buffer=[],e._Add_event("receive"),e._Add_event("garbage"),e._Add_event("session_end"),e}return s(t,f),i(t,[{key:"set_sender",value:function(e){return this._sender=e,this}},{key:"has_ended",value:function(){return this._has_ended()}},{key:"consume",value:function(e){if(this._before_consume(e),this._aborted)throw new l.Error("already_aborted");e.length&&(this._strip_and_enqueue_input(e),this._check_for_abort_sequence(e)||this._consume_first())}},{key:"aborted",value:function(){return!!this._aborted}}],[{key:"parse",value:function(e){var t;try{t=l.Header.parse_hex(e)}catch(e){return}if(t)switch(t.NAME){case"ZRQINIT":return new l.Session.Receive;case"ZRINIT":return new l.Session.Send(t)}}}]),i(t,[{key:"get_role",value:function(){return this.type}},{key:"_trim_leading_garbage_until_header",value:function(){var e=l.Header.trim_leading_garbage(this._input_buffer);e.length&&0===this._Happen("garbage",e)&&console.debug("Garbage: ",String.fromCharCode.apply(String,e),e)}},{key:"_parse_and_consume_header",value:function(){this._trim_leading_garbage_until_header();var e=l.Header.parse(this._input_buffer);if(e)return this._consume_header(e[0]),this._last_header_name=e[0].NAME,this._last_header_crc=e[1],e[0]}},{key:"_consume_header",value:function(e){this._on_receive(e);var t=this._next_header_handler[e.NAME];if(!t)throw console.error("Unhandled header!",e,this._next_header_handler),new l.Error("Unhandled header: "+e.NAME);this._next_header_handler=null,t.call(this,e)}},{key:"_check_for_abort_sequence",value:function(){var e=l.ZMLIB.find_subarray(this._input_buffer,u);if(-1!==e)throw this._input_buffer.splice(0,e+u.length),this._aborted=!0,this._on_session_end(),new l.Error("peer_aborted")}},{key:"_send_header",value:function(e){if(!this._sender)throw"Need sender!";var t=Array.apply(null,arguments),r=this._create_header_bytes(t);this._sender(r[0]),this._last_sent_header=r[1]}},{key:"_create_header_bytes",value:function(e){var t=l.Header.build.apply(l.Header,e);return[t[this._get_header_formatter(e[0])](this._zencoder),t]}},{key:"_strip_and_enqueue_input",value:function(e){l.ZMLIB.strip_ignored_bytes(e),this._input_buffer.push.apply(this._input_buffer,e)}},{key:"abort",value:function(){this._sender(u.concat([8,8,8,8,8])),this._aborted=!0,this._sender=function(){throw new l.Error("already_aborted")},this._on_session_end()}},{key:"_on_session_end",value:function(){this._Happen("session_end")}},{key:"_on_receive",value:function(e){this._Happen("receive",e)}},{key:"_before_consume",value:function(){}}]),t}(),l.Session.Receive=function(e){function t(){a(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._Add_event("offer"),e._Add_event("data_in"),e._Add_event("file_end"),e}return s(t,l.Session),i(t,[{key:"_before_consume",value:function(e){if(this._bytes_after_OO)throw"PROTOCOL: Session is completed!";this._bytes_being_consumed=e}},{key:"get_trailing_bytes",value:function(){if(this._aborted)return[];if(!this._bytes_after_OO)throw"PROTOCOL: Session is not completed!";return this._bytes_after_OO.slice(0)}},{key:"_has_ended",value:function(){return this.aborted()||!!this._bytes_after_OO}},{key:"_get_header_formatter",value:function(){return"to_hex"}},{key:"_parse_and_consume_subpacket",value:function(){var e;e=16===this._last_header_crc?"parse16":"parse32";var t=l.Subpacket[e](this._input_buffer);return t&&(this._consume_data(t),t.frame_end()&&(this._next_subpacket_handler=null)),t}},{key:"_consume_first",value:function(){if(this._got_ZFIN){if(this._input_buffer.length<2)return;if(0===l.ZMLIB.find_subarray(this._input_buffer,h))return this._bytes_after_OO=(e=this._bytes_being_consumed.slice(0),0===l.ZMLIB.find_subarray(e,h)?e.splice(0,h.length):e[0]===h[h.length-1]&&e.splice(0,1),e),void this._on_session_end();throw"PROTOCOL: Only thing after ZFIN should be “OO” (79,79), not: "+array_buf.join()}var e,t;do{t=this._next_subpacket_handler?this._parse_and_consume_subpacket():this._parse_and_consume_header()}while(t&&this._input_buffer.length)}},{key:"_consume_data",value:function(e){if(this._on_receive(e),!this._next_subpacket_handler)throw"PROTOCOL: Received unexpected data packet after "+this._last_header_name+" header: "+e.get_payload().join();this._next_subpacket_handler.call(this,e)}},{key:"_octets_to_string",value:function(e){return this._textdecoder||(this._textdecoder=new l.Text.Decoder),this._textdecoder.decode(new Uint8Array(e))}},{key:"_consume_ZFILE_data",value:function(e,t){if(this._file_info)throw"PROTOCOL: second ZFILE data subpacket received";var r=t.get_payload(),n=r.indexOf(0),i=this._octets_to_string(r.slice(0,n)),o=this._octets_to_string(r.slice(1+n)).split(" "),s=o[1]&&parseInt(o[1],8)||void 0;s&&(s=new Date(1e3*s)),this._file_info={name:i,size:o[0]?parseInt(o[0],10):null,mtime:s||null,mode:o[2]&&parseInt(o[2],8)||null,serial:o[3]&&parseInt(o[3],10)||null,files_remaining:o[4]?parseInt(o[4],10):null,bytes_remaining:o[5]?parseInt(o[5],10):null};var a=new p(e.get_options(),this._file_info,this._accept.bind(this),this._skip.bind(this));this._current_transfer=a}},{key:"_consume_ZDATA_data",value:function(e){if(!this._accepted_offer)throw"PROTOCOL: Received data without accepting!";if(!this._offset_ok)return console.warn("offset not ok!"),void _send_ZRPOS();this._file_offset+=e.get_payload().length,this._on_data_in(e),e.ack_expected()&&!e.frame_end()&&this._send_header("ZACK",l.ENCODELIB.pack_u32_le(this._file_offset))}},{key:"_make_promise_for_between_files",value:function(){var e=this;return new Promise(function(t){var r={ZFILE:function(e){this._next_subpacket_handler=function(r){this._next_subpacket_handler=null,this._consume_ZFILE_data(e,r),this._Happen("offer",this._current_transfer),t(this._current_transfer)}},ZSINIT:function(t){e._next_subpacket_handler=function(t){e._next_subpacket_handler=null,e._consume_ZSINIT_data(t),e._send_header("ZACK"),e._next_header_handler=r}},ZFIN:function(){this._consume_ZFIN(),t()}};e._next_header_handler=r})}},{key:"_consume_ZSINIT_data",value:function(e){this._attn=e.get_payload()}},{key:"start",value:function(){if(this._started)throw"Already started!";this._started=!0;var e=this._make_promise_for_between_files();return this._send_ZRINIT(),e}},{key:"_accept",value:function(e){this._accepted_offer=!0,this._file_offset=e||0;var t=this,r=new Promise(function(e){t._next_header_handler={ZDATA:function(t){this._consume_ZDATA(t),this._next_subpacket_handler=this._consume_ZDATA_data,this._next_header_handler={ZEOF:function(t){this._next_subpacket_handler=null,this._consume_ZEOF(t);var r=this._make_promise_for_between_files();e(r)}}}}});return this._send_ZRPOS(),r}},{key:"_skip",value:function(){var e=this._make_promise_for_between_files();if(this._accepted_offer){var t=function(){this._accepted_offer=!1,this._next_subpacket_handler=null,this._make_promise_for_between_files()}.bind(this);Object.assign(this._next_header_handler,{ZEOF:t,ZDATA:function(){t(),this._next_header_handler.ZEOF=t}.bind(this)})}return this._file_info=null,this._send_header("ZSKIP"),e}},{key:"_send_ZRINIT",value:function(){this._send_header("ZRINIT",c)}},{key:"_consume_ZFIN",value:function(){this._got_ZFIN=!0,this._send_header("ZFIN")}},{key:"_consume_ZEOF",value:function(e){if(this._file_offset!==e.get_offset())throw"ZEOF offset mismatch; unimplemented (local: "+this._file_offset+"; ZEOF: "+e.get_offset()+")";this._send_ZRINIT(),this._on_file_end(),this._file_info=null,this._current_transfer=null}},{key:"_consume_ZDATA",value:function(e){if(this._file_offset!==e.get_offset())throw"Error correction is unimplemented.";this._offset_ok=!0}},{key:"_send_ZRPOS",value:function(){this._send_header("ZRPOS",this._file_offset)}},{key:"_on_file_end",value:function(){this._Happen("file_end"),this._current_transfer&&(this._current_transfer._Happen("complete"),this._current_transfer=null)}},{key:"_on_data_in",value:function(e){this._Happen("data_in",e),this._current_transfer&&this._current_transfer._Happen("input",e.get_payload())}}]),t}(),Object.assign(l.Session.Receive.prototype,{type:"receive"});var _={get_details:function(){return Object.assign({},this._file_info)},get_options:function(){return Object.assign({},this._zfile_opts)},get_offset:function(){return this._file_offset}},d=function(){function e(t,r,n,i){a(this,e),this._file_info=t,this._file_offset=r||0,this._send=n,this._end=i}return i(e,[{key:"send",value:function(e){this._send(e),this._file_offset+=e.length}},{key:"end",value:function(e){var t=this._end(e||[]);return e&&(this._file_offset+=e.length),t}}]),e}();Object.assign(d.prototype,_);var p=function(e){function t(e,r,n,i){a(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return s._zfile_opts=e,s._file_info=r,s._accept_func=n,s._skip_func=i,s._Add_event("input"),s._Add_event("complete"),s.on("input",s._input_handler),s}return s(t,f),i(t,[{key:"_verify_not_skipped",value:function(){if(this._skipped)throw new l.Error("Already skipped!")}},{key:"skip",value:function(){return this._verify_not_skipped(),this._skipped=!0,this._skip_func.apply(this,arguments)}},{key:"accept",value:function(e){if(this._verify_not_skipped(),this._accepted)throw new l.Error("Already accepted!");switch(this._accepted=!0,e||(e={}),this._file_offset=e.offset||0,e.on_input){case null:case void 0:case"spool_array":case"spool_uint8array":this._spool=[];break;default:if("function"!=typeof e.on_input)throw"Invalid “on_input”: "+e.on_input}return this._input_handler_mode=e.on_input||"spool_uint8array",this._accept_func(this._file_offset).then(this._get_spool.bind(this))}},{key:"_input_handler",value:function(e){if(this._file_offset+=e.length,"function"==typeof this._input_handler_mode)this._input_handler_mode(e);else{if("spool_uint8array"===this._input_handler_mode)e=new Uint8Array(e);else if("spool_array"!==this._input_handler_mode)throw new l.Error("WTF?? _input_handler_mode = "+this._input_handler_mode);this._spool.push(e)}}},{key:"_get_spool",value:function(){return this._spool}}]),t}();Object.assign(p.prototype,_);var y={ZFILE:!0,ZDATA:!0};l.Session.Send=function(e){function t(e){a(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(!e)throw"Need first header!";if("ZRINIT"!==e.NAME)throw"First header should be ZRINIT, not "+e.NAME;r._last_header_name="ZRINIT",r._subpacket_encode_func="encode16",r._zencoder=new l.ZDLE,r._consume_ZRINIT(e),r._file_offset=0;return r._start_keepalive_on_set_sender=!0,r}return s(t,l.Session),i(t,[{key:"set_sender",value:function(e){return n(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"set_sender",this).call(this,e),this._start_keepalive_on_set_sender&&(this._start_keepalive_on_set_sender=!1,this._start_keepalive()),this}},{key:"_get_header_formatter",value:function(e){return y[e]?"to_binary16":"to_hex"}},{key:"_start_keepalive",value:function(){if(!this._keepalive_promise){var e=this;this._keepalive_promise=new Promise(function(t){e._keepalive_timeout=setTimeout(t,5e3)}).then(function(){e._next_header_handler={ZACK:function(){e._got_ZSINIT_ZACK=!0}},e._send_ZSINIT(),e._keepalive_promise=null,e._start_keepalive()})}}},{key:"_stop_keepalive",value:function(){this._keepalive_promise&&(clearTimeout(this._keepalive_timeout),this._keep_alive_promise=null)}},{key:"_send_ZSINIT",value:function(){var e=[];this._zencoder.escapes_ctrl_chars()&&e.push("ESCCTL"),this._send_header_and_data(["ZSINIT",e],[0],"end_ack")}},{key:"_consume_ZRINIT",value:function(e){if(this._last_ZRINIT=e,e.get_buffer_size())throw"Buffer size ("+e.get_buffer_size()+") is unsupported!";if(!e.can_full_duplex())throw"Half-duplex I/O is unsupported!";if(!e.can_overlap_io())throw"Non-overlap I/O is unsupported!";if(e.escape_8th_bit())throw"8-bit escaping is unsupported!";this._zencoder.set_escape_ctrl_chars(!0),e.escape_ctrl_chars()||console.debug("Peer didn’t request escape of all control characters. Will send ZSINIT to force recognition of escaped control characters.")}},{key:"_ensure_receiver_escapes_ctrl_chars",value:function(){var e;if(!this._last_ZRINIT.escape_ctrl_chars()&&!this._got_ZSINIT_ZACK){var t=this;e=new Promise(function(e){t._next_header_handler={ZACK:function(t){e()}},t._send_ZSINIT()})}else e=Promise.resolve();return e}},{key:"_convert_params_to_offer_payload_array",value:function(e){var t=(e=l.Validation.offer_parameters(e)).name+"\0",r=[(e.size||0).toString(10),e.mtime?e.mtime.toString(8):"0",e.mode?(32768|e.mode).toString(8):"0","0"];return e.files_remaining&&(r.push(e.files_remaining),e.bytes_remaining&&r.push(e.bytes_remaining)),t+=r.join(" "),this._string_to_octets(t)}},{key:"send_offer",value:function(e){if(!e)throw"need file params!";if(this._sending_file)throw"Already sending file!";var t=this._convert_params_to_offer_payload_array(e);this._stop_keepalive();var r=this,n=function(){var n=new Promise(function(t){r._next_header_handler={ZSKIP:function(){r._start_keepalive(),t()},ZRPOS:function(n){r._sending_file=!0,t(new d(e,n.get_offset(),r._send_interim_file_piece.bind(r),r._end_file.bind(r)))}}});return r._send_header_and_data(["ZFILE"],t,"end_ack"),delete r._sent_ZDATA,n};return this._ensure_receiver_escapes_ctrl_chars().then(n)}},{key:"_send_header_and_data",value:function(e,t,r){var n=this._create_header_bytes(e),i=this._build_subpacket_bytes(t,r);n[0].push.apply(n[0],i),this._sender(n[0]),this._last_sent_header=n[1]}},{key:"_build_subpacket_bytes",value:function(e,t){return l.Subpacket.build(e,t)[this._subpacket_encode_func](this._zencoder)}},{key:"_build_and_send_subpacket",value:function(e,t){this._sender(this._build_subpacket_bytes(e,t))}},{key:"_string_to_octets",value:function(e){this._textencoder||(this._textencoder=new l.Text.Encoder);var t=this._textencoder.encode(e);return Array.prototype.slice.call(t)}},{key:"_send_interim_file_piece",value:function(e){return this._send_file_part(e,"no_end_no_ack"),Promise.resolve()}},{key:"_ensure_we_are_sending",value:function(){if(!this._sending_file)throw"Not sending a file currently!"}},{key:"_end_file",value:function(e){this._ensure_we_are_sending(),this._send_file_part(e,"end_no_ack");var t=this,r=new Promise(function(e){t._sending_file=!1,t._prepare_to_receive_ZRINIT(e)});return this._send_header("ZEOF",this._file_offset),this._file_offset=0,r}},{key:"_prepare_to_receive_ZRINIT",value:function(e){this._next_header_handler={ZRINIT:function(t){this._consume_ZRINIT(t),e&&e()}}}},{key:"close",value:function(){var e="ZRINIT"===this._last_header_name;if(e||(e="ZSKIP"===this._last_header_name),e||(e="ZSINIT"===this._last_sent_header.name&&"ZACK"===this._last_header_name),!e)throw"Can’t close; last received header was “"+this._last_header_name+"”";var t=this,r=new Promise(function(e,r){t._next_header_handler={ZFIN:function(){t._sender(h),t._sent_OO=!0,t._on_session_end(),e()}}});return this._send_header("ZFIN"),r}},{key:"_has_ended",value:function(){return this.aborted()||!!this._sent_OO}},{key:"_send_file_part",value:function(e,t){this._sent_ZDATA||(this._send_header("ZDATA",this._file_offset),this._sent_ZDATA=!0);for(var r=0,n=e.length;;){var i=Math.min(r+8192,n)-r,o=i+r>=n,s=e.slice(r,r+i);if(s instanceof Array||(s=Array.prototype.slice.call(s)),this._build_and_send_subpacket(s,o?t:"no_end_no_ack"),this._file_offset+=i,(r+=i)>=n)break}}},{key:"_consume_first",value:function(){if(!this._parse_and_consume_header()&&"67"===this._input_buffer.join())throw"Receiver has fallen back to YMODEM."}},{key:"_on_session_end",value:function(){this._stop_keepalive(),n(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_on_session_end",this).call(this)}}]),t}(),Object.assign(l.Session.Send.prototype,{type:"send"})},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=e.exports;Object.assign(o,r(39),r(152));var s=[42,42,24,66,48],a=["to_terminal","on_detect","on_retract","sender"],l=function(){function e(t,r,n,o){i(this,e),this._confirmer=r,this._denier=n,this._is_valid=o,this._session_type=t}return n(e,[{key:"confirm",value:function(){return this._confirmer.apply(this,arguments)}},{key:"deny",value:function(){return this._denier.apply(this,arguments)}},{key:"is_valid",value:function(){return this._is_valid.apply(this,arguments)}},{key:"get_session_role",value:function(){return this._session_type}}]),e}();o.Sentry=function(){function e(t){if(i(this,e),!t)throw"Need options!";var r=this;a.forEach(function(e){if(!t[e])throw"Need “"+e+"”!";r["_"+e]=t[e]}),this._cache=[]}return n(e,[{key:"_after_session_end",value:function(){this._zsession=null}},{key:"consume",value:function(e){if(e instanceof Array||(e=Array.prototype.slice.call(new Uint8Array(e))),this._zsession){var t=this._zsession;if(t.consume(e),!t.has_ended())return;e="receive"===t.type?t.get_trailing_bytes():[]}var r=this._parse(e),n=e;if(r){!!this._parsed_session&&(this._parsed_session.type===r.type&&(n=[]),this._on_retract()),this._parsed_session=r;var i=this;this._on_detect(new l(r.type,function(){if(!this.is_valid())throw"Stale ZMODEM session!";return r.on("garbage",i._to_terminal),r.on("session_end",i._after_session_end.bind(i)),r.set_sender(i._sender),delete i._parsed_session,i._zsession=r},this._send_abort.bind(this),function(){return i._parsed_session===r}))}else{var o=this._parsed_session;this._parsed_session=null,o&&(1===n.length&&67===n[0]&&this._send_abort(),this._on_retract())}this._to_terminal(n)}},{key:"get_confirmed_session",value:function(){return this._zsession||null}},{key:"_send_abort",value:function(){this._sender(o.ZMLIB.ABORT_SEQUENCE)}},{key:"_parse",value:function(e){var t=this._cache;for(t.push.apply(t,e);;){var r=o.ZMLIB.find_subarray(t,s);if(-1===r)break;t.splice(0,r);var n=void 0;try{n=o.Session.parse(t)}catch(e){}if(!n)break;return 1===t.length&&t[0]===o.ZMLIB.XON&&t.shift(),t.length?null:n}return t.splice(21),null}}]),e}()},function(e,t,r){"use strict";Object.assign(e.exports,r(153))},function(e,t,r){"use strict";var n=e.exports;function i(e){if(e.aborted())throw new n.Error("aborted")}window.Zmodem=n,Object.assign(n,r(154)),n.Browser={send_files:function(e,t,r){r||(r={});for(var n=[],o=0,s=t.length-1;s>=0;s--){var a=t[s];o+=a.size,n[s]={obj:a,name:a.name,size:a.size,mtime:new Date(a.lastModified),files_remaining:t.length-s,bytes_remaining:o}}var l=0;return function t(){var o=n[l];return o?(l++,e.send_offer(o).then(function(n){return r.on_offer_response&&r.on_offer_response(o.obj,n),void 0===n?t():new Promise(function(s){var a,l=new FileReader;l.onerror=function(e){throw console.error("file read error",e),"File read error: "+e},l.onprogress=function(t){t.target.result&&(a=new Uint8Array(t.target.result,n.get_offset()),i(e),n.send(a),r.on_progress&&r.on_progress(o.obj,n,a))},l.onload=function(l){a=new Uint8Array(l.target.result,n,a),i(e),n.end(a).then(function(){r.on_progress&&a.length&&r.on_progress(o.obj,n,a),r.on_file_complete&&r.on_file_complete(o.obj,n),s(t())})},l.readAsArrayBuffer(o.obj)})})):Promise.resolve()}()},save_to_disk:function(e,t){var r=new Blob(e),n=URL.createObjectURL(r),i=document.createElement("a");i.style.display="none",i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){(function(e){!function(e){function t(e){if("utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+e+"') is invalid.")}function r(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,"utf-8"!==e)throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(e.TextEncoder&&e.TextDecoder)return!1;Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var r=e.length,n=0,i=Math.max(32,r+(r>>1)+7),o=new Uint8Array(i>>3<<3);t<r;){var s=e.charCodeAt(t++);if(55296<=s&&56319>=s){if(t<r){var a=e.charCodeAt(t);56320==(64512&a)&&(++t,s=((1023&s)<<10)+(1023&a)+65536)}if(55296<=s&&56319>=s)continue}if(n+4>o.length&&(i+=8,i=(i*=1+t/e.length*2)>>3<<3,(a=new Uint8Array(i)).set(o),o=a),0==(4294967168&s))o[n++]=s;else{if(0==(4294965248&s))o[n++]=s>>6&31|192;else if(0==(4294901760&s))o[n++]=s>>12&15|224,o[n++]=s>>6&63|128;else{if(0!=(4292870144&s))continue;o[n++]=s>>18&7|240,o[n++]=s>>12&63|128,o[n++]=s>>6&63|128}o[n++]=63&s|128}}return o.slice(0,n)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1}),r.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");t=0;for(var r=(e=new Uint8Array(e)).length,n=[];t<r;){var i=e[t++];if(0===i)break;if(0==(128&i))n.push(i);else if(192==(224&i)){var o=63&e[t++];n.push((31&i)<<6|o)}else if(224==(240&i)){o=63&e[t++];var s=63&e[t++];n.push((31&i)<<12|o<<6|s)}else if(240==(248&i)){65535<(i=(7&i)<<18|(o=63&e[t++])<<12|(s=63&e[t++])<<6|63&e[t++])&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i)}}return String.fromCharCode.apply(null,n)},e.TextEncoder=t,e.TextDecoder=r}("undefined"!=typeof window?window:void 0!==e?e:this)}).call(this,r(156))},function(e,t,r){var n=r(1)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,r){var n=r(2),i=r(28),o=r(1)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,r){var n=r(159),i=r(58);e.exports=function(e,t,r){if(n(t))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(e))}},function(e,t,r){"use strict";var n=r(0),i=r(5),o=r(160),s="".endsWith;n(n.P+n.F*r(158)("endsWith"),"String",{endsWith:function(e){var t=o(this,e,"endsWith"),r=arguments.length>1?arguments[1]:void 0,n=i(t.length),a=void 0===r?n:Math.min(i(r),n),l=String(e);return s?s.call(t,l,a):t.slice(a-l.length,a)===l}})},function(e,t,r){r(161),e.exports=r(10).String.endsWith},function(e,t,r){r(19)("Float64",8,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(19)("Float32",4,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(19)("Uint32",4,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(19)("Int32",4,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(19)("Uint16",2,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(19)("Int16",2,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(19)("Uint8",1,function(e){return function(t,r,n){return e(this,t,r,n)}},!0)},function(e,t,r){r(19)("Uint8",1,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){r(19)("Int8",1,function(e){return function(t,r,n){return e(this,t,r,n)}})},function(e,t,r){var n=r(0);n(n.G+n.W+n.F*!r(50).ABV,{DataView:r(68).DataView})},function(e,t,r){"use strict";var n=r(0),i=r(50),o=r(68),s=r(12),a=r(32),l=r(5),c=r(2),h=r(3).ArrayBuffer,u=r(51),f=o.ArrayBuffer,_=o.DataView,d=i.ABV&&h.isView,p=f.prototype.slice,y=i.VIEW;n(n.G+n.W+n.F*(h!==f),{ArrayBuffer:f}),n(n.S+n.F*!i.CONSTR,"ArrayBuffer",{isView:function(e){return d&&d(e)||c(e)&&y in e}}),n(n.P+n.U+n.F*r(7)(function(){return!new f(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(e,t){if(void 0!==p&&void 0===t)return p.call(s(this),e);for(var r=s(this).byteLength,n=a(e,r),i=a(void 0===t?r:t,r),o=new(u(this,f))(l(i-n)),c=new _(this),h=new _(o),d=0;n<i;)h.setUint8(d++,c.getUint8(n++));return o}}),r(55)("ArrayBuffer")},function(e,t,r){r(173),r(172),r(171),r(170),r(169),r(168),r(167),r(166),r(165),r(164),r(163),r(72),e.exports=r(10)},function(e,t,r){"use strict";var n=r(0),i=r(70),o=r(95);n(n.S,"Promise",{try:function(e){var t=i.f(this),r=o(e);return(r.e?t.reject:t.resolve)(r.v),t.promise}})},function(e,t,r){"use strict";var n=r(0),i=r(10),o=r(3),s=r(51),a=r(94);n(n.P+n.R,"Promise",{finally:function(e){var t=s(this,i.Promise||o.Promise),r="function"==typeof e;return this.then(r?function(r){return a(t,e()).then(function(){return r})}:e,r?function(r){return a(t,e()).then(function(){throw r})}:e)}})},function(e,t,r){var n=r(3),i=r(96).set,o=n.MutationObserver||n.WebKitMutationObserver,s=n.process,a=n.Promise,l="process"==r(28)(s);e.exports=function(){var e,t,r,c=function(){var n,i;for(l&&(n=s.domain)&&n.exit();e;){i=e.fn,e=e.next;try{i()}catch(n){throw e?r():t=void 0,n}}t=void 0,n&&n.enter()};if(l)r=function(){s.nextTick(c)};else if(!o||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var h=a.resolve();r=function(){h.then(c)}}else r=function(){i.call(n,c)};else{var u=!0,f=document.createTextNode("");new o(c).observe(f,{characterData:!0}),r=function(){f.data=u=!u}}return function(n){var i={fn:n,next:void 0};t&&(t.next=i),e||(e=i,r()),t=i}}},function(e,t){e.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},function(e,t,r){var n=r(21),i=r(105),o=r(79),s=r(12),a=r(5),l=r(77),c={},h={};(t=e.exports=function(e,t,r,u,f){var _,d,p,y,m=f?function(){return e}:l(e),g=n(r,u,t?2:1),v=0;if("function"!=typeof m)throw TypeError(e+" is not iterable!");if(o(m)){for(_=a(e.length);_>v;v++)if((y=t?g(s(d=e[v])[0],d[1]):g(e[v]))===c||y===h)return y}else for(p=m.call(e);!(d=p.next()).done;)if((y=i(p,g,d.value,t))===c||y===h)return y}).BREAK=c,t.RETURN=h},function(e,t,r){"use strict";var n,i,o,s,a=r(31),l=r(3),c=r(21),h=r(42),u=r(0),f=r(2),_=r(20),d=r(71),p=r(179),y=r(51),m=r(96).set,g=r(177)(),v=r(70),b=r(95),C=r(94),w=l.TypeError,S=l.process,E=l.Promise,x="process"==h(S),A=function(){},k=i=v.f,L=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[r(1)("species")]=function(e){e(A,A)};return(x||"function"==typeof PromiseRejectionEvent)&&e.then(A)instanceof t}catch(e){}}(),T=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},O=function(e,t){if(!e._n){e._n=!0;var r=e._c;g(function(){for(var n=e._v,i=1==e._s,o=0,s=function(t){var r,o,s=i?t.ok:t.fail,a=t.resolve,l=t.reject,c=t.domain;try{s?(i||(2==e._h&&D(e),e._h=1),!0===s?r=n:(c&&c.enter(),r=s(n),c&&c.exit()),r===t.promise?l(w("Promise-chain cycle")):(o=T(r))?o.call(r,a,l):a(r)):l(n)}catch(e){l(e)}};r.length>o;)s(r[o++]);e._c=[],e._n=!1,t&&!e._h&&R(e)})}},R=function(e){m.call(l,function(){var t,r,n,i=e._v,o=M(e);if(o&&(t=b(function(){x?S.emit("unhandledRejection",i,e):(r=l.onunhandledrejection)?r({promise:e,reason:i}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",i)}),e._h=x||M(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},M=function(e){return 1!==e._h&&0===(e._a||e._c).length},D=function(e){m.call(l,function(){var t;x?S.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},P=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),O(t,!0))},H=function(e){var t,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw w("Promise can't be resolved itself");(t=T(e))?g(function(){var n={_w:r,_d:!1};try{t.call(e,c(H,n,1),c(P,n,1))}catch(e){P.call(n,e)}}):(r._v=e,r._s=1,O(r,!1))}catch(e){P.call({_w:r,_d:!1},e)}}};L||(E=function(e){d(this,E,"Promise","_h"),_(e),n.call(this);try{e(c(H,this,1),c(P,this,1))}catch(e){P.call(this,e)}},(n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(69)(E.prototype,{then:function(e,t){var r=k(y(this,E));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=x?S.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&O(this,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n;this.promise=e,this.resolve=c(H,e,1),this.reject=c(P,e,1)},v.f=k=function(e){return e===E||e===s?new o(e):i(e)}),u(u.G+u.W+u.F*!L,{Promise:E}),r(44)(E,"Promise"),r(55)("Promise"),s=r(10).Promise,u(u.S+u.F*!L,"Promise",{reject:function(e){var t=k(this);return(0,t.reject)(e),t.promise}}),u(u.S+u.F*(a||!L),"Promise",{resolve:function(e){return C(a&&this===s?E:this,e)}}),u(u.S+u.F*!(L&&r(76)(function(e){E.all(e).catch(A)})),"Promise",{all:function(e){var t=this,r=k(t),n=r.resolve,i=r.reject,o=b(function(){var r=[],o=0,s=1;p(e,!1,function(e){var a=o++,l=!1;r.push(void 0),s++,t.resolve(e).then(function(e){l||(l=!0,r[a]=e,--s||n(r))},i)}),--s||n(r)});return o.e&&i(o.v),r.promise},race:function(e){var t=this,r=k(t),n=r.reject,i=b(function(){p(e,!1,function(e){t.resolve(e).then(r.resolve,n)})});return i.e&&n(i.v),r.promise}})},function(e,t,r){for(var n=r(73),i=r(29),o=r(34),s=r(3),a=r(16),l=r(33),c=r(1),h=c("iterator"),u=c("toStringTag"),f=l.Array,_={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(_),p=0;p<d.length;p++){var y,m=d[p],g=_[m],v=s[m],b=v&&v.prototype;if(b&&(b[h]||a(b,h,f),b[u]||a(b,u,m),l[m]=f,g))for(y in n)b[y]||o(b,y,n[y],!0)}},function(e,t,r){r(72),r(110),r(181),r(180),r(176),r(175),e.exports=r(10).Promise},function(e,t,r){var n=r(0),i=r(97),o=r(46);n(n.S+n.F,"Object",{make:function(e,t){return i(o(e),t)}})},function(e,t,r){var n=r(0),i=r(97);n(n.S+n.F,"Object",{define:i})},function(e,t,r){var n=r(0);n(n.S+n.F,"Object",{classof:r(42)})},function(e,t,r){var n=r(0);n(n.S+n.F,"Object",{isObject:r(2)})},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(36),s=r(43),a=r(24).f;r(6)&&n(n.P+r(52),"Object",{__lookupSetter__:function(e){var t,r=i(this),n=o(e,!0);do{if(t=a(r,n))return t.set}while(r=s(r))}})},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(36),s=r(43),a=r(24).f;r(6)&&n(n.P+r(52),"Object",{__lookupGetter__:function(e){var t,r=i(this),n=o(e,!0);do{if(t=a(r,n))return t.get}while(r=s(r))}})},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(20),s=r(8);r(6)&&n(n.P+r(52),"Object",{__defineSetter__:function(e,t){s.f(i(this),e,{set:o(t),enumerable:!0,configurable:!0})}})},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(20),s=r(8);r(6)&&n(n.P+r(52),"Object",{__defineGetter__:function(e,t){s.f(i(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},function(e,t,r){var n=r(0),i=r(98)(!0);n(n.S,"Object",{entries:function(e){return i(e)}})},function(e,t,r){var n=r(0),i=r(98)(!1);n(n.S,"Object",{values:function(e){return i(e)}})},function(e,t,r){var n=r(0),i=r(99),o=r(9),s=r(24),a=r(78);n(n.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,r,n=o(e),l=s.f,c=i(n),h={},u=0;c.length>u;)void 0!==(r=l(n,t=c[u++]))&&a(h,t,r);return h}})},function(e,t,r){var n=r(2),i=r(12),o=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=r(21)(Function.call,r(24).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return o(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:o}},function(e,t,r){var n=r(0);n(n.S,"Object",{setPrototypeOf:r(194).set})},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,r){var n=r(0);n(n.S,"Object",{is:r(196)})},function(e,t,r){"use strict";var n=r(29),i=r(53),o=r(41),s=r(4),a=r(45),l=Object.assign;e.exports=!l||r(7)(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=l({},e)[r]||Object.keys(l({},t)).join("")!=n})?function(e,t){for(var r=s(e),l=arguments.length,c=1,h=i.f,u=o.f;l>c;)for(var f,_=a(arguments[c++]),d=h?n(_).concat(h(_)):n(_),p=d.length,y=0;p>y;)u.call(_,f=d[y++])&&(r[f]=_[f]);return r}:l},function(e,t,r){var n=r(0);n(n.S+n.F,"Object",{assign:r(198)})},function(e,t,r){var n=r(2);r(15)("isExtensible",function(e){return function(t){return!!n(t)&&(!e||e(t))}})},function(e,t,r){var n=r(2);r(15)("isSealed",function(e){return function(t){return!n(t)||!!e&&e(t)}})},function(e,t,r){var n=r(2);r(15)("isFrozen",function(e){return function(t){return!n(t)||!!e&&e(t)}})},function(e,t,r){var n=r(2),i=r(54).onFreeze;r(15)("preventExtensions",function(e){return function(t){return e&&n(t)?e(i(t)):t}})},function(e,t,r){var n=r(2),i=r(54).onFreeze;r(15)("seal",function(e){return function(t){return e&&n(t)?e(i(t)):t}})},function(e,t,r){var n=r(2),i=r(54).onFreeze;r(15)("freeze",function(e){return function(t){return e&&n(t)?e(i(t)):t}})},function(e,t,r){r(15)("getOwnPropertyNames",function(){return r(100).f})},function(e,t,r){var n=r(4),i=r(29);r(15)("keys",function(){return function(e){return i(n(e))}})},function(e,t,r){var n=r(4),i=r(43);r(15)("getPrototypeOf",function(){return function(e){return i(n(e))}})},function(e,t,r){var n=r(9),i=r(24).f;r(15)("getOwnPropertyDescriptor",function(){return function(e,t){return i(n(e),t)}})},function(e,t,r){var n=r(0);n(n.S+n.F*!r(6),"Object",{defineProperties:r(107)})},function(e,t,r){var n=r(0);n(n.S+n.F*!r(6),"Object",{defineProperty:r(8).f})},function(e,t,r){var n=r(0);n(n.S,"Object",{create:r(46)})},function(e,t,r){var n=r(29),i=r(53),o=r(41);e.exports=function(e){var t=n(e),r=i.f;if(r)for(var s,a=r(e),l=o.f,c=0;a.length>c;)l.call(e,s=a[c++])&&t.push(s);return t}},function(e,t,r){var n=r(3),i=r(10),o=r(31),s=r(101),a=r(8).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}},function(e,t,r){"use strict";var n=r(3),i=r(22),o=r(6),s=r(0),a=r(34),l=r(54).KEY,c=r(7),h=r(82),u=r(44),f=r(30),_=r(1),d=r(101),p=r(214),y=r(213),m=r(56),g=r(12),v=r(2),b=r(9),C=r(36),w=r(35),S=r(46),E=r(100),x=r(24),A=r(8),k=r(29),L=x.f,T=A.f,O=E.f,R=n.Symbol,M=n.JSON,D=M&&M.stringify,P=_("_hidden"),H=_("toPrimitive"),I={}.propertyIsEnumerable,B=h("symbol-registry"),F=h("symbols"),j=h("op-symbols"),N=Object.prototype,W="function"==typeof R,U=n.QObject,Z=!U||!U.prototype||!U.prototype.findChild,z=o&&c(function(){return 7!=S(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=L(N,t);n&&delete N[t],T(e,t,r),n&&e!==N&&T(N,t,n)}:T,K=function(e){var t=F[e]=S(R.prototype);return t._k=e,t},V=W&&"symbol"==typeof R.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof R},G=function(e,t,r){return e===N&&G(j,t,r),g(e),t=C(t,!0),g(r),i(F,t)?(r.enumerable?(i(e,P)&&e[P][t]&&(e[P][t]=!1),r=S(r,{enumerable:w(0,!1)})):(i(e,P)||T(e,P,w(1,{})),e[P][t]=!0),z(e,t,r)):T(e,t,r)},q=function(e,t){g(e);for(var r,n=y(t=b(t)),i=0,o=n.length;o>i;)G(e,r=n[i++],t[r]);return e},Y=function(e){var t=I.call(this,e=C(e,!0));return!(this===N&&i(F,e)&&!i(j,e))&&(!(t||!i(this,e)||!i(F,e)||i(this,P)&&this[P][e])||t)},X=function(e,t){if(e=b(e),t=C(t,!0),e!==N||!i(F,t)||i(j,t)){var r=L(e,t);return!r||!i(F,t)||i(e,P)&&e[P][t]||(r.enumerable=!0),r}},J=function(e){for(var t,r=O(b(e)),n=[],o=0;r.length>o;)i(F,t=r[o++])||t==P||t==l||n.push(t);return n},Q=function(e){for(var t,r=e===N,n=O(r?j:b(e)),o=[],s=0;n.length>s;)!i(F,t=n[s++])||r&&!i(N,t)||o.push(F[t]);return o};W||(a((R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(r){this===N&&t.call(j,r),i(this,P)&&i(this[P],e)&&(this[P][e]=!1),z(this,e,w(1,r))};return o&&Z&&z(N,e,{configurable:!0,set:t}),K(e)}).prototype,"toString",function(){return this._k}),x.f=X,A.f=G,r(40).f=E.f=J,r(41).f=Y,r(53).f=Q,o&&!r(31)&&a(N,"propertyIsEnumerable",Y,!0),d.f=function(e){return K(_(e))}),s(s.G+s.W+s.F*!W,{Symbol:R});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;$.length>ee;)_($[ee++]);for(var te=k(_.store),re=0;te.length>re;)p(te[re++]);s(s.S+s.F*!W,"Symbol",{for:function(e){return i(B,e+="")?B[e]:B[e]=R(e)},keyFor:function(e){if(!V(e))throw TypeError(e+" is not a symbol!");for(var t in B)if(B[t]===e)return t},useSetter:function(){Z=!0},useSimple:function(){Z=!1}}),s(s.S+s.F*!W,"Object",{create:function(e,t){return void 0===t?S(e):q(S(e),t)},defineProperty:G,defineProperties:q,getOwnPropertyDescriptor:X,getOwnPropertyNames:J,getOwnPropertySymbols:Q}),M&&s(s.S+s.F*(!W||c(function(){var e=R();return"[null]"!=D([e])||"{}"!=D({a:e})||"{}"!=D(Object(e))})),"JSON",{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(v(t)||void 0!==e)&&!V(e))return m(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!V(t))return t}),n[1]=t,D.apply(M,n)}}),R.prototype[H]||r(16)(R.prototype,H,R.prototype.valueOf),u(R,"Symbol"),u(Math,"Math",!0),u(n.JSON,"JSON",!0)},function(e,t,r){r(215),r(212),r(211),r(210),r(209),r(208),r(207),r(206),r(205),r(204),r(203),r(202),r(201),r(200),r(199),r(197),r(195),r(72),r(193),r(192),r(191),r(190),r(189),r(188),r(187),r(186),r(185),r(184),r(183),e.exports=r(10).Object},function(e,t,r){"use strict";var n=r(0),i=r(102),o=r(4),s=r(5),a=r(27),l=r(75);n(n.P,"Array",{flatten:function(){var e=arguments[0],t=o(this),r=s(t.length),n=l(t,0);return i(n,t,t,r,0,void 0===e?1:a(e)),n}}),r(25)("flatten")},function(e,t,r){"use strict";var n=r(0),i=r(102),o=r(4),s=r(5),a=r(20),l=r(75);n(n.P,"Array",{flatMap:function(e){var t,r,n=o(this);return a(e),t=s(n.length),r=l(n,0),i(r,n,n,t,0,1,e,arguments[1]),r}}),r(25)("flatMap")},function(e,t,r){"use strict";var n=r(0),i=r(57)(!0);n(n.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(25)("includes")},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){r(55)("Array")},function(e,t,r){"use strict";var n=r(0),i=r(26)(6),o="findIndex",s=!0;o in[]&&Array(1)[o](function(){s=!1}),n(n.P+n.F*s,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(25)(o)},function(e,t,r){"use strict";var n=r(0),i=r(26)(5),o=!0;"find"in[]&&Array(1).find(function(){o=!1}),n(n.P+n.F*o,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(25)("find")},function(e,t,r){var n=r(0);n(n.P,"Array",{fill:r(74)}),r(25)("fill")},function(e,t,r){var n=r(0);n(n.P,"Array",{copyWithin:r(103)}),r(25)("copyWithin")},function(e,t,r){"use strict";var n=r(0),i=r(9),o=r(27),s=r(5),a=[].lastIndexOf,l=!!a&&1/[1].lastIndexOf(1,-0)<0;n(n.P+n.F*(l||!r(11)(a)),"Array",{lastIndexOf:function(e){if(l)return a.apply(this,arguments)||0;var t=i(this),r=s(t.length),n=r-1;for(arguments.length>1&&(n=Math.min(n,o(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}})},function(e,t,r){"use strict";var n=r(0),i=r(57)(!1),o=[].indexOf,s=!!o&&1/[1].indexOf(1,-0)<0;n(n.P+n.F*(s||!r(11)(o)),"Array",{indexOf:function(e){return s?o.apply(this,arguments)||0:i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(104);n(n.P+n.F*!r(11)([].reduceRight,!0),"Array",{reduceRight:function(e){return i(this,e,arguments.length,arguments[1],!0)}})},function(e,t,r){"use strict";var n=r(0),i=r(104);n(n.P+n.F*!r(11)([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},function(e,t,r){"use strict";var n=r(0),i=r(26)(4);n(n.P+n.F*!r(11)([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(26)(3);n(n.P+n.F*!r(11)([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(26)(2);n(n.P+n.F*!r(11)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(26)(1);n(n.P+n.F*!r(11)([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},function(e,t,r){var n=r(2),i=r(56),o=r(1)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),n(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,r){"use strict";var n=r(0),i=r(26)(0),o=r(11)([].forEach,!0);n(n.P+n.F*!o,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(0),i=r(20),o=r(4),s=r(7),a=[].sort,l=[1,2,3];n(n.P+n.F*(s(function(){l.sort(void 0)})||!s(function(){l.sort(null)})||!r(11)(a)),"Array",{sort:function(e){return void 0===e?a.call(o(this)):a.call(o(this),i(e))}})},function(e,t,r){"use strict";var n=r(0),i=r(80),o=r(28),s=r(32),a=r(5),l=[].slice;n(n.P+n.F*r(7)(function(){i&&l.call(i)}),"Array",{slice:function(e,t){var r=a(this.length),n=o(this);if(t=void 0===t?r:t,"Array"==n)return l.call(this,e,t);for(var i=s(e,r),c=s(t,r),h=a(c-i),u=new Array(h),f=0;f<h;f++)u[f]="String"==n?this.charAt(i+f):this[i+f];return u}})},function(e,t,r){"use strict";var n=r(0),i=r(9),o=[].join;n(n.P+n.F*(r(45)!=Object||!r(11)(o)),"Array",{join:function(e){return o.call(i(this),void 0===e?",":e)}})},function(e,t,r){"use strict";var n=r(0),i=r(78);n(n.S+n.F*r(7)(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,r=new("function"==typeof this?this:Array)(t);t>e;)i(r,e,arguments[e++]);return r.length=t,r}})},function(e,t,r){"use strict";var n=r(21),i=r(0),o=r(4),s=r(105),a=r(79),l=r(5),c=r(78),h=r(77);i(i.S+i.F*!r(76)(function(e){Array.from(e)}),"Array",{from:function(e){var t,r,i,u,f=o(e),_="function"==typeof this?this:Array,d=arguments.length,p=d>1?arguments[1]:void 0,y=void 0!==p,m=0,g=h(f);if(y&&(p=n(p,d>2?arguments[2]:void 0,2)),void 0==g||_==Array&&a(g))for(r=new _(t=l(f.length));t>m;m++)c(r,m,y?p(f[m],m):f[m]);else for(u=g.call(f),r=new _;!(i=u.next()).done;m++)c(r,m,y?s(u,p,[i.value,m],!0):i.value);return r.length=m,r}})},function(e,t,r){var n=r(0);n(n.S,"Array",{isArray:r(56)})},function(e,t,r){"use strict";var n=r(46),i=r(35),o=r(44),s={};r(16)(s,r(1)("iterator"),function(){return this}),e.exports=function(e,t,r){e.prototype=n(s,{next:i(1,r)}),o(e,t+" Iterator")}},function(e,t,r){var n=r(27),i=r(58);e.exports=function(e){return function(t,r){var o,s,a=String(i(t)),l=n(r),c=a.length;return l<0||l>=c?e?"":void 0:(o=a.charCodeAt(l))<55296||o>56319||l+1===c||(s=a.charCodeAt(l+1))<56320||s>57343?e?a.charAt(l):o:e?a.slice(l,l+2):s-56320+(o-55296<<10)+65536}}},function(e,t,r){r(110),r(241),r(240),r(239),r(238),r(237),r(236),r(235),r(233),r(232),r(231),r(230),r(229),r(228),r(227),r(226),r(225),r(224),r(223),r(222),r(221),r(73),r(219),r(218),r(217),e.exports=r(10).Array},,,function(e,t,r){},function(e,t,r){"use strict";r(247),r(244),r(216),r(182),r(174),r(162),r(157);var n=r(155),i=r(146).Terminal;i.applyAddon(r(112)),i.applyAddon(r(111));var o={self:document.getElementById("modal"),header:document.getElementById("header"),status:{self:document.getElementById("status"),filesRemaining:document.getElementById("files-remaining"),bytesRemaining:document.getElementById("bytes-remaining")},choose:{self:document.getElementById("choose"),files:document.getElementById("files"),filesNames:document.getElementById("file-names")},progress:{self:document.getElementById("progress"),fileName:document.getElementById("file-name"),progressBar:document.getElementById("progress-bar"),bytesReceived:document.getElementById("bytes-received"),bytesFile:document.getElementById("bytes-file"),percentReceived:document.getElementById("percent-received"),skip:document.getElementById("skip")}};function s(e){o.status.self.style.display="",o.choose.self.style.display="none",o.progress.self.style.display="",o.status.filesRemaining.textContent=e.files_remaining,o.status.bytesRemaining.textContent=h(e.bytes_remaining,2),o.progress.fileName.textContent=e.name}function a(){o.self.classList.remove("is-active")}function l(e){o.header.textContent=e,o.status.self.style.display="none",o.choose.self.style.display="none",o.progress.self.style.display="none",o.progress.bytesReceived.textContent="-",o.progress.percentReceived.textContent="-%",o.progress.progressBar.textContent="0%",o.progress.progressBar.value=0,o.progress.skip.style.display="none"}function c(e){var t=e.get_details().size,r=e.get_offset();o.progress.bytesReceived.textContent=h(r,2),o.progress.bytesFile.textContent=h(t,2);var n=(100*r/t).toFixed(2);o.progress.percentReceived.textContent=n+"%",o.progress.progressBar.textContent=n+"%",o.progress.progressBar.setAttribute("value",n)}function h(e,t){if(isNaN(parseFloat(e))||!isFinite(e))return"-";if(0===e)return 0;void 0===t&&(t=1);var r=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,Math.floor(r))).toFixed(t)+" "+["bytes","KB","MB","GB","TB","PB"][r]}function u(e){return new Promise(function(t){var r;r=function(r){n.Browser.send_files(e,r,{on_progress:function(e,t){s(t.get_details()),c(t)},on_file_complete:function(e){}}).then(e.close.bind(e),console.error.bind(console)).then(function(){t()})},l("Sending files"),o.choose.self.style.display="",o.choose.files.disabled=!1,o.choose.files.value="",o.choose.filesNames.textContent="",o.choose.files.onchange=function(){this.disabled=!0;for(var e=this.files,t="",n=0;n<e.length;n++)0===n?t=e[n].name:t+=", "+e[n].name;o.choose.filesNames.textContent=t,r(e)},o.self.classList.add("is-active")})}function f(e){e.on("offer",function(e){!function(e){l("Receiving files"),s(e.get_details()),o.progress.skip.disabled=!1,o.progress.skip.onclick=function(){this.disabled=!0,e.skip()},o.progress.skip.style.display="",o.self.classList.add("is-active")}(e);var t=[];e.on("input",function(r){c(e),t.push(new Uint8Array(r))}),e.accept().then(function(){n.Browser.save_to_disk(t,e.get_details().name)},console.error.bind(console))});var t=new Promise(function(t){e.on("session_end",function(){t()})});return e.start(),t}var _,d,p,y,m=document.getElementById("terminal-container"),g=("https:"===window.location.protocol?"wss://":"ws://")+window.location.host+window.location.pathname+(window.location.pathname.endsWith("/")?"":"/")+"ws"+window.location.search,v=new TextDecoder,b=new TextEncoder,C="undefined"!=typeof tty_auth_token?tty_auth_token:null,w=-1,S=function e(){var t=new WebSocket(g,["tty"]),r=function(e){t.readyState===WebSocket.OPEN&&t.send(b.encode(e))},o=function(e){r("0"+e)},s=function(e){var t="Close terminal? this will also terminate the command.";return(e||window.event).returnValue=t,t},l=new n.Sentry({to_terminal:function(e){var t=new Uint8Array(e).buffer;d.write(v.decode(t))},sender:function(e){for(;e.length;){var r=e.splice(0,4095),n=new Uint8Array(r.length+1);n[0]="0".charCodeAt(0),n.set(r,1),t.send(n)}},on_retract:function(){},on_detect:function(e){d.setOption("disableStdin",!0);var t=e.confirm();("send"===t.type?u(t):f(t)).catch(console.error.bind(console)).then(function(){a(),d.setOption("disableStdin",!1)})}});t.binaryType="arraybuffer",t.onopen=function(e){for(console.log("[ttyd] websocket opened"),y=!1,r(JSON.stringify({AuthToken:C})),void 0!==d&&d.dispose(),(d=window.term=new i({fontSize:13,fontFamily:'"Menlo for Powerline", Menlo, Consolas, "Liberation Mono", Courier, monospace',theme:{foreground:"#d2d2d2",background:"#2b2b2b",cursor:"#adadad",black:"#000000",red:"#d81e00",green:"#5ea702",yellow:"#cfae00",blue:"#427ab3",magenta:"#89658e",cyan:"#00a7aa",white:"#dbded8",brightBlack:"#686a66",brightRed:"#f54235",brightGreen:"#99e343",brightYellow:"#fdeb61",brightBlue:"#84b0d8",brightMagenta:"#bc94b7",brightCyan:"#37e6e8",brightWhite:"#f1f1f0"}})).on("resize",function(e){t.readyState===WebSocket.OPEN&&r("1"+JSON.stringify({columns:e.cols,rows:e.rows})),setTimeout(function(){d.showOverlay(e.cols+"x"+e.rows)},500)}),d.on("title",function(e){e&&""!==e&&(document.title=e+" | "+p)}),d.on("data",o);m.firstChild;)m.removeChild(m.firstChild);window.addEventListener("resize",function(){clearTimeout(window.resizedFinished),window.resizedFinished=setTimeout(function(){d.fit()},250)}),window.addEventListener("beforeunload",s),d.open(m,!0),d.fit(),d.focus()},t.onmessage=function(r){var n=new Uint8Array(r.data),i=String.fromCharCode(n[0]),o=n.slice(1).buffer;switch(i){case"0":try{l.consume(o)}catch(r){console.error(r),a(),clearTimeout(_),t.readyState!==WebSocket.CLOSED&&t.close(),e()}break;case"1":p=v.decode(o),document.title=p;break;case"2":var s=JSON.parse(v.decode(o));Object.keys(s).forEach(function(e){console.log("[ttyd] xterm option: "+e+"="+s[e]),d.setOption(e,s[e])});break;case"3":w=JSON.parse(v.decode(o)),console.log("[ttyd] reconnect: "+w+" seconds");break;default:console.log("[ttyd] unknown command: "+i)}},t.onclose=function(t){console.log("[ttyd] websocket closed, code: "+t.code),d&&(d.off("data"),d.off("resize"),y||d.showOverlay("Connection Closed",null)),window.removeEventListener("beforeunload",s),1e3!==t.code&&w>0&&(_=setTimeout(e,1e3*w))}};"complete"===document.readyState||"loading"!==document.readyState?S():document.addEventListener("DOMContentLoaded",S)}]);</script></body></html>
\ No newline at end of file