(window.webpackJsonpivprogCore=window.webpackJsonpivprogCore||[]).push([[1],[,,,,,function(t,e,n){var r;!function(i){"use strict";var o,s,a,l=9e15,u=1e9,c="0123456789abcdef",h="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",p="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",f={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-l,maxE:l,crypto:!1},d=!0,g="[DecimalError] ",v=g+"Invalid argument: ",m=g+"Precision limit exceeded",y=g+"crypto unavailable",x=Math.floor,S=Math.pow,T=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,C=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,b=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,w=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,E=1e7,A=7,L=h.length-1,N=p.length-1,k={name:"[object Decimal]"};function O(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;en)throw Error(v+t)}function I(t,e,n,r){var i,o,s,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=A,i=0):(i=Math.ceil((e+1)/A),e%=A),o=S(10,A-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)==S(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)==S(10,e-3)-1,s}function M(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()}k.absoluteValue=k.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),D(t)},k.ceil=function(){return D(new this.constructor(this),this.e+1,2)},k.comparedTo=k.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},k.cosine=k.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())+A,r.rounding=1,n=function(t,e){var n,r,i=e.d.length;i<32?(n=Math.ceil(i/3),r=(1/Z(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10");t.precision+=n,e=$(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,J(r,n)),r.precision=t,r.rounding=e,D(2==a||3==a?n.neg():n,t,e,!0)):new r(1):new r(NaN)},k.cubeRoot=k.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(d=!1,(o=c.s*S(c.s*c,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=O(c.d),(o=((t=c.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=S(n,1/3),t=x((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=P(u.plus(c).times(a),u.plus(l),s+2,1),O(a.d).slice(0,s)===(n=O(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))||(D(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!i&&(D(a,t+1,0),a.times(a).times(a).eq(c))){r=a;break}s+=4,i=1}return d=!0,D(r,t,h.rounding,e)},k.decimalPlaces=k.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=((t=e.length-1)-x(this.e/A))*A,t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},k.dividedBy=k.div=function(t){return P(this,new this.constructor(t))},k.dividedToIntegerBy=k.divToInt=function(t){var e=this.constructor;return D(P(this,new e(t),0,1,1),e.precision,e.rounding)},k.equals=k.eq=function(t){return 0===this.cmp(t)},k.floor=function(){return D(new this.constructor(this),this.e+1,3)},k.greaterThan=k.gt=function(t){return this.cmp(t)>0},k.greaterThanOrEqualTo=k.gte=function(t){var e=this.cmp(t);return 1==e||0===e},k.hyperbolicCosine=k.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/Z(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=$(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 D(o,s.precision=n,s.rounding=r,!0)},k.hyperbolicSine=k.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=$(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=$(o,2,i=i.times(1/Z(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,D(i,e,n,!0)},k.hyperbolicTangent=k.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,P(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},k.inverseCosine=k.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()?B(n,i,o):new n(0):new n(NaN):e.isZero()?B(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=B(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},k.inverseHyperbolicCosine=k.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,d=!1,n=n.times(n).minus(1).sqrt().plus(n),d=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},k.inverseHyperbolicSine=k.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,d=!1,n=n.times(n).plus(1).sqrt().plus(n),d=!0,r.precision=t,r.rounding=e,n.ln())},k.inverseHyperbolicTangent=k.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?D(new o(i),t,e,!0):(o.precision=n=r-i.e,i=P(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)},k.inverseSine=k.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=B(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)))},k.inverseTangent=k.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<=N)return(s=B(c,h+4,p).times(.25)).s=u.s,s}else{if(!u.s)return new c(NaN);if(h+4<=N)return(s=B(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/A+2|0);t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(d=!1,e=Math.ceil(a/A),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},k.isNaN=function(){return!this.s},k.isNegative=k.isNeg=function(){return this.s<0},k.isPositive=k.isPos=function(){return this.s>0},k.isZero=function(){return!!this.d&&0===this.d[0]},k.lessThan=k.lt=function(t){return this.cmp(t)<0},k.lessThanOrEqualTo=k.lte=function(t){return this.cmp(t)<1},k.logarithm=k.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(d=!1,s=K(this,a=c+5),r=e?H(u,a+10):K(t,a),I((l=P(s,r,a,1)).d,i=c,h))do{if(s=K(this,a+=10),r=e?H(u,a+10):K(t,a),l=P(s,r,a,1),!o){+O(l.d).slice(i+1,i+15)+1==1e14&&(l=D(l,c+1,0));break}}while(I(l.d,i+=10,h));return d=!0,D(l,c,h)},k.minus=k.sub=function(t){var e,n,r,i,o,s,a,l,u,c,h,p,f=this,g=f.constructor;if(t=new g(t),!f.d||!t.d)return f.s&&t.s?f.d?t.s=-t.s:t=new g(t.d||f.s!==t.s?f:NaN):t=new g(NaN),t;if(f.s!=t.s)return t.s=-t.s,f.plus(t);if(u=f.d,p=t.d,a=g.precision,l=g.rounding,!u[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!u[0])return new g(3===l?-0:0);t=new g(f)}return d?D(t,a,l):t}if(n=x(t.e/A),c=x(f.e/A),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/A),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/A))>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)/E|0,u[i]%=E;for(e&&(u.unshift(e),++r),s=u.length;0==u[--s];)u.pop();return t.d=u,t.e=F(u,r),d?D(t,a,l):t},k.precision=k.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(v+t);return n.d?(e=W(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},k.round=function(){var t=this,e=t.constructor;return D(new e(t),t.e+1,e.rounding)},k.sine=k.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())+A,r.rounding=1,n=function(t,e){var n,r=e.d.length;if(r<3)return $(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=e.times(1/Z(5,n)),e=$(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,J(r,n)),r.precision=t,r.rounding=e,D(a>2?n.neg():n,t,e,!0)):new r(NaN)},k.squareRoot=k.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(d=!1,0==(u=Math.sqrt(+s))||u==1/0?(((e=O(a)).length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=x((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(P(s,o,n+2,1)).times(.5),O(o.d).slice(0,n)===(e=O(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))||(D(r,l+1,1),t=!r.times(r).eq(s));break}if(!i&&(D(o,l+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}return d=!0,D(r,l,c.rounding,t)},k.tangent=k.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=P(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,D(2==a||4==a?n.neg():n,t,e,!0)):new r(NaN)},k.times=k.mul=function(t){var e,n,r,i,o,s,a,l,u,c=this,h=c.constructor,p=c.d,f=(t=new h(t)).d;if(t.s*=c.s,!(p&&p[0]&&f&&f[0]))return new h(!t.s||p&&!p[0]&&!f||f&&!f[0]&&!p?NaN:p&&f?0*t.s:t.s/0);for(n=x(c.e/A)+x(t.e/A),(l=p.length)<(u=f.length)&&(o=p,p=f,f=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]+f[r]*p[i-r-1]+e,o[i--]=a%E|0,e=a/E|0;o[i]=(o[i]+e)%E|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=F(o,n),d?D(t,h.precision,h.rounding):t},k.toBinary=function(t,e){return Q(this,2,t,e)},k.toDecimalPlaces=k.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(_(t,0,u),void 0===e?e=r.rounding:_(e,0,8),D(n,t+n.e+1,e))},k.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=R(r,!0):(_(t,0,u),void 0===e?e=i.rounding:_(e,0,8),n=R(r=D(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},k.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=R(i):(_(t,0,u),void 0===e?e=o.rounding:_(e,0,8),n=R(r=D(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},k.toFraction=function(t){var e,n,r,i,o,s,a,l,u,c,h,p,f=this,g=f.d,m=f.constructor;if(!g)return new m(f);if(u=n=new m(1),r=l=new m(0),s=(o=(e=new m(r)).e=W(g)-f.e-1)%A,e.d[0]=S(10,s<0?A+s:s),null==t)t=o>0?e:u;else{if(!(a=new m(t)).isInt()||a.lt(u))throw Error(v+a);t=a.gt(e)?o>0?e:u:a}for(d=!1,a=new m(O(g)),c=m.precision,m.precision=o=g.length*A*2;h=P(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=P(t.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=f.s,p=P(u,r,o,1).minus(f).abs().cmp(P(l,n,o,1).minus(f).abs())<1?[u,r]:[l,n],m.precision=c,d=!0,p},k.toHexadecimal=k.toHex=function(t,e){return Q(this,16,t,e)},k.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:_(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]?(d=!1,n=P(n,t,0,e,1).times(t),d=!0,D(n)):(t.s=n.s,n=t),n},k.toNumber=function(){return+this},k.toOctal=function(t,e){return Q(this,8,t,e)},k.toPower=k.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(S(+a,u));if((a=new l(a)).eq(1))return a;if(r=l.precision,o=l.rounding,t.eq(1))return D(a,r,o);if((e=x(t.e/A))>=t.d.length-1&&(n=u<0?-u:u)<=9007199254740991)return i=U(l,a,n,r),t.s<0?new l(1).div(i):D(i,r,o);if((s=a.s)<0){if(el.maxE+1||e0?s/0:0):(d=!1,l.rounding=a.s=1,n=Math.min(12,(e+"").length),(i=q(t.times(K(a,r+n)),r)).d&&I((i=D(i,r+5,1)).d,r,o)&&(e=r+10,+O((i=D(q(t.times(K(a,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=D(i,r+1,0))),i.s=s,d=!0,l.rounding=o,D(i,r,o))},k.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=R(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(_(t,1,u),void 0===e?e=i.rounding:_(e,0,8),n=R(r=D(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},k.toSignificantDigits=k.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(_(t,1,u),void 0===e?e=n.rounding:_(e,0,8)),D(new n(this),t,e)},k.toString=function(){var t=this,e=t.constructor,n=R(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},k.truncated=k.trunc=function(){return D(new this.constructor(this),this.e+1,1)},k.valueOf=k.toJSON=function(){var t=this,e=t.constructor,n=R(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var P=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,g,v,m,y,S,T,C,b,w,L,N,k,O,_,I,M=r.constructor,P=r.s==i.s?1:-1,R=r.d,F=i.d;if(!(R&&R[0]&&F&&F[0]))return new M(r.s&&i.s&&(R?!F||R[0]!=F[0]:F)?R&&0==R[0]||!F?0*P:P/0:NaN);for(u?(d=1,h=r.e-i.e):(u=E,d=A,h=x(r.e/d)-x(i.e/d)),_=F.length,k=R.length,S=(y=new M(P)).d=[],p=0;F[p]==(R[p]||0);p++);if(F[p]>(R[p]||0)&&h--,null==o?(w=o=M.precision,a=M.rounding):w=l?o+(r.e-i.e)+1:o,w<0)S.push(1),g=!0;else{if(w=w/d+2|0,p=0,1==_){for(f=0,F=F[0],w++;(p1&&(F=t(F,f,u),R=t(R,f,u),_=F.length,k=R.length),N=_,C=(T=R.slice(0,_)).length;C<_;)T[C++]=0;(I=F.slice()).unshift(0),O=F[0],F[1]>=u/2&&++O;do{f=0,(c=e(F,T,_,C))<0?(b=T[0],_!=C&&(b=b*u+(T[1]||0)),(f=b/O|0)>1?(f>=u&&(f=u-1),1==(c=e(v=t(F,f,u),T,m=v.length,C=T.length))&&(f--,n(v,_=10;f/=10)p++;y.e=p+h*d-1,D(y,l?o+y.e+1:o,a,g)}return y}}();function D(t,e,n,r){var i,o,s,a,l,u,c,h,p,f=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+=A,s=e,l=(c=h[p=0])/S(10,i-s-1)%10|0;else if((p=Math.ceil((o+1)/A))>=(a=h.length)){if(!r)break t;for(;a++<=p;)h.push(0);c=l=0,i=1,s=(o%=A)-A+1}else{for(c=a=h[p],i=1;a>=10;a/=10)i++;l=(s=(o%=A)-A+i)<0?0:c/S(10,i-s-1)%10|0}if(r=r||e<0||void 0!==h[p+1]||(s<0?c:c%S(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/S(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]=S(10,(A-e%A)%A),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=p,a=1,p--):(h.length=p+1,a=S(10,A-o),h[p]=s>0?(c/S(10,i-s)%S(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]==E&&(h[0]=1));break}if(h[p]+=a,h[p]!=E)break;h[p--]=0,a=1}for(o=h.length;0===h[--o];)h.pop()}return d&&(t.e>f.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+z(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+z(-i-1)+o,n&&(r=n-s)>0&&(o+=z(r))):i>=s?(o+=z(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+z(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=z(r))),o}function F(t,e){var n=t[0];for(e*=A;n>=10;n/=10)e++;return e}function H(t,e,n){if(e>L)throw d=!0,n&&(t.precision=n),Error(m);return D(new t(h),e,1,!0)}function B(t,e,n){if(e>N)throw Error(m);return D(new t(p),e,n,!0)}function W(t){var e=t.length-1,n=e*A+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function z(t){for(var e="";t--;)e+="0";return e}function U(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/A+4);for(d=!1;;){if(n%2&&tt((o=o.times(e)).d,s)&&(i=!0),0===(n=x(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}tt((e=e.times(e)).d,s)}return d=!0,o}function j(t){return 1&t.d[t.d.length-1]}function V(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?(d=!1,l=g):l=e,a=new p(.03125);t.e>-2;)t=t.times(a),h+=5;for(l+=r=Math.log(S(2,h))/Math.LN10*2+5|0,n=o=s=new p(1),p.precision=l;;){if(o=D(o.times(t),l,1),n=n.times(++c),O((a=s.plus(P(o,n,l,1))).d).slice(0,l)===O(s.d).slice(0,l)){for(i=h;i--;)s=D(s.times(s),l,1);if(null!=e)return p.precision=g,s;if(!(u<3&&I(s.d,l-r,f,u)))return D(s,p.precision=g,f,d=!0);p.precision=l+=10,n=o=a=new p(1),c=0,u++}s=a}}function K(t,e){var n,r,i,o,s,a,l,u,c,h,p,f=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?(d=!1,c=x):c=e,m.precision=c+=10,r=(n=O(v)).charAt(0),!(Math.abs(o=g.e)<15e14))return u=H(m,c+2,x).times(o+""),g=K(new m(r+"."+n.slice(1)),c-10).plus(u),m.precision=x,null==e?D(g,x,y,d=!0):g;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=O((g=g.times(t)).d)).charAt(0),f++;for(o=g.e,r>1?(g=new m("0."+n),o++):g=new m(r+"."+n.slice(1)),h=g,l=s=g=P(g.minus(1),g.plus(1),c,1),p=D(g.times(g),c,1),i=3;;){if(s=D(s.times(p),c,1),O((u=l.plus(P(s,new m(i),c,1))).d).slice(0,c)===O(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(H(m,c+2,x).times(o+""))),l=P(l,new m(f),c,1),null!=e)return m.precision=x,l;if(!I(l.d,c-10,y,a))return D(l,m.precision=x,y,d=!0);m.precision=c+=10,u=s=g=P(h.minus(1),h.plus(1),c,1),p=D(g.times(g),c,1),i=a=1}l=u,i+=2}}function G(t){return String(t.s*t.s/0)}function Y(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)%A,n<0&&(r+=A),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=U(r,new r(n),s,2*s)),s=h=(c=M(e,n,E)).length-1;0===c[s];--s)c.pop();return s<0?new r(0*t.s):(t.e=F(c,h),t.d=c,d=!1,a&&(t=P(t,i,4*l)),u&&(t=t.times(Math.abs(u)<54?S(2,u):o.pow(2,u))),d=!0,t)}function $(t,e,n,r,i){var o,s,a,l,u=t.precision,c=Math.ceil(u/A);for(d=!1,l=n.times(n),a=new t(r);;){if(s=P(a.times(l),new t(e++*e++),u,1),a=i?r.plus(s):r.minus(s),r=P(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,0}return d=!0,s.d.length=c+1,s}function Z(t,e){for(var n=t;--e;)n*=t;return n}function J(t,e){var n,r=e.s<0,i=B(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=j(n)?r?2:3:r?4:1,e;a=j(n)?r?1:4:r?3:2}return e.minus(i).abs()}function Q(t,e,n,r){var i,o,a,l,h,p,f,d,g,v=t.constructor,m=void 0!==n;if(m?(_(n,1,u),void 0===r?r=v.rounding:_(r,0,8)):(n=v.precision,r=v.rounding),t.isFinite()){for(m?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(a=(f=R(t)).indexOf("."))>=0&&(f=f.replace(".",""),(g=new v(1)).e=f.length-a,g.d=M(R(g),10,i),g.e=g.d.length),o=h=(d=M(f,10,i)).length;0==d[--h];)d.pop();if(d[0]){if(a<0?o--:((t=new v(t)).d=d,t.e=o,d=(t=P(t,g,n,r,0,i)).d,o=t.e,p=s),a=d[n],l=i/2,p=p||void 0!==d[n+1],p=r<4?(void 0!==a||p)&&(0===r||r===(t.s<0?3:2)):a>l||a===l&&(4===r||p||6===r&&1&d[n-1]||r===(t.s<0?8:7)),d.length=n,p)for(;++d[--n]>i-1;)d[n]=0,n||(++o,d.unshift(1));for(h=d.length;!d[h-1];--h);for(a=0,f="";a1)if(16==e||8==e){for(a=16==e?4:3,--h;h%a;h++)f+="0";for(h=(d=M(f,i,e)).length;!d[h-1];--h);for(a=1,f="1.";ah)for(o-=h;o--;)f+="0";else oe)return t.length=e,!0}function et(t){return new this(t).abs()}function nt(t){return new this(t).acos()}function rt(t){return new this(t).acosh()}function it(t,e){return new this(t).plus(e)}function ot(t){return new this(t).asin()}function st(t){return new this(t).asinh()}function at(t){return new this(t).atan()}function lt(t){return new this(t).atanh()}function ut(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?B(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=B(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(P(t,e,o,1)),e=B(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(P(t,e,o,1)):(n=B(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function ct(t){return new this(t).cbrt()}function ht(t){return D(t=new this(t),t.e+1,2)}function pt(t){if(!t||"object"!=typeof t)throw Error(g+"Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,u,"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(v+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=f[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(v+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(y);this[n]=!0}else this[n]=!1}return this}function ft(t){return new this(t).cos()}function dt(t){return new this(t).cosh()}function gt(t,e){return new this(t).div(e)}function vt(t){return new this(t).exp()}function mt(t){return D(t=new this(t),t.e+1,3)}function yt(){var t,e,n=new this(0);for(d=!1,t=0;t=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(y);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++;ro.maxE?(i.e=NaN,i.d=null):t.e=10;n/=10)e++;return void(d?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[t]||null;return null===n?null:n[e]||null},u.prototype.set=function(t,e,n){var r=this[t]||null;null===r&&(r={},this[t]=r),r[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(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(8).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 u(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 u(g,f);return null!==r&&r.set(t,e,v),v}(t,e,n,r);if(n){if(t instanceof l)return t;if(e instanceof l)return e}return t instanceof a&&(t=new u([t.getParent()],[t.returnState])),e instanceof a&&(e=new u([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 s=0,l=0,h=0,p=[],f=[];for(;s0&&(t+=", "),this.returnStates[e]!==o.EMPTY_RETURN_STATE?(t+=this.returnStates[e],null!==this.parents[e]?t=t+" "+this.parents[e]:t+="null"):t+="$";return t+"]"},e.merge=c,e.PredictionContext=o,e.PredictionContextCache=s,e.SingletonPredictionContext=a,e.predictionContextFromRuleContext=function t(e,n){if(null==n&&(n=r.EMPTY),null===n.parentCtx||n===r.EMPTY)return o.EMPTY;var i=t(e,n.parentCtx),s=e.states[n.invokingState].transitions[0];return a.create(i,s.followState.stateNumber)},e.getCachedPredictionContext=function t(e,n,r){if(e.isEmpty())return e;var i=r[e]||null;if(null!==i)return i;if(null!==(i=n.get(e)))return r[e]=i,i;for(var s=!1,l=[],c=0;c=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(8).Token,i=(n(9).Interval,n(9).IntervalSet),o=n(22).Predicate,s=n(22).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||(console.warn("Internal Error. The language set at ivprog.lang is not valid: "+this.service.getLang()),n=this.i18nData[this.service.getDefaultLang()]),n[e]?n[e][t]?n[e][t]:"{MISSING_I18N_IDENTIFIER}":"{MISSING_I18N_TYPE_IDENTIFIER}"},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(18).ATN,i=n(7),o=i.Hash,s=i.Set,a=n(22).SemanticContext,l=n(15).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(21).ATNConfigSet,i=n(7),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 C=y&&(u||h&&(null==T||T<12.11)),b=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};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 Y(t){for(;G.length<=t;)G.push(X(G)+" ");return G[t]}function X(t){return t[t.length-1]}function $(t,e){for(var n=[],r=0;r"ย€"&&(t.toUpperCase()!=t.toLowerCase()||Q.test(t))}function et(t,e){return e?!!(e.source.indexOf("\\w")>-1&&tt(t))||e.test(t):tt(t)}function nt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var rt=/[\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 it(t){return t.charCodeAt(0)>=768&&rt.test(t)}function ot(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 at=null;function lt(t,e,n){var r;at=null;for(var i=0;ie)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:at=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:at=i)}return null!=r?r:at}var ut=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,i=/[LRr]/,o=/[Lb1n]/,s=/[1n]/;function a(t,e,n){this.level=t,this.from=e,this.to=n}return function(l,u){var c="ltr"==u?"L":"R";if(0==l.length||"ltr"==u&&!n.test(l))return!1;for(var h,p=l.length,f=[],d=0;d-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function gt(t,e){var n=ft(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function xt(t){t.prototype.on=function(t,e){pt(this,t,e)},t.prototype.off=function(t,e){dt(this,t,e)}}function St(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Tt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Ct(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function bt(t){St(t),Tt(t)}function wt(t){return t.target||t.srcElement}function Et(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 At,Lt,Nt=function(){if(s&&a<9)return!1;var t=k("div");return"draggable"in t||"dragDrop"in t}();function kt(t){if(null==At){var e=k("span","โ€‹");N(t,k("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(At=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=At?k("span","โ€‹"):k("span","ย ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ot(t){if(null!=Lt)return Lt;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)&&(Lt=r.right-n.right<3)}var _t,It=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/)},Mt=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)},Pt="oncopy"in(_t=k("div"))||(_t.setAttribute("oncopy","return;"),"function"==typeof _t.oncopy),Dt=null,Rt={},Ft={};function Ht(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Rt[t]=e}function Bt(t){if("string"==typeof t&&Ft.hasOwnProperty(t))t=Ft[t];else if(t&&"string"==typeof t.name&&Ft.hasOwnProperty(t.name)){var e=Ft[t.name];"string"==typeof e&&(e={name:e}),(t=J(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Bt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Bt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Wt(t,e){e=Bt(e);var n=Rt[e.name];if(!n)return Wt(t,"text/plain");var r=n(t,e);if(zt.hasOwnProperty(e.name)){var i=zt[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 zt={};function Ut(t,e){F(e,zt.hasOwnProperty(t)?zt[t]:zt[t]={})}function jt(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 Vt(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 qt(t,e,n){return!t.startState||t.startState(e,n)}var Kt=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?ee(n,Gt(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?ee(t.line,e):n<0?ee(t.line,0):t}(e,Gt(t,e.line).text.length)}function ue(t,e){for(var n=[],r=0;r=this.string.length},Kt.prototype.sol=function(){return this.pos==this.lineStart},Kt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Kt.prototype.next=function(){if(this.pose},Kt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Kt.prototype.skipToEnd=function(){this.pos=this.string.length},Kt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Kt.prototype.backUp=function(t){this.pos-=t},Kt.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},Kt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Kt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Kt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Kt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ce=function(t,e){this.state=t,this.lookAhead=e},he=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 pe(t,e,n,r){var i=[t.state.modeGen],o={};Te(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,Te(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&&jt(t.doc.mode,r.state),o=pe(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 de(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new he(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 ce?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?he.fromSaved(r,s,o):new he(r,qt(r.mode),o);return r.iter(o,e,(function(n){ge(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.")}he.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},he.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}},he.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},he.fromSaved=function(t,e,n){return e instanceof ce?new he(t,jt(t.mode,e.state),n,e.lookAhead):new he(t,jt(t.mode,e),n)},he.prototype.save=function(t){var e=!1!==t?jt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ce(e,this.maxLookAhead):e};var ye=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function xe(t,e,n,r){var i,o,s=t.doc,a=s.mode,l=Gt(s,(e=le(s,e)).line),u=de(t,e.line,n),c=new Kt(l.text,t.options.tabSize,u);for(r&&(o=[]);(r||c.post.options.maxHighlightLength?(a=!1,s&&ge(t,e,r,h.pos),h.pos=e.length,l=null):l=Se(me(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 we(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||Me(n,o.marker)<0)&&(n=o.marker)}return n}function He(t,e,n,r,i){var o=Gt(t,e),s=be&&o.markedSpans;if(s)for(var a=0;a=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ne(u.to,n)>=0:ne(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ne(u.from,r)<=0:ne(u.from,r)<0)))return!0}}}function Be(t){for(var e;e=De(t);)t=e.find(-1,!0).line;return t}function We(t,e){var n=Gt(t,e),r=Be(n);return n==r?e:Zt(r)}function ze(t,e){if(e>t.lastLine())return e;var n,r=Gt(t,e);if(!Ue(t,r))return e;for(;n=Re(r);)r=n.find(1,!0).line;return Zt(r)+1}function Ue(t,e){var n=be&&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,Oe(this,e),this.height=n?n(this):1};function Ye(t){t.parent=null,ke(t)}Ge.prototype.lineNo=function(){return Zt(this)},xt(Ge);var Xe={},$e={};function Ze(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?$e:Xe;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function Je(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=tn,Ot(t.display.measure)&&(s=ct(o,t.doc.direction))&&(r.addToken=en(r.addToken,s)),r.map=[],rn(o,r,fe(t,o,e!=t.display.externalMeasured&&Zt(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(kt(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 gt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=P(r.pre.className,r.textClass||"")),r}function Qe(t){var e=k("span","โ€ข","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function tn(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 nn(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 rn(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||C.collapsed&&T.to==d&&T.from==d)){if(null!=T.to&&T.to!=d&&m>T.to&&(m=T.to,u=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&T.from==d&&(c+=" "+C.startStyle),C.endStyle&&T.to==m&&(x||(x=[])).push(C.endStyle,T.to),C.title&&((p||(p={})).title=C.title),C.attributes)for(var b in C.attributes)(p||(p={}))[b]=C.attributes[b];C.collapsed&&(!h||Me(h.marker,C)<0)&&(h=T)}else T.from>d&&m>T.from&&(m=T.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=Ze(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 _n(t,e,n,r){return Pn(t,Mn(t,e),n,r)}function In(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=Fn(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&&it(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+or(t.display),top:d.top,bottom:d.bottom}:Rn}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 Bn(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=lt(a,l,u),p=at,f=c(l,h,"before"==u);return null!=p&&(f.other=c(l,p,"before"!=u)),f}function Xn(t,e){var n=0;e=le(t.doc,e),t.options.lineWrapping||(n=or(t.display)*e.ch);var r=Gt(t.doc,e.line),i=Ve(r)+wn(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function $n(t,e,n,r,i){var o=ee(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function Zn(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return $n(r.first,0,null,-1,-1);var i=Jt(r,n),o=r.first+r.size-1;if(i>o)return $n(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=er(t,s,i,e,n),l=Fe(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 Jn(t,e,n,r){r-=Vn(e);var i=e.text.length,o=st((function(e){return Pn(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=st((function(e){return Pn(t,n,e).top>r}),o,i)}}function Qn(t,e,n,r){return n||(n=Mn(t,e)),Jn(t,e,n,qn(t,e,Pn(t,n,r),"line").top)}function tr(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function er(t,e,n,r,i){i-=Ve(e);var o=Mn(t,e),s=Vn(e),a=0,l=e.text.length,u=!0,c=ct(e,t.doc.direction);if(c){var h=(t.options.lineWrapping?rr:nr)(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=st((function(e){var n=Pn(t,o,e);return n.top+=s,n.bottom+=s,!!tr(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 $n(n,v=ot(e.text,v,1),f,m,r-p)}function nr(t,e,n,r,i,o,s){var a=st((function(a){var l=i[a],u=1!=l.level;return tr(Yn(t,ee(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=Yn(t,ee(n,u?l.from:l.to,u?"after":"before"),"line",e,r);tr(c,o,s,!0)&&c.top>s&&(l=i[a-1])}return l}function rr(t,e,n,r,i,o,s){var a=Jn(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=Pn(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 ir(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Dn){Dn=k("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(k("br"));Dn.appendChild(document.createTextNode("x"))}N(t.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),L(t.measure),n||1}function or(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 sr(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:ar(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function ar(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function lr(t){var e=ir(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/or(t.display)-3);return function(i){if(Ue(t.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s=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)be&&We(t.doc,e)i.viewFrom?dr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)dr(t);else if(e<=i.viewFrom){var o=gr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):dr(t)}else if(n>=i.viewTo){var s=gr(t,e,e,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):dr(t)}else{var a=gr(t,e,e,-1),l=gr(t,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(sn(t,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):dr(t)}var u=i.externalMeasured;u&&(n=i.lineN&&e=r.viewTo)){var o=r.view[hr(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==W(s,n)&&s.push(n)}}}function dr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function gr(t,e,n,r){var i,o=hr(t,e),s=t.display.view;if(!be||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(;We(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 vr(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,T=0==h,C=!g||h==g.length-1;if(y.top-m.top<=3){var b=(u?S:x)&&C,w=(u?x:S)&&T?a:(v?m:y).left,E=b?l:(v?y:m).right;c(w,m.top,E-w,m.bottom)}else{var A,L,N,k;v?(A=u&&x&&T?a:m.left,L=u?l:d(t,i,"before"),N=u?a:d(e,i,"after"),k=u&&S&&C?l:y.right):(A=u?d(t,i,"before"):a,L=!u&&x&&T?l:m.right,N=!u&&S&&C?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 br(t){t.state.focused||(t.display.input.focus(),Er(t))}function wr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Ar(t))}),100)}function Er(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(gt(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()),Cr(t))}function Ar(t,e){t.state.delayingBlurEvent||(t.state.focused&&(gt(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 Lr(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r.005||p<-.005)&&($t(i.line,l),Nr(i.line),i.rest))for(var f=0;ft.display.sizerWidth){var d=Math.ceil(u/or(t.display));d>t.display.maxLineLength&&(t.display.maxLineLength=d,t.display.maxLine=i.line,t.display.maxLineChanged=!0)}}}}function Nr(t){if(t.widgets)for(var e=0;e=s&&(o=Jt(e,Ve(Gt(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function Or(t,e){var n=t.display,r=ir(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=kn(t),s={};e.bottom-e.top>o&&(e.bottom=e.top+o);var a=t.doc.height+En(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=Nn(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 _r(t,e){null!=e&&(Pr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Ir(t){Pr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Mr(t,e,n){null==e&&null==n||Pr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Pr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Dr(t,Xn(t,e.from),Xn(t,e.to),e.margin))}function Dr(t,e,n,r){var i=Or(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});Mr(t,i.scrollLeft,i.scrollTop)}function Rr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||li(t,{top:e}),Fr(t,e,!0),n&&li(t),ri(t,100))}function Fr(t,e,n){e=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 Hr(t,e,n,r){e=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 Br(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+En(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+Ln(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Wr=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),pt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),pt(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wr.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}},Wr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wr.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},Wr.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)}))},Wr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var zr=function(){};function Ur(t,e){e||(e=Br(t));var n=t.display.barWidth,r=t.display.barHeight;jr(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Lr(t),jr(t,Br(t)),n=t.display.barWidth,r=t.display.barHeight}function jr(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=""}zr.prototype.update=function(){return{bottom:0,right:0}},zr.prototype.setScrollLeft=function(){},zr.prototype.setScrollTop=function(){},zr.prototype.clear=function(){};var Vr={native:Wr,null:zr};function qr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&A(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Vr[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),pt(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?Hr(t,e):Rr(t,e)}),t),t.display.scrollbars.addClass&&M(t.display.wrapper,t.display.scrollbars.addClass)}var Kr=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:++Kr},e=t.curOp,an?an.ops.push(e):e.ownsGroup=an={ops:[e],delayedCallbacks:[]}}function Yr(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 $r(t){var e=t.cm,n=e.display;t.updatedDisplay&&Lr(e),t.barMeasure=Br(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=_n(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+Ln(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Nn(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-wn(t.display))+"px;\n height: "+(e.bottom-e.top+Ln(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?ee(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?ee(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var s=!1,a=Yn(t,e),l=n&&n!=e?Yn(t,n):a,u=Or(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&&(Rr(t,u.scrollTop),Math.abs(t.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(Hr(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return i}(e,le(r,t.scrollToPos.from),le(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=de(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?jt(e.mode,r.state):null,l=pe(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==vr(t))return!1;pi(t)&&(dr(t),e.dims=sr(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)),be&&(o=We(t.doc,o),s=ze(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=sn(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=sn(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,hr(t,n)))),r.viewTo=n}(t,o,s),n.viewOffset=Ve(Gt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var u=vr(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),hn(t,p,c,n)),f&&(L(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(te(t.options,c)))),s=p.node.nextSibling}else{var d=yn(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(),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&&t.options.lineWrapping&&e.oldDisplayWidth!=Nn(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+En(t.display)-kn(t),n.top)}),e.visible=kr(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&si(t,e);r=!1){Lr(t);var i=Br(t);mr(t),Ur(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)){Lr(t),ai(t,n);var r=Br(t);mr(t),Ur(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+Ln(t)+"px"}function hi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=ar(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&&ne(t,r.to())<=0)return n}return-1};var bi=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 ne(t.from(),e.from())})),n=W(e,i);for(var o=1;o0:l>=0){var u=se(a.from(),s.from()),c=oe(a.to(),s.to()),h=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,e.splice(--o,2,new bi(h?c:u,h?u:c))}}return new Ci(e,n)}function Ei(t,e){return new Ci([new bi(t,e||t)],0)}function Ai(t){return t.text?ee(t.from.line+t.text.length-1,X(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Li(t,e){if(ne(t,e.from)<0)return t;if(ne(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),ee(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)}un(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),X(t.done)):t.done.length&&!X(t.done).ranges?X(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),X(t.done)):void 0}(i,i.lastOp==r)))s=X(o.changes),0==ne(e.from,e.to)&&0==ne(e.from,s.to)?s.to=Ai(e):o.changes.push(Hi(t,e));else{var l=X(i.done);for(l&&l.ranges||Ui(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||gt(t,"historyAdded")}function zi(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,X(i.done),e))?i.done[i.done.length-1]=e:Ui(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Bi(i.undone)}function Ui(t,e){var n=X(e);n&&n.ranges&&n.equals(t)||e.push(t)}function ji(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&&(X(a)[h]=u[h],delete u[h])}}}return r}function Gi(t,e,n,r){if(r){var i=t.anchor;if(n){var o=ne(e,i)<0;o!=ne(n,i)<0?(i=e,e=n):o!=ne(e,n)<0&&(e=n)}return new bi(i,e)}return new bi(n||e,e)}function Yi(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Qi(t,new Ci([Gi(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&&(gt(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=ne(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,ee(t.first,0))}function so(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?le(t,ee(e.line-1)):null:n>0&&e.ch==(r||Gt(t,e.line)).text.length?e.line0)){var c=[l,1],h=ne(u.from,a.from),p=ne(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!=ne(e.from,e.to)){var n=Ni(t,e);Wi(t,e,n,t.cm?t.cm.curOp.id:NaN),fo(t,e,n,Le(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,Le(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 Ci($(t.sel.ranges,(function(t){return new bi(ee(t.anchor.line+e,t.anchor.ch),ee(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){pr(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:ee(o,Gt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Yt(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=Zt(Be(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&&mt(t),Mi(r,e,n,lr(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=qe(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 ce)||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(He(t,e.line,e,n,o)||e.line!=n.line&&He(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");be=!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&&Be(t)==u.display.maxLine&&(a=!0),o.collapsed&&l!=e.line&&$t(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new we(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){Ue(t,e)&&$t(e,0)})),o.clearOnEnter&&pt(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ce=!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)pr(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++)fr(u,c,"text");o.atomic&&no(u.doc),un(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),yt(this,"clear")){var n=this.find();n&&un(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&&pr(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&&un(t,"markerCleared",t,this,r,i),e&&Yr(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&&Ir(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=le(this,t),e=le(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})),le(this,ee(n,e))},indexFromPos:function(t){var e=(t=le(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 c=t.dataTransfer.getData("Text");if(c){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),to(e.doc,Ei(n,n)),h)for(var p=0;p=0;e--)go(t.doc,"",r[e].from,r[e].to,"+delete");Ir(t)}))}function Jo(t,e,n){var r=ot(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 ee(e.line,r,n<0?"after":"before")}function ts(t,e,n,r,i){if(t){var o=ct(n,e.doc.direction);if(o){var s,a=i<0?X(o):o[0],l=i<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var u=Mn(e,n);s=i<0?n.text.length-1:0;var c=Pn(e,u,s).top;s=st((function(t){return Pn(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 ee(r,s,l)}}return new ee(r,i<0?n.text.length:0,i<0?"before":"after")}jo.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"},jo.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"},jo.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"},jo.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"]},jo.default=y?jo.macDefault:jo.pcDefault;var es={selectAll:ao,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),j)},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 ee(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ee(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 ee(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),ee(i.line-1,s.length-1),i,"+transpose"))}n.push(new bi(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&&(ne((i=u.ranges[i]).from(),e)<0||e.xRel>0)&&(ne(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,dt(i.wrapper.ownerDocument,"mouseup",u),dt(i.wrapper.ownerDocument,"mousemove",c),dt(i.scroller,"dragstart",h),dt(i.scroller,"drop",u),o||(St(e),r.addNew||Yi(t.doc,n,null,null,r.extend),l||s&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),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(),pt(i.wrapper.ownerDocument,"mouseup",u),pt(i.wrapper.ownerDocument,"mousemove",c),pt(i.scroller,"dragstart",h),pt(i.scroller,"drop",u),wr(t),setTimeout((function(){return i.input.focus()}),20)}(t,r,e,o):function(t,e,n,r){var i=t.display,o=t.doc;St(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 bi(n,n)):(s=o.sel.primary(),a=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new bi(n,n)),n=cr(t,e,!0,!0),a=-1;else{var c=ms(t,n,r.unit);s=r.extend?Gi(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,V):(a=0,Qi(o,new Ci([s],0),V),l=o.sel);var h=n;function p(e){if(0!=ne(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=K(m,f,u);f==d?i.push(new bi(ee(g,y),ee(g,y))):m.length>y&&i.push(new bi(ee(g,y),ee(g,K(m,d,u))))}i.length||i.push(new bi(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,T=ms(t,e,r.unit),C=S.anchor;ne(T.anchor,C)>0?(x=T.head,C=se(S.from(),T.anchor)):(x=T.anchor,C=oe(S.to(),T.head));var b=l.ranges.slice(0);b[a]=function(t,e){var n=e.anchor,r=e.head,i=Gt(t.doc,n.line);if(0==ne(n,r)&&n.sticky==r.sticky)return e;var o=ct(i);if(!o)return e;var s=lt(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=lt(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 bi(new ee(n.line,d,g),r)}(t,new bi(le(o,C),x)),Qi(o,wi(t,b,a),V)}}var f=i.wrapper.getBoundingClientRect(),d=0;function g(e){t.state.selectingText=!1,d=1/0,e&&(St(e),i.input.focus()),dt(i.wrapper.ownerDocument,"mousemove",v),dt(i.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=ti(t,(function(e){0!==e.buttons&&Et(e)?function e(n){var s=++d,a=cr(t,n,!0,"rectangle"==r.unit);if(a)if(0!=ne(a,h)){t.curOp.focus=I(),p(a);var l=kr(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,pt(i.wrapper.ownerDocument,"mousemove",v),pt(i.wrapper.ownerDocument,"mouseup",m)}(t,r,e,o)}(e,r,o,t):wt(t)==n.scroller&&St(t):2==i?(r&&Yi(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(b?e.display.input.onContextMenu(t):wr(e)))}}function ms(t,e,n){if("char"==n)return new bi(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new bi(ee(e.line,0),le(t.doc,ee(e.line+1,0)));var r=n(t,e);return new bi(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&&St(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!yt(t,n))return Ct(e);o-=a.top-s.viewOffset;for(var l=0;l=i)return gt(t,n,t,Jt(t.doc,o),t.display.gutterSpecs[l].className,e),Ct(e)}}function xs(t,e){return ys(t,e,"gutterClick",!0)}function Ss(t,e){bn(t.display,e)||function(t,e){return!!yt(t,"gutterContextMenu")&&ys(t,e,"gutterContextMenu",!1)}(t,e)||vt(t,e,"contextmenu")||b||t.display.input.onContextMenu(e)}function Ts(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zn(t)}gs.prototype.compare=function(t,e,n){return this.time+400>t&&0==ne(e,this.pos)&&n==this.button};var Cs={toString:function(){return"CodeMirror.Init"}},bs={},ws={};function Es(t,e,n){if(!e!=!(n&&n!=Cs)){var r=t.display.dragFunctions,i=e?pt:dt;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"),Ke(t)),ur(t),pr(t),zn(t),setTimeout((function(){return Ur(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(bs,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,Ts(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qr(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;pt(e.scroller,"mousedown",ti(t,vs)),pt(e.scroller,"dblclick",s&&a<11?ti(t,(function(e){if(!vt(t,e)){var n=cr(t,e);if(n&&!xs(t,e)&&!bn(t.display,e)){St(e);var r=t.findWordAt(n);Yi(t.doc,r.anchor,r.head)}}})):function(e){return vt(t,e)||St(e)}),pt(e.scroller,"contextmenu",(function(e){return Ss(t,e)}));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}pt(e.scroller,"touchstart",(function(i){if(!vt(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)}})),pt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),pt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!bn(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 bi(a,a):!r.prev.prev||o(r,r.prev.prev)?t.findWordAt(a):new bi(ee(a.line,0),le(t.doc,ee(a.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),St(n)}i()})),pt(e.scroller,"touchcancel",i),pt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Rr(t,e.scroller.scrollTop),Hr(t,e.scroller.scrollLeft,!0),gt(t,"scroll",t))})),pt(e.scroller,"mousewheel",(function(e){return Ti(t,e)})),pt(e.scroller,"DOMMouseScroll",(function(e){return Ti(t,e)})),pt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){vt(t,e)||bt(e)},over:function(e){vt(t,e)||(function(t,e){var n=cr(t,e);if(n){var r=document.createDocumentFragment();xr(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),bt(e))},start:function(e){return function(t,e){if(s&&(!t.state.draggingText||+new Date-Io<100))bt(e);else if(!vt(t,e)&&!bn(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){vt(t,e)||Po(t)}};var l=e.input.getField();pt(l,"keyup",(function(e){return hs.call(t,e)})),pt(l,"keydown",ti(t,cs)),pt(l,"keypress",ti(t,ps)),pt(l,"focus",(function(e){return Er(t,e)})),pt(l,"blur",(function(e){return Ar(t,e)}))}(this),Fo(),Gr(this),this.curOp.forceUpdate=!0,Di(this,r),e.autofocus&&!m||this.hasFocus()?setTimeout(R(Er,this),20):Ar(this),ws)ws.hasOwnProperty(u)&&ws[u](n,e[u],Cs);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=It(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=ee(d.line,d.ch-n):t.state.overwrite&&!a?g=ee(g.line,Math.min(Gt(o,g.line).text.length,g.ch+X(l).length)):a&&Os&&Os.lineWise&&Os.text.join("\n")==e&&(d=g=ee(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),un(t,"inputRead",t,v)}e&&!a&&Ps(t,e),Ir(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&&un(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=lt(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 ee(n.line,p,f)}}var d=function(t,e,r){for(var o=function(t,e){return e?new ee(n.line,l(t,1),"before"):new ee(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+n)=t.first+t.size||(e=new ee(s,e.ch,e.sticky),!(a=Gt(t,s))))return!1;e=ts(i,t.cm,a,e.line,n)}else e=o;return!0}if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var u=null,c="group"==r,h=t.cm&&t.cm.getHelper(e,"wordChars"),p=!0;!(n<0)||l(!p);p=!1){var f=a.text.charAt(e.ch)||"\n",d=et(f,h)?"w":c&&"\n"==f?"n":!c||/\s/.test(f)?null:"p";if(!c||p||d||(d="s"),u&&u!=d){n<0&&(n=1,l(),e.sticky="after");break}if(d&&(u=d),n>0&&!l(!p))break}var g=oo(t,e,o,s,!0);return re(o,g)&&(g.hitSide=!0),g}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*ir(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=Zn(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 zs(t,e){var n=In(t,e.line);if(!n||n.hidden)return null;var r=Gt(t.doc,e.line),i=On(n,r,e.line),o=ct(r,t.doc.direction),s="left";o&&(s=lt(o,e.ch)%2?"right":"left");var a=Fn(i.map,e.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function Us(t,e){return e&&(t.bad=!0),t}function js(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return Us(t.clipPos(ee(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&&zs(e,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(s=ee(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=hr(r,s.line))?(e=Zt(i.view[0].line),n=i.view[0].node):(e=Zt(i.view[t].line),n=i.view[t-1].node.nextSibling);var l,u,c=hr(r,a.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=Zt(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(ee(r,0),ee(i+1,0),(v=+p,function(t){return t.id==v}));return void(f.length&&(o=f[0].find(0))&&c(Yt(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(X(h)==X(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 T=ee(e,f),C=ee(l,p.length?X(p).length-d:0);return h.length>1||h[0]||ne(T,C)?(go(r.doc,h,T,C,"+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 pr(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(!vt(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,j):(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"),pt(i,"input",(function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),pt(i,"paste",(function(t){vt(r,t)||Ms(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pt(i,"cut",o),pt(i,"copy",o),pt(t.scroller,"paste",(function(e){if(!bn(t,e)&&!vt(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)}})),pt(t.lineSpace,"selectstart",(function(e){bn(t,e)||St(e)})),pt(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"})}})),pt(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.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=yr(t);if(t.options.moveInputWithCursor){var i=Yn(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||Mt(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=cr(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),j);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(),b){bt(t);var g=function(){dt(window,"mouseup",g),setTimeout(m,20)};pt(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!=Cs&&i(t,e,n)}:i)}t.defineOption=n,t.Init=Cs,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),zn(t),pr(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(ee(r,o))}r++}));for(var i=n.length-1;i>=0;i--)go(t.doc,e,n[i],ee(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!=Cs&&t.refresh()})),n("specialCharPlaceholder",Qe,(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){Ts(t),gi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=$o(e),i=n!=Cs&&$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?ar(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return Ur(t)}),!0),n("scrollbarStyle","native",(function(t){qr(t),Ur(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,mr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Ar(t),t.display.input.blur()),t.display.input.readOnlyChanged(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,mr,!0),n("singleCursorHeightPerLine",!0,mr,!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),gt(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&&Ir(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 bi(o,u[r].to()),j)}}})),getTokenAt:function(t,e){return xe(this,t,e)},getLineTokens:function(t,e){return xe(this,ee(t),e,!0)},getTokenTypeAt:function(t){t=le(this.doc,t);var e,n=fe(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 qn(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-Ve(r):0)},defaultTextHeight:function(){return ir(this.display)},defaultCharWidth:function(){return or(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=Yn(this,le(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=Or(o,s)).scrollTop&&Rr(o,a.scrollTop),null!=a.scrollLeft&&Hr(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=le(this.doc,t),s=0;s0&&s(e.charAt(n-1));)--n;for(;r.5)&&ur(this),gt(this,"refresh",this)})),swapDoc:ei((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Di(this,t),zn(this),this.display.input.reset(),Mr(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,un(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}},xt(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 Ks="iter insert remove copy getEditor constructor".split(" ");for(var Gs in _o.prototype)_o.prototype.hasOwnProperty(Gs)&&W(Ks,Gs)<0&&(Ls.prototype[Gs]=function(t){return function(){return t.apply(this.doc,arguments)}}(_o.prototype[Gs]));return xt(_o),Ls.inputStyles={textarea:qs,contenteditable:Ws},Ls.defineMode=function(t){Ls.defaults.mode||"null"==t||(Ls.defaults.mode=t),Ht.apply(this,arguments)},Ls.defineMIME=function(t,e){Ft[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&&(pt(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&&(dt(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=dt,t.on=pt,t.wheelEventPixels=Si,t.Doc=_o,t.splitLines=It,t.countColumn=H,t.findColumn=K,t.isWordChar=tt,t.Pass=U,t.signal=gt,t.Line=Ge,t.changeEnd=Ai,t.scrollbarModel=Vr,t.Pos=ee,t.cmpPos=ne,t.modes=Rt,t.mimeModes=Ft,t.resolveMode=Bt,t.getMode=Wt,t.modeExtensions=zt,t.extendMode=Ut,t.copyState=jt,t.startState=qt,t.innerMode=Vt,t.commands=es,t.keyMap=jo,t.keyName=Xo,t.isModifierKey=Go,t.lookupKey=Ko,t.normalizeKeyMap=qo,t.StringStream=Kt,t.SharedTextMarker=Lo,t.TextMarker=Eo,t.LineWidget=Co,t.e_preventDefault=St,t.e_stopPropagation=Tt,t.e_stop=bt,t.addClass=M,t.contains=_,t.rmClass=A,t.keyNames=Bo}(Ls),Ls.version="5.49.0",Ls}()},,function(t,e,n){var r=n(11).DecisionState,i=n(22).SemanticContext,o=n(7).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(12).RuleNode,i=n(12).INVALID_INTERVAL,o=n(18).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(39).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(28).RuleContext,i=n(12),o=i.INVALID_INTERVAL,s=i.TerminalNode,a=i.TerminalNodeImpl,l=i.ErrorNodeImpl,u=n(9).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,n){var r=n(7),i=n(8).Token,o=(n(12).RuleNode,n(12).ErrorNode),s=n(12).TerminalNode,a=n(34).ParserRuleContext,l=n(28).RuleContext,u=n(18).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(K,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+65533}));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(G.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 b.EPSILON:return new O(u);case b.RANGE:return new N(u,0!==a?r.EOF:o,s);case b.RULE:return new L(t.states[o],s,a,u);case b.PREDICATE:return new I(u,o,s,0!==a);case b.PRECEDENCE:return new M(u,o);case b.ATOM:return new w(u,0!==a?r.EOF:o);case b.ACTION:return new k(u,o,s,0!==a);case b.SET:return new E(u,l[o]);case b.NOT_SET:return new A(u,l[o]);case b.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 T},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 z.INSTANCE},r[F.POP_MODE]=function(t,e){return V.INSTANCE},r[F.PUSH_MODE]=function(t,e){return new j(t)},r[F.SKIP]=function(t,e){return H.INSTANCE},r[F.TYPE]=function(t,e){return new U(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(8).Token,i=n(30).ConsoleErrorListener,o=n(30).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.7.2"!==t&&console.log("ANTLR runtime and generated code versions disagree: 4.7.2!="+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(23).DFAState,i=n(21).ATNConfigSet,o=n(15).getCachedPredictionContext;function s(t,e){return this.atn=t,this.sharedContextCache=e,this}s.ERROR=new r(2147483647,new i),s.prototype.getCachedContext=function(t){if(null===this.sharedContextCache)return t;return o(t,this.sharedContextCache,{})},e.ATNSimulator=s},function(t,e,n){n(7).Set;var r=n(7).Map,i=n(7).BitSet,o=n(7).AltDict,s=n(18).ATN,a=n(11).RuleStopState,l=n(21).ATNConfigSet,u=n(27).ATNConfig,c=n(22).SemanticContext,h=(n(7).Hash,n(7).hashStuff);n(7).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(8).Token,i=n(13),o=i.NoViableAltException,s=i.InputMismatchException,a=i.FailedPredicateException,l=i.ParseCancellationException,u=n(11).ATNState,c=n(9).Interval,h=n(9).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,n){e.ATN=n(18).ATN,e.ATNDeserializer=n(40).ATNDeserializer,e.LexerATNSimulator=n(58).LexerATNSimulator,e.ParserATNSimulator=n(61).ParserATNSimulator,e.PredictionMode=n(45).PredictionMode},function(t,e,n){var r=n(7).Set,i=n(7).BitSet,o=n(8).Token,s=n(27).ATNConfig,a=(n(9).Interval,n(9).IntervalSet),l=n(11).RuleStopState,u=n(19).RuleTransition,c=n(19).NotSetTransition,h=n(19).WildcardTransition,p=n(19).AbstractPredicateTransition,f=n(15),d=f.predictionContextFromRuleContext,g=f.PredictionContext,v=f.SingletonPredictionContext;function m(t){this.atn=t}m.HIT_PRED=o.INVALID_TYPE,m.prototype.getDecisionLookahead=function(t){if(null===t)return null;for(var e=t.transitions.length,n=[],o=0;oy.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?n:(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 C.RULE:return this.ruleTransition(t,e);case C.PRECEDENCE:return this.precedenceTransition(t,e,n,r,i);case C.PREDICATE:return this.predTransition(t,e,n,r,i);case C.ACTION:return this.actionTransition(t,e);case C.EPSILON:return new u({state:e.target},t);case C.ATOM:case C.RANGE:case C.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 b){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(63).DFA,e.DFASerializer=n(31).DFASerializer,e.LexerDFASerializer=n(31).LexerDFASerializer,e.PredPrediction=n(23).PredPrediction},function(t,e,n){var r=n(7).Set,i=n(23).DFAState,o=n(11).StarLoopEntryState,s=n(21).ATNConfigSet,a=n(31).DFASerializer,l=n(31).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(12);e.Trees=n(39).Trees,e.RuleNode=r.RuleNode,e.ParseTreeListener=r.ParseTreeListener,e.ParseTreeVisitor=r.ParseTreeVisitor,e.ParseTreeWalker=r.ParseTreeWalker},function(t,e,n){e.RecognitionException=n(13).RecognitionException,e.NoViableAltException=n(13).NoViableAltException,e.LexerNoViableAltException=n(13).LexerNoViableAltException,e.InputMismatchException=n(13).InputMismatchException,e.FailedPredicateException=n(13).FailedPredicateException,e.DiagnosticErrorListener=n(66).DiagnosticErrorListener,e.BailErrorStrategy=n(48).BailErrorStrategy,e.ErrorListener=n(30).ErrorListener},function(t,e,n){var r=n(7).BitSet,i=n(30).ErrorListener,o=n(9).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(29).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,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 T=0==x.ch?" ":e.getRange(n(x.line,x.ch-1),x);if(t.isWordChar(S)||T==i||t.isWordChar(T))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 C=l%2?s.charAt(l-1):i,b=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(C+b,null),e.triggerElectric(C+b),e.execCommand("goCharLeft")):"addFour"==c&&(e.replaceSelection(C+C+C+C,"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(25))},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