(window.webpackJsonpivprogCore=window.webpackJsonpivprogCore||[]).push([[1],[,function(t,e,n){t.exports=n(89)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e){function n(t,e){for(var n=0;n0){for(o+=s,e=1;en)throw Error(d+t)}function L(t,e,n,r){var i,o,s,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=v(10,7-e),a=t[i]%o|0,null==r?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),s=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(t[i+1]/o/100|0)==v(10,e-2)-1||(a==o/2||0==a)&&0==(t[i+1]/o/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),s=(r||n<4)&&9999==a||!r&&n>3&&4999==a):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(t[i+1]/o/1e3|0)==v(10,e-3)-1,s}function N(t,e,n){for(var r,i,o=[0],s=0,a=t.length;sn-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}w.absoluteValue=w.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),O(t)},w.ceil=function(){return O(new this.constructor(this),this.e+1,2)},w.comparedTo=w.cmp=function(t){var e,n,r,i,o=this,s=o.d,a=(t=new o.constructor(t)).d,l=o.s,u=t.s;if(!s||!a)return l&&u?l!==u?l:s===a?0:!s^l<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(e=0,n=(r=s.length)<(i=a.length)?r:i;ea[e]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1},w.cosine=w.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r,i=e.d.length;i<32?(n=Math.ceil(i/3),r=(1/G(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10");t.precision+=n,e=q(t,1,e.times(r),new t(1));for(var o=n;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=n,e}(r,K(r,n)),r.precision=t,r.rounding=e,O(2==a||3==a?n.neg():n,t,e,!0)):new r(1):new r(NaN)},w.cubeRoot=w.cbrt=function(){var t,e,n,r,i,o,s,a,l,u,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(f=!1,(o=c.s*v(c.s*c,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=E(c.d),(o=((t=c.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=v(n,1/3),t=g((t+1)/3)-(t%3==(t<0?-1:2)),(r=new h(n=o==1/0?"5e"+t:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+t)).s=c.s),s=(t=h.precision)+3;;)if(u=(l=(a=r).times(a).times(a)).plus(c),r=k(u.plus(c).times(a),u.plus(l),s+2,1),E(a.d).slice(0,s)===(n=E(r.d)).slice(0,s)){if("9999"!=(n=n.slice(s-3,s+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(O(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!i&&(O(a,t+1,0),a.times(a).times(a).eq(c))){r=a;break}s+=4,i=1}return f=!0,O(r,t,h.rounding,e)},w.decimalPlaces=w.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=7*((t=e.length-1)-g(this.e/7)),t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},w.dividedBy=w.div=function(t){return k(this,new this.constructor(t))},w.dividedToIntegerBy=w.divToInt=function(t){var e=this.constructor;return O(k(this,new e(t),0,1,1),e.precision,e.rounding)},w.equals=w.eq=function(t){return 0===this.cmp(t)},w.floor=function(){return O(new this.constructor(this),this.e+1,3)},w.greaterThan=w.gt=function(t){return this.cmp(t)>0},w.greaterThanOrEqualTo=w.gte=function(t){var e=this.cmp(t);return 1==e||0===e},w.hyperbolicCosine=w.cosh=function(){var t,e,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?e=(1/G(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=q(s,1,o.times(e),new s(1),!0);for(var l,u=t,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return O(o,s.precision=n,s.rounding=r,!0)},w.hyperbolicSine=w.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=q(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=q(o,2,i=i.times(1/G(5,t)),i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);t--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=e,o.rounding=n,O(i,e,n,!0)},w.hyperbolicTangent=w.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,k(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},w.inverseCosine=w.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?P(n,i,o):new n(0):new n(NaN):e.isZero()?P(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=P(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},w.inverseHyperbolicCosine=w.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,f=!1,n=n.times(n).minus(1).sqrt().plus(n),f=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},w.inverseHyperbolicSine=w.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,f=!1,n=n.times(n).plus(1).sqrt().plus(n),f=!0,r.precision=t,r.rounding=e,n.ln())},w.inverseHyperbolicTangent=w.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?O(new o(i),t,e,!0):(o.precision=n=r-i.e,i=k(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},w.inverseSine=w.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=P(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},w.inverseTangent=w.atan=function(){var t,e,n,r,i,o,s,a,l,u=this,c=u.constructor,h=c.precision,p=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&h+4<=C)return(s=P(c,h+4,p).times(.25)).s=u.s,s}else{if(!u.s)return new c(NaN);if(h+4<=C)return(s=P(c,h+4,p).times(.5)).s=u.s,s}for(c.precision=a=h+10,c.rounding=1,t=n=Math.min(28,a/7+2|0);t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(f=!1,e=Math.ceil(a/7),r=1,l=u.times(u),s=new c(u),i=u;-1!==t;)if(i=i.times(l),o=s.minus(i.div(r+=2)),i=i.times(l),void 0!==(s=o.plus(i.div(r+=2))).d[e])for(t=e;s.d[t]===o.d[t]&&t--;);return n&&(s=s.times(2<this.d.length-2},w.isNaN=function(){return!this.s},w.isNegative=w.isNeg=function(){return this.s<0},w.isPositive=w.isPos=function(){return this.s>0},w.isZero=function(){return!!this.d&&0===this.d[0]},w.lessThan=w.lt=function(t){return this.cmp(t)<0},w.lessThanOrEqualTo=w.lte=function(t){return this.cmp(t)<1},w.logarithm=w.log=function(t){var e,n,r,i,o,s,a,l,u=this.constructor,c=u.precision,h=u.rounding;if(null==t)t=new u(10),e=!0;else{if(n=(t=new u(t)).d,t.s<0||!n||!n[0]||t.eq(1))return new u(NaN);e=t.eq(10)}if(n=this.d,this.s<0||!n||!n[0]||this.eq(1))return new u(n&&!n[0]?-1/0:1!=this.s?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(f=!1,s=j(this,a=c+5),r=e?M(u,a+10):j(t,a),L((l=k(s,r,a,1)).d,i=c,h))do{if(s=j(this,a+=10),r=e?M(u,a+10):j(t,a),l=k(s,r,a,1),!o){+E(l.d).slice(i+1,i+15)+1==1e14&&(l=O(l,c+1,0));break}}while(L(l.d,i+=10,h));return f=!0,O(l,c,h)},w.minus=w.sub=function(t){var e,n,r,i,o,s,a,l,u,c,h,p,d=this,v=d.constructor;if(t=new v(t),!d.d||!t.d)return d.s&&t.s?d.d?t.s=-t.s:t=new v(t.d||d.s!==t.s?d:NaN):t=new v(NaN),t;if(d.s!=t.s)return t.s=-t.s,d.plus(t);if(u=d.d,p=t.d,a=v.precision,l=v.rounding,!u[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!u[0])return new v(3===l?-0:0);t=new v(d)}return f?O(t,a,l):t}if(n=g(t.e/7),c=g(d.e/7),u=u.slice(),o=c-n){for((h=o<0)?(e=u,o=-o,s=p.length):(e=p,n=c,s=u.length),o>(r=Math.max(Math.ceil(a/7),s)+2)&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((h=(r=u.length)<(s=p.length))&&(s=r),r=0;r0;--r)u[s++]=0;for(r=p.length;r>o;){if(u[--r](s=(o=Math.ceil(a/7))>s?o+1:s+1)&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((s=u.length)-(i=c.length)<0&&(i=s,n=c,c=u,u=n),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/b|0,u[i]%=b;for(e&&(u.unshift(e),++r),s=u.length;0==u[--s];)u.pop();return t.d=u,t.e=I(u,r),f?O(t,a,l):t},w.precision=w.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(d+t);return n.d?(e=D(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},w.round=function(){var t=this,e=t.constructor;return O(new e(t),t.e+1,e.rounding)},w.sine=w.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r=e.d.length;if(r<3)return q(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=e.times(1/G(5,n)),e=q(t,2,e,e);for(var i,o=new t(5),s=new t(16),a=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(a))));return e}(r,K(r,n)),r.precision=t,r.rounding=e,O(a>2?n.neg():n,t,e,!0)):new r(NaN)},w.squareRoot=w.sqrt=function(){var t,e,n,r,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(1!==u||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(f=!1,0==(u=Math.sqrt(+s))||u==1/0?(((e=E(a)).length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=g((l+1)/2)-(l<0||l%2),r=new c(e=u==1/0?"1e"+l:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+l)):r=new c(u.toString()),n=(l=c.precision)+3;;)if(r=(o=r).plus(k(s,o,n+2,1)).times(.5),E(o.d).slice(0,n)===(e=E(r.d)).slice(0,n)){if("9999"!=(e=e.slice(n-3,n+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(O(r,l+1,1),t=!r.times(r).eq(s));break}if(!i&&(O(o,l+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}return f=!0,O(r,l,c.rounding,t)},w.tangent=w.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=k(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,O(2==a||4==a?n.neg():n,t,e,!0)):new r(NaN)},w.times=w.mul=function(t){var e,n,r,i,o,s,a,l,u,c=this,h=c.constructor,p=c.d,d=(t=new h(t)).d;if(t.s*=c.s,!(p&&p[0]&&d&&d[0]))return new h(!t.s||p&&!p[0]&&!d||d&&!d[0]&&!p?NaN:p&&d?0*t.s:t.s/0);for(n=g(c.e/7)+g(t.e/7),(l=p.length)<(u=d.length)&&(o=p,p=d,d=o,s=l,l=u,u=s),o=[],r=s=l+u;r--;)o.push(0);for(r=u;--r>=0;){for(e=0,i=l+r;i>r;)a=o[i]+d[r]*p[i-r-1]+e,o[i--]=a%b|0,e=a/b|0;o[i]=(o[i]+e)%b|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=I(o,n),f?O(t,h.precision,h.rounding):t},w.toBinary=function(t,e){return Y(this,2,t,e)},w.toDecimalPlaces=w.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(A(t,0,1e9),void 0===e?e=r.rounding:A(e,0,8),O(n,t+n.e+1,e))},w.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=_(r,!0):(A(t,0,1e9),void 0===e?e=i.rounding:A(e,0,8),n=_(r=O(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},w.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=_(i):(A(t,0,1e9),void 0===e?e=o.rounding:A(e,0,8),n=_(r=O(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},w.toFraction=function(t){var e,n,r,i,o,s,a,l,u,c,h,p,g=this,m=g.d,y=g.constructor;if(!m)return new y(g);if(u=n=new y(1),r=l=new y(0),s=(o=(e=new y(r)).e=D(m)-g.e-1)%7,e.d[0]=v(10,s<0?7+s:s),null==t)t=o>0?e:u;else{if(!(a=new y(t)).isInt()||a.lt(u))throw Error(d+a);t=a.gt(e)?o>0?e:u:a}for(f=!1,a=new y(E(m)),c=y.precision,y.precision=o=7*m.length*2;h=k(a,e,0,1,1),1!=(i=n.plus(h.times(r))).cmp(t);)n=r,r=i,i=u,u=l.plus(h.times(i)),l=i,i=e,e=a.minus(h.times(i)),a=i;return i=k(t.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=g.s,p=k(u,r,o,1).minus(g).abs().cmp(k(l,n,o,1).minus(g).abs())<1?[u,r]:[l,n],y.precision=c,f=!0,p},w.toHexadecimal=w.toHex=function(t,e){return Y(this,16,t,e)},w.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),null==t){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:A(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(f=!1,n=k(n,t,0,e,1).times(t),f=!0,O(n)):(t.s=n.s,n=t),n},w.toNumber=function(){return+this},w.toOctal=function(t,e){return Y(this,8,t,e)},w.toPower=w.pow=function(t){var e,n,r,i,o,s,a=this,l=a.constructor,u=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(v(+a,u));if((a=new l(a)).eq(1))return a;if(r=l.precision,o=l.rounding,t.eq(1))return O(a,r,o);if((e=g(t.e/7))>=t.d.length-1&&(n=u<0?-u:u)<=9007199254740991)return i=F(l,a,n,r),t.s<0?new l(1).div(i):O(i,r,o);if((s=a.s)<0){if(el.maxE+1||e0?s/0:0):(f=!1,l.rounding=a.s=1,n=Math.min(12,(e+"").length),(i=W(t.times(j(a,r+n)),r)).d&&L((i=O(i,r+5,1)).d,r,o)&&(e=r+10,+E((i=O(W(t.times(j(a,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=O(i,r+1,0))),i.s=s,f=!0,l.rounding=o,O(i,r,o))},w.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=_(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(A(t,1,1e9),void 0===e?e=i.rounding:A(e,0,8),n=_(r=O(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},w.toSignificantDigits=w.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(A(t,1,1e9),void 0===e?e=n.rounding:A(e,0,8)),O(new n(this),t,e)},w.toString=function(){var t=this,e=t.constructor,n=_(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},w.truncated=w.trunc=function(){return O(new this.constructor(this),this.e+1,1)},w.valueOf=w.toJSON=function(){var t=this,e=t.constructor,n=_(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var k=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]1;)t.shift()}return function(r,i,o,a,l,u){var c,h,p,f,d,v,m,y,x,S,T,C,w,E,A,L,N,k,_,I,M=r.constructor,P=r.s==i.s?1:-1,D=r.d,R=i.d;if(!(D&&D[0]&&R&&R[0]))return new M(r.s&&i.s&&(D?!R||D[0]!=R[0]:R)?D&&0==D[0]||!R?0*P:P/0:NaN);for(u?(d=1,h=r.e-i.e):(u=b,d=7,h=g(r.e/d)-g(i.e/d)),_=R.length,N=D.length,S=(x=new M(P)).d=[],p=0;R[p]==(D[p]||0);p++);if(R[p]>(D[p]||0)&&h--,null==o?(E=o=M.precision,a=M.rounding):E=l?o+(r.e-i.e)+1:o,E<0)S.push(1),v=!0;else{if(E=E/d+2|0,p=0,1==_){for(f=0,R=R[0],E++;(p1&&(R=t(R,f,u),D=t(D,f,u),_=R.length,N=D.length),L=_,C=(T=D.slice(0,_)).length;C<_;)T[C++]=0;(I=R.slice()).unshift(0),k=R[0],R[1]>=u/2&&++k;do{f=0,(c=e(R,T,_,C))<0?(w=T[0],_!=C&&(w=w*u+(T[1]||0)),(f=w/k|0)>1?(f>=u&&(f=u-1),1==(c=e(m=t(R,f,u),T,y=m.length,C=T.length))&&(f--,n(m,_=10;f/=10)p++;x.e=p+h*d-1,O(x,l?o+x.e+1:o,a,v)}return x}}();function O(t,e,n,r){var i,o,s,a,l,u,c,h,p,d=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(i=1,a=h[0];a>=10;a/=10)i++;if((o=e-i)<0)o+=7,s=e,l=(c=h[p=0])/v(10,i-s-1)%10|0;else if((p=Math.ceil((o+1)/7))>=(a=h.length)){if(!r)break t;for(;a++<=p;)h.push(0);c=l=0,i=1,s=(o%=7)-7+1}else{for(c=a=h[p],i=1;a>=10;a/=10)i++;l=(s=(o%=7)-7+i)<0?0:c/v(10,i-s-1)%10|0}if(r=r||e<0||void 0!==h[p+1]||(s<0?c:c%v(10,i-s-1)),u=n<4?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?s>0?c/v(10,i-s):0:h[p-1])%10&1||n==(t.s<0?8:7)),e<1||!h[0])return h.length=0,u?(e-=t.e+1,h[0]=v(10,(7-e%7)%7),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=p,a=1,p--):(h.length=p+1,a=v(10,7-o),h[p]=s>0?(c/v(10,i-s)%v(10,s)|0)*a:0),u)for(;;){if(0==p){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,h[0]==b&&(h[0]=1));break}if(h[p]+=a,h[p]!=b)break;h[p--]=0,a=1}for(o=h.length;0===h[--o];)h.pop()}return f&&(t.e>d.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+R(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+R(-i-1)+o,n&&(r=n-s)>0&&(o+=R(r))):i>=s?(o+=R(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+R(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=R(r))),o}function I(t,e){var n=t[0];for(e*=7;n>=10;n/=10)e++;return e}function M(t,e,n){if(e>T)throw f=!0,n&&(t.precision=n),Error("[DecimalError] Precision limit exceeded");return O(new t(c),e,1,!0)}function P(t,e,n){if(e>C)throw Error("[DecimalError] Precision limit exceeded");return O(new t(h),e,n,!0)}function D(t){var e=t.length-1,n=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function R(t){for(var e="";t--;)e+="0";return e}function F(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/7+4);for(f=!1;;){if(n%2&&X((o=o.times(e)).d,s)&&(i=!0),0===(n=g(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}X((e=e.times(e)).d,s)}return f=!0,o}function H(t){return 1&t.d[t.d.length-1]}function B(t,e,n){for(var r,i=new t(e[0]),o=0;++o17)return new p(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(f=!1,l=g):l=e,a=new p(.03125);t.e>-2;)t=t.times(a),h+=5;for(l+=r=Math.log(v(2,h))/Math.LN10*2+5|0,n=o=s=new p(1),p.precision=l;;){if(o=O(o.times(t),l,1),n=n.times(++c),E((a=s.plus(k(o,n,l,1))).d).slice(0,l)===E(s.d).slice(0,l)){for(i=h;i--;)s=O(s.times(s),l,1);if(null!=e)return p.precision=g,s;if(!(u<3&&L(s.d,l-r,d,u)))return O(s,p.precision=g,d,f=!0);p.precision=l+=10,n=o=a=new p(1),c=0,u++}s=a}}function j(t,e){var n,r,i,o,s,a,l,u,c,h,p,d=1,g=t,v=g.d,m=g.constructor,y=m.rounding,x=m.precision;if(g.s<0||!v||!v[0]||!g.e&&1==v[0]&&1==v.length)return new m(v&&!v[0]?-1/0:1!=g.s?NaN:v?0:g);if(null==e?(f=!1,c=x):c=e,m.precision=c+=10,r=(n=E(v)).charAt(0),!(Math.abs(o=g.e)<15e14))return u=M(m,c+2,x).times(o+""),g=j(new m(r+"."+n.slice(1)),c-10).plus(u),m.precision=x,null==e?O(g,x,y,f=!0):g;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=E((g=g.times(t)).d)).charAt(0),d++;for(o=g.e,r>1?(g=new m("0."+n),o++):g=new m(r+"."+n.slice(1)),h=g,l=s=g=k(g.minus(1),g.plus(1),c,1),p=O(g.times(g),c,1),i=3;;){if(s=O(s.times(p),c,1),E((u=l.plus(k(s,new m(i),c,1))).d).slice(0,c)===E(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(M(m,c+2,x).times(o+""))),l=k(l,new m(d),c,1),null!=e)return m.precision=x,l;if(!L(l.d,c-10,y,a))return O(l,m.precision=x,y,f=!0);m.precision=c+=10,u=s=g=k(h.minus(1),h.plus(1),c,1),p=O(g.times(g),c,1),i=a=1}l=u,i+=2}}function z(t){return String(t.s*t.s/0)}function U(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%7,n<0&&(r+=7),rt.constructor.maxE?(t.d=null,t.e=NaN):t.e0?(u=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),a=(s=e.indexOf("."))>=0,r=t.constructor,a&&(s=(l=(e=e.replace(".","")).length)-s,i=F(r,new r(n),s,2*s)),s=h=(c=N(e,n,b)).length-1;0===c[s];--s)c.pop();return s<0?new r(0*t.s):(t.e=I(c,h),t.d=c,f=!1,a&&(t=k(t,i,4*l)),u&&(t=t.times(Math.abs(u)<54?v(2,u):o.pow(2,u))),f=!0,t)}function q(t,e,n,r,i){var o,s,a,l,u=t.precision,c=Math.ceil(u/7);for(f=!1,l=n.times(n),a=new t(r);;){if(s=k(a.times(l),new t(e++*e++),u,1),a=i?r.plus(s):r.minus(s),r=k(s.times(l),new t(e++*e++),u,1),void 0!==(s=a.plus(r)).d[c]){for(o=c;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=r,r=s,s=o}return f=!0,s.d.length=c+1,s}function G(t,e){for(var n=t;--e;)n*=t;return n}function K(t,e){var n,r=e.s<0,i=P(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return a=r?4:1,e;if((n=e.divToInt(i)).isZero())a=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return a=H(n)?r?2:3:r?4:1,e;a=H(n)?r?1:4:r?3:2}return e.minus(i).abs()}function Y(t,e,n,r){var i,o,a,l,c,h,p,f,d,g=t.constructor,v=void 0!==n;if(v?(A(n,1,1e9),void 0===r?r=g.rounding:A(r,0,8)):(n=g.precision,r=g.rounding),t.isFinite()){for(v?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(a=(p=_(t)).indexOf("."))>=0&&(p=p.replace(".",""),(d=new g(1)).e=p.length-a,d.d=N(_(d),10,i),d.e=d.d.length),o=c=(f=N(p,10,i)).length;0==f[--c];)f.pop();if(f[0]){if(a<0?o--:((t=new g(t)).d=f,t.e=o,f=(t=k(t,d,n,r,0,i)).d,o=t.e,h=s),a=f[n],l=i/2,h=h||void 0!==f[n+1],h=r<4?(void 0!==a||h)&&(0===r||r===(t.s<0?3:2)):a>l||a===l&&(4===r||h||6===r&&1&f[n-1]||r===(t.s<0?8:7)),f.length=n,h)for(;++f[--n]>i-1;)f[n]=0,n||(++o,f.unshift(1));for(c=f.length;!f[c-1];--c);for(a=0,p="";a1)if(16==e||8==e){for(a=16==e?4:3,--c;c%a;c++)p+="0";for(c=(f=N(p,i,e)).length;!f[c-1];--c);for(a=1,p="1.";ac)for(o-=c;o--;)p+="0";else oe)return t.length=e,!0}function $(t){return new this(t).abs()}function Z(t){return new this(t).acos()}function J(t){return new this(t).acosh()}function Q(t,e){return new this(t).plus(e)}function tt(t){return new this(t).asin()}function et(t){return new this(t).asinh()}function nt(t){return new this(t).atan()}function rt(t){return new this(t).atanh()}function it(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?P(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=P(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(k(t,e,o,1)),e=P(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(k(t,e,o,1)):(n=P(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function ot(t){return new this(t).cbrt()}function st(t){return O(t=new this(t),t.e+1,2)}function at(t){if(!t||"object"!=typeof t)throw Error("[DecimalError] Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-l,0,"toExpPos",0,l,"maxE",0,l,"minE",-l,0,"modulo",0,9];for(e=0;e=o[e+1]&&r<=o[e+2]))throw Error(d+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=p[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(d+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[n]=!0}else this[n]=!1}return this}function lt(t){return new this(t).cos()}function ut(t){return new this(t).cosh()}function ct(t,e){return new this(t).div(e)}function ht(t){return new this(t).exp()}function pt(t){return O(t=new this(t),t.e+1,3)}function ft(){var t,e,n=new this(0);for(f=!1,t=0;t=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(e=crypto.randomBytes(r*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(a.push(i%1e7),o+=4);o=r/4}else for(;o=10;i/=10)r++;r<7&&(n-=7-r)}return s.e=n,s.d=a,s}function Et(t){return O(t=new this(t),t.e+1,this.rounding)}function At(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Lt(t){return new this(t).sin()}function Nt(t){return new this(t).sinh()}function kt(t){return new this(t).sqrt()}function Ot(t,e){return new this(t).sub(e)}function _t(t){return new this(t).tan()}function It(t){return new this(t).tanh()}function Mt(t){return O(t=new this(t),t.e+1,1)}(o=function t(e){var n,r,i;function o(t){var e,n,r,i=this;if(!(i instanceof o))return new o(t);if(i.constructor=o,t instanceof o)return i.s=t.s,void(f?!t.d||t.e>o.maxE?(i.e=NaN,i.d=null):t.e=10;n/=10)e++;return void(f?e>o.maxE?(i.e=NaN,i.d=null):e>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(s=0,t){case 3:s^=(255&l.charCodeAt(a+2))<<16;case 2:s^=(255&l.charCodeAt(a+1))<<8;case 1:n^=s=(65535&(s=(s=(65535&(s^=255&l.charCodeAt(a)))*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295}return n^=l.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0},Object.defineProperty(o.prototype,"length",{get:function(){var t=0;for(var e in this.data)0===e.indexOf("hash_")&&(t+=this.data[e].length);return t}}),o.prototype.add=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data){for(var n=this.data[e],r=0;r>>17,n*=461845907,this.count=this.count+1;var r=this.hash^n;r=5*(r=r<<13|r>>>19)+3864292196,this.hash=r}}},c.prototype.finish=function(){var t=this.hash^4*this.count;return t^=t>>>16,t*=2246822507,t^=t>>>13,t*=3266489909,t^=t>>>16},u.prototype.get=function(t,e){var n=this.cacheMap.get(t)||null;return null===n?null:n.get(e)||null},u.prototype.set=function(t,e,n){var r=this.cacheMap.get(t)||null;null===r&&(r=new this.defaultMapCtor,this.cacheMap.put(t,r)),r.put(e,n)},e.Hash=c,e.Set=o,e.Map=a,e.BitSet=s,e.AltDict=l,e.DoubleDict=u,e.hashStuff=function(){var t=new c;return t.update.apply(t,arguments),t.finish()},e.escapeWhitespace=function(t,e){return t=t.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),e&&(t=t.replace(/ /g,"ยท")),t},e.arrayToString=n,e.titleCase=function(t){return t.replace(/\w\S*/g,(function(t){return t.charAt(0).toUpperCase()+t.substr(1)}))},e.equalArrays=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n"},set:function(t){this._text=t}}),r.prototype.toString=function(){var t=this.text;return t=null!==t?t.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+t+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"},e.Token=n,e.CommonToken=r},function(t,e,n){var r=n(17).Token;function i(t,e){return this.start=t,this.stop=e,this}function o(){this.intervals=null,this.readOnly=!1}i.prototype.contains=function(t){return t>=this.start&&t=n.stop?(this.intervals.pop(t+1),this.reduce(t)):e.stop>=n.start&&(this.intervals[t]=new i(e.start,n.stop),this.intervals.pop(t+1))}},o.prototype.complement=function(t,e){var n=new o;n.addInterval(new i(t,e+1));for(var r=0;rr.start&&t.stop=r.stop?(this.intervals.splice(e,1),e-=1):t.start"):t.push("'"+String.fromCharCode(n.start)+"'"):t.push("'"+String.fromCharCode(n.start)+"'..'"+String.fromCharCode(n.stop-1)+"'")}return t.length>1?"{"+t.join(", ")+"}":t[0]},o.prototype.toIndexString=function(){for(var t=[],e=0;e"):t.push(n.start.toString()):t.push(n.start.toString()+".."+(n.stop-1).toString())}return t.length>1?"{"+t.join(", ")+"}":t[0]},o.prototype.toTokenString=function(t,e){for(var n=[],r=0;r1?"{"+n.join(", ")+"}":n[0]},o.prototype.elementName=function(t,e,n){return n===r.EOF?"":n===r.EPSILON?"":t[n]||e[n]},e.Interval=i,e.IntervalSet=o},function(t,e,n){"use strict";t.exports=function(){var t={noMore:!1,useDirtyCheck:!1,preserveExistingSetters:!1},e=[],n=[],r=[],i=!1;try{i=Object.defineProperty&&Object.defineProperty({},"x",{})}catch(t){}var o=function(t){return t&&"[object Function]"=={}.toString.call(t)},s=function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=function(t){return"[object Object]"==={}.toString.apply(t)},l=function(t,e){var n=[],r=[];if("string"!=typeof t&&"string"!=typeof e){if(s(t)&&e)for(var i=0;i0)for(var o=0;o0)&&f(t[e],n,void 0!==r?r-1:r),E(t,e,n,r),i&&(void 0===r||r>0)&&F(t,e,n,r)))},v=function(t,e){if(!(t instanceof String)&&(t instanceof Object||s(t)))if(s(t)){for(var n=["__watchall__"],r=0;r0?arguments[0]:void 0;return a=e.apply(t,arguments),"slice"!==n&&("pop"===n?(s=a,l=t.length):"push"===n?l=t.length-1:"shift"===n?s=a:"unshift"!==n&&void 0===o&&(o=a),r.call(t,l,n,o,s)),a}))},k=function(t,e){if(o(e)&&t&&!(t instanceof String)&&s(t))for(var n,r=L.length;r--;)N(t,t[n=L[r]],n,e)},O=function(t,e,n){if(e){if(t.watchers&&t.watchers[e])if(void 0===n)delete t.watchers[e];else for(var r=0;r0)for(t=0;t":this.symbol.text},g.prototype=Object.create(d.prototype),g.prototype.constructor=g,g.prototype.isErrorNode=function(){return!0},g.prototype.accept=function(t){return t.visitErrorNode(this)},v.prototype.walk=function(t,e){if(e instanceof h||void 0!==e.isErrorNode&&e.isErrorNode())t.visitErrorNode(e);else if(e instanceof c)t.visitTerminal(e);else{this.enterRule(t,e);for(var n=0;n=0&&this.startIndexe.returnState&&(f[0]=e.returnState,f[1]=t.returnState);var d=new c(g=[p,p],f);return null!==r&&r.set(t,e,d),d}f=[t.returnState,e.returnState];var g=[t.parentCtx,e.parentCtx];t.returnState>e.returnState&&(f[0]=e.returnState,f[1]=t.returnState,g=[e.parentCtx,t.parentCtx]);var v=new c(g,f);return null!==r&&r.set(t,e,v),v}(t,e,n,r);if(n){if(t instanceof u)return t;if(e instanceof u)return e}return t instanceof l&&(t=new c([t.getParent()],[t.returnState])),e instanceof l&&(e=new c([e.getParent()],[e.returnState])),function(t,e,n,r){if(null!==r){var i=r.get(t,e);if(null!==i)return i;if(null!==(i=r.get(e,t)))return i}var a=0,u=0,p=0,f=[],d=[];for(;a0&&(t+=", "),this.returnStates[e]!==s.EMPTY_RETURN_STATE?(t+=this.returnStates[e],null!==this.parents[e]?t=t+" "+this.parents[e]:t+="null"):t+="$";return t+"]"},e.merge=h,e.PredictionContext=s,e.PredictionContextCache=a,e.SingletonPredictionContext=l,e.predictionContextFromRuleContext=function t(e,n){if(null==n&&(n=r.EMPTY),null===n.parentCtx||n===r.EMPTY)return s.EMPTY;var i=t(e,n.parentCtx),o=e.states[n.invokingState].transitions[0];return l.create(i,o.followState.stateNumber)},e.getCachedPredictionContext=function t(e,n,r){if(e.isEmpty())return e;var i=r.get(e)||null;if(null!==i)return i;if(null!==(i=n.get(e)))return r.put(e,i),i;for(var o=!1,a=[],u=0;u=this.states.length)throw"Invalid state number.";var n=this.states[t],r=this.nextTokens(n);if(!r.contains(s.EPSILON))return r;var o=new i;for(o.addSet(r),o.removeOne(s.EPSILON);null!==e&&e.invokingState>=0&&r.contains(s.EPSILON);){var a=this.states[e.invokingState].transitions[0];r=this.nextTokens(a.followState),o.addSet(r),o.removeOne(s.EPSILON),e=e.parentCtx}return r.contains(s.EPSILON)&&o.addOne(s.EOF),o},o.INVALID_ALT_NUMBER=0,e.ATN=o},function(t,e,n){var r=n(17).Token,i=(n(18).Interval,n(18).IntervalSet),o=n(32).Predicate,s=n(32).PrecedencePredicate;function a(t){if(null==t)throw"target cannot be null.";return this.target=t,this.isEpsilon=!1,this.label=null,this}function l(t,e){return a.call(this,t),this.label_=e,this.label=this.makeLabel(),this.serializationType=a.ATOM,this}function u(t,e,n,r){return a.call(this,t),this.ruleIndex=e,this.precedence=n,this.followState=r,this.serializationType=a.RULE,this.isEpsilon=!0,this}function c(t,e){return a.call(this,t),this.serializationType=a.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=e,this}function h(t,e,n){return a.call(this,t),this.serializationType=a.RANGE,this.start=e,this.stop=n,this.label=this.makeLabel(),this}function p(t){return a.call(this,t),this}function f(t,e,n,r){return p.call(this,t),this.serializationType=a.PREDICATE,this.ruleIndex=e,this.predIndex=n,this.isCtxDependent=r,this.isEpsilon=!0,this}function d(t,e,n,r){return a.call(this,t),this.serializationType=a.ACTION,this.ruleIndex=e,this.actionIndex=void 0===n?-1:n,this.isCtxDependent=void 0!==r&&r,this.isEpsilon=!0,this}function g(t,e){return a.call(this,t),this.serializationType=a.SET,null!=e?this.label=e:(this.label=new i,this.label.addOne(r.INVALID_TYPE)),this}function v(t,e){return g.call(this,t,e),this.serializationType=a.NOT_SET,this}function m(t){return a.call(this,t),this.serializationType=a.WILDCARD,this}function y(t,e){return p.call(this,t),this.serializationType=a.PRECEDENCE,this.precedence=e,this.isEpsilon=!0,this}a.EPSILON=1,a.RANGE=2,a.RULE=3,a.PREDICATE=4,a.ATOM=5,a.ACTION=6,a.SET=7,a.NOT_SET=8,a.WILDCARD=9,a.PRECEDENCE=10,a.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],a.serializationTypes={EpsilonTransition:a.EPSILON,RangeTransition:a.RANGE,RuleTransition:a.RULE,PredicateTransition:a.PREDICATE,AtomTransition:a.ATOM,ActionTransition:a.ACTION,SetTransition:a.SET,NotSetTransition:a.NOT_SET,WildcardTransition:a.WILDCARD,PrecedencePredicateTransition:a.PRECEDENCE},l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.prototype.makeLabel=function(){var t=new i;return t.addOne(this.label_),t},l.prototype.matches=function(t,e,n){return this.label_===t},l.prototype.toString=function(){return this.label_},u.prototype=Object.create(a.prototype),u.prototype.constructor=u,u.prototype.matches=function(t,e,n){return!1},c.prototype=Object.create(a.prototype),c.prototype.constructor=c,c.prototype.matches=function(t,e,n){return!1},c.prototype.toString=function(){return"epsilon"},h.prototype=Object.create(a.prototype),h.prototype.constructor=h,h.prototype.makeLabel=function(){var t=new i;return t.addRange(this.start,this.stop),t},h.prototype.matches=function(t,e,n){return t>=this.start&&t<=this.stop},h.prototype.toString=function(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"},p.prototype=Object.create(a.prototype),p.prototype.constructor=p,f.prototype=Object.create(p.prototype),f.prototype.constructor=f,f.prototype.matches=function(t,e,n){return!1},f.prototype.getPredicate=function(){return new o(this.ruleIndex,this.predIndex,this.isCtxDependent)},f.prototype.toString=function(){return"pred_"+this.ruleIndex+":"+this.predIndex},d.prototype=Object.create(a.prototype),d.prototype.constructor=d,d.prototype.matches=function(t,e,n){return!1},d.prototype.toString=function(){return"action_"+this.ruleIndex+":"+this.actionIndex},g.prototype=Object.create(a.prototype),g.prototype.constructor=g,g.prototype.matches=function(t,e,n){return this.label.contains(t)},g.prototype.toString=function(){return this.label.toString()},v.prototype=Object.create(g.prototype),v.prototype.constructor=v,v.prototype.matches=function(t,e,n){return t>=e&&t<=n&&!g.prototype.matches.call(this,t,e,n)},v.prototype.toString=function(){return"~"+g.prototype.toString.call(this)},m.prototype=Object.create(a.prototype),m.prototype.constructor=m,m.prototype.matches=function(t,e,n){return t>=e&&t<=n},m.prototype.toString=function(){return"."},y.prototype=Object.create(p.prototype),y.prototype.constructor=y,y.prototype.matches=function(t,e,n){return!1},y.prototype.getPredicate=function(){return new s(this.precedence)},y.prototype.toString=function(){return this.precedence+" >= _p"},e.Transition=a,e.AtomTransition=l,e.SetTransition=g,e.NotSetTransition=v,e.RuleTransition=u,e.ActionTransition=d,e.EpsilonTransition=c,e.RangeTransition=h,e.WildcardTransition=m,e.PredicateTransition=f,e.PrecedencePredicateTransition=y,e.AbstractPredicateTransition=p},function(t,e,n){"use strict";var r,i=function(){function t(t,e){void 0===e&&(e="pt"),this.lsKey=t,this.defaultLang=e,this.listeners=[],this.document=document,this.setupListener()}return t.prototype.setupListener=function(){var t=this;null!==this.document&&this.document.addEventListener("storage",(function(e){e.key===t.lsKey&&t.listeners.forEach((function(t){return t()}))}))},t.prototype.getLang=function(){var t=localStorage.getItem(this.lsKey);return null==t?(console.warn("Internal Error: User language information has not been set. Returning default..."),this.getDefaultLang()):t},t.prototype.getDefaultLang=function(){return this.defaultLang},t.prototype.registerLanguageChangeListener=function(t){this.listeners.push(t)},t}();!function(t){t.ERROR="error",t.MESSAGE="message",t.UI="ui"}(r||(r={}));var o=function(){function t(t,e,n){var r=this;void 0===n&&(n=!1),this.service=t,this.i18nData=e,this.listenToChange=n,this.document=document,this.listenToChange&&t.registerLanguageChangeListener((function(){r.updateTagText()}))}return t.prototype.getString=function(t,e){var n=this.i18nData[this.service.getLang()];return n?n[e]&&n[e][t]?n[e][t]:this.getDefaultString(t,e):(console.warn("Internal Error. The language set at ivprog.lang is not valid: "+this.service.getLang()),this.getDefaultString(t,e))},t.prototype.getDefaultString=function(t,e){var n=this.i18nData[this.service.getDefaultLang()];return n[e]?n[e][t]?n[e][t]:"{MISSING_I18N_IDENTIFIER: "+t+"}":"{MISSING_I18N_TYPE_IDENTIFIER: "+e+"}"},t.prototype.getOR=function(){return this.getUI("string_join_or")},t.prototype.getError=function(t,e){void 0===e&&(e=[]);var n=this.getString(t,r.ERROR);return this.processString(n,e)},t.prototype.getMessage=function(t,e){void 0===e&&(e=[]);var n=this.getString(t,r.MESSAGE);return this.processString(n,e)},t.prototype.getUI=function(t,e){void 0===e&&(e=[]);var n=this.getString(t,r.UI);return this.processString(n,e)},t.prototype.processString=function(t,e){for(var n=0;n";var e=t.split(":"),n=e[0].toLowerCase(),i=e[1];return r.ERROR===n?this.getError(i):r.MESSAGE===n?this.getMessage(i):r.UI===n?this.getUI(i):(console.warn(" A string has been passed to the i18n helper function that was not in the form type:id -> "+t),this.getString(i,n))},t}(),s=function(){function t(t){this.lang=t,this.listeners=[]}return t.prototype.setupListener=function(){},t.prototype.notifyChange=function(){this.listeners.forEach((function(t){return t()}))},t.prototype.setLang=function(t){this.lang=t,this.notifyChange()},t.prototype.getLang=function(){return this.lang},t.prototype.getDefaultLang=function(){return this.lang},t.prototype.registerLanguageChangeListener=function(t){this.listeners.push(t)},t}();e.a={LanguageService:i,LanguageServiceNoLS:s,LocalizedStrings:o,StringTypes:r}},function(t,e,n){var r=n(27).ATN,i=n(16),o=i.Hash,s=i.Set,a=n(32).SemanticContext,l=n(24).merge;function u(t){return t.hashCodeForConfigSet()}function c(t,e){return t===e||null!==t&&null!==e&&t.equalsForConfigSet(e)}function h(t){return this.configLookup=new s(u,c),this.fullCtx=void 0===t||t,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1,this}function p(){return h.call(this),this.configLookup=new s,this}h.prototype.add=function(t,e){if(void 0===e&&(e=null),this.readOnly)throw"This set is readonly";t.semanticContext!==a.NONE&&(this.hasSemanticContext=!0),t.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);var n=this.configLookup.add(t);if(n===t)return this.cachedHashCode=-1,this.configs.push(t),!0;var r=!this.fullCtx,i=l(n.context,t.context,r,e);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,t.reachesIntoOuterContext),t.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=i,!0},h.prototype.getStates=function(){for(var t=new s,e=0;e0){var s=null;i.map((function(t){(null===s||t.precedence0){var s=i.sort((function(t,e){return t.compareTo(e)})),l=s[s.length-1];n.add(l)}return this.opnds=n.values(),this}o.prototype.hashCode=function(){var t=new i;return this.updateHashCode(t),t.finish()},o.prototype.evaluate=function(t,e){},o.prototype.evalPrecedence=function(t,e){return this},o.andContext=function(t,e){if(null===t||t===o.NONE)return e;if(null===e||e===o.NONE)return t;var n=new l(t,e);return 1===n.opnds.length?n.opnds[0]:n},o.orContext=function(t,e){if(null===t)return e;if(null===e)return t;if(t===o.NONE||e===o.NONE)return o.NONE;var n=new u(t,e);return 1===n.opnds.length?n.opnds[0]:n},s.prototype=Object.create(o.prototype),s.prototype.constructor=s,o.NONE=new s,s.prototype.evaluate=function(t,e){var n=this.isCtxDependent?e:null;return t.sempred(n,this.ruleIndex,this.predIndex)},s.prototype.updateHashCode=function(t){t.update(this.ruleIndex,this.predIndex,this.isCtxDependent)},s.prototype.equals=function(t){return this===t||t instanceof s&&(this.ruleIndex===t.ruleIndex&&this.predIndex===t.predIndex&&this.isCtxDependent===t.isCtxDependent)},s.prototype.toString=function(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"},a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype.evaluate=function(t,e){return t.precpred(e,this.precedence)},a.prototype.evalPrecedence=function(t,e){return t.precpred(e,this.precedence)?o.NONE:null},a.prototype.compareTo=function(t){return this.precedence-t.precedence},a.prototype.updateHashCode=function(t){t.update(31)},a.prototype.equals=function(t){return this===t||t instanceof a&&this.precedence===t.precedence},a.prototype.toString=function(){return"{"+this.precedence+">=prec}?"},a.filterPrecedencePredicates=function(t){var e=[];return t.values().map((function(t){t instanceof a&&e.push(t)})),e},l.prototype=Object.create(o.prototype),l.prototype.constructor=l,l.prototype.equals=function(t){return this===t||t instanceof l&&this.opnds===t.opnds},l.prototype.updateHashCode=function(t){t.update(this.opnds,"AND")},l.prototype.evaluate=function(t,e){for(var n=0;n3?t.slice(3):t},u.prototype=Object.create(o.prototype),u.prototype.constructor=u,u.prototype.constructor=function(t){return this===t||t instanceof u&&this.opnds===t.opnds},u.prototype.updateHashCode=function(t){t.update(this.opnds,"OR")},u.prototype.evaluate=function(t,e){for(var n=0;n3?t.slice(3):t},e.SemanticContext=o,e.PrecedencePredicate=a,e.Predicate=s},function(t,e,n){var r=n(30).ATNConfigSet,i=n(16),o=i.Hash,s=i.Set;function a(t,e){return this.alt=e,this.pred=t,this}function l(t,e){return null===t&&(t=-1),null===e&&(e=new r),this.stateNumber=t,this.configs=e,this.edges=null,this.isAcceptState=!1,this.prediction=0,this.lexerActionExecutor=null,this.requiresFullContext=!1,this.predicates=null,this}a.prototype.toString=function(){return"("+this.pred+", "+this.alt+")"},l.prototype.getAltSet=function(){var t=new s;if(null!==this.configs)for(var e=0;e=15&&(h=!1,l=!0);var T=y&&(u||h&&(null==b||b<12.11)),C=n||s&&a>=9;function w(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var E,A=function(t,e){var n=t.className,r=w(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function L(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function N(t,e){return L(t).appendChild(e)}function k(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return s+(e-o);s+=a-o,s+=n-s%n,o=a+1}}g?D=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:s&&(D=function(t){try{t.select()}catch(t){}});var B=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function W(t,e){for(var n=0;n=e)return r+Math.min(s,e-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=e)return r}}var G=[""];function K(t){for(;G.length<=t;)G.push(Y(G)+" ");return G[t]}function Y(t){return t[t.length-1]}function X(t,e){for(var n=[],r=0;r"ย€"&&(t.toUpperCase()!=t.toLowerCase()||J.test(t))}function tt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&Q(t))||e.test(t):Q(t)}function et(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var nt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function rt(t){return t.charCodeAt(0)>=768&&nt.test(t)}function it(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}var st=null;function at(t,e,n){var r;st=null;for(var i=0;ie)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:st=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:st=i)}return null!=r?r:st}var lt=function(){var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(t,e,n){this.level=t,this.from=e,this.to=n}return function(s,a){var l="ltr"==a?"L":"R";if(0==s.length||"ltr"==a&&!t.test(s))return!1;for(var u,c=s.length,h=[],p=0;p-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function dt(t,e){var n=pt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function yt(t){t.prototype.on=function(t,e){ht(this,t,e)},t.prototype.off=function(t,e){ft(this,t,e)}}function xt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function St(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function bt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Tt(t){xt(t),St(t)}function Ct(t){return t.target||t.srcElement}function wt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Et,At,Lt=function(){if(s&&a<9)return!1;var t=k("div");return"draggable"in t||"dragDrop"in t}();function Nt(t){if(null==Et){var e=k("span","โ€‹");N(t,k("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Et=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=Et?k("span","โ€‹"):k("span","ย ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function kt(t){if(null!=At)return At;var e=N(t,document.createTextNode("AุฎA")),n=E(e,0,1).getBoundingClientRect(),r=E(e,1,2).getBoundingClientRect();return L(t),!(!n||n.left==n.right)&&(At=r.right-n.right<3)}var Ot,_t=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),e+=s+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},It=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Mt="oncopy"in(Ot=k("div"))||(Ot.setAttribute("oncopy","return;"),"function"==typeof Ot.oncopy),Pt=null,Dt={},Rt={};function Ft(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Dt[t]=e}function Ht(t){if("string"==typeof t&&Rt.hasOwnProperty(t))t=Rt[t];else if(t&&"string"==typeof t.name&&Rt.hasOwnProperty(t.name)){var e=Rt[t.name];"string"==typeof e&&(e={name:e}),(t=Z(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Ht("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Ht("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Bt(t,e){e=Ht(e);var n=Dt[e.name];if(!n)return Bt(t,"text/plain");var r=n(t,e);if(Wt.hasOwnProperty(e.name)){var i=Wt[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)r[s]=e.modeProps[s];return r}var Wt={};function jt(t,e){F(e,Wt.hasOwnProperty(t)?Wt[t]:Wt[t]={})}function zt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ut(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Vt(t,e,n){return!t.startState||t.startState(e,n)}var qt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Gt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e=t.first&&en?te(n,Gt(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?te(t.line,e):n<0?te(t.line,0):t}(e,Gt(t,e.line).text.length)}function le(t,e){for(var n=[],r=0;r=this.string.length},qt.prototype.sol=function(){return this.pos==this.lineStart},qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qt.prototype.next=function(){if(this.pose},qt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},qt.prototype.skipToEnd=function(){this.pos=this.string.length},qt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},qt.prototype.backUp=function(t){this.pos-=t},qt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},qt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},qt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},qt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ue=function(t,e){this.state=t,this.lookAhead=e},ce=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function he(t,e,n,r){var i=[t.state.modeGen],o={};Se(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var s=n.state,a=function(r){n.baseTokens=i;var a=t.state.overlays[r],l=1,u=0;n.state=!0,Se(t,e.text,a.mode,n,(function(t,e){for(var n=l;ut&&i.splice(l,1,t,i[l+1],r),l+=2,u=Math.min(t,r)}if(e)if(a.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&zt(t.doc.mode,r.state),o=he(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function fe(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new ce(r,!0,e);var o=function(t,e,n){for(var r,i,o=t.doc,s=n?-1:e-(t.doc.mode.innerMode?1e3:100),a=e;a>s;--a){if(a<=o.first)return o.first;var l=Gt(o,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof ue?u.lookAhead:0)<=o.modeFrontier))return a;var c=H(l.text,null,t.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}(t,e,n),s=o>r.first&&Gt(r,o-1).stateAfter,a=s?ce.fromSaved(r,s,o):new ce(r,Vt(r.mode),o);return r.iter(o,e,(function(n){de(t,n.text,a);var r=a.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&re.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}ce.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ce.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ce.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ce.fromSaved=function(t,e,n){return e instanceof ue?new ce(t,zt(t.mode,e.state),n,e.lookAhead):new ce(t,zt(t.mode,e),n)},ce.prototype.save=function(t){var e=!1!==t?zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ue(e,this.maxLookAhead):e};var me=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ye(t,e,n,r){var i,o,s=t.doc,a=s.mode,l=Gt(s,(e=ae(s,e)).line),u=fe(t,e.line,n),c=new qt(l.text,t.options.tabSize,u);for(r&&(o=[]);(r||c.post.options.maxHighlightLength?(a=!1,s&&de(t,e,r,h.pos),h.pos=e.length,l=null):l=xe(ve(n,h,r.state,p),o),p){var f=p[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||c!=l){for(;u=e:o.to>e);(r||(r=[])).push(new Ce(s,o.from,a?null:o.to))}}return r}(n,i,s),l=function(t,e,n){var r;if(t)for(var i=0;i=e:o.to>e)||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(s.inclusiveLeft?o.from<=e:o.from0&&a)for(var x=0;xe)&&(!n||Ie(n,o.marker)<0)&&(n=o.marker)}return n}function Fe(t,e,n,r,i){var o=Gt(t,e),s=Te&&o.markedSpans;if(s)for(var a=0;a=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ee(u.to,n)>=0:ee(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ee(u.from,r)<=0:ee(u.from,r)<0)))return!0}}}function He(t){for(var e;e=Pe(t);)t=e.find(-1,!0).line;return t}function Be(t,e){var n=Gt(t,e),r=He(n);return n==r?e:$t(r)}function We(t,e){if(e>t.lastLine())return e;var n,r=Gt(t,e);if(!je(t,r))return e;for(;n=De(r);)r=n.find(1,!0).line;return $t(r)+1}function je(t,e){var n=Te&&e.markedSpans;if(n)for(var r=void 0,i=0;ie.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var Ge=function(t,e,n){this.text=t,ke(this,e),this.height=n?n(this):1};function Ke(t){t.parent=null,Ne(t)}Ge.prototype.lineNo=function(){return $t(this)},yt(Ge);var Ye={},Xe={};function $e(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?Xe:Ye;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function Ze(t,e){var n=O("span",null,null,l?"padding-right: .1px":null),r={pre:O("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,s=void 0;r.pos=0,r.addToken=Qe,kt(t.display.measure)&&(s=ut(o,t.doc.direction))&&(r.addToken=tn(r.addToken,s)),r.map=[],nn(o,r,pe(t,o,e!=t.display.externalMeasured&&$t(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=P(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=P(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Nt(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return dt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=P(r.pre.className,r.textClass||"")),r}function Je(t){var e=k("span","โ€ข","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function Qe(t,e,n,r,i,o,l){if(e){var u,c=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;iu&&h.from<=u);p++);if(h.to>=c)return t(n,r,i,o,s,a,l);t(n,r.slice(0,h.to-u),i,o,null,a,l),o=null,r=r.slice(h.to-u),u=h.to}}}function en(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function nn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var s,a,l,u,c,h,p,f=i.length,d=0,g=1,v="",m=0;;){if(m==d){l=u=c=a="",p=null,h=null,m=1/0;for(var y=[],x=void 0,S=0;Sd||T.collapsed&&b.to==d&&b.from==d)){if(null!=b.to&&b.to!=d&&m>b.to&&(m=b.to,u=""),T.className&&(l+=" "+T.className),T.css&&(a=(a?a+";":"")+T.css),T.startStyle&&b.from==d&&(c+=" "+T.startStyle),T.endStyle&&b.to==m&&(x||(x=[])).push(T.endStyle,b.to),T.title&&((p||(p={})).title=T.title),T.attributes)for(var C in T.attributes)(p||(p={}))[C]=T.attributes[C];T.collapsed&&(!h||Ie(h.marker,T)<0)&&(h=b)}else b.from>d&&m>b.from&&(m=b.from)}if(x)for(var w=0;w=f)break;for(var A=Math.min(f,m);;){if(v){var L=d+v.length;if(!h){var N=L>A?v.slice(0,A-d):v;e.addToken(e,N,s?s+l:l,c,d+N.length==m?u:"",a,p)}if(L>=A){v=v.slice(A-d),d=A;break}d=L,c=""}v=i.slice(o,o=n[g++]),s=$e(n[g++],e.cm.options)}}else for(var k=1;kn)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function On(t,e,n,r){return Mn(t,In(t,e),n,r)}function _n(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&e2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(o=function(t,e,n,r){var i,o=Rn(e.map,n,r),l=o.node,u=o.start,c=o.end,h=o.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){for(;u&&rt(e.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}(t.display.measure,i))}else{var f;u>0&&(h=r="right"),i=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!u&&(!i||!i.left&&!i.right)){var d=l.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+ir(t.display),top:d.top,bottom:d.bottom}:Dn}for(var g=i.top-e.rect.top,v=i.bottom-e.rect.top,m=(g+v)/2,y=e.view.measure.heights,x=0;xe)&&(i=(o=l-a)-1,e>=l&&(s="right")),null!=i){if(r=t[u+2],a==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==i)for(;u&&t[u-2]==t[u-3]&&t[u-1].insertLeft;)r=t[2+(u-=3)],s="left";if("right"==n&&i==l-a)for(;u=0&&(n=t[i]).left==n.right;i--);return n}function Hn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!a)return s("before"==u?l-1:l,"before"==u);function c(t,e,n){return s(n?t-1:t,1==a[e].level!=n)}var h=at(a,l,u),p=st,f=c(l,h,"before"==u);return null!=p&&(f.other=c(l,p,"before"!=u)),f}function Yn(t,e){var n=0;e=ae(t.doc,e),t.options.lineWrapping||(n=ir(t.display)*e.ch);var r=Gt(t.doc,e.line),i=Ue(r)+Cn(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Xn(t,e,n,r,i){var o=te(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function $n(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return Xn(r.first,0,null,-1,-1);var i=Zt(r,n),o=r.first+r.size-1;if(i>o)return Xn(r.first+r.size-1,Gt(r,o).text.length,null,1,1);e<0&&(e=0);for(var s=Gt(r,i);;){var a=tr(t,s,i,e,n),l=Re(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==i)return u;s=Gt(r,i=u.line)}}function Zn(t,e,n,r){r-=Un(e);var i=e.text.length,o=ot((function(e){return Mn(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=ot((function(e){return Mn(t,n,e).top>r}),o,i)}}function Jn(t,e,n,r){return n||(n=In(t,e)),Zn(t,e,n,Vn(t,e,Mn(t,n,r),"line").top)}function Qn(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function tr(t,e,n,r,i){i-=Ue(e);var o=In(t,e),s=Un(e),a=0,l=e.text.length,u=!0,c=ut(e,t.doc.direction);if(c){var h=(t.options.lineWrapping?nr:er)(t,e,n,o,c,r,i);a=(u=1!=h.level)?h.from:h.to-1,l=u?h.to:h.from-1}var p,f,d=null,g=null,v=ot((function(e){var n=Mn(t,o,e);return n.top+=s,n.bottom+=s,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(d=e,g=n),!0)}),a,l),m=!1;if(g){var y=r-g.left=S.bottom?1:0}return Xn(n,v=it(e.text,v,1),f,m,r-p)}function er(t,e,n,r,i,o,s){var a=ot((function(a){var l=i[a],u=1!=l.level;return Qn(Kn(t,te(n,u?l.to:l.from,u?"before":"after"),"line",e,r),o,s,!0)}),0,i.length-1),l=i[a];if(a>0){var u=1!=l.level,c=Kn(t,te(n,u?l.from:l.to,u?"after":"before"),"line",e,r);Qn(c,o,s,!0)&&c.top>s&&(l=i[a-1])}return l}function nr(t,e,n,r,i,o,s){var a=Zn(t,e,r,s),l=a.begin,u=a.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var c=null,h=null,p=0;p=u||f.to<=l)){var d=Mn(t,r,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,g=dg)&&(c=f,h=g)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function rr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Pn){Pn=k("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Pn.appendChild(document.createTextNode("x")),Pn.appendChild(k("br"));Pn.appendChild(document.createTextNode("x"))}N(t.measure,Pn);var n=Pn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),L(t.measure),n||1}function ir(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=k("span","xxxxxxxxxx"),n=k("pre",[e],"CodeMirror-line-like");N(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function or(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=t.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:sr(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function sr(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function ar(t){var e=rr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/ir(t.display)-3);return function(i){if(je(t.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s0&&(l=Gt(t.doc,u.line).text).length==u.ch){var c=H(l,l.length,t.options.tabSize)-l.length;u=te(u.line,Math.max(0,Math.round((o-En(t.display).left)/ir(t.display))-c))}return u}function cr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;re)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Te&&Be(t.doc,e)i.viewFrom?fr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)fr(t);else if(e<=i.viewFrom){var o=dr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):fr(t)}else if(n>=i.viewTo){var s=dr(t,e,e,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):fr(t)}else{var a=dr(t,e,e,-1),l=dr(t,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(on(t,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):fr(t)}var u=i.externalMeasured;u&&(n=i.lineN&&e=r.viewTo)){var o=r.view[cr(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==W(s,n)&&s.push(n)}}}function fr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function dr(t,e,n,r){var i,o=cr(t,e),s=t.display.view;if(!Te||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var a=t.display.viewFrom,l=0;l0){if(o==s.length-1)return null;i=a+s[o].size-e,o++}else i=a-e;e+=i,n+=i}for(;Be(t.doc,n)!=n;){if(o==(r<0?0:s.length-1))return null;n+=r*s[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function gr(t){for(var e=t.display.view,n=0,r=0;r=t.display.viewTo||a.to().linee||e==n&&s.to==e)&&(r(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}(g,n||0,null==r?p:r,(function(t,e,i,h){var v="ltr"==i,m=f(t,v?"left":"right"),y=f(e-1,v?"right":"left"),x=null==n&&0==t,S=null==r&&e==p,b=0==h,T=!g||h==g.length-1;if(y.top-m.top<=3){var C=(u?S:x)&&T,w=(u?x:S)&&b?a:(v?m:y).left,E=C?l:(v?y:m).right;c(w,m.top,E-w,m.bottom)}else{var A,L,N,k;v?(A=u&&x&&b?a:m.left,L=u?l:d(t,i,"before"),N=u?a:d(e,i,"after"),k=u&&S&&T?l:y.right):(A=u?d(t,i,"before"):a,L=!u&&x&&b?l:m.right,N=!u&&S&&T?a:y.left,k=u?d(e,i,"after"):l),c(A,m.top,L-A,m.bottom),m.bottom0?e.blinker=setInterval((function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Tr(t){t.state.focused||(t.display.input.focus(),wr(t))}function Cr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Er(t))}),100)}function wr(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(dt(t,"focus",t,e),t.state.focused=!0,M(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),br(t))}function Er(t,e){t.state.delayingBlurEvent||(t.state.focused&&(dt(t,"blur",t,e),t.state.focused=!1,A(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Ar(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r.005||p<-.005)&&(Xt(i.line,l),Lr(i.line),i.rest))for(var f=0;ft.display.sizerWidth){var d=Math.ceil(u/ir(t.display));d>t.display.maxLineLength&&(t.display.maxLineLength=d,t.display.maxLine=i.line,t.display.maxLineChanged=!0)}}}}function Lr(t){if(t.widgets)for(var e=0;e=s&&(o=Zt(e,Ue(Gt(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function kr(t,e){var n=t.display,r=rr(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Nn(t),s={};e.bottom-e.top>o&&(e.bottom=e.top+o);var a=t.doc.height+wn(n),l=e.topa-r;if(e.topi+o){var c=Math.min(e.top,(u?a:e.bottom)-o);c!=i&&(s.scrollTop=c)}var h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,p=Ln(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),f=e.right-e.left>p;return f&&(e.right=e.left+p),e.left<10?s.scrollLeft=0:e.leftp+h-3&&(s.scrollLeft=e.right+(f?0:10)-p),s}function Or(t,e){null!=e&&(Mr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function _r(t){Mr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Ir(t,e,n){null==e&&null==n||Mr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Mr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Pr(t,Yn(t,e.from),Yn(t,e.to),e.margin))}function Pr(t,e,n,r){var i=kr(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});Ir(t,i.scrollLeft,i.scrollTop)}function Dr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||li(t,{top:e}),Rr(t,e,!0),n&&li(t),ri(t,100))}function Rr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Fr(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,hi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Hr(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+wn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+An(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Br=function(t,e,n){this.cm=n;var r=this.vert=k("div",[k("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=k("div",[k("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),ht(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),ht(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},Br.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new B,this.disableVert=new B},Br.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,(function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}))},Br.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Wr=function(){};function jr(t,e){e||(e=Hr(t));var n=t.display.barWidth,r=t.display.barHeight;zr(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Ar(t),zr(t,Hr(t)),n=t.display.barWidth,r=t.display.barHeight}function zr(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}Wr.prototype.update=function(){return{bottom:0,right:0}},Wr.prototype.setScrollLeft=function(){},Wr.prototype.setScrollTop=function(){},Wr.prototype.clear=function(){};var Ur={native:Br,null:Wr};function Vr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&A(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Ur[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ht(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?Fr(t,e):Dr(t,e)}),t),t.display.scrollbars.addClass&&M(t.display.wrapper,t.display.scrollbars.addClass)}var qr=0;function Gr(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qr},e=t.curOp,sn?sn.ops.push(e):e.ownsGroup=sn={ops:[e],delayedCallbacks:[]}}function Kr(t){var e=t.curOp;e&&function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new oi(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Xr(t){t.updatedDisplay=t.mustUpdate&&si(t.cm,t.update)}function $r(t){var e=t.cm,n=e.display;t.updatedDisplay&&Ar(e),t.barMeasure=Hr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=On(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+An(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Ln(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Zr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!d){var o=k("div","โ€‹",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Cn(t.display))+"px;\n height: "+(e.bottom-e.top+An(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(i),t.display.lineSpace.removeChild(o)}}}(e,function(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?te(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?te(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var s=!1,a=Kn(t,e),l=n&&n!=e?Kn(t,n):a,u=kr(t,i={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-r,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+r}),c=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=u.scrollTop&&(Dr(t,u.scrollTop),Math.abs(t.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(Fr(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return i}(e,ae(r,t.scrollToPos.from),ae(r,t.scrollToPos.to),t.scrollToPos.margin));var i=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(i)for(var s=0;s=t.display.viewTo)){var n=+new Date+t.options.workTime,r=fe(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var s=o.styles,a=o.text.length>t.options.maxHighlightLength?zt(e.mode,r.state):null,l=he(t,o,r,!0);a&&(r.state=a),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),p=0;!h&&pn)return ri(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Qr(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==gr(t))return!1;pi(t)&&(fr(t),e.dims=or(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),s=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(i,n.viewTo)),Te&&(o=Be(t.doc,o),s=We(t.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;!function(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=on(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=on(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,cr(t,n)))),r.viewTo=n}(t,o,s),n.viewOffset=Ue(Gt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var u=gr(t);if(!a&&0==u&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(t){if(t.hasFocus())return null;var e=I();if(!e||!_(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&_(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(t);return u>4&&(n.lineDiv.style.display="none"),function(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,s=o.firstChild;function a(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var u=r.view,c=r.viewFrom,h=0;h-1&&(f=!1),cn(t,p,c,n)),f&&(L(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(Qt(t.options,c)))),s=p.node.nextSibling}else{var d=mn(t,p,c,n);o.insertBefore(d,s)}c+=p.size}for(;s;)s=a(s)}(t,n.updateLineNumbers,e.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=I()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&_(document.body,t.anchorNode)&&_(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(c),L(n.cursorDiv),L(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,ri(t,400)),n.updateLineNumbers=null,!0}function ai(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Ln(t))r&&(e.visible=Nr(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+wn(t.display)-Nn(t),n.top)}),e.visible=Nr(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!si(t,e))break;Ar(t);var i=Hr(t);vr(t),jr(t,i),ci(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function li(t,e){var n=new oi(t,e);if(si(t,n)){Ar(t),ai(t,n);var r=Hr(t);vr(t),jr(t,r),ci(t,r),n.finish()}}function ui(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function ci(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+An(t)+"px"}function hi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=sr(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",s=0;sa.clientWidth,c=a.scrollHeight>a.clientHeight;if(i&&u||o&&c){if(o&&y&&l)t:for(var p=e.target,f=s.view;p!=a;p=p.parentNode)for(var d=0;d=0&&ee(t,r.to())<=0)return n}return-1};var Ci=function(t,e){this.anchor=t,this.head=e};function wi(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return ee(t.from(),e.from())})),n=W(e,i);for(var o=1;o0:l>=0){var u=oe(a.from(),s.from()),c=ie(a.to(),s.to()),h=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,e.splice(--o,2,new Ci(h?c:u,h?u:c))}}return new Ti(e,n)}function Ei(t,e){return new Ti([new Ci(t,e||t)],0)}function Ai(t){return t.text?te(t.from.line+t.text.length-1,Y(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Li(t,e){if(ee(t,e.from)<0)return t;if(ee(t,e.to)<=0)return Ai(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=Ai(e).ch-e.to.ch),te(n,r)}function Ni(t,e){for(var n=[],r=0;r1&&t.remove(a.line+1,d-1),t.insert(a.line+1,m)}ln(t,"change",t,e)}function Pi(t,e,n){!function t(r,i,o){if(r.linked)for(var s=0;sa-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=function(t,e){return e?(Bi(t.done),Y(t.done)):t.done.length&&!Y(t.done).ranges?Y(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),Y(t.done)):void 0}(i,i.lastOp==r)))s=Y(o.changes),0==ee(e.from,e.to)&&0==ee(e.from,s.to)?s.to=Ai(e):o.changes.push(Hi(t,e));else{var l=Y(i.done);for(l&&l.ranges||zi(t.sel,i.done),o={changes:[Hi(t,e)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,s||dt(t,"historyAdded")}function ji(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,o,Y(i.done),e))?i.done[i.done.length-1]=e:zi(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Bi(i.undone)}function zi(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Ui(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Vi(t){if(!t)return null;for(var e,n=0;n-1&&(Y(a)[h]=u[h],delete u[h])}}}return r}function Ki(t,e,n,r){if(r){var i=t.anchor;if(n){var o=ee(e,i)<0;o!=ee(n,i)<0?(i=e,e=n):o!=ee(e,n)<0&&(e=n)}return new Ci(i,e)}return new Ci(n||e,e)}function Yi(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Qi(t,new Ti([Ki(t.sel.primary(),e,n,i)],0),r)}function Xi(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:a.to>e.ch))){if(i&&(dt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var h=l.find(r<0?1:-1),p=void 0;if((r<0?c:u)&&(h=so(t,h,-r,h&&h.line==e.line?o:null)),h&&h.line==e.line&&(p=ee(h,n))&&(r<0?p<0:p>0))return io(t,h,e,r,i)}var f=l.find(r<0?-1:1);return(r<0?u:c)&&(f=so(t,f,r,f.line==e.line?o:null)),f?io(t,f,e,r,i):null}}return e}function oo(t,e,n,r,i){var o=r||1,s=io(t,e,n,o,i)||!i&&io(t,e,n,o,!0)||io(t,e,n,-o,i)||!i&&io(t,e,n,-o,!0);return s||(t.cantEdit=!0,te(t.first,0))}function so(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?ae(t,te(e.line-1)):null:n>0&&e.ch==(r||Gt(t,e.line)).text.length?e.line0)){var c=[l,1],h=ee(u.from,a.from),p=ee(u.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&c.push({from:u.from,to:a.from}),(p>0||!s.inclusiveRight&&!p)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)co(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else co(t,e)}}function co(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ee(e.from,e.to)){var n=Ni(t,e);Wi(t,e,n,t.cm?t.cm.curOp.id:NaN),fo(t,e,n,Ae(t,e));var r=[];Pi(t,(function(t,n){n||-1!=W(r,t.history)||(yo(t.history,e),r.push(t.history)),fo(t,e,null,Ae(t,e))}))}}function ho(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,s=t.sel,a="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,u=0;u=0;--f){var d=p(f);if(d)return d.v}}}}function po(t,e){if(0!=e&&(t.first+=e,t.sel=new Ti(X(t.sel.ranges,(function(t){return new Ci(te(t.anchor.line+e,t.anchor.ch),te(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){hr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.lineo&&(e={from:e.from,to:te(o,Gt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Kt(t,e.from,e.to),n||(n=Ni(t,e)),t.cm?function(t,e,n){var r=t.doc,i=t.display,o=e.from,s=e.to,a=!1,l=o.line;t.options.lineWrapping||(l=$t(He(Gt(r,o.line))),r.iter(l,s.line+1,(function(t){if(t==i.maxLine)return a=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&vt(t),Mi(r,e,n,ar(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=Ve(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,a=!1)})),a&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;r--){var i=Gt(t,r).stateAfter;if(i&&(!(i instanceof ue)||r+i.lookAhead1||!(this.children[0]instanceof So))){var a=[];this.collapse(a),this.children=[new So(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var s=i.lines.length%25+25,a=s;a10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Fe(t,e.line,e,n,o)||e.line!=n.line&&Fe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Te=!0}o.addToHistory&&Wi(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,u=t.cm;if(t.iter(l,n.line+1,(function(t){u&&o.collapsed&&!u.options.lineWrapping&&He(t)==u.display.maxLine&&(a=!0),o.collapsed&&l!=e.line&&Xt(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new Ce(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){je(t,e)&&Xt(e,0)})),o.clearOnEnter&&ht(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(be=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++wo,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)hr(u,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=e.line;c<=n.line;c++)pr(u,c,"text");o.atomic&&no(u.doc),ln(u,"markerAdded",u,o)}return o}Eo.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Gr(t),mt(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&hr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&no(t.doc)),t&&ln(t,"markerCleared",t,this,r,i),e&&Kr(t),this.parent&&this.parent.clear()}},Eo.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i=0;l--)uo(this,r[l]);a?Ji(this,a):this.cm&&_r(this.cm)})),undo:ni((function(){ho(this,"undo")})),redo:ni((function(){ho(this,"redo")})),undoSelection:ni((function(){ho(this,"undo",!0)})),redoSelection:ni((function(){ho(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=ae(this,t),e=ae(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;rt)return e=t,!0;t-=o,++n})),ae(this,te(n,e))},indexFromPos:function(t){var e=(t=ae(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var h=t.dataTransfer.getData("Text");if(h){var p;if(e.state.draggingText&&!e.state.draggingText.copy&&(p=e.listSelections()),to(e.doc,Ei(n,n)),p)for(var f=0;f=0;e--)go(t.doc,"",r[e].from,r[e].to,"+delete");_r(t)}))}function Jo(t,e,n){var r=it(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Qo(t,e,n){var r=Jo(t,e.ch,n);return null==r?null:new te(e.line,r,n<0?"after":"before")}function ts(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=ut(n,e.doc.direction);if(o){var s,a=i<0?Y(o):o[0],l=i<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var u=In(e,n);s=i<0?n.text.length-1:0;var c=Mn(e,u,s).top;s=ot((function(t){return Mn(e,u,t).top==c}),i<0==(1==a.level)?a.from:a.to-1,s),"before"==l&&(s=Jo(n,s,1))}else s=i<0?a.to:a.from;return new te(r,s,l)}}return new te(r,i<0?n.text.length:0,i<0?"before":"after")}Uo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Uo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Uo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Uo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Uo.default=y?Uo.macDefault:Uo.pcDefault;var es={selectAll:ao,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),z)},killLine:function(t){return Zo(t,(function(e){if(e.empty()){var n=Gt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)i=new te(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),te(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var s=Gt(t.doc,i.line-1).text;s&&(i=new te(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),te(i.line-1,s.length-1),i,"+transpose"))}n.push(new Ci(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Qr(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r-1&&(ee((i=u.ranges[i]).from(),e)<0||e.xRel>0)&&(ee(i.to(),e)>0||e.xRel<0)?function(t,e,n,r){var i=t.display,o=!1,u=ti(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,ft(i.wrapper.ownerDocument,"mouseup",u),ft(i.wrapper.ownerDocument,"mousemove",c),ft(i.scroller,"dragstart",h),ft(i.scroller,"drop",u),o||(xt(e),r.addNew||Yi(t.doc,n,null,null,r.extend),l&&!p||s&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},h=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=u,u.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ht(i.wrapper.ownerDocument,"mouseup",u),ht(i.wrapper.ownerDocument,"mousemove",c),ht(i.scroller,"dragstart",h),ht(i.scroller,"drop",u),Cr(t),setTimeout((function(){return i.input.focus()}),20)}(t,r,e,o):function(t,e,n,r){var i=t.display,o=t.doc;xt(e);var s,a,l=o.sel,u=l.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),s=a>-1?u[a]:new Ci(n,n)):(s=o.sel.primary(),a=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new Ci(n,n)),n=ur(t,e,!0,!0),a=-1;else{var c=ms(t,n,r.unit);s=r.extend?Ki(s,c.anchor,c.head,r.extend):c}r.addNew?-1==a?(a=u.length,Qi(o,wi(t,u.concat([s]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==r.unit&&!r.extend?(Qi(o,wi(t,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):$i(o,a,s,U):(a=0,Qi(o,new Ti([s],0),U),l=o.sel);var h=n;function p(e){if(0!=ee(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],u=t.options.tabSize,c=H(Gt(o,n.line).text,n.ch,u),p=H(Gt(o,e.line).text,e.ch,u),f=Math.min(c,p),d=Math.max(c,p),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var m=Gt(o,g).text,y=q(m,f,u);f==d?i.push(new Ci(te(g,y),te(g,y))):m.length>y&&i.push(new Ci(te(g,y),te(g,q(m,d,u))))}i.length||i.push(new Ci(n,n)),Qi(o,wi(t,l.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var x,S=s,b=ms(t,e,r.unit),T=S.anchor;ee(b.anchor,T)>0?(x=b.head,T=oe(S.from(),b.anchor)):(x=b.anchor,T=ie(S.to(),b.head));var C=l.ranges.slice(0);C[a]=function(t,e){var n=e.anchor,r=e.head,i=Gt(t.doc,n.line);if(0==ee(n,r)&&n.sticky==r.sticky)return e;var o=ut(i);if(!o)return e;var s=at(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return e;var l,u=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var c=at(o,r.ch,r.sticky),h=c-s||(r.ch-n.ch)*(1==a.level?-1:1);l=c==u-1||c==u?h<0:h>0}var p=o[u+(l?-1:0)],f=l==(1==p.level),d=f?p.from:p.to,g=f?"after":"before";return n.ch==d&&n.sticky==g?e:new Ci(new te(n.line,d,g),r)}(t,new Ci(ae(o,T),x)),Qi(o,wi(t,C,a),U)}}var f=i.wrapper.getBoundingClientRect(),d=0;function g(e){t.state.selectingText=!1,d=1/0,e&&(xt(e),i.input.focus()),ft(i.wrapper.ownerDocument,"mousemove",v),ft(i.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=ti(t,(function(e){0!==e.buttons&&wt(e)?function e(n){var s=++d,a=ur(t,n,!0,"rectangle"==r.unit);if(a)if(0!=ee(a,h)){t.curOp.focus=I(),p(a);var l=Nr(i,o);(a.line>=l.to||a.linef.bottom?20:0;u&&setTimeout(ti(t,(function(){d==s&&(i.scroller.scrollTop+=u,e(n))})),50)}}(e):g(e)})),m=ti(t,g);t.state.selectingText=m,ht(i.wrapper.ownerDocument,"mousemove",v),ht(i.wrapper.ownerDocument,"mouseup",m)}(t,r,e,o)}(e,r,o,t):Ct(t)==n.scroller&&xt(t):2==i?(r&&Yi(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(C?e.display.input.onContextMenu(t):Cr(e)))}}function ms(t,e,n){if("char"==n)return new Ci(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Ci(te(e.line,0),ae(t.doc,te(e.line+1,0)));var r=n(t,e);return new Ci(r.from,r.to)}function ys(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(e){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&xt(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!mt(t,n))return bt(e);o-=a.top-s.viewOffset;for(var l=0;l=i)return dt(t,n,t,Zt(t.doc,o),t.display.gutterSpecs[l].className,e),bt(e)}}function xs(t,e){return ys(t,e,"gutterClick",!0)}function Ss(t,e){Tn(t.display,e)||function(t,e){return!!mt(t,"gutterContextMenu")&&ys(t,e,"gutterContextMenu",!1)}(t,e)||gt(t,e,"contextmenu")||C||t.display.input.onContextMenu(e)}function bs(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wn(t)}gs.prototype.compare=function(t,e,n){return this.time+400>t&&0==ee(e,this.pos)&&n==this.button};var Ts={toString:function(){return"CodeMirror.Init"}},Cs={},ws={};function Es(t,e,n){if(!e!=!(n&&n!=Ts)){var r=t.display.dragFunctions,i=e?ht:ft;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function As(t){t.options.lineWrapping?(M(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(A(t.display.wrapper,"CodeMirror-wrap"),qe(t)),lr(t),hr(t),Wn(t),setTimeout((function(){return jr(t)}),100)}function Ls(t,e){var n=this;if(!(this instanceof Ls))return new Ls(t,e);this.options=e=e?F(e):{},F(Cs,e,!1);var r=e.value;"string"==typeof r?r=new _o(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Ls.inputStyles[e.inputStyle](this),o=this.display=new vi(t,r,i,e);for(var u in o.wrapper.CodeMirror=this,bs(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new B,keySeq:null,specialChars:null},e.autofocus&&!m&&o.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(t){var e=t.display;ht(e.scroller,"mousedown",ti(t,vs)),ht(e.scroller,"dblclick",s&&a<11?ti(t,(function(e){if(!gt(t,e)){var n=ur(t,e);if(n&&!xs(t,e)&&!Tn(t.display,e)){xt(e);var r=t.findWordAt(n);Yi(t.doc,r.anchor,r.head)}}})):function(e){return gt(t,e)||xt(e)}),ht(e.scroller,"contextmenu",(function(e){return Ss(t,e)})),ht(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||Ss(t,n)}));var n,r={end:0};function i(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(r=e.activeTouch).end=+new Date)}function o(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>400}ht(e.scroller,"touchstart",(function(i){if(!gt(t,i)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(i)&&!xs(t,i)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),ht(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ht(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Tn(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var s,a=t.coordsChar(e.activeTouch,"page");s=!r.prev||o(r,r.prev)?new Ci(a,a):!r.prev.prev||o(r,r.prev.prev)?t.findWordAt(a):new Ci(te(a.line,0),ae(t.doc,te(a.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),xt(n)}i()})),ht(e.scroller,"touchcancel",i),ht(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Dr(t,e.scroller.scrollTop),Fr(t,e.scroller.scrollLeft,!0),dt(t,"scroll",t))})),ht(e.scroller,"mousewheel",(function(e){return bi(t,e)})),ht(e.scroller,"DOMMouseScroll",(function(e){return bi(t,e)})),ht(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){gt(t,e)||Tt(e)},over:function(e){gt(t,e)||(function(t,e){var n=ur(t,e);if(n){var r=document.createDocumentFragment();yr(t,n,r),t.display.dragCursor||(t.display.dragCursor=k("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),N(t.display.dragCursor,r)}}(t,e),Tt(e))},start:function(e){return function(t,e){if(s&&(!t.state.draggingText||+new Date-Io<100))Tt(e);else if(!gt(t,e)&&!Tn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!p)){var n=k("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(t,e)},drop:ti(t,Mo),leave:function(e){gt(t,e)||Po(t)}};var l=e.input.getField();ht(l,"keyup",(function(e){return hs.call(t,e)})),ht(l,"keydown",ti(t,cs)),ht(l,"keypress",ti(t,ps)),ht(l,"focus",(function(e){return wr(t,e)})),ht(l,"blur",(function(e){return Er(t,e)}))}(this),Fo(),Gr(this),this.curOp.forceUpdate=!0,Di(this,r),e.autofocus&&!m||this.hasFocus()?setTimeout(R(wr,this),20):Er(this),ws)ws.hasOwnProperty(u)&&ws[u](this,e[u],Ts);pi(this),e.finishInit&&e.finishInit(this);for(var c=0;c150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>o.first?H(Gt(o,e-1).text,null,s):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var h="",p=0;if(t.options.indentWithTabs)for(var f=Math.floor(u/s);f;--f)p+=s,h+="\t";if(ps,l=_t(e),u=null;if(a&&r.ranges.length>1)if(Os&&Os.text.join("\n")==e){if(r.ranges.length%Os.text.length==0){u=[];for(var c=0;c=0;p--){var f=r.ranges[p],d=f.from(),g=f.to();f.empty()&&(n&&n>0?d=te(d.line,d.ch-n):t.state.overwrite&&!a?g=te(g.line,Math.min(Gt(o,g.line).text.length,g.ch+Y(l).length)):a&&Os&&Os.lineWise&&Os.text.join("\n")==e&&(d=g=te(d.line,0)));var v={from:d,to:g,text:u?u[p%u.length]:l,origin:i||(a?"paste":t.state.cutIncoming>s?"cut":"+input")};uo(t.doc,v),ln(t,"inputRead",t,v)}e&&!a&&Ps(t,e),_r(t),t.curOp.updateInput<2&&(t.curOp.updateInput=h),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ms(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Qr(e,(function(){return Is(e,n,0,null,"paste")})),!0}function Ps(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=t.getModeAt(i.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=ks(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Gt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(s=ks(t,i.head.line,"smart"));s&&ln(t,"electricInput",t,i.head.line)}}}function Ds(t){for(var e=[],n=[],r=0;r=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=at(i,n.ch,n.sticky),s=i[o];if("ltr"==t.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from=s.from&&p>=c.begin)){var f=h?"before":"after";return new te(n.line,p,f)}}var d=function(t,e,r){for(var o=function(t,e){return e?new te(n.line,l(t,1),"before"):new te(n.line,t,"after")};t>=0&&t0==(1!=s.level),u=a?r.begin:l(r.end,-1);if(s.from<=u&&u0?c.end:l(c.begin,-1);return null==v||r>0&&v==e.text.length||!(g=d(r>0?0:i.length-1,r,u(v)))?null:g}(t.cm,a,e,n):Qo(a,e,n))){if(r||(s=e.line+l)=t.first+t.size||(e=new te(s,e.ch,e.sticky),!(a=Gt(t,s))))return!1;e=ts(i,t.cm,a,e.line,l)}else e=o;return!0}if("char"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var c=null,h="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var d=a.text.charAt(e.ch)||"\n",g=tt(d,p)?"w":h&&"\n"==d?"n":!h||/\s/.test(d)?null:"p";if(!h||f||g||(g="s"),c&&c!=g){n<0&&(n=1,u(),e.sticky="after");break}if(g&&(c=g),n>0&&!u(!f))break}var v=oo(t,e,o,s,!0);return ne(o,v)&&(v.hitSide=!0),v}function Bs(t,e,n,r){var i,o,s=t.doc,a=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*rr(t.display),3);i=(n>0?e.bottom:e.top)+n*u}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(o=$n(t,a,i)).outside;){if(n<0?i<=0:i>=s.height){o.hitSide=!0;break}i+=5*n}return o}var Ws=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new B,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function js(t,e){var n=_n(t,e.line);if(!n||n.hidden)return null;var r=Gt(t.doc,e.line),i=kn(n,r,e.line),o=ut(r,t.doc.direction),s="left";o&&(s=at(o,e.ch)%2?"right":"left");var a=Rn(i.map,e.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function zs(t,e){return e&&(t.bad=!0),t}function Us(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return zs(t.clipPos(te(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var i=0;i=e.display.viewTo||o.line=e.display.viewFrom&&js(e,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(s=te(s.line-1,Gt(r.doc,s.line-1).length)),a.ch==Gt(r.doc,a.line).text.length&&a.linei.viewTo-1)return!1;s.line==i.viewFrom||0==(t=cr(r,s.line))?(e=$t(i.view[0].line),n=i.view[0].node):(e=$t(i.view[t].line),n=i.view[t-1].node.nextSibling);var l,u,c=cr(r,a.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=$t(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var h=r.doc.splitLines(function(t,e,n,r,i){var o="",s=!1,a=t.doc.lineSeparator(),l=!1;function u(){s&&(o+=a,l&&(o+=a),s=l=!1)}function c(t){t&&(u(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void c(n);var o,p=e.getAttribute("cm-marker");if(p){var f=t.findMarks(te(r,0),te(i+1,0),(v=+p,function(t){return t.id==v}));return void(f.length&&(o=f[0].find(0))&&c(Kt(t.doc,o.from,o.to).join(a)))}if("false"==e.getAttribute("contenteditable"))return;var d=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;d&&u();for(var g=0;g1&&p.length>1;)if(Y(h)==Y(p))h.pop(),p.pop(),l--;else{if(h[0]!=p[0])break;h.shift(),p.shift(),e++}for(var f=0,d=0,g=h[0],v=p[0],m=Math.min(g.length,v.length);fs.ch&&y.charCodeAt(y.length-d-1)==x.charCodeAt(x.length-d-1);)f--,d++;h[h.length-1]=y.slice(0,y.length-d).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var b=te(e,f),T=te(l,p.length?Y(p).length-d:0);return h.length>1||h[0]||ee(b,T)?(go(r.doc,h,b,T,"+input"),!0):void 0},Ws.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ws.prototype.reset=function(){this.forceCompositionEnd()},Ws.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ws.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Ws.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return hr(t.cm)}))},Ws.prototype.setUneditable=function(t){t.contentEditable="false"},Ws.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||ti(this.cm,Is)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Ws.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Ws.prototype.onContextMenu=function(){},Ws.prototype.resetPosition=function(){},Ws.prototype.needsContentAttribute=!0;var qs=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new B,this.hasSelection=!1,this.composing=null};qs.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!gt(r,t)){if(r.somethingSelected())_s({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Ds(r);_s({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,z):(n.prevInput="",i.value=e.text.join("\n"),D(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(i.style.width="0px"),ht(i,"input",(function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),ht(i,"paste",(function(t){gt(r,t)||Ms(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),ht(i,"cut",o),ht(i,"copy",o),ht(t.scroller,"paste",(function(e){if(!Tn(t,e)&&!gt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),ht(t.lineSpace,"selectstart",(function(e){Tn(t,e)||xt(e)})),ht(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),ht(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},qs.prototype.createField=function(t){this.wrapper=Fs(),this.textarea=this.wrapper.firstChild},qs.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},qs.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=mr(t);if(t.options.moveInputWithCursor){var i=Kn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+s.left-o.left))}return r},qs.prototype.showSelection=function(t){var e=this.cm.display;N(e.cursorDiv,t.cursors),N(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},qs.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&D(this.textarea),s&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},qs.prototype.getField=function(){return this.textarea},qs.prototype.supportsTouch=function(){return!1},qs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||I()!=this.textarea))try{this.textarea.focus()}catch(t){}},qs.prototype.blur=function(){this.textarea.blur()},qs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qs.prototype.receivedFocus=function(){this.slowPoll()},qs.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},qs.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,(function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}))},qs.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||It(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="โ€‹"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},qs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qs.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},qs.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=ur(n,t),u=r.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ti(n,Qi)(n.doc,Ei(o),z);var c,p=i.style.cssText,f=e.wrapper.style.cssText,d=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&a>=9&&v(),C){Tt(t);var g=function(){ft(window,"mouseup",g),setTimeout(m,20)};ht(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var t=n.somethingSelected(),o="โ€‹"+(t?i.value:"");i.value="โ‡š",i.value=o,e.prevInput=t?"":"โ€‹",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function m(){if(e.contextMenuPending==m&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,i.style.cssText=p,s&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!s||s&&a<9)&&v();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"โ€‹"==e.prevInput?ti(n,ao)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},qs.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},qs.prototype.setUneditable=function(){},qs.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=Ts&&i(t,e,n)}:i)}t.defineOption=n,t.Init=Ts,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,Oi(t)}),!0),n("indentUnit",2,Oi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){_i(t),Wn(t),hr(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(te(r,o))}r++}));for(var i=n.length-1;i>=0;i--)go(t.doc,e,n[i],te(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Ts&&t.refresh()})),n("specialCharPlaceholder",Je,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!S),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){bs(t),gi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=$o(e),i=n!=Ts&&$o(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,As,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=fi(e,t.options.lineNumbers),gi(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?sr(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return jr(t)}),!0),n("scrollbarStyle","native",(function(t){Vr(t),jr(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=fi(t.options.gutters,e),gi(t)}),!0),n("firstLineNumber",1,gi,!0),n("lineNumberFormatter",(function(t){return t}),gi,!0),n("showCursorWhenSelecting",!1,vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Er(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Es),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vr,!0),n("singleCursorHeightPerLine",!0,vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,_i,!0),n("addModeClass",!1,_i,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,_i,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}(Ls),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,i=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&ti(this,e[t])(this,n,i),dt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"]($o(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;nn&&(ks(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&_r(this));else{var o=i.from(),s=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&$i(this.doc,r,new Ci(o,u[r].to()),z)}}})),getTokenAt:function(t,e){return ye(this,t,e)},getLineTokens:function(t,e){return ye(this,te(t),e,!0)},getTokenTypeAt:function(t){t=ae(this.doc,t);var e,n=pe(this,Gt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var s=r+i>>1;if((s?n[2*s-1]:0)>=o)i=s;else{if(!(n[2*s+1]o&&(t=o,i=!0),r=Gt(this.doc,t)}else r=t;return Vn(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-Ue(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o,s,a,l=this.display,u=(t=Kn(this,ae(this.doc,t))).bottom,c=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==r)u=t.top;else if("above"==r||"near"==r){var h=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>h)&&t.top>e.offsetHeight?u=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=h&&(u=t.bottom),c+e.offsetWidth>p&&(c=p-e.offsetWidth)}e.style.top=u+"px",e.style.left=e.style.right="","right"==i?(c=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=c+"px"),n&&(o=this,s={left:c,top:u,right:c+e.offsetWidth,bottom:u+e.offsetHeight},null!=(a=kr(o,s)).scrollTop&&Dr(o,a.scrollTop),null!=a.scrollLeft&&Fr(o,a.scrollLeft))},triggerOnKeyDown:ei(cs),triggerOnKeyPress:ei(ps),triggerOnKeyUp:hs,triggerOnMouseDown:ei(vs),execCommand:function(t){if(es.hasOwnProperty(t))return es[t].call(null,this)},triggerElectric:ei((function(t){Ps(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=ae(this.doc,t),s=0;s0&&s(e.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&lr(this),dt(this,"refresh",this)})),swapDoc:ei((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Di(this,t),Wn(this),this.display.input.reset(),Ir(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},yt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}(Ls);var Gs="iter insert remove copy getEditor constructor".split(" ");for(var Ks in _o.prototype)_o.prototype.hasOwnProperty(Ks)&&W(Gs,Ks)<0&&(Ls.prototype[Ks]=function(t){return function(){return t.apply(this.doc,arguments)}}(_o.prototype[Ks]));return yt(_o),Ls.inputStyles={textarea:qs,contenteditable:Ws},Ls.defineMode=function(t){Ls.defaults.mode||"null"==t||(Ls.defaults.mode=t),Ft.apply(this,arguments)},Ls.defineMIME=function(t,e){Rt[t]=e},Ls.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ls.defineMIME("text/plain","null"),Ls.defineExtension=function(t,e){Ls.prototype[t]=e},Ls.defineDocExtension=function(t,e){_o.prototype[t]=e},Ls.fromTextArea=function(t,e){if((e=e?F(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=I();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=a.getValue()}var i;if(t.form&&(ht(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var s=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=s}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(ft(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var a=Ls((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return a},function(t){t.off=ft,t.on=ht,t.wheelEventPixels=Si,t.Doc=_o,t.splitLines=_t,t.countColumn=H,t.findColumn=q,t.isWordChar=Q,t.Pass=j,t.signal=dt,t.Line=Ge,t.changeEnd=Ai,t.scrollbarModel=Ur,t.Pos=te,t.cmpPos=ee,t.modes=Dt,t.mimeModes=Rt,t.resolveMode=Ht,t.getMode=Bt,t.modeExtensions=Wt,t.extendMode=jt,t.copyState=zt,t.startState=Vt,t.innerMode=Ut,t.commands=es,t.keyMap=Uo,t.keyName=Xo,t.isModifierKey=Ko,t.lookupKey=Go,t.normalizeKeyMap=qo,t.StringStream=qt,t.SharedTextMarker=Lo,t.TextMarker=Eo,t.LineWidget=To,t.e_preventDefault=xt,t.e_stopPropagation=St,t.e_stop=Tt,t.addClass=M,t.contains=_,t.rmClass=A,t.keyNames=Bo}(Ls),Ls.version="5.54.0",Ls}()},function(t,e,n){var r=n(3),i=n(49),o=n(91),s=n(92);function a(e){var n="function"==typeof Map?new Map:void 0;return t.exports=a=function(t){if(null===t||!o(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return s(t,arguments,r(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},a(e)}t.exports=a},,,function(t,e,n){e.atn=n(71),e.codepointat=n(60),e.dfa=n(78),e.fromcodepoint=n(61),e.tree=n(80),e.error=n(81),e.Token=n(17).Token,e.CharStreams=n(83).CharStreams,e.CommonToken=n(17).CommonToken,e.InputStream=n(48).InputStream,e.FileStream=n(84).FileStream,e.CommonTokenStream=n(85).CommonTokenStream,e.Lexer=n(42).Lexer,e.Parser=n(87).Parser;var r=n(24);e.PredictionContextCache=r.PredictionContextCache,e.ParserRuleContext=n(47).ParserRuleContext,e.Interval=n(18).Interval,e.Utils=n(16)},function(t,e,n){var r=n(97),i=n(98),o=n(65),s=n(99);t.exports=function(t){return r(t)||i(t)||o(t)||s()}},function(t,e,n){var r=n(20).DecisionState,i=n(32).SemanticContext,o=n(16).Hash;function s(t,e){if(null===t){var n={state:null,alt:null,context:null,semanticContext:null};return e&&(n.reachesIntoOuterContext=0),n}var r={};return r.state=t.state||null,r.alt=void 0===t.alt?null:t.alt,r.context=t.context||null,r.semanticContext=t.semanticContext||null,e&&(r.reachesIntoOuterContext=t.reachesIntoOuterContext||0,r.precedenceFilterSuppressed=t.precedenceFilterSuppressed||!1),r}function a(t,e){return this.checkContext(t,e),t=s(t),e=s(e,!0),this.state=null!==t.state?t.state:e.state,this.alt=null!==t.alt?t.alt:e.alt,this.context=null!==t.context?t.context:e.context,this.semanticContext=null!==t.semanticContext?t.semanticContext:null!==e.semanticContext?e.semanticContext:i.NONE,this.reachesIntoOuterContext=e.reachesIntoOuterContext,this.precedenceFilterSuppressed=e.precedenceFilterSuppressed,this}function l(t,e){a.call(this,t,e);var n=t.lexerActionExecutor||null;return this.lexerActionExecutor=n||(null!==e?e.lexerActionExecutor:null),this.passedThroughNonGreedyDecision=null!==e&&this.checkNonGreedyDecision(e,this.state),this}a.prototype.checkContext=function(t,e){null!==t.context&&void 0!==t.context||null!==e&&null!==e.context&&void 0!==e.context||(this.context=null)},a.prototype.hashCode=function(){var t=new o;return this.updateHashCode(t),t.finish()},a.prototype.updateHashCode=function(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)},a.prototype.equals=function(t){return this===t||t instanceof a&&(this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&(null===this.context?null===t.context:this.context.equals(t.context))&&this.semanticContext.equals(t.semanticContext)&&this.precedenceFilterSuppressed===t.precedenceFilterSuppressed)},a.prototype.hashCodeForConfigSet=function(){var t=new o;return t.update(this.state.stateNumber,this.alt,this.semanticContext),t.finish()},a.prototype.equalsForConfigSet=function(t){return this===t||t instanceof a&&(this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&this.semanticContext.equals(t.semanticContext))},a.prototype.toString=function(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==i.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"},l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.prototype.updateHashCode=function(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext,this.passedThroughNonGreedyDecision,this.lexerActionExecutor)},l.prototype.equals=function(t){return this===t||t instanceof l&&this.passedThroughNonGreedyDecision==t.passedThroughNonGreedyDecision&&(this.lexerActionExecutor?this.lexerActionExecutor.equals(t.lexerActionExecutor):!t.lexerActionExecutor)&&a.prototype.equals.call(this,t)},l.prototype.hashCodeForConfigSet=l.prototype.hashCode,l.prototype.equalsForConfigSet=l.prototype.equals,l.prototype.checkNonGreedyDecision=function(t,e){return t.passedThroughNonGreedyDecision||e instanceof r&&e.nonGreedy},e.ATNConfig=a,e.LexerATNConfig=l},function(t,e,n){var r=n(21).RuleNode,i=n(21).INVALID_INTERVAL,o=n(27).INVALID_ALT_NUMBER;function s(t,e){return r.call(this),this.parentCtx=t||null,this.invokingState=e||-1,this}s.prototype=Object.create(r.prototype),s.prototype.constructor=s,s.prototype.depth=function(){for(var t=0,e=this;null!==e;)e=e.parentCtx,t+=1;return t},s.prototype.isEmpty=function(){return-1===this.invokingState},s.prototype.getSourceInterval=function(){return i},s.prototype.getRuleContext=function(){return this},s.prototype.getPayload=function(){return this},s.prototype.getText=function(){return 0===this.getChildCount()?"":this.children.map((function(t){return t.getText()})).join("")},s.prototype.getAltNumber=function(){return o},s.prototype.setAltNumber=function(t){},s.prototype.getChild=function(t){return null},s.prototype.getChildCount=function(){return 0},s.prototype.accept=function(t){return t.visitChildren(this)},e.RuleContext=s;var a=n(53).Trees;s.prototype.toStringTree=function(t,e){return a.toStringTree(this,t,e)},s.prototype.toString=function(t,e){t=t||null,e=e||null;for(var n=this,r="[";null!==n&&n!==e;){if(null===t)n.isEmpty()||(r+=n.invokingState);else{var i=n.ruleIndex;r+=i>=0&&i":"\n"===t?"\\n":"\t"===t?"\\t":"\r"===t?"\\r":t},l.prototype.getCharErrorDisplay=function(t){return"'"+this.getErrorDisplayForChar(t)+"'"},l.prototype.recover=function(t){this._input.LA(1)!==r.EOF&&(t instanceof a?this._interp.consume(this._input):this._input.consume())},e.Lexer=l},function(t,e){function n(){return this}function r(){return n.call(this),this}function i(t){if(n.call(this),null===t)throw"delegates";return this.delegates=t,this}n.prototype.syntaxError=function(t,e,n,r,i,o){},n.prototype.reportAmbiguity=function(t,e,n,r,i,o,s){},n.prototype.reportAttemptingFullContext=function(t,e,n,r,i,o){},n.prototype.reportContextSensitivity=function(t,e,n,r,i,o){},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.INSTANCE=new r,r.prototype.syntaxError=function(t,e,n,r,i,o){console.error("line "+n+":"+r+" "+i)},i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.syntaxError=function(t,e,n,r,i,o){this.delegates.map((function(s){s.syntaxError(t,e,n,r,i,o)}))},i.prototype.reportAmbiguity=function(t,e,n,r,i,o,s){this.delegates.map((function(a){a.reportAmbiguity(t,e,n,r,i,o,s)}))},i.prototype.reportAttemptingFullContext=function(t,e,n,r,i,o){this.delegates.map((function(s){s.reportAttemptingFullContext(t,e,n,r,i,o)}))},i.prototype.reportContextSensitivity=function(t,e,n,r,i,o){this.delegates.map((function(s){s.reportContextSensitivity(t,e,n,r,i,o)}))},e.ErrorListener=n,e.ConsoleErrorListener=r,e.ProxyErrorListener=i},function(t,e){function n(t,e,n){return this.dfa=t,this.literalNames=e||[],this.symbolicNames=n||[],this}function r(t){return n.call(this,t,null),this}n.prototype.toString=function(){if(null===this.dfa.s0)return null;for(var t="",e=this.dfa.sortedStates(),n=0;n")).concat(this.getStateString(s))).concat("\n"))}}return 0===t.length?null:t},n.prototype.getEdgeLabel=function(t){return 0===t?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[t-1]||this.symbolicNames[t-1]:String.fromCharCode(t-1)},n.prototype.getStateString=function(t){var e=(t.isAcceptState?":":"")+"s"+t.stateNumber+(t.requiresFullContext?"^":"");return t.isAcceptState?null!==t.predicates?e+"=>"+t.predicates.toString():e+"=>"+t.prediction.toString():e},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.getEdgeLabel=function(t){return"'"+String.fromCharCode(t)+"'"},e.DFASerializer=n,e.LexerDFASerializer=r},,,function(t,e,n){var r=n(41).RuleContext,i=n(21),o=i.INVALID_INTERVAL,s=i.TerminalNode,a=i.TerminalNodeImpl,l=i.ErrorNodeImpl,u=n(18).Interval;function c(t,e){t=t||null,e=e||null,r.call(this,t,e),this.ruleIndex=-1,this.children=null,this.start=null,this.stop=null,this.exception=null}function h(t,e,n){return c.call(t,e),this.ruleIndex=n,this}c.prototype=Object.create(r.prototype),c.prototype.constructor=c,c.prototype.copyFrom=function(t){this.parentCtx=t.parentCtx,this.invokingState=t.invokingState,this.children=null,this.start=t.start,this.stop=t.stop,t.children&&(this.children=[],t.children.map((function(t){t instanceof l&&(this.children.push(t),t.parentCtx=this)}),this))},c.prototype.enterRule=function(t){},c.prototype.exitRule=function(t){},c.prototype.addChild=function(t){return null===this.children&&(this.children=[]),this.children.push(t),t},c.prototype.removeLastChild=function(){null!==this.children&&this.children.pop()},c.prototype.addTokenNode=function(t){var e=new a(t);return this.addChild(e),e.parentCtx=this,e},c.prototype.addErrorNode=function(t){var e=new l(t);return this.addChild(e),e.parentCtx=this,e},c.prototype.getChild=function(t,e){if(e=e||null,null===this.children||t<0||t>=this.children.length)return null;if(null===e)return this.children[t];for(var n=0;n=this.children.length)return null;for(var n=0;n=this._size)throw"cannot consume EOF";this._index+=1},i.prototype.LA=function(t){if(0===t)return 0;t<0&&(t+=1);var e=this._index+t-1;return e<0||e>=this._size?r.EOF:this.data[e]},i.prototype.LT=function(t){return this.LA(t)},i.prototype.mark=function(){return-1},i.prototype.release=function(t){},i.prototype.seek=function(t){t<=this._index?this._index=t:this._index=Math.min(t,this._size)},i.prototype.getText=function(t,e){if(e>=this._size&&(e=this._size-1),t>=this._size)return"";if(this.decodeToUnicodeCodePoints){for(var n="",r=t;r<=e;r++)n+=String.fromCodePoint(this.data[r]);return n}return this.strdata.slice(t,e+1)},i.prototype.toString=function(){return this.strdata},e.InputStream=i},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},,,,function(t,e,n){var r=n(16),i=n(17).Token,o=(n(21).RuleNode,n(21).ErrorNode),s=n(21).TerminalNode,a=n(47).ParserRuleContext,l=n(41).RuleContext,u=n(27).INVALID_ALT_NUMBER;function c(){}c.toStringTree=function(t,e,n){e=e||null,null!==(n=n||null)&&(e=n.ruleNames);var i=c.getNodeText(t,e);i=r.escapeWhitespace(i,!1);var o=t.getChildCount();if(0===o)return i;var s="("+i+" ";o>0&&(i=c.toStringTree(t.getChild(0),e),s=s.concat(i));for(var a=1;a=n},X.prototype.deserialize=function(t){this.reset(t),this.checkVersion(),this.checkUUID();var e=this.readATN();this.readStates(e),this.readRules(e),this.readModes(e);var n=[];return this.readSets(e,n,this.readInt.bind(this)),this.isFeatureSupported(G,this.uuid)&&this.readSets(e,n,this.readInt32.bind(this)),this.readEdges(e,n),this.readDecisions(e),this.readLexerActions(e),this.markPrecedenceDecisions(e),this.verifyATN(e),this.deserializationOptions.generateRuleBypassTransitions&&e.grammarType===o.PARSER&&(this.generateRuleBypassTransitions(e),this.verifyATN(e)),e},X.prototype.reset=function(t){var e=t.split("").map((function(t){var e=t.charCodeAt(0);return e>1?e-2:e+65534}));e[0]=t.charCodeAt(0),this.data=e,this.pos=0},X.prototype.checkVersion=function(){var t=this.readInt();if(3!==t)throw"Could not deserialize ATN with version "+t+" (expected 3)."},X.prototype.checkUUID=function(){var t=this.readUUID();if(K.indexOf(t)<0)throw"59627784-3BE5-417A-B9EB-8131A7286089";this.uuid=t},X.prototype.readATN=function(){var t=this.readInt(),e=this.readInt();return new i(t,e)},X.prototype.readStates=function(t){for(var e,n,r,i=[],o=[],s=this.readInt(),l=0;l0;)i.addTransition(p.transitions[f-1]),p.transitions=p.transitions.slice(-1);t.ruleToStartState[e].addTransition(new O(i)),o.addTransition(new O(a));var d=new l;t.addState(d),d.addTransition(new w(o,t.ruleToTokenType[e])),i.addTransition(new O(d))},X.prototype.stateIsEndStateFor=function(t,e){if(t.ruleIndex!==e)return null;if(!(t instanceof y))return null;var n=t.transitions[t.transitions.length-1].target;return n instanceof p&&n.epsilonOnlyTransitions&&n.transitions[0].target instanceof d?t:null},X.prototype.markPrecedenceDecisions=function(t){for(var e=0;e=0):this.checkCondition(n.transitions.length<=1||n instanceof d)}},X.prototype.checkCondition=function(t,e){if(!t)throw null==e&&(e="IllegalState"),e},X.prototype.readInt=function(){return this.data[this.pos++]},X.prototype.readInt32=function(){return this.readInt()|this.readInt()<<16},X.prototype.readLong=function(){return 4294967295&this.readInt32()|this.readInt32()<<32};var $=function(){for(var t=[],e=0;e<256;e++)t[e]=(e+256).toString(16).substr(1).toUpperCase();return t}();X.prototype.readUUID=function(){for(var t=[],e=7;e>=0;e--){var n=this.readInt();t[2*e+1]=255&n,t[2*e]=n>>8&255}return $[t[0]]+$[t[1]]+$[t[2]]+$[t[3]]+"-"+$[t[4]]+$[t[5]]+"-"+$[t[6]]+$[t[7]]+"-"+$[t[8]]+$[t[9]]+"-"+$[t[10]]+$[t[11]]+$[t[12]]+$[t[13]]+$[t[14]]+$[t[15]]},X.prototype.edgeFactory=function(t,e,n,i,o,s,a,l){var u=t.states[i];switch(e){case C.EPSILON:return new O(u);case C.RANGE:return new N(u,0!==a?r.EOF:o,s);case C.RULE:return new L(t.states[o],s,a,u);case C.PREDICATE:return new I(u,o,s,0!==a);case C.PRECEDENCE:return new M(u,o);case C.ATOM:return new w(u,0!==a?r.EOF:o);case C.ACTION:return new k(u,o,s,0!==a);case C.SET:return new E(u,l[o]);case C.NOT_SET:return new A(u,l[o]);case C.WILDCARD:return new _(u);default:throw"The specified transition type: "+e+" is not valid."}},X.prototype.stateFactory=function(t,e){if(null===this.stateFactories){var n=[];n[a.INVALID_TYPE]=null,n[a.BASIC]=function(){return new l},n[a.RULE_START]=function(){return new f},n[a.BLOCK_START]=function(){return new b},n[a.PLUS_BLOCK_START]=function(){return new x},n[a.STAR_BLOCK_START]=function(){return new S},n[a.TOKEN_START]=function(){return new g},n[a.RULE_STOP]=function(){return new d},n[a.BLOCK_END]=function(){return new h},n[a.STAR_LOOP_BACK]=function(){return new m},n[a.STAR_LOOP_ENTRY]=function(){return new y},n[a.PLUS_LOOP_BACK]=function(){return new v},n[a.LOOP_END]=function(){return new p},this.stateFactories=n}if(t>this.stateFactories.length||null===this.stateFactories[t])throw"The specified state type "+t+" is not valid.";var r=this.stateFactories[t]();if(null!==r)return r.ruleIndex=e,r},X.prototype.lexerActionFactory=function(t,e,n){if(null===this.actionFactories){var r=[];r[F.CHANNEL]=function(t,e){return new B(t)},r[F.CUSTOM]=function(t,e){return new W(t,e)},r[F.MODE]=function(t,e){return new q(t)},r[F.MORE]=function(t,e){return j.INSTANCE},r[F.POP_MODE]=function(t,e){return V.INSTANCE},r[F.PUSH_MODE]=function(t,e){return new U(t)},r[F.SKIP]=function(t,e){return H.INSTANCE},r[F.TYPE]=function(t,e){return new z(t)},this.actionFactories=r}if(t>this.actionFactories.length||null===this.actionFactories[t])throw"The specified lexer action type "+t+" is not valid.";return this.actionFactories[t](e,n)},e.ATNDeserializer=X},function(t,e){function n(t){return void 0===t&&(t=null),this.readOnly=!1,this.verifyATN=null===t||t.verifyATN,this.generateRuleBypassTransitions=null!==t&&t.generateRuleBypassTransitions,this}n.defaultOptions=new n,n.defaultOptions.readOnly=!0,e.ATNDeserializationOptions=n},function(t,e){function n(){}function r(t){return this.actionType=t,this.isPositionDependent=!1,this}function i(){return r.call(this,n.SKIP),this}function o(t){return r.call(this,n.TYPE),this.type=t,this}function s(t){return r.call(this,n.PUSH_MODE),this.mode=t,this}function a(){return r.call(this,n.POP_MODE),this}function l(){return r.call(this,n.MORE),this}function u(t){return r.call(this,n.MODE),this.mode=t,this}function c(t,e){return r.call(this,n.CUSTOM),this.ruleIndex=t,this.actionIndex=e,this.isPositionDependent=!0,this}function h(t){return r.call(this,n.CHANNEL),this.channel=t,this}function p(t,e){return r.call(this,e.actionType),this.offset=t,this.action=e,this.isPositionDependent=!0,this}n.CHANNEL=0,n.CUSTOM=1,n.MODE=2,n.MORE=3,n.POP_MODE=4,n.PUSH_MODE=5,n.SKIP=6,n.TYPE=7,r.prototype.hashCode=function(){var t=new Hash;return this.updateHashCode(t),t.finish()},r.prototype.updateHashCode=function(t){t.update(this.actionType)},r.prototype.equals=function(t){return this===t},i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.INSTANCE=new i,i.prototype.execute=function(t){t.skip()},i.prototype.toString=function(){return"skip"},o.prototype=Object.create(r.prototype),o.prototype.constructor=o,o.prototype.execute=function(t){t.type=this.type},o.prototype.updateHashCode=function(t){t.update(this.actionType,this.type)},o.prototype.equals=function(t){return this===t||t instanceof o&&this.type===t.type},o.prototype.toString=function(){return"type("+this.type+")"},s.prototype=Object.create(r.prototype),s.prototype.constructor=s,s.prototype.execute=function(t){t.pushMode(this.mode)},s.prototype.updateHashCode=function(t){t.update(this.actionType,this.mode)},s.prototype.equals=function(t){return this===t||t instanceof s&&this.mode===t.mode},s.prototype.toString=function(){return"pushMode("+this.mode+")"},a.prototype=Object.create(r.prototype),a.prototype.constructor=a,a.INSTANCE=new a,a.prototype.execute=function(t){t.popMode()},a.prototype.toString=function(){return"popMode"},l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.INSTANCE=new l,l.prototype.execute=function(t){t.more()},l.prototype.toString=function(){return"more"},u.prototype=Object.create(r.prototype),u.prototype.constructor=u,u.prototype.execute=function(t){t.mode(this.mode)},u.prototype.updateHashCode=function(t){t.update(this.actionType,this.mode)},u.prototype.equals=function(t){return this===t||t instanceof u&&this.mode===t.mode},u.prototype.toString=function(){return"mode("+this.mode+")"},c.prototype=Object.create(r.prototype),c.prototype.constructor=c,c.prototype.execute=function(t){t.action(null,this.ruleIndex,this.actionIndex)},c.prototype.updateHashCode=function(t){t.update(this.actionType,this.ruleIndex,this.actionIndex)},c.prototype.equals=function(t){return this===t||t instanceof c&&(this.ruleIndex===t.ruleIndex&&this.actionIndex===t.actionIndex)},h.prototype=Object.create(r.prototype),h.prototype.constructor=h,h.prototype.execute=function(t){t._channel=this.channel},h.prototype.updateHashCode=function(t){t.update(this.actionType,this.channel)},h.prototype.equals=function(t){return this===t||t instanceof h&&this.channel===t.channel},h.prototype.toString=function(){return"channel("+this.channel+")"},p.prototype=Object.create(r.prototype),p.prototype.constructor=p,p.prototype.execute=function(t){this.action.execute(t)},p.prototype.updateHashCode=function(t){t.update(this.actionType,this.offset,this.action)},p.prototype.equals=function(t){return this===t||t instanceof p&&(this.offset===t.offset&&this.action===t.action)},e.LexerActionType=n,e.LexerSkipAction=i,e.LexerChannelAction=h,e.LexerCustomAction=c,e.LexerIndexedCustomAction=p,e.LexerMoreAction=l,e.LexerTypeAction=o,e.LexerPushModeAction=s,e.LexerPopModeAction=a,e.LexerModeAction=u},function(t,e,n){var r=n(17).Token,i=n(43).ConsoleErrorListener,o=n(43).ProxyErrorListener;function s(){return this._listeners=[i.INSTANCE],this._interp=null,this._stateNumber=-1,this}s.tokenTypeMapCache={},s.ruleIndexMapCache={},s.prototype.checkVersion=function(t){"4.8"!==t&&console.log("ANTLR runtime and generated code versions disagree: 4.8!="+t)},s.prototype.addErrorListener=function(t){this._listeners.push(t)},s.prototype.removeErrorListeners=function(){this._listeners=[]},s.prototype.getTokenTypeMap=function(){var t=this.getTokenNames();if(null===t)throw"The current recognizer does not provide a list of token names.";var e=this.tokenTypeMapCache[t];return void 0===e&&((e=t.reduce((function(t,e,n){t[e]=n}))).EOF=r.EOF,this.tokenTypeMapCache[t]=e),e},s.prototype.getRuleIndexMap=function(){var t=this.ruleNames;if(null===t)throw"The current recognizer does not provide a list of rule names.";var e=this.ruleIndexMapCache[t];return void 0===e&&(e=t.reduce((function(t,e,n){t[e]=n})),this.ruleIndexMapCache[t]=e),e},s.prototype.getTokenType=function(t){var e=this.getTokenTypeMap()[t];return void 0!==e?e:r.INVALID_TYPE},s.prototype.getErrorHeader=function(t){return"line "+t.getOffendingToken().line+":"+t.getOffendingToken().column},s.prototype.getTokenErrorDisplay=function(t){if(null===t)return"";var e=t.text;return null===e&&(e=t.type===r.EOF?"":"<"+t.type+">"),"'"+(e=e.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"))+"'"},s.prototype.getErrorListenerDispatch=function(){return new o(this._listeners)},s.prototype.sempred=function(t,e,n){return!0},s.prototype.precpred=function(t,e){return!0},Object.defineProperty(s.prototype,"state",{get:function(){return this._stateNumber},set:function(t){this._stateNumber=t}}),e.Recognizer=s},function(t,e,n){var r=n(33).DFAState,i=n(30).ATNConfigSet,o=n(24).getCachedPredictionContext,s=n(16).Map;function a(t,e){return this.atn=t,this.sharedContextCache=e,this}a.ERROR=new r(2147483647,new i),a.prototype.getCachedContext=function(t){if(null===this.sharedContextCache)return t;var e=new s;return o(t,this.sharedContextCache,e)},e.ATNSimulator=a},function(t,e,n){n(16).Set;var r=n(16).Map,i=n(16).BitSet,o=n(16).AltDict,s=n(27).ATN,a=n(20).RuleStopState,l=n(30).ATNConfigSet,u=n(40).ATNConfig,c=n(32).SemanticContext,h=(n(16).Hash,n(16).hashStuff);n(16).equalArrays;function p(){return this}p.SLL=0,p.LL=1,p.LL_EXACT_AMBIG_DETECTION=2,p.hasSLLConflictTerminatingPrediction=function(t,e){if(p.allConfigsInRuleStopStates(e))return!0;if(t===p.SLL&&e.hasSemanticContext){for(var n=new l,r=0;r1)return!0}return!1},p.allSubsetsEqual=function(t){for(var e=null,n=0;n=n)){var i,o=e.charCodeAt(r);return o>=55296&&o<=56319&&n>r+1&&(i=e.charCodeAt(r+1))>=56320&&i<=57343?1024*(o-55296)+i-56320+65536:o}};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}()},function(t,e){var n,r,i,o; /*! https://mths.be/fromcodepoint v0.2.1 by @mathias */ String.fromCodePoint||(n=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),r=String.fromCharCode,i=Math.floor,o=function(t){var e,n,o=16384,s=[],a=-1,l=arguments.length;if(!l)return"";for(var u="";++a1114111||i(c)!=c)throw RangeError("Invalid code point: "+c);c<=65535?s.push(c):(e=55296+((c-=65536)>>10),n=c%1024+56320,s.push(e,n)),(a+1==l||s.length>o)&&(u+=r.apply(null,s),s.length=0)}return u},n?n(String,"fromCodePoint",{value:o,configurable:!0,writable:!0}):String.fromCodePoint=o)},function(t,e,n){var r=n(17).Token,i=n(22),o=i.NoViableAltException,s=i.InputMismatchException,a=i.FailedPredicateException,l=i.ParseCancellationException,u=n(20).ATNState,c=n(18).Interval,h=n(18).IntervalSet;function p(){}function f(){return p.call(this),this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.lastErrorStates=null,this}function d(){return f.call(this),this}p.prototype.reset=function(t){},p.prototype.recoverInline=function(t){},p.prototype.recover=function(t,e){},p.prototype.sync=function(t){},p.prototype.inErrorRecoveryMode=function(t){},p.prototype.reportError=function(t){},f.prototype=Object.create(p.prototype),f.prototype.constructor=f,f.prototype.reset=function(t){this.endErrorCondition(t)},f.prototype.beginErrorCondition=function(t){this.errorRecoveryMode=!0},f.prototype.inErrorRecoveryMode=function(t){return this.errorRecoveryMode},f.prototype.endErrorCondition=function(t){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1},f.prototype.reportMatch=function(t){this.endErrorCondition(t)},f.prototype.reportError=function(t,e){this.inErrorRecoveryMode(t)||(this.beginErrorCondition(t),e instanceof o?this.reportNoViableAlternative(t,e):e instanceof s?this.reportInputMismatch(t,e):e instanceof a?this.reportFailedPredicate(t,e):(console.log("unknown recognition error type: "+e.constructor.name),console.log(e.stack),t.notifyErrorListeners(e.getOffendingToken(),e.getMessage(),e)))},f.prototype.recover=function(t,e){this.lastErrorIndex===t.getInputStream().index&&null!==this.lastErrorStates&&this.lastErrorStates.indexOf(t.state)>=0&&t.consume(),this.lastErrorIndex=t._input.index,null===this.lastErrorStates&&(this.lastErrorStates=[]),this.lastErrorStates.push(t.state);var n=this.getErrorRecoverySet(t);this.consumeUntil(t,n)},f.prototype.sync=function(t){if(!this.inErrorRecoveryMode(t)){var e=t._interp.atn.states[t.state],n=t.getTokenStream().LA(1),i=t.atn.nextTokens(e);if(!i.contains(r.EPSILON)&&!i.contains(n))switch(e.stateType){case u.BLOCK_START:case u.STAR_BLOCK_START:case u.PLUS_BLOCK_START:case u.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(t))return;throw new s(t);case u.PLUS_LOOP_BACK:case u.STAR_LOOP_BACK:this.reportUnwantedToken(t);var o=new h;o.addSet(t.getExpectedTokens());var a=o.addSet(this.getErrorRecoverySet(t));this.consumeUntil(t,a)}}},f.prototype.reportNoViableAlternative=function(t,e){var n,i=t.getTokenStream();n=null!==i?e.startToken.type===r.EOF?"":i.getText(new c(e.startToken.tokenIndex,e.offendingToken.tokenIndex)):"";var o="no viable alternative at input "+this.escapeWSAndQuote(n);t.notifyErrorListeners(o,e.offendingToken,e)},f.prototype.reportInputMismatch=function(t,e){var n="mismatched input "+this.getTokenErrorDisplay(e.offendingToken)+" expecting "+e.getExpectedTokens().toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e.offendingToken,e)},f.prototype.reportFailedPredicate=function(t,e){var n="rule "+t.ruleNames[t._ctx.ruleIndex]+" "+e.message;t.notifyErrorListeners(n,e.offendingToken,e)},f.prototype.reportUnwantedToken=function(t){if(!this.inErrorRecoveryMode(t)){this.beginErrorCondition(t);var e=t.getCurrentToken(),n="extraneous input "+this.getTokenErrorDisplay(e)+" expecting "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e,null)}},f.prototype.reportMissingToken=function(t){if(!this.inErrorRecoveryMode(t)){this.beginErrorCondition(t);var e=t.getCurrentToken(),n="missing "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames)+" at "+this.getTokenErrorDisplay(e);t.notifyErrorListeners(n,e,null)}},f.prototype.recoverInline=function(t){var e=this.singleTokenDeletion(t);if(null!==e)return t.consume(),e;if(this.singleTokenInsertion(t))return this.getMissingSymbol(t);throw new s(t)},f.prototype.singleTokenInsertion=function(t){var e=t.getTokenStream().LA(1),n=t._interp.atn,r=n.states[t.state].transitions[0].target;return!!n.nextTokens(r,t._ctx).contains(e)&&(this.reportMissingToken(t),!0)},f.prototype.singleTokenDeletion=function(t){var e=t.getTokenStream().LA(2);if(this.getExpectedTokens(t).contains(e)){this.reportUnwantedToken(t),t.consume();var n=t.getCurrentToken();return this.reportMatch(t),n}return null},f.prototype.getMissingSymbol=function(t){var e,n=t.getCurrentToken(),i=this.getExpectedTokens(t).first();e=i===r.EOF?"":"";var o=n,s=t.getTokenStream().LT(-1);return o.type===r.EOF&&null!==s&&(o=s),t.getTokenFactory().create(o.source,i,e,r.DEFAULT_CHANNEL,-1,-1,o.line,o.column)},f.prototype.getExpectedTokens=function(t){return t.getExpectedTokens()},f.prototype.getTokenErrorDisplay=function(t){if(null===t)return"";var e=t.text;return null===e&&(e=t.type===r.EOF?"":"<"+t.type+">"),this.escapeWSAndQuote(e)},f.prototype.escapeWSAndQuote=function(t){return"'"+(t=(t=(t=t.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"},f.prototype.getErrorRecoverySet=function(t){for(var e=t._interp.atn,n=t._ctx,i=new h;null!==n&&n.invokingState>=0;){var o=e.states[n.invokingState].transitions[0],s=e.nextTokens(o.followState);i.addSet(s),n=n.parentCtx}return i.removeOne(r.EPSILON),i},f.prototype.consumeUntil=function(t,e){for(var n=t.getTokenStream().LA(1);n!==r.EOF&&!e.contains(n);)t.consume(),n=t.getTokenStream().LA(1)},d.prototype=Object.create(f.prototype),d.prototype.constructor=d,d.prototype.recover=function(t,e){for(var n=t._ctx;null!==n;)n.exception=e,n=n.parentCtx;throw new l(e)},d.prototype.recoverInline=function(t){this.recover(t,new s(t))},d.prototype.sync=function(t){},e.BailErrorStrategy=d,e.DefaultErrorStrategy=f},function(t,e){},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ny.MAX_DFA_EDGE)return null;var n=t.edges[e-y.MIN_DFA_EDGE];return void 0===n&&(n=null),y.debug&&null!==n&&console.log("reuse state "+t.stateNumber+" edge to "+n.stateNumber),n},y.prototype.computeTargetState=function(t,e,n){var r=new l;return this.getReachableConfigSet(t,e.configs,r,n),0===r.items.length?(r.hasSemanticContext||this.addDFAEdge(e,n,s.ERROR),s.ERROR):this.addDFAEdge(e,n,null,r)},y.prototype.failOrAccept=function(t,e,n,i){if(null!==this.prevAccept.dfaState){var o=t.dfaState.lexerActionExecutor;return this.accept(e,o,this.startIndex,t.index,t.line,t.column),t.dfaState.prediction}if(i===r.EOF&&e.index===this.startIndex)return r.EOF;throw new g(this.recog,e,this.startIndex,n)},y.prototype.getReachableConfigSet=function(t,e,n,i){for(var s=o.INVALID_ALT_NUMBER,a=0;ay.MAX_DFA_EDGE||(y.debug&&console.log("EDGE "+t+" -> "+n+" upon "+e),null===t.edges&&(t.edges=[]),t.edges[e-y.MIN_DFA_EDGE]=n),n},y.prototype.addDFAState=function(t){for(var e=new a(null,t),n=null,r=0;r0&&(o=this.getAltThatFinishedDecisionEntryRule(i))!==a.INVALID_ALT_NUMBER?o:a.INVALID_ALT_NUMBER},O.prototype.getAltThatFinishedDecisionEntryRule=function(t){for(var e=[],n=0;n0||r.state instanceof y&&r.context.hasEmptyPath())&&e.indexOf(r.alt)<0&&e.push(r.alt)}return 0===e.length?a.INVALID_ALT_NUMBER:Math.min.apply(null,e)},O.prototype.splitAccordingToSemanticValidity=function(t,e){for(var n=new c(t.fullCtx),r=new c(t.fullCtx),i=0;i50))throw"problem";if(t.state instanceof y){if(!t.context.isEmpty()){for(var a=0;a=0&&(p+=1)}this.closureCheckingStopState(h,e,n,c,i,p,s)}}},O.prototype.canDropLoopEntryEdgeInLeftRecursiveRule=function(t){var e=t.state;if(e.stateType!=l.STAR_LOOP_ENTRY)return!1;if(e.stateType!=l.STAR_LOOP_ENTRY||!e.isPrecedenceDecision||t.context.isEmpty()||t.context.hasEmptyPath())return!1;for(var n=t.context.length,r=0;r=0?this.parser.ruleNames[t]:""},O.prototype.getEpsilonTarget=function(t,e,n,r,i,o){switch(e.serializationType){case T.RULE:return this.ruleTransition(t,e);case T.PRECEDENCE:return this.precedenceTransition(t,e,n,r,i);case T.PREDICATE:return this.predTransition(t,e,n,r,i);case T.ACTION:return this.actionTransition(t,e);case T.EPSILON:return new u({state:e.target},t);case T.ATOM:case T.RANGE:case T.SET:return o&&e.matches(h.EOF,0,1)?new u({state:e.target},t):null;default:return null}},O.prototype.actionTransition=function(t,e){if(this.debug){var n=-1==e.actionIndex?65535:e.actionIndex;console.log("ACTION edge "+e.ruleIndex+":"+n)}return new u({state:e.target},t)},O.prototype.precedenceTransition=function(t,e,n,i,o){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+r.arrayToString(this.parser.getRuleInvocationStack())));var s=null;if(n&&i)if(o){var a=this._input.index;this._input.seek(this._startIndex);var l=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(a),l&&(s=new u({state:e.target},t))}else{var c=m.andContext(t.semanticContext,e.getPredicate());s=new u({state:e.target,semanticContext:c},t)}else s=new u({state:e.target},t);return this.debug&&console.log("config from pred transition="+s),s},O.prototype.predTransition=function(t,e,n,i,o){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.ruleIndex+":"+e.predIndex+", ctx dependent="+e.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+r.arrayToString(this.parser.getRuleInvocationStack())));var s=null;if(n&&(e.isCtxDependent&&i||!e.isCtxDependent))if(o){var a=this._input.index;this._input.seek(this._startIndex);var l=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(a),l&&(s=new u({state:e.target},t))}else{var c=m.andContext(t.semanticContext,e.getPredicate());s=new u({state:e.target,semanticContext:c},t)}else s=new u({state:e.target},t);return this.debug&&console.log("config from pred transition="+s),s},O.prototype.ruleTransition=function(t,e){this.debug&&console.log("CALL rule "+this.getRuleName(e.target.ruleIndex)+", ctx="+t.context);var n=e.followState,r=N.create(t.context,n.stateNumber);return new u({state:e.target,context:r},t)},O.prototype.getConflictingAlts=function(t){var e=g.getConflictingAltSubsets(t);return g.getAlts(e)},O.prototype.getConflictingAltsOrUniqueAlt=function(t){var e=null;return t.uniqueAlt!==a.INVALID_ALT_NUMBER?(e=new o).add(t.uniqueAlt):e=t.conflictingAlts,e},O.prototype.getTokenName=function(t){if(t===h.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(t>=this.parser.literalNames.length&&t>=this.parser.symbolicNames.length))return(this.parser.literalNames[t]||this.parser.symbolicNames[t])+"<"+t+">";console.log(t+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+t},O.prototype.getLookaheadName=function(t){return this.getTokenName(t.LA(1))},O.prototype.dumpDeadEndConfigs=function(t){console.log("dead end configs: ");for(var e=t.getDeadEndConfigs(),n=0;n0){var o=r.state.transitions[0];if(o instanceof AtomTransition)i="Atom "+this.getTokenName(o.label);else if(o instanceof C){i=(o instanceof w?"~":"")+"Set "+o.set}}console.error(r.toString(this.parser,!0)+":"+i)}},O.prototype.noViableAlt=function(t,e,n,r){return new L(this.parser,t,t.get(r),t.LT(1),n,e)},O.prototype.getUniqueAlt=function(t){for(var e=a.INVALID_ALT_NUMBER,n=0;n "+r+" upon "+this.getTokenName(n)),null===r)return null;if(r=this.addDFAState(t,r),null===e||n<-1||n>this.atn.maxTokenType)return r;if(null===e.edges&&(e.edges=[]),e.edges[n+1]=r,this.debug){var i=null===this.parser?null:this.parser.literalNames,o=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+t.toString(i,o))}return r},O.prototype.addDFAState=function(t,e){if(e==d.ERROR)return e;var n=t.states.get(e);return null!==n?n:(e.stateNumber=t.states.length,e.configs.readOnly||(e.configs.optimizeConfigs(this),e.configs.setReadonly(!0)),t.states.add(e),this.debug&&console.log("adding new DFA state: "+e),e)},O.prototype.reportAttemptingFullContext=function(t,e,n,r,i){if(this.debug||this.retry_debug){var o=new S(r,i+1);console.log("reportAttemptingFullContext decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(o))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,t,r,i,e,n)},O.prototype.reportContextSensitivity=function(t,e,n,r,i){if(this.debug||this.retry_debug){var o=new S(r,i+1);console.log("reportContextSensitivity decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(o))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,t,r,i,e,n)},O.prototype.reportAmbiguity=function(t,e,n,r,i,o,s){if(this.debug||this.retry_debug){var a=new S(n,r+1);console.log("reportAmbiguity "+o+":"+s+", input="+this.parser.getTokenStream().getText(a))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,t,n,r,i,o,s)},e.ParserATNSimulator=O},function(t,e,n){e.DFA=n(79).DFA,e.DFASerializer=n(44).DFASerializer,e.LexerDFASerializer=n(44).LexerDFASerializer,e.PredPrediction=n(33).PredPrediction},function(t,e,n){var r=n(16).Set,i=n(33).DFAState,o=n(20).StarLoopEntryState,s=n(30).ATNConfigSet,a=n(44).DFASerializer,l=n(44).LexerDFASerializer;function u(t,e){if(void 0===e&&(e=0),this.atnStartState=t,this.decision=e,this._states=new r,this.s0=null,this.precedenceDfa=!1,t instanceof o&&t.isPrecedenceDecision){this.precedenceDfa=!0;var n=new i(null,new s);n.edges=[],n.isAcceptState=!1,n.requiresFullContext=!1,this.s0=n}return this}u.prototype.getPrecedenceStartState=function(t){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return t<0||t>=this.s0.edges.length?null:this.s0.edges[t]||null},u.prototype.setPrecedenceStartState=function(t,e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";t<0||(this.s0.edges[t]=e)},u.prototype.setPrecedenceDfa=function(t){if(this.precedenceDfa!==t){if(this._states=new DFAStatesSet,t){var e=new i(null,new s);e.edges=[],e.isAcceptState=!1,e.requiresFullContext=!1,this.s0=e}else this.s0=null;this.precedenceDfa=t}},Object.defineProperty(u.prototype,"states",{get:function(){return this._states}}),u.prototype.sortedStates=function(){return this._states.values().sort((function(t,e){return t.stateNumber-e.stateNumber}))},u.prototype.toString=function(t,e){return t=t||null,e=e||null,null===this.s0?"":new a(this,t,e).toString()},u.prototype.toLexerString=function(){return null===this.s0?"":new l(this).toString()},e.DFA=u},function(t,e,n){var r=n(21);e.Trees=n(53).Trees,e.RuleNode=r.RuleNode,e.ParseTreeListener=r.ParseTreeListener,e.ParseTreeVisitor=r.ParseTreeVisitor,e.ParseTreeWalker=r.ParseTreeWalker},function(t,e,n){e.RecognitionException=n(22).RecognitionException,e.NoViableAltException=n(22).NoViableAltException,e.LexerNoViableAltException=n(22).LexerNoViableAltException,e.InputMismatchException=n(22).InputMismatchException,e.FailedPredicateException=n(22).FailedPredicateException,e.DiagnosticErrorListener=n(82).DiagnosticErrorListener,e.BailErrorStrategy=n(62).BailErrorStrategy,e.ErrorListener=n(43).ErrorListener},function(t,e,n){var r=n(16).BitSet,i=n(43).ErrorListener,o=n(18).Interval;function s(t){return i.call(this),t=t||!0,this.exactOnly=t,this}s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.prototype.reportAmbiguity=function(t,e,n,r,i,s,a){if(!this.exactOnly||i){var l="reportAmbiguity d="+this.getDecisionDescription(t,e)+": ambigAlts="+this.getConflictingAlts(s,a)+", input='"+t.getTokenStream().getText(new o(n,r))+"'";t.notifyErrorListeners(l)}},s.prototype.reportAttemptingFullContext=function(t,e,n,r,i,s){var a="reportAttemptingFullContext d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new o(n,r))+"'";t.notifyErrorListeners(a)},s.prototype.reportContextSensitivity=function(t,e,n,r,i,s){var a="reportContextSensitivity d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new o(n,r))+"'";t.notifyErrorListeners(a)},s.prototype.getDecisionDescription=function(t,e){var n=e.decision,r=e.atnStartState.ruleIndex,i=t.ruleNames;if(r<0||r>=i.length)return""+n;var o=i[r]||null;return null===o||0===o.length?""+n:n+" ("+o+")"},s.prototype.getConflictingAlts=function(t,e){if(null!==t)return t;for(var n=new r,i=0;i=0&&(this.fetchedEOF?this.index0)||this.fetch(e)>=e},a.prototype.fetch=function(t){if(this.fetchedEOF)return 0;for(var e=0;e=this.tokens.length&&(e=this.tokens.length-1);for(var o=t;o=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[e]},a.prototype.adjustSeekIndex=function(t){return t},a.prototype.lazyInit=function(){-1===this.index&&this.setup()},a.prototype.setup=function(){this.sync(0),this.index=this.adjustSeekIndex(0)},a.prototype.setTokenSource=function(t){this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1},a.prototype.nextTokenOnChannel=function(t,e){if(this.sync(t),t>=this.tokens.length)return-1;for(var n=this.tokens[t];n.channel!==this.channel;){if(n.type===r.EOF)return-1;t+=1,this.sync(t),n=this.tokens[t]}return t},a.prototype.previousTokenOnChannel=function(t,e){for(;t>=0&&this.tokens[t].channel!==e;)t-=1;return t},a.prototype.getHiddenTokensToRight=function(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;var n=this.nextTokenOnChannel(t+1,i.DEFAULT_TOKEN_CHANNEL),r=t+1,o=-1===n?this.tokens.length-1:n;return this.filterForChannel(r,o,e)},a.prototype.getHiddenTokensToLeft=function(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;var n=this.previousTokenOnChannel(t-1,i.DEFAULT_TOKEN_CHANNEL);if(n===t-1)return null;var r=n+1,o=t-1;return this.filterForChannel(r,o,e)},a.prototype.filterForChannel=function(t,e,n){for(var r=[],o=t;o=this.tokens.length&&(n=this.tokens.length-1);for(var i="",s=e;s=0&&this._parseListeners.splice(e,1),0===this._parseListeners.length&&(this._parseListeners=null)}},p.prototype.removeParseListeners=function(){this._parseListeners=null},p.prototype.triggerEnterRuleEvent=function(){if(null!==this._parseListeners){var t=this._ctx;this._parseListeners.map((function(e){e.enterEveryRule(t),t.enterRule(e)}))}},p.prototype.triggerExitRuleEvent=function(){if(null!==this._parseListeners){var t=this._ctx;this._parseListeners.slice(0).reverse().map((function(e){t.exitRule(e),e.exitEveryRule(t)}))}},p.prototype.getTokenFactory=function(){return this._input.tokenSource._factory},p.prototype.setTokenFactory=function(t){this._input.tokenSource._factory=t},p.prototype.getATNWithBypassAlts=function(){var t=this.getSerializedATN();if(null===t)throw"The current parser does not support an ATN with bypass alternatives.";var e=this.bypassAltsAtnCache[t];if(null===e){var n=new l;n.generateRuleBypassTransitions=!0,e=new a(n).deserialize(t),this.bypassAltsAtnCache[t]=e}return e};var f=n(42).Lexer;p.prototype.compileParseTreePattern=function(t,e,n){if(null===(n=n||null)&&null!==this.getTokenStream()){var r=this.getTokenStream().tokenSource;r instanceof f&&(n=r)}if(null===n)throw"Parser can't discover a lexer to use";return new ParseTreePatternMatcher(n,this).compile(t,e)},p.prototype.getInputStream=function(){return this.getTokenStream()},p.prototype.setInputStream=function(t){this.setTokenStream(t)},p.prototype.getTokenStream=function(){return this._input},p.prototype.setTokenStream=function(t){this._input=null,this.reset(),this._input=t},p.prototype.getCurrentToken=function(){return this._input.LT(1)},p.prototype.notifyErrorListeners=function(t,e,n){n=n||null,null===(e=e||null)&&(e=this.getCurrentToken()),this._syntaxErrors+=1;var r=e.line,i=e.column;this.getErrorListenerDispatch().syntaxError(this,e,r,i,t,n)},p.prototype.consume=function(){var t=this.getCurrentToken();t.type!==r.EOF&&this.getInputStream().consume();var e,n=null!==this._parseListeners&&this._parseListeners.length>0;(this.buildParseTrees||n)&&((e=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(t):this._ctx.addTokenNode(t)).invokingState=this.state,n&&this._parseListeners.map((function(t){e instanceof c||void 0!==e.isErrorNode&&e.isErrorNode()?t.visitErrorNode(e):e instanceof u&&t.visitTerminal(e)})));return t},p.prototype.addContextToParseTree=function(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)},p.prototype.enterRule=function(t,e,n){this.state=e,this._ctx=t,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),null!==this._parseListeners&&this.triggerEnterRuleEvent()},p.prototype.exitRule=function(){this._ctx.stop=this._input.LT(-1),null!==this._parseListeners&&this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx},p.prototype.enterOuterAlt=function(t,e){t.setAltNumber(e),this.buildParseTrees&&this._ctx!==t&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(t)),this._ctx=t},p.prototype.getPrecedence=function(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]},p.prototype.enterRecursionRule=function(t,e,n,r){this.state=e,this._precedenceStack.push(r),this._ctx=t,this._ctx.start=this._input.LT(1),null!==this._parseListeners&&this.triggerEnterRuleEvent()},p.prototype.pushNewRecursionContext=function(t,e,n){var r=this._ctx;r.parentCtx=t,r.invokingState=e,r.stop=this._input.LT(-1),this._ctx=t,this._ctx.start=r.start,this.buildParseTrees&&this._ctx.addChild(r),null!==this._parseListeners&&this.triggerEnterRuleEvent()},p.prototype.unrollRecursionContexts=function(t){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);var e=this._ctx;if(null!==this._parseListeners)for(;this._ctx!==t;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=t;e.parentCtx=t,this.buildParseTrees&&null!==t&&t.addChild(e)},p.prototype.getInvokingContext=function(t){for(var e=this._ctx;null!==e;){if(e.ruleIndex===t)return e;e=e.parentCtx}return null},p.prototype.precpred=function(t,e){return e>=this._precedenceStack[this._precedenceStack.length-1]},p.prototype.inContext=function(t){return!1},p.prototype.isExpectedToken=function(t){var e=this._interp.atn,n=this._ctx,i=e.states[this.state],o=e.nextTokens(i);if(o.contains(t))return!0;if(!o.contains(r.EPSILON))return!1;for(;null!==n&&n.invokingState>=0&&o.contains(r.EPSILON);){var s=e.states[n.invokingState].transitions[0];if((o=e.nextTokens(s.followState)).contains(t))return!0;n=n.parentCtx}return!(!o.contains(r.EPSILON)||t!==r.EOF)},p.prototype.getExpectedTokens=function(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)},p.prototype.getExpectedTokensWithinCurrentRule=function(){var t=this._interp.atn,e=t.states[this.state];return t.nextTokens(e)},p.prototype.getRuleIndex=function(t){var e=this.getRuleIndexMap()[t];return null!==e?e:-1},p.prototype.getRuleInvocationStack=function(t){null===(t=t||null)&&(t=this._ctx);for(var e=[];null!==t;){var n=t.ruleIndex;n<0?e.push("n/a"):e.push(this.ruleNames[n]),t=t.parentCtx}return e},p.prototype.getDFAStrings=function(){return this._interp.decisionToDFA.toString()},p.prototype.dumpDFA=function(){for(var t=!1,e=0;e0&&(t&&console.log(),this.printer.println("Decision "+n.decision+":"),this.printer.print(n.toString(this.literalNames,this.symbolicNames)),t=!0)}},p.prototype.getSourceName=function(){return this._input.sourceName},p.prototype.setTrace=function(t){t?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new h(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)},e.Parser=p},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function a(t,e,n,r){var i=e&&e.prototype instanceof c?e:c,o=Object.create(i.prototype),s=new T(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return w()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=x(s,n);if(a){if(a===u)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,s),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var u={};function c(){}function h(){}function p(){}var f={};f[i]=function(){return this};var d=Object.getPrototypeOf,g=d&&d(d(C([])));g&&g!==e&&n.call(g,i)&&(f=g);var v=p.prototype=c.prototype=Object.create(f);function m(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function y(t,e){var r;this._invoke=function(i,o){function s(){return new e((function(r,s){!function r(i,o,s,a){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}(i,o,r,s)}))}return r=r?r.then(s,s):s()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;b(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},,function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}},function(t,e,n){var r=n(49),i=n(93);function o(e,n,s){return i()?t.exports=o=Reflect.construct:t.exports=o=function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&r(o,n.prototype),o},o.apply(null,arguments)}t.exports=o},function(t,e){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}},,,,function(t,e,n){var r=n(64);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},,,,function(t,e,n){!function(t){var e={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=t.Pos;function r(t,n){return"pairs"==n&&"string"==typeof t?t:"object"==typeof t&&null!=t[n]?t[n]:e[n]}t.defineOption("autoCloseBrackets",!1,(function(e,n,s){s&&s!=t.Init&&(e.removeKeyMap(i),e.state.closeBrackets=null),n&&(o(r(n,"pairs")),e.state.closeBrackets=n,e.addKeyMap(i))}));var i={Backspace:function(e){var i=a(e);if(!i||e.getOption("disableInput"))return t.Pass;for(var o=r(i,"pairs"),s=e.listSelections(),u=0;u=0;u--){var h=s[u].head;e.replaceRange("",n(h.line,h.ch-1),n(h.line,h.ch+1),"+delete")}},Enter:function(e){var n=a(e),i=n&&r(n,"explode");if(!i||e.getOption("disableInput"))return t.Pass;for(var o=e.listSelections(),s=0;s1&&p.indexOf(i)>=0&&e.getRange(n(x.line,x.ch-2),x)==i+i){if(x.ch>2&&/\bstring/.test(e.getTokenTypeAt(n(x.line,x.ch-2))))return t.Pass;m="addFour"}else if(f){var b=0==x.ch?" ":e.getRange(n(x.line,x.ch-1),x);if(t.isWordChar(S)||b==i||t.isWordChar(b))return t.Pass;m="both"}else{if(!g||!(0===S.length||/\s/.test(S)||h.indexOf(S)>-1))return t.Pass;m="both"}else m=f&&u(e,x)?"both":p.indexOf(i)>=0&&e.getRange(x,n(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(c){if(c!=m)return t.Pass}else c=m}var T=l%2?s.charAt(l-1):i,C=l%2?i:s.charAt(l+1);e.operation((function(){if("skip"==c)e.execCommand("goCharRight");else if("skipThree"==c)for(var r=0;r<3;r++)e.execCommand("goCharRight");else if("surround"==c){var i=e.getSelections();for(r=0;r0,{anchor:new n(o.anchor.line,o.anchor.ch+(s?-1:1)),head:new n(o.head.line,o.head.ch+(s?1:-1))});e.setSelections(i)}else"both"==c?(e.replaceSelection(T+C,null),e.triggerElectric(T+C),e.execCommand("goCharLeft")):"addFour"==c&&(e.replaceSelection(T+T+T+T,"before"),e.execCommand("goCharRight"));var o,s}))}(i,e)}}function a(t){var e=t.state.closeBrackets;return!e||e.override?e:t.getModeAt(t.getCursor()).closeBrackets||e}function l(t,e){var r=t.getRange(n(e.line,e.ch-1),n(e.line,e.ch+1));return 2==r.length?r:null}function u(t,e){var r=t.getTokenAt(n(e.line,e.ch+1));return/\bstring/.test(r.type)&&r.start==e.ch&&(0==e.ch||!/\bstring/.test(t.getTokenTypeAt(e)))}o(e.pairs+"`")}(n(34))},function(t,e,n){!function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=t.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(t){return t&&t.bracketRegex||/[(){}[\]]/}function o(t,e,o){var a=t.getLineHandle(e.line),l=e.ch-1,u=o&&o.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var c=i(o),h=!u&&l>=0&&c.test(a.text.charAt(l))&&r[a.text.charAt(l)]||c.test(a.text.charAt(l+1))&&r[a.text.charAt(++l)];if(!h)return null;var p=">"==h.charAt(1)?1:-1;if(o&&o.strict&&p>0!=(l==e.ch))return null;var f=t.getTokenTypeAt(n(e.line,l+1)),d=s(t,n(e.line,l+(p>0?1:0)),p,f||null,o);return null==d?null:{from:n(e.line,l),to:d&&d.pos,match:d&&d.ch==h.charAt(0),forward:p>0}}function s(t,e,o,s,a){for(var l=a&&a.maxScanLineLength||1e4,u=a&&a.maxScanLines||1e3,c=[],h=i(a),p=o>0?Math.min(e.line+u,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-u),f=e.line;f!=p;f+=o){var d=t.getLine(f);if(d){var g=o>0?0:d.length-1,v=o>0?d.length:-1;if(!(d.length>l))for(f==e.line&&(g=e.ch-(o<0?1:0));g!=v;g+=o){var m=d.charAt(g);if(h.test(m)&&(void 0===s||t.getTokenTypeAt(n(f,g+1))==s)){var y=r[m];if(y&&">"==y.charAt(1)==o>0)c.push(m);else{if(!c.length)return{pos:n(f,g),ch:m};c.pop()}}}}}return f-o!=(o>0?t.lastLine():t.firstLine())&&null}function a(t,r,i){for(var s=t.state.matchBrackets.maxHighlightLineLength||1e3,a=[],l=t.listSelections(),u=0;u