!function(){"use strict";function t(t,s){for(var e=s-t,r=new Array(e);e--;)r[e]=--s;return r}function s(t,s,e,r,i){t[e<<8|s]=(0|r)<<4|(void 0===i?e:i)}function e(t,e,r,i,n){for(var a=0;a31&&s<128)n=n+1?0|n:0|f;else{switch((e=0|(s<160?0|this.transitions[i<<8|s|0]:16))>>4|0){case 2:n=n+1?0|n:0|f;break;case 3:n+1&&(this.term.inst_p(t.substring(n,f)),n=-1),this.term.inst_x(String.fromCharCode(s));break;case 0:n+1?(this.term.inst_p(t.substring(n,f)),n=-1):a+1&&(this.term.inst_P(t.substring(a,f)),a=-1);break;case 1:if(s>159)switch(i){case 0:n=n+1?0|n:0|f;break;case 8:o+=String.fromCharCode(s),e|=8;break;case 6:e|=6;break;case 11:e|=11;break;case 13:a+1||(a=0|f),e|=13;break;default:r=!0}else r=!0;if(r){if(this.term.inst_E({pos:f,character:String.fromCharCode(s),state:i,print:n,dcs:a,osc:o,collect:c,params:h}))return;r=!1}break;case 7:this.term.inst_c(c,h,String.fromCharCode(s));break;case 8:59===s?h.push(0):h[h.length-1]=10*h[h.length-1]+s-48|0;break;case 9:c+=String.fromCharCode(s);break;case 10:this.term.inst_e(c,String.fromCharCode(s));break;case 11:n+1&&(this.term.inst_p(t.substring(n,f)),n=-1),o="",h=[0],c="",a=-1;break;case 12:this.term.inst_H(c,h,String.fromCharCode(s));break;case 13:a+1||(a=0|f);break;case 14:a+1&&this.term.inst_P(t.substring(a,f)),this.term.inst_U(),27===s&&(e|=1),o="",h=[0],c="",a=-1;break;case 4:~n&&(this.term.inst_p(t.substring(n,f)),n=-1),o="";break;case 5:o+=t.charAt(f);break;case 6:o&&24!==s&&26!==s&&this.term.inst_o(o),27===s&&(e|=1),o="",h=[0],c="",a=-1}i=15&e|0}!i&&n+1?this.term.inst_p(t.substring(n)):13===i&&a+1&&this.term.inst_P(t.substring(a)),this.osc=o,this.collected=c,this.params=h,this.current_state=0|i},"undefined"!=typeof module&&void 0!==module.exports?module.exports=r:"function"==typeof define&&define.amd?define([],function(){return r}):window.AnsiParser=r}();