| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-00a46cc0"],{"279f":function(t,e,n){"use strict";var i,r;function s(t,e,n){var i=function(e,n){return t.js_beautify(e,n)};return i.js=t.js_beautify,i.css=e.css_beautify,i.html=n.html_beautify,i.js_beautify=t.js_beautify,i.css_beautify=e.css_beautify,i.html_beautify=n.html_beautify,i}i=[n("a179"),n("a16b"),n("a69e")],r=function(t,e,n){return s(t,e,n)}.apply(e,i),void 0===r||(t.exports=r)},69713:function(t,e,n){(function(e,n){t.exports=n()})(0,(function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),i=/MSIE \d/.test(t),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),s=/Edge\/(\d+)/.exec(t),o=i||r||s,a=o&&(i?document.documentMode||6:+(s||r)[1]),l=!s&&/WebKit\//.test(t),u=l&&/Qt\/\d+\.\d+/.test(t),h=!s&&/Chrome\/(\d+)/.exec(t),c=h&&+h[1],_=/Opera\//.test(t),p=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),d=/PhantomJS/.test(t),g=p&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),m=/Android/.test(t),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),w=/win/i.test(e),x=_&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(_=!1,l=!0);var k=y&&(u||_&&(null==x||x<12.11)),C=n||o&&a>=9;function T(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var S,O=function(t,e){var n=t.className,i=T(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function L(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function E(t,e){return L(t).appendChild(e)}function A(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var s=0;s<e.length;++s)r.appendChild(e[s]);return r}function N(t,e,n,i){var r=A(t,e,n,i);return r.setAttribute("role","presentation"),r}function M(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if(11==e.nodeType&&(e=e.host),e==t)return!0}while(e=e.parentNode)}function R(t){var e,n=t.ownerDocument||t;try{e=t.activeElement}catch(i){e=n.body||null}while(e&&e.shadowRoot&&e.shadowRoot.activeElement)e=e.shadowRoot.activeElement;return e}function D(t,e){var n=t.className;T(e).test(n)||(t.className+=(n?" ":"")+e)}function W(t,e){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!T(n[i]).test(e)&&(e+=" "+n[i]);return e}S=document.createRange?function(t,e,n,i){var r=document.createRange();return r.setEnd(i||t,n),r.setStart(t,e),r}:function(t,e,n){var i=document.body.createTextRange();try{i.moveToElementText(t.parentNode)}catch(r){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",e),i};var P=function(t){t.select()};function z(t){return t.display.wrapper.ownerDocument}function I(t){return j(t.display.wrapper)}function j(t){return t.getRootNode?t.getRootNode():t.ownerDocument}function F(t){return z(t).defaultView}function B(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function H(t,e,n){for(var i in e||(e={}),t)!Object.prototype.hasOwnProperty.call(t,i)||!1===n&&Object.prototype.hasOwnProperty.call(e,i)||(e[i]=t[i]);return e}function U(t,e,n,i,r){null==e&&(e=t.search(/[^\s\u00a0]/),-1==e&&(e=t.length));for(var s=i||0,o=r||0;;){var a=t.indexOf("\t",s);if(a<0||a>=e)return o+(e-s);o+=a-s,o+=n-o%n,s=a+1}}g?P=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:o&&(P=function(t){try{t.select()}catch(e){}});var K=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};function V(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}K.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},K.prototype.set=function(t,e){this.f=e;var n=+new Date+t;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=n)};var G=50,X={toString:function(){return"CodeMirror.Pass"}},$={scroll:!1},q={origin:"*mouse"},Y={origin:"+move"};function Q(t,e,n){for(var i=0,r=0;;){var s=t.indexOf("\t",i);-1==s&&(s=t.length);var o=s-i;if(s==t.length||r+o>=e)return i+Math.min(o,e-r);if(r+=s-i,r+=n-r%n,i=s+1,r>=e)return i}}var Z=[""];function J(t){while(Z.length<=t)Z.push(tt(Z)+" ");return Z[t]}function tt(t){return t[t.length-1]}function et(t,e){for(var n=[],i=0;i<t.length;i++)n[i]=e(t[i],i);return n}function nt(t,e,n){var i=0,r=n(e);while(i<t.length&&n(t[i])<=r)i++;t.splice(i,0,e)}function it(){}function rt(t,e){var n;return Object.create?n=Object.create(t):(it.prototype=t,n=new it),e&&H(e,n),n}var st=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ot(t){return/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||st.test(t))}function at(t,e){return e?!!(e.source.indexOf("\\w")>-1&&ot(t))||e.test(t):ot(t)}function lt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var ut=/[\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 ht(t){return t.charCodeAt(0)>=768&&ut.test(t)}function ct(t,e,n){while((n<0?e>0:e<t.length)&&ht(t.charAt(e)))e+=n;return e}function _t(t,e,n){for(var i=e>n?-1:1;;){if(e==n)return e;var r=(e+n)/2,s=i<0?Math.ceil(r):Math.floor(r);if(s==e)return t(s)?e:n;t(s)?n=s:e=s+i}}function pt(t,e,n,i){if(!t)return i(e,n,"ltr",0);for(var r=!1,s=0;s<t.length;++s){var o=t[s];(o.from<n&&o.to>e||e==n&&o.to==e)&&(i(Math.max(o.from,e),Math.min(o.to,n),1==o.level?"rtl":"ltr",s),r=!0)}r||i(e,n,"ltr")}var ft=null;function dt(t,e,n){var i;ft=null;for(var r=0;r<t.length;++r){var s=t[r];if(s.from<e&&s.to>e)return r;s.to==e&&(s.from!=s.to&&"before"==n?i=r:ft=r),s.from==e&&(s.from!=s.to&&"before"!=n?i=r:ft=r)}return null!=i?i:ft}var gt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var u="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!i.test(t))return!1;for(var h=t.length,c=[],_=0;_<h;++_)c.push(n(t.charCodeAt(_)));for(var p=0,f=u;p<h;++p){var d=c[p];"m"==d?c[p]=f:f=d}for(var g=0,m=u;g<h;++g){var v=c[g];"1"==v&&"r"==m?c[g]="n":s.test(v)&&(m=v,"r"==v&&(c[g]="R"))}for(var y=1,b=c[0];y<h-1;++y){var w=c[y];"+"==w&&"1"==b&&"1"==c[y+1]?c[y]="1":","!=w||b!=c[y+1]||"1"!=b&&"n"!=b||(c[y]=b),b=w}for(var x=0;x<h;++x){var k=c[x];if(","==k)c[x]="N";else if("%"==k){var C=void 0;for(C=x+1;C<h&&"%"==c[C];++C);for(var T=x&&"!"==c[x-1]||C<h&&"1"==c[C]?"1":"N",S=x;S<C;++S)c[S]=T;x=C-1}}for(var O=0,L=u;O<h;++O){var E=c[O];"L"==L&&"1"==E?c[O]="L":s.test(E)&&(L=E)}for(var A=0;A<h;++A)if(r.test(c[A])){var N=void 0;for(N=A+1;N<h&&r.test(c[N]);++N);for(var M="L"==(A?c[A-1]:u),R="L"==(N<h?c[N]:u),D=M==R?M?"L":"R":u,W=A;W<N;++W)c[W]=D;A=N-1}for(var P,z=[],I=0;I<h;)if(o.test(c[I])){var j=I;for(++I;I<h&&o.test(c[I]);++I);z.push(new l(0,j,I))}else{var F=I,B=z.length,H="rtl"==e?1:0;for(++I;I<h&&"L"!=c[I];++I);for(var U=F;U<I;)if(a.test(c[U])){F<U&&(z.splice(B,0,new l(1,F,U)),B+=H);var K=U;for(++U;U<I&&a.test(c[U]);++U);z.splice(B,0,new l(2,K,U)),B+=H,F=U}else++U;F<I&&z.splice(B,0,new l(1,F,I))}return"ltr"==e&&(1==z[0].level&&(P=t.match(/^\s+/))&&(z[0].from=P[0].length,z.unshift(new l(0,0,P[0].length))),1==tt(z).level&&(P=t.match(/\s+$/))&&(tt(z).to-=P[0].length,z.push(new l(0,h-P[0].length,h)))),"rtl"==e?z.reverse():z}}();function mt(t,e){var n=t.order;return null==n&&(n=t.order=gt(t.text,e)),n}var vt=[],yt=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var i=t._handlers||(t._handlers={});i[e]=(i[e]||vt).concat(n)}};function bt(t,e){return t._handlers&&t._handlers[e]||vt}function wt(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var i=t._handlers,r=i&&i[e];if(r){var s=V(r,n);s>-1&&(i[e]=r.slice(0,s).concat(r.slice(s+1)))}}}function xt(t,e){var n=bt(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function kt(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),xt(t,n||e.type,t,e),Et(e)||e.codemirrorIgnore}function Ct(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),i=0;i<e.length;++i)-1==V(n,e[i])&&n.push(e[i])}function Tt(t,e){return bt(t,e).length>0}function St(t){t.prototype.on=function(t,e){yt(this,t,e)},t.prototype.off=function(t,e){wt(this,t,e)}}function Ot(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Lt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Et(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function At(t){Ot(t),Lt(t)}function Nt(t){return t.target||t.srcElement}function Mt(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 Rt,Dt,Wt=function(){if(o&&a<9)return!1;var t=A("div");return"draggable"in t||"dragDrop"in t}();function Pt(t){if(null==Rt){var e=A("span","");E(t,A("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Rt=e.offsetWidth<=1&&e.offsetHeight>2&&!(o&&a<8))}var n=Rt?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function zt(t){if(null!=Dt)return Dt;var e=E(t,document.createTextNode("AخA")),n=S(e,0,1).getBoundingClientRect(),i=S(e,1,2).getBoundingClientRect();return L(t),!(!n||n.left==n.right)&&(Dt=i.right-n.right<3)}var It=3!="\n\nb".split(/\n/).length?function(t){var e=0,n=[],i=t.length;while(e<=i){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var s=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),o=s.indexOf("\r");-1!=o?(n.push(s.slice(0,o)),e+=o+1):(n.push(s),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},jt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(n){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Ft=function(){var t=A("div");return"oncopy"in t||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),Bt=null;function Ht(t){if(null!=Bt)return Bt;var e=E(t,A("span","x")),n=e.getBoundingClientRect(),i=S(e,0,1).getBoundingClientRect();return Bt=Math.abs(n.left-i.left)>1}var Ut={},Kt={};function Vt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Ut[t]=e}function Gt(t,e){Kt[t]=e}function Xt(t){if("string"==typeof t&&Kt.hasOwnProperty(t))t=Kt[t];else if(t&&"string"==typeof t.name&&Kt.hasOwnProperty(t.name)){var e=Kt[t.name];"string"==typeof e&&(e={name:e}),t=rt(e,t),t.name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Xt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Xt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function $t(t,e){e=Xt(e);var n=Ut[e.name];if(!n)return $t(t,"text/plain");var i=n(t,e);if(qt.hasOwnProperty(e.name)){var r=qt[e.name];for(var s in r)r.hasOwnProperty(s)&&(i.hasOwnProperty(s)&&(i["_"+s]=i[s]),i[s]=r[s])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var o in e.modeProps)i[o]=e.modeProps[o];return i}var qt={};function Yt(t,e){var n=qt.hasOwnProperty(t)?qt[t]:qt[t]={};H(e,n)}function Qt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Zt(t,e){var n;while(t.innerMode){if(n=t.innerMode(e),!n||n.mode==t)break;e=n.state,t=n.mode}return n||{mode:t,state:e}}function Jt(t,e,n){return!t.startState||t.startState(e,n)}var te=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 ee(t,e){if(e-=t.first,e<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");var n=t;while(!n.lines)for(var i=0;;++i){var r=n.children[i],s=r.chunkSize();if(e<s){n=r;break}e-=s}return n.lines[e]}function ne(t,e,n){var i=[],r=e.line;return t.iter(e.line,n.line+1,(function(t){var s=t.text;r==n.line&&(s=s.slice(0,n.ch)),r==e.line&&(s=s.slice(e.ch)),i.push(s),++r})),i}function ie(t,e,n){var i=[];return t.iter(e,n,(function(t){i.push(t.text)})),i}function re(t,e){var n=e-t.height;if(n)for(var i=t;i;i=i.parent)i.height+=n}function se(t){if(null==t.parent)return null;for(var e=t.parent,n=V(e.lines,t),i=e.parent;i;e=i,i=i.parent)for(var r=0;;++r){if(i.children[r]==e)break;n+=i.children[r].chunkSize()}return n+e.first}function oe(t,e){var n=t.first;t:do{for(var i=0;i<t.children.length;++i){var r=t.children[i],s=r.height;if(e<s){t=r;continue t}e-=s,n+=r.chunkSize()}return n}while(!t.lines);for(var o=0;o<t.lines.length;++o){var a=t.lines[o],l=a.height;if(e<l)break;e-=l}return n+o}function ae(t,e){return e>=t.first&&e<t.first+t.size}function le(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function ue(t,e,n){if(void 0===n&&(n=null),!(this instanceof ue))return new ue(t,e,n);this.line=t,this.ch=e,this.sticky=n}function he(t,e){return t.line-e.line||t.ch-e.ch}function ce(t,e){return t.sticky==e.sticky&&0==he(t,e)}function _e(t){return ue(t.line,t.ch)}function pe(t,e){return he(t,e)<0?e:t}function fe(t,e){return he(t,e)<0?t:e}function de(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function ge(t,e){if(e.line<t.first)return ue(t.first,0);var n=t.first+t.size-1;return e.line>n?ue(n,ee(t,n).text.length):me(e,ee(t,e.line).text.length)}function me(t,e){var n=t.ch;return null==n||n>e?ue(t.line,e):n<0?ue(t.line,0):t}function ve(t,e){for(var n=[],i=0;i<e.length;i++)n[i]=ge(t,e[i]);return n}te.prototype.eol=function(){return this.pos>=this.string.length},te.prototype.sol=function(){return this.pos==this.lineStart},te.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},te.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},te.prototype.eat=function(t){var e,n=this.string.charAt(this.pos);if(e="string"==typeof t?n==t:n&&(t.test?t.test(n):t(n)),e)return++this.pos,n},te.prototype.eatWhile=function(t){var e=this.pos;while(this.eat(t));return this.pos>e},te.prototype.eatSpace=function(){var t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>t},te.prototype.skipToEnd=function(){this.pos=this.string.length},te.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},te.prototype.backUp=function(t){this.pos-=t},te.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=U(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?U(this.string,this.lineStart,this.tabSize):0)},te.prototype.indentation=function(){return U(this.string,null,this.tabSize)-(this.lineStart?U(this.string,this.lineStart,this.tabSize):0)},te.prototype.match=function(t,e,n){if("string"!=typeof t){var i=this.string.slice(this.pos).match(t);return i&&i.index>0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t},s=this.string.substr(this.pos,t.length);if(r(s)==r(t))return!1!==e&&(this.pos+=t.length),!0},te.prototype.current=function(){return this.string.slice(this.start,this.pos)},te.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},te.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},te.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ye=function(t,e){this.state=t,this.lookAhead=e},be=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function we(t,e,n,i){var r=[t.state.modeGen],s={};Ae(t,e.text,t.doc.mode,n,(function(t,e){return r.push(t,e)}),s,i);for(var o=n.state,a=function(i){n.baseTokens=r;var a=t.state.overlays[i],l=1,u=0;n.state=!0,Ae(t,e.text,a.mode,n,(function(t,e){var n=l;while(u<t){var i=r[l];i>t&&r.splice(l,1,t,r[l+1],i),l+=2,u=Math.min(t,i)}if(e)if(a.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var s=r[n+1];r[n+1]=(s?s+" ":"")+"overlay "+e}}),s),n.state=o,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)a(l);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function xe(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var i=ke(t,se(e)),r=e.text.length>t.options.maxHighlightLength&&Qt(t.doc.mode,i.state),s=we(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=s.styles,s.classes?e.styleClasses=s.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 ke(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new be(i,!0,e);var s=Ne(t,e,n),o=s>i.first&&ee(i,s-1).stateAfter,a=o?be.fromSaved(i,o,s):new be(i,Jt(i.mode),s);return i.iter(s,e,(function(n){Ce(t,n.text,a);var i=a.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&i<r.viewTo?a.save():null,a.nextLine()})),n&&(i.modeFrontier=a.line),a}function Ce(t,e,n,i){var r=t.doc.mode,s=new te(e,t.options.tabSize,n);s.start=s.pos=i||0,""==e&&Te(r,n.state);while(!s.eol())Se(r,s,n.state),s.start=s.pos}function Te(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Zt(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Se(t,e,n,i){for(var r=0;r<10;r++){i&&(i[0]=Zt(t,n).mode);var s=t.token(e,n);if(e.pos>e.start)return s}throw new Error("Mode "+t.name+" failed to advance stream.")}be.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},be.prototype.baseToken=function(t){if(!this.baseTokens)return null;while(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}},be.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},be.fromSaved=function(t,e,n){return e instanceof ye?new be(t,Qt(t.mode,e.state),n,e.lookAhead):new be(t,Qt(t.mode,e),n)},be.prototype.save=function(t){var e=!1!==t?Qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ye(e,this.maxLookAhead):e};var Oe=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Le(t,e,n,i){var r,s=t.doc,o=s.mode;e=ge(s,e);var a,l=ee(s,e.line),u=ke(t,e.line,n),h=new te(l.text,t.options.tabSize,u);i&&(a=[]);while((i||h.pos<e.ch)&&!h.eol())h.start=h.pos,r=Se(o,h,u.state),i&&a.push(new Oe(h,r,Qt(s.mode,u.state)));return i?a:new Oe(h,r,u.state)}function Ee(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==e[i]?e[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(e[i])||(e[i]+=" "+n[2])}return t}function Ae(t,e,n,i,r,s,o){var a=n.flattenSpans;null==a&&(a=t.options.flattenSpans);var l,u=0,h=null,c=new te(e,t.options.tabSize,i),_=t.options.addModeClass&&[null];""==e&&Ee(Te(n,i.state),s);while(!c.eol()){if(c.pos>t.options.maxHighlightLength?(a=!1,o&&Ce(t,e,i,c.pos),c.pos=e.length,l=null):l=Ee(Se(n,c,i.state,_),s),_){var p=_[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!a||h!=l){while(u<c.start)u=Math.min(c.start,u+5e3),r(u,h);h=l}c.start=c.pos}while(u<c.pos){var f=Math.min(c.pos,u+5e3);r(f,h),u=f}}function Ne(t,e,n){for(var i,r,s=t.doc,o=n?-1:e-(t.doc.mode.innerMode?1e3:100),a=e;a>o;--a){if(a<=s.first)return s.first;var l=ee(s,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof ye?u.lookAhead:0)<=s.modeFrontier))return a;var h=U(l.text,null,t.options.tabSize);(null==r||i>h)&&(r=a-1,i=h)}return r}function Me(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,i=e-1;i>n;i--){var r=ee(t,i).stateAfter;if(r&&(!(r instanceof ye)||i+r.lookAhead<e)){n=i+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}var Re=!1,De=!1;function We(){Re=!0}function Pe(){De=!0}function ze(t,e,n){this.marker=t,this.from=e,this.to=n}function Ie(t,e){if(t)for(var n=0;n<t.length;++n){var i=t[n];if(i.marker==e)return i}}function je(t,e){for(var n,i=0;i<t.length;++i)t[i]!=e&&(n||(n=[])).push(t[i]);return n}function Fe(t,e,n){var i=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));i&&t.markedSpans&&i.has(t.markedSpans)?t.markedSpans.push(e):(t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],i&&i.add(t.markedSpans)),e.marker.attachLine(t)}function Be(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var s=t[r],o=s.marker,a=null==s.from||(o.inclusiveLeft?s.from<=e:s.from<e);if(a||s.from==e&&"bookmark"==o.type&&(!n||!s.marker.insertLeft)){var l=null==s.to||(o.inclusiveRight?s.to>=e:s.to>e);(i||(i=[])).push(new ze(o,s.from,l?null:s.to))}}return i}function He(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var s=t[r],o=s.marker,a=null==s.to||(o.inclusiveRight?s.to>=e:s.to>e);if(a||s.from==e&&"bookmark"==o.type&&(!n||s.marker.insertLeft)){var l=null==s.from||(o.inclusiveLeft?s.from<=e:s.from<e);(i||(i=[])).push(new ze(o,l?null:s.from-e,null==s.to?null:s.to-e))}}return i}function Ue(t,e){if(e.full)return null;var n=ae(t,e.from.line)&&ee(t,e.from.line).markedSpans,i=ae(t,e.to.line)&&ee(t,e.to.line).markedSpans;if(!n&&!i)return null;var r=e.from.ch,s=e.to.ch,o=0==he(e.from,e.to),a=Be(n,r,o),l=He(i,s,o),u=1==e.text.length,h=tt(e.text).length+(u?r:0);if(a)for(var c=0;c<a.length;++c){var _=a[c];if(null==_.to){var p=Ie(l,_.marker);p?u&&(_.to=null==p.to?null:p.to+h):_.to=r}}if(l)for(var f=0;f<l.length;++f){var d=l[f];if(null!=d.to&&(d.to+=h),null==d.from){var g=Ie(a,d.marker);g||(d.from=h,u&&(a||(a=[])).push(d))}else d.from+=h,u&&(a||(a=[])).push(d)}a&&(a=Ke(a)),l&&l!=a&&(l=Ke(l));var m=[a];if(!u){var v,y=e.text.length-2;if(y>0&&a)for(var b=0;b<a.length;++b)null==a[b].to&&(v||(v=[])).push(new ze(a[b].marker,null,null));for(var w=0;w<y;++w)m.push(v);m.push(l)}return m}function Ke(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function Ve(t,e,n){var i=null;if(t.iter(e.line,n.line+1,(function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||i&&-1!=V(i,n)||(i||(i=[])).push(n)}})),!i)return null;for(var r=[{from:e,to:n}],s=0;s<i.length;++s)for(var o=i[s],a=o.find(0),l=0;l<r.length;++l){var u=r[l];if(!(he(u.to,a.from)<0||he(u.from,a.to)>0)){var h=[l,1],c=he(u.from,a.from),_=he(u.to,a.to);(c<0||!o.inclusiveLeft&&!c)&&h.push({from:u.from,to:a.from}),(_>0||!o.inclusiveRight&&!_)&&h.push({from:a.to,to:u.to}),r.splice.apply(r,h),l+=h.length-3}}return r}function Ge(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Xe(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function $e(t){return t.inclusiveLeft?-1:0}function qe(t){return t.inclusiveRight?1:0}function Ye(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var i=t.find(),r=e.find(),s=he(i.from,r.from)||$e(t)-$e(e);if(s)return-s;var o=he(i.to,r.to)||qe(t)-qe(e);return o||e.id-t.id}function Qe(t,e){var n,i=De&&t.markedSpans;if(i)for(var r=void 0,s=0;s<i.length;++s)r=i[s],r.marker.collapsed&&null==(e?r.from:r.to)&&(!n||Ye(n,r.marker)<0)&&(n=r.marker);return n}function Ze(t){return Qe(t,!0)}function Je(t){return Qe(t,!1)}function tn(t,e){var n,i=De&&t.markedSpans;if(i)for(var r=0;r<i.length;++r){var s=i[r];s.marker.collapsed&&(null==s.from||s.from<e)&&(null==s.to||s.to>e)&&(!n||Ye(n,s.marker)<0)&&(n=s.marker)}return n}function en(t,e,n,i,r){var s=ee(t,e),o=De&&s.markedSpans;if(o)for(var a=0;a<o.length;++a){var l=o[a];if(l.marker.collapsed){var u=l.marker.find(0),h=he(u.from,n)||$e(l.marker)-$e(r),c=he(u.to,i)||qe(l.marker)-qe(r);if(!(h>=0&&c<=0||h<=0&&c>=0)&&(h<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?he(u.to,n)>=0:he(u.to,n)>0)||h>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?he(u.from,i)<=0:he(u.from,i)<0)))return!0}}}function nn(t){var e;while(e=Ze(t))t=e.find(-1,!0).line;return t}function rn(t){var e;while(e=Je(t))t=e.find(1,!0).line;return t}function sn(t){var e,n;while(e=Je(t))t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function on(t,e){var n=ee(t,e),i=nn(n);return n==i?e:se(i)}function an(t,e){if(e>t.lastLine())return e;var n,i=ee(t,e);if(!ln(t,i))return e;while(n=Je(i))i=n.find(1,!0).line;return se(i)+1}function ln(t,e){var n=De&&e.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if(i=n[r],i.marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&un(t,e,i))return!0}}function un(t,e,n){if(null==n.to){var i=n.marker.find(1,!0);return un(t,i.line,Ie(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var r=void 0,s=0;s<e.markedSpans.length;++s)if(r=e.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&un(t,e,r))return!0}function hn(t){t=nn(t);for(var e=0,n=t.parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==t)break;e+=r.height}for(var s=n.parent;s;n=s,s=n.parent)for(var o=0;o<s.children.length;++o){var a=s.children[o];if(a==n)break;e+=a.height}return e}function cn(t){if(0==t.height)return 0;var e,n=t.text.length,i=t;while(e=Ze(i)){var r=e.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}i=t;while(e=Je(i)){var s=e.find(0,!0);n-=i.text.length-s.from.ch,i=s.to.line,n+=i.text.length-s.to.ch}return n}function _n(t){var e=t.display,n=t.doc;e.maxLine=ee(n,n.first),e.maxLineLength=cn(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=cn(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var pn=function(t,e,n){this.text=t,Xe(this,e),this.height=n?n(this):1};function fn(t,e,n,i){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ge(t),Xe(t,n);var r=i?i(t):1;r!=t.height&&re(t,r)}function dn(t){t.parent=null,Ge(t)}pn.prototype.lineNo=function(){return se(this)},St(pn);var gn={},mn={};function vn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?mn:gn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function yn(t,e){var n=N("span",null,null,l?"padding-right: .1px":null),i={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var s=r?e.rest[r-1]:e.line,o=void 0;i.pos=0,i.addToken=wn,zt(t.display.measure)&&(o=mt(s,t.doc.direction))&&(i.addToken=kn(i.addToken,o)),i.map=[];var a=e!=t.display.externalMeasured&&se(s);Tn(s,i,xe(t,s,a)),s.styleClasses&&(s.styleClasses.bgClass&&(i.bgClass=W(s.styleClasses.bgClass,i.bgClass||"")),s.styleClasses.textClass&&(i.textClass=W(s.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Pt(t.display.measure))),0==r?(e.measure.map=i.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(i.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var u=i.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return xt(t,"renderLine",t,e.line,i.pre),i.pre.className&&(i.textClass=W(i.pre.className,i.textClass||"")),i}function bn(t){var e=A("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function wn(t,e,n,i,r,s,l){if(e){var u,h=t.splitSpaces?xn(e,t.trailingSpace):e,c=t.cm.state.specialChars,_=!1;if(c.test(e)){u=document.createDocumentFragment();var p=0;while(1){c.lastIndex=p;var f=c.exec(e),d=f?f.index-p:e.length-p;if(d){var g=document.createTextNode(h.slice(p,p+d));o&&a<9?u.appendChild(A("span",[g])):u.appendChild(g),t.map.push(t.pos,t.pos+d,g),t.col+=d,t.pos+=d}if(!f)break;p+=d+1;var m=void 0;if("\t"==f[0]){var v=t.cm.options.tabSize,y=v-t.col%v;m=u.appendChild(A("span",J(y),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=y}else"\r"==f[0]||"\n"==f[0]?(m=u.appendChild(A("span","\r"==f[0]?"␍":"","cm-invalidchar")),m.setAttribute("cm-text",f[0]),t.col+=1):(m=t.cm.options.specialCharPlaceholder(f[0]),m.setAttribute("cm-text",f[0]),o&&a<9?u.appendChild(A("span",[m])):u.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,u=document.createTextNode(h),t.map.push(t.pos,t.pos+e.length,u),o&&a<9&&(_=!0),t.pos+=e.length;if(t.trailingSpace=32==h.charCodeAt(e.length-1),n||i||r||_||s||l){var b=n||"";i&&(b+=i),r&&(b+=r);var w=A("span",[u],b,s);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&w.setAttribute(x,l[x]);return t.content.appendChild(w)}t.content.appendChild(u)}}function xn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,i="",r=0;r<t.length;r++){var s=t.charAt(r);" "!=s||!n||r!=t.length-1&&32!=t.charCodeAt(r+1)||(s=" "),i+=s,n=" "==s}return i}function kn(t,e){return function(n,i,r,s,o,a,l){r=r?r+" cm-force-border":"cm-force-border";for(var u=n.pos,h=u+i.length;;){for(var c=void 0,_=0;_<e.length;_++)if(c=e[_],c.to>u&&c.from<=u)break;if(c.to>=h)return t(n,i,r,s,o,a,l);t(n,i.slice(0,c.to-u),r,s,null,a,l),s=null,i=i.slice(c.to-u),u=c.to}}}function Cn(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function Tn(t,e,n){var i=t.markedSpans,r=t.text,s=0;if(i)for(var o,a,l,u,h,c,_,p=r.length,f=0,d=1,g="",m=0;;){if(m==f){l=u=h=a="",_=null,c=null,m=1/0;for(var v=[],y=void 0,b=0;b<i.length;++b){var w=i[b],x=w.marker;if("bookmark"==x.type&&w.from==f&&x.widgetNode)v.push(x);else if(w.from<=f&&(null==w.to||w.to>f||x.collapsed&&w.to==f&&w.from==f)){if(null!=w.to&&w.to!=f&&m>w.to&&(m=w.to,u=""),x.className&&(l+=" "+x.className),x.css&&(a=(a?a+";":"")+x.css),x.startStyle&&w.from==f&&(h+=" "+x.startStyle),x.endStyle&&w.to==m&&(y||(y=[])).push(x.endStyle,w.to),x.title&&((_||(_={})).title=x.title),x.attributes)for(var k in x.attributes)(_||(_={}))[k]=x.attributes[k];x.collapsed&&(!c||Ye(c.marker,x)<0)&&(c=w)}else w.from>f&&m>w.from&&(m=w.from)}if(y)for(var C=0;C<y.length;C+=2)y[C+1]==m&&(u+=" "+y[C]);if(!c||c.from==f)for(var T=0;T<v.length;++T)Cn(e,0,v[T]);if(c&&(c.from||0)==f){if(Cn(e,(null==c.to?p+1:c.to)-f,c.marker,null==c.from),null==c.to)return;c.to==f&&(c=!1)}}if(f>=p)break;var S=Math.min(p,m);while(1){if(g){var O=f+g.length;if(!c){var L=O>S?g.slice(0,S-f):g;e.addToken(e,L,o?o+l:l,h,f+L.length==m?u:"",a,_)}if(O>=S){g=g.slice(S-f),f=S;break}f=O,h=""}g=r.slice(s,s=n[d++]),o=vn(n[d++],e.cm.options)}}else for(var E=1;E<n.length;E+=2)e.addToken(e,r.slice(s,s=n[E]),vn(n[E+1],e.cm.options))}function Sn(t,e,n){this.line=e,this.rest=sn(e),this.size=this.rest?se(tt(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ln(t,e)}function On(t,e,n){for(var i,r=[],s=e;s<n;s=i){var o=new Sn(t.doc,ee(t.doc,s),s);i=s+o.size,r.push(o)}return r}var Ln=null;function En(t){Ln?Ln.ops.push(t):t.ownsGroup=Ln={ops:[t],delayedCallbacks:[]}}function An(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var i=0;i<t.ops.length;i++){var r=t.ops[i];if(r.cursorActivityHandlers)while(r.cursorActivityCalled<r.cursorActivityHandlers.length)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<e.length)}function Nn(t,e){var n=t.ownsGroup;if(n)try{An(n)}finally{Ln=null,e(n)}}var Mn=null;function Rn(t,e){var n=bt(t,e);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);Ln?i=Ln.delayedCallbacks:Mn?i=Mn:(i=Mn=[],setTimeout(Dn,0));for(var s=function(t){i.push((function(){return n[t].apply(null,r)}))},o=0;o<n.length;++o)s(o)}}function Dn(){var t=Mn;Mn=null;for(var e=0;e<t.length;++e)t[e]()}function Wn(t,e,n,i){for(var r=0;r<e.changes.length;r++){var s=e.changes[r];"text"==s?jn(t,e):"gutter"==s?Bn(t,e,n,i):"class"==s?Fn(t,e):"widget"==s&&Hn(t,e,i)}e.changes=null}function Pn(t){return t.node==t.text&&(t.node=A("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),o&&a<8&&(t.node.style.zIndex=2)),t.node}function zn(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var i=Pn(e);e.background=i.insertBefore(A("div",null,n),i.firstChild),t.display.input.setUneditable(e.background)}}function In(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):yn(t,e)}function jn(t,e){var n=e.text.className,i=In(t,e);e.text==e.node&&(e.node=i.pre),e.text.parentNode.replaceChild(i.pre,e.text),e.text=i.pre,i.bgClass!=e.bgClass||i.textClass!=e.textClass?(e.bgClass=i.bgClass,e.textClass=i.textClass,Fn(t,e)):n&&(e.text.className=n)}function Fn(t,e){zn(t,e),e.line.wrapClass?Pn(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function Bn(t,e,n,i){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var r=Pn(e);e.gutterBackground=A("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),r.insertBefore(e.gutterBackground,e.text)}var s=e.line.gutterMarkers;if(t.options.lineNumbers||s){var o=Pn(e),a=e.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),t.display.input.setUneditable(a),o.insertBefore(a,e.text),e.line.gutterClass&&(a.className+=" "+e.line.gutterClass),!t.options.lineNumbers||s&&s["CodeMirror-linenumbers"]||(e.lineNumber=a.appendChild(A("div",le(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),s)for(var l=0;l<t.display.gutterSpecs.length;++l){var u=t.display.gutterSpecs[l].className,h=s.hasOwnProperty(u)&&s[u];h&&a.appendChild(A("div",[h],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Hn(t,e,n){e.alignable&&(e.alignable=null);for(var i=T("CodeMirror-linewidget"),r=e.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,i.test(r.className)&&e.node.removeChild(r);Kn(t,e,n)}function Un(t,e,n,i){var r=In(t,e);return e.text=e.node=r.pre,r.bgClass&&(e.bgClass=r.bgClass),r.textClass&&(e.textClass=r.textClass),Fn(t,e),Bn(t,e,n,i),Kn(t,e,i),e.node}function Kn(t,e,n){if(Vn(t,e.line,e,n,!0),e.rest)for(var i=0;i<e.rest.length;i++)Vn(t,e.rest[i],e,n,!1)}function Vn(t,e,n,i,r){if(e.widgets)for(var s=Pn(n),o=0,a=e.widgets;o<a.length;++o){var l=a[o],u=A("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Gn(l,u,n,i),t.display.input.setUneditable(u),r&&l.above?s.insertBefore(u,n.gutter||n.text):s.appendChild(u),Rn(l,"redraw")}}function Gn(t,e,n,i){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var r=i.wrapperWidth;e.style.left=i.fixedPos+"px",t.coverGutter||(r-=i.gutterTotalWidth,e.style.paddingLeft=i.gutterTotalWidth+"px"),e.style.width=r+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-i.gutterTotalWidth+"px"))}function Xn(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!M(document.body,t.node)){var n="position: relative;";t.coverGutter&&(n+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(n+="width: "+e.display.wrapper.clientWidth+"px;"),E(e.display.measure,A("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function $n(t,e){for(var n=Nt(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function qn(t){return t.lineSpace.offsetTop}function Yn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Qn(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=E(t.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(t.cachedPaddingH=i),i}function Zn(t){return G-t.display.nativeBarWidth}function Jn(t){return t.display.scroller.clientWidth-Zn(t)-t.display.barWidth}function ti(t){return t.display.scroller.clientHeight-Zn(t)-t.display.barHeight}function ei(t,e,n){var i=t.options.lineWrapping,r=i&&Jn(t);if(!e.measure.heights||i&&e.measure.width!=r){var s=e.measure.heights=[];if(i){e.measure.width=r;for(var o=e.text.firstChild.getClientRects(),a=0;a<o.length-1;a++){var l=o[a],u=o[a+1];Math.abs(l.bottom-u.bottom)>2&&s.push((l.bottom+u.top)/2-n.top)}}s.push(n.bottom-n.top)}}function ni(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){for(var i=0;i<t.rest.length;i++)if(t.rest[i]==e)return{map:t.measure.maps[i],cache:t.measure.caches[i]};for(var r=0;r<t.rest.length;r++)if(se(t.rest[r])>n)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}}function ii(t,e){e=nn(e);var n=se(e),i=t.display.externalMeasured=new Sn(t.doc,e,n);i.lineN=n;var r=i.built=yn(t,i);return i.text=r.pre,E(t.display.lineMeasure,r.pre),i}function ri(t,e,n,i){return ai(t,oi(t,e),n,i)}function si(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[Fi(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function oi(t,e){var n=se(e),i=si(t,n);i&&!i.text?i=null:i&&i.changes&&(Wn(t,i,n,Wi(t)),t.curOp.forceUpdate=!0),i||(i=ii(t,e));var r=ni(i,e,n);return{line:e,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ai(t,e,n,i,r){e.before&&(n=-1);var s,o=n+(i||"");return e.cache.hasOwnProperty(o)?s=e.cache[o]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(ei(t,e.view,e.rect),e.hasHeights=!0),s=_i(t,e,n,i),s.bogus||(e.cache[o]=s)),{left:s.left,right:s.right,top:r?s.rtop:s.top,bottom:r?s.rbottom:s.bottom}}var li,ui={left:0,right:0,top:0,bottom:0};function hi(t,e,n){for(var i,r,s,o,a,l,u=0;u<t.length;u+=3)if(a=t[u],l=t[u+1],e<a?(r=0,s=1,o="left"):e<l?(r=e-a,s=r+1):(u==t.length-3||e==l&&t[u+3]>e)&&(s=l-a,r=s-1,e>=l&&(o="right")),null!=r){if(i=t[u+2],a==l&&n==(i.insertLeft?"left":"right")&&(o=n),"left"==n&&0==r)while(u&&t[u-2]==t[u-3]&&t[u-1].insertLeft)i=t[2+(u-=3)],o="left";if("right"==n&&r==l-a)while(u<t.length-3&&t[u+3]==t[u+4]&&!t[u+5].insertLeft)i=t[(u+=3)+2],o="right";break}return{node:i,start:r,end:s,collapse:o,coverStart:a,coverEnd:l}}function ci(t,e){var n=ui;if("left"==e){for(var i=0;i<t.length;i++)if((n=t[i]).left!=n.right)break}else for(var r=t.length-1;r>=0;r--)if((n=t[r]).left!=n.right)break;return n}function _i(t,e,n,i){var r,s=hi(e.map,n,i),l=s.node,u=s.start,h=s.end,c=s.collapse;if(3==l.nodeType){for(var _=0;_<4;_++){while(u&&ht(e.line.text.charAt(s.coverStart+u)))--u;while(s.coverStart+h<s.coverEnd&&ht(e.line.text.charAt(s.coverStart+h)))++h;if(r=o&&a<9&&0==u&&h==s.coverEnd-s.coverStart?l.parentNode.getBoundingClientRect():ci(S(l,u,h).getClientRects(),i),r.left||r.right||0==u)break;h=u,u-=1,c="right"}o&&a<11&&(r=pi(t.display.measure,r))}else{var p;u>0&&(c=i="right"),r=t.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==i?p.length-1:0]:l.getBoundingClientRect()}if(o&&a<9&&!u&&(!r||!r.left&&!r.right)){var f=l.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+Di(t.display),top:f.top,bottom:f.bottom}:ui}for(var d=r.top-e.rect.top,g=r.bottom-e.rect.top,m=(d+g)/2,v=e.view.measure.heights,y=0;y<v.length-1;y++)if(m<v[y])break;var b=y?v[y-1]:0,w=v[y],x={left:("right"==c?r.right:r.left)-e.rect.left,right:("left"==c?r.left:r.right)-e.rect.left,top:b,bottom:w};return r.left||r.right||(x.bogus=!0),t.options.singleCursorHeightPerLine||(x.rtop=d,x.rbottom=g),x}function pi(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ht(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*i,bottom:e.bottom*i}}function fi(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function di(t){t.display.externalMeasure=null,L(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)fi(t.display.view[e])}function gi(t){di(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function mi(t){return h&&m?-(t.body.getBoundingClientRect().left-parseInt(getComputedStyle(t.body).marginLeft)):t.defaultView.pageXOffset||(t.documentElement||t.body).scrollLeft}function vi(t){return h&&m?-(t.body.getBoundingClientRect().top-parseInt(getComputedStyle(t.body).marginTop)):t.defaultView.pageYOffset||(t.documentElement||t.body).scrollTop}function yi(t){var e=nn(t),n=e.widgets,i=0;if(n)for(var r=0;r<n.length;++r)n[r].above&&(i+=Xn(n[r]));return i}function bi(t,e,n,i,r){if(!r){var s=yi(e);n.top+=s,n.bottom+=s}if("line"==i)return n;i||(i="local");var o=hn(e);if("local"==i?o+=qn(t.display):o-=t.display.viewOffset,"page"==i||"window"==i){var a=t.display.lineSpace.getBoundingClientRect();o+=a.top+("window"==i?0:vi(z(t)));var l=a.left+("window"==i?0:mi(z(t)));n.left+=l,n.right+=l}return n.top+=o,n.bottom+=o,n}function wi(t,e,n){if("div"==n)return e;var i=e.left,r=e.top;if("page"==n)i-=mi(z(t)),r-=vi(z(t));else if("local"==n||!n){var s=t.display.sizer.getBoundingClientRect();i+=s.left,r+=s.top}var o=t.display.lineSpace.getBoundingClientRect();return{left:i-o.left,top:r-o.top}}function xi(t,e,n,i,r){return i||(i=ee(t.doc,e.line)),bi(t,i,ri(t,i,e.ch,r),n)}function ki(t,e,n,i,r,s){function o(e,o){var a=ai(t,r,e,o?"right":"left",s);return o?a.left=a.right:a.right=a.left,bi(t,i,a,n)}i=i||ee(t.doc,e.line),r||(r=oi(t,i));var a=mt(i,t.doc.direction),l=e.ch,u=e.sticky;if(l>=i.text.length?(l=i.text.length,u="before"):l<=0&&(l=0,u="after"),!a)return o("before"==u?l-1:l,"before"==u);function h(t,e,n){var i=a[e],r=1==i.level;return o(n?t-1:t,r!=n)}var c=dt(a,l,u),_=ft,p=h(l,c,"before"==u);return null!=_&&(p.other=h(l,_,"before"!=u)),p}function Ci(t,e){var n=0;e=ge(t.doc,e),t.options.lineWrapping||(n=Di(t.display)*e.ch);var i=ee(t.doc,e.line),r=hn(i)+qn(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Ti(t,e,n,i,r){var s=ue(t,e,n);return s.xRel=r,i&&(s.outside=i),s}function Si(t,e,n){var i=t.doc;if(n+=t.display.viewOffset,n<0)return Ti(i.first,0,null,-1,-1);var r=oe(i,n),s=i.first+i.size-1;if(r>s)return Ti(i.first+i.size-1,ee(i,s).text.length,null,1,1);e<0&&(e=0);for(var o=ee(i,r);;){var a=Ai(t,o,r,e,n),l=tn(o,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==r)return u;o=ee(i,r=u.line)}}function Oi(t,e,n,i){i-=yi(e);var r=e.text.length,s=_t((function(e){return ai(t,n,e-1).bottom<=i}),r,0);return r=_t((function(e){return ai(t,n,e).top>i}),s,r),{begin:s,end:r}}function Li(t,e,n,i){n||(n=oi(t,e));var r=bi(t,e,ai(t,n,i),"line").top;return Oi(t,e,n,r)}function Ei(t,e,n,i){return!(t.bottom<=n)&&(t.top>n||(i?t.left:t.right)>e)}function Ai(t,e,n,i,r){r-=hn(e);var s=oi(t,e),o=yi(e),a=0,l=e.text.length,u=!0,h=mt(e,t.doc.direction);if(h){var c=(t.options.lineWrapping?Mi:Ni)(t,e,n,s,h,i,r);u=1!=c.level,a=u?c.from:c.to-1,l=u?c.to:c.from-1}var _,p,f=null,d=null,g=_t((function(e){var n=ai(t,s,e);return n.top+=o,n.bottom+=o,!!Ei(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=e,d=n),!0)}),a,l),m=!1;if(d){var v=i-d.left<d.right-i,y=v==u;g=f+(y?0:1),p=y?"after":"before",_=v?d.left:d.right}else{u||g!=l&&g!=a||g++,p=0==g?"after":g==e.text.length?"before":ai(t,s,g-(u?1:0)).bottom+o<=r==u?"after":"before";var b=ki(t,ue(n,g,p),"line",e,s);_=b.left,m=r<b.top?-1:r>=b.bottom?1:0}return g=ct(e.text,g,1),Ti(n,g,p,m,i-_)}function Ni(t,e,n,i,r,s,o){var a=_t((function(a){var l=r[a],u=1!=l.level;return Ei(ki(t,ue(n,u?l.to:l.from,u?"before":"after"),"line",e,i),s,o,!0)}),0,r.length-1),l=r[a];if(a>0){var u=1!=l.level,h=ki(t,ue(n,u?l.from:l.to,u?"after":"before"),"line",e,i);Ei(h,s,o,!0)&&h.top>o&&(l=r[a-1])}return l}function Mi(t,e,n,i,r,s,o){var a=Oi(t,e,i,o),l=a.begin,u=a.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var h=null,c=null,_=0;_<r.length;_++){var p=r[_];if(!(p.from>=u||p.to<=l)){var f=1!=p.level,d=ai(t,i,f?Math.min(u,p.to)-1:Math.max(l,p.from)).right,g=d<s?s-d+1e9:d-s;(!h||c>g)&&(h=p,c=g)}}return h||(h=r[r.length-1]),h.from<l&&(h={from:l,to:h.to,level:h.level}),h.to>u&&(h={from:h.from,to:u,level:h.level}),h}function Ri(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==li){li=A("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)li.appendChild(document.createTextNode("x")),li.appendChild(A("br"));li.appendChild(document.createTextNode("x"))}E(t.measure,li);var n=li.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),L(t.measure),n||1}function Di(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=A("span","xxxxxxxxxx"),n=A("pre",[e],"CodeMirror-line-like");E(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function Wi(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,s=e.gutters.firstChild,o=0;s;s=s.nextSibling,++o){var a=t.display.gutterSpecs[o].className;n[a]=s.offsetLeft+s.clientLeft+r,i[a]=s.clientWidth}return{fixedPos:Pi(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function Pi(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function zi(t){var e=Ri(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/Di(t.display)-3);return function(r){if(ln(t.doc,r))return 0;var s=0;if(r.widgets)for(var o=0;o<r.widgets.length;o++)r.widgets[o].height&&(s+=r.widgets[o].height);return n?s+(Math.ceil(r.text.length/i)||1)*e:s+e}}function Ii(t){var e=t.doc,n=zi(t);e.iter((function(t){var e=n(t);e!=t.height&&re(t,e)}))}function ji(t,e,n,i){var r=t.display;if(!n&&"true"==Nt(e).getAttribute("cm-not-content"))return null;var s,o,a=r.lineSpace.getBoundingClientRect();try{s=e.clientX-a.left,o=e.clientY-a.top}catch(c){return null}var l,u=Si(t,s,o);if(i&&u.xRel>0&&(l=ee(t.doc,u.line).text).length==u.ch){var h=U(l,l.length,t.options.tabSize)-l.length;u=ue(u.line,Math.max(0,Math.round((s-Qn(t.display).left)/Di(t.display))-h))}return u}function Fi(t,e){if(e>=t.display.viewTo)return null;if(e-=t.display.viewFrom,e<0)return null;for(var n=t.display.view,i=0;i<n.length;i++)if(e-=n[i].size,e<0)return i}function Bi(t,e,n,i){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),i||(i=0);var r=t.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>e)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)De&&on(t.doc,e)<r.viewTo&&Ui(t);else if(n<=r.viewFrom)De&&an(t.doc,n+i)>r.viewFrom?Ui(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)Ui(t);else if(e<=r.viewFrom){var s=Ki(t,n,n+i,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=i):Ui(t)}else if(n>=r.viewTo){var o=Ki(t,e,e,-1);o?(r.view=r.view.slice(0,o.index),r.viewTo=o.lineN):Ui(t)}else{var a=Ki(t,e,e,-1),l=Ki(t,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(On(t,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):Ui(t)}var u=r.externalMeasured;u&&(n<u.lineN?u.lineN+=i:e<u.lineN+u.size&&(r.externalMeasured=null))}function Hi(t,e,n){t.curOp.viewChanged=!0;var i=t.display,r=t.display.externalMeasured;if(r&&e>=r.lineN&&e<r.lineN+r.size&&(i.externalMeasured=null),!(e<i.viewFrom||e>=i.viewTo)){var s=i.view[Fi(t,e)];if(null!=s.node){var o=s.changes||(s.changes=[]);-1==V(o,n)&&o.push(n)}}}function Ui(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Ki(t,e,n,i){var r,s=Fi(t,e),o=t.display.view;if(!De||n==t.doc.first+t.doc.size)return{index:s,lineN:n};for(var a=t.display.viewFrom,l=0;l<s;l++)a+=o[l].size;if(a!=e){if(i>0){if(s==o.length-1)return null;r=a+o[s].size-e,s++}else r=a-e;e+=r,n+=r}while(on(t.doc,n)!=n){if(s==(i<0?0:o.length-1))return null;n+=i*o[s-(i<0?1:0)].size,s+=i}return{index:s,lineN:n}}function Vi(t,e,n){var i=t.display,r=i.view;0==r.length||e>=i.viewTo||n<=i.viewFrom?(i.view=On(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=On(t,e,i.viewFrom).concat(i.view):i.viewFrom<e&&(i.view=i.view.slice(Fi(t,e))),i.viewFrom=e,i.viewTo<n?i.view=i.view.concat(On(t,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,Fi(t,n)))),i.viewTo=n}function Gi(t){for(var e=t.display.view,n=0,i=0;i<e.length;i++){var r=e[i];r.hidden||r.node&&!r.changes||++n}return n}function Xi(t){t.display.input.showSelection(t.display.input.prepareSelection())}function $i(t,e){void 0===e&&(e=!0);var n=t.doc,i={},r=i.cursors=document.createDocumentFragment(),s=i.selection=document.createDocumentFragment(),o=t.options.$customCursor;o&&(e=!0);for(var a=0;a<n.sel.ranges.length;a++)if(e||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=t.display.viewTo||l.to().line<t.display.viewFrom)){var u=l.empty();if(o){var h=o(t,l);h&&qi(t,h,r)}else(u||t.options.showCursorWhenSelecting)&&qi(t,l.head,r);u||Qi(t,l,s)}}return i}function qi(t,e,n){var i=ki(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),r=n.appendChild(A("div"," ","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*t.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var s=xi(t,e,"div",null,null),o=s.right-s.left;r.style.width=(o>0?o:t.defaultCharWidth())+"px"}if(i.other){var a=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Yi(t,e){return t.top-e.top||t.left-e.left}function Qi(t,e,n){var i=t.display,r=t.doc,s=document.createDocumentFragment(),o=Qn(t.display),a=o.left,l=Math.max(i.sizerWidth,Jn(t)-i.sizer.offsetLeft)-o.right,u="ltr"==r.direction;function h(t,e,n,i){e<0&&(e=0),e=Math.round(e),i=Math.round(i),s.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(i-e)+"px"))}function c(e,n,i){var s,o,c=ee(r,e),_=c.text.length;function p(n,i){return xi(t,ue(e,n),"div",c,i)}function f(e,n,i){var r=Li(t,c,null,e),s="ltr"==n==("after"==i)?"left":"right",o="after"==i?r.begin:r.end-(/\s/.test(c.text.charAt(r.end-1))?2:1);return p(o,s)[s]}var d=mt(c,r.direction);return pt(d,n||0,null==i?_:i,(function(t,e,r,c){var g="ltr"==r,m=p(t,g?"left":"right"),v=p(e-1,g?"right":"left"),y=null==n&&0==t,b=null==i&&e==_,w=0==c,x=!d||c==d.length-1;if(v.top-m.top<=3){var k=(u?y:b)&&w,C=(u?b:y)&&x,T=k?a:(g?m:v).left,S=C?l:(g?v:m).right;h(T,m.top,S-T,m.bottom)}else{var O,L,E,A;g?(O=u&&y&&w?a:m.left,L=u?l:f(t,r,"before"),E=u?a:f(e,r,"after"),A=u&&b&&x?l:v.right):(O=u?f(t,r,"before"):a,L=!u&&y&&w?l:m.right,E=!u&&b&&x?a:v.left,A=u?f(e,r,"after"):l),h(O,m.top,L-O,m.bottom),m.bottom<v.top&&h(a,m.bottom,null,v.top),h(E,v.top,A-E,v.bottom)}(!s||Yi(m,s)<0)&&(s=m),Yi(v,s)<0&&(s=v),(!o||Yi(m,o)<0)&&(o=m),Yi(v,o)<0&&(o=v)})),{start:s,end:o}}var _=e.from(),p=e.to();if(_.line==p.line)c(_.line,_.ch,p.ch);else{var f=ee(r,_.line),d=ee(r,p.line),g=nn(f)==nn(d),m=c(_.line,_.ch,g?f.text.length+1:null).end,v=c(p.line,g?0:null,p.ch).start;g&&(m.top<v.top-2?(h(m.right,m.top,null,m.bottom),h(a,v.top,v.left,v.bottom)):h(m.right,m.top,v.left-m.right,m.bottom)),m.bottom<v.top&&h(a,m.bottom,null,v.top)}n.appendChild(s)}function Zi(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval((function(){t.hasFocus()||nr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Ji(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||er(t))}function tr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&nr(t))}),100)}function er(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(xt(t,"focus",t,e),t.state.focused=!0,D(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()),Zi(t))}function nr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(xt(t,"blur",t,e),t.state.focused=!1,O(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function ir(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=Math.max(0,e.scroller.getBoundingClientRect().top),r=e.lineDiv.getBoundingClientRect().top,s=0,l=0;l<e.view.length;l++){var u=e.view[l],h=t.options.lineWrapping,c=void 0,_=0;if(!u.hidden){if(r+=u.line.height,o&&a<8){var p=u.node.offsetTop+u.node.offsetHeight;c=p-n,n=p}else{var f=u.node.getBoundingClientRect();c=f.bottom-f.top,!h&&u.text.firstChild&&(_=u.text.firstChild.getBoundingClientRect().right-f.left-1)}var d=u.line.height-c;if((d>.005||d<-.005)&&(r<i&&(s-=d),re(u.line,c),rr(u.line),u.rest))for(var g=0;g<u.rest.length;g++)rr(u.rest[g]);if(_>t.display.sizerWidth){var m=Math.ceil(_/Di(t.display));m>t.display.maxLineLength&&(t.display.maxLineLength=m,t.display.maxLine=u.line,t.display.maxLineChanged=!0)}}}Math.abs(s)>2&&(e.scroller.scrollTop+=s)}function rr(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function sr(t,e,n){var i=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;i=Math.floor(i-qn(t));var r=n&&null!=n.bottom?n.bottom:i+t.wrapper.clientHeight,s=oe(e,i),o=oe(e,r);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;a<s?(s=a,o=oe(e,hn(ee(e,a))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=o&&(s=oe(e,hn(ee(e,l))-t.wrapper.clientHeight),o=l)}return{from:s,to:Math.max(o,s+1)}}function or(t,e){if(!kt(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),r=null,s=n.wrapper.ownerDocument;if(e.top+i.top<0?r=!0:e.bottom+i.top>(s.defaultView.innerHeight||s.documentElement.clientHeight)&&(r=!1),null!=r&&!d){var o=A("div","",null,"position: absolute;\n top: "+(e.top-n.viewOffset-qn(t.display))+"px;\n height: "+(e.bottom-e.top+Zn(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(r),t.display.lineSpace.removeChild(o)}}}function ar(t,e,n,i){var r;null==i&&(i=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?ue(e.line,e.ch+1,"before"):e,e=e.ch?ue(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var s=0;s<5;s++){var o=!1,a=ki(t,e),l=n&&n!=e?ki(t,n):a;r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i};var u=ur(t,r),h=t.doc.scrollTop,c=t.doc.scrollLeft;if(null!=u.scrollTop&&(gr(t,u.scrollTop),Math.abs(t.doc.scrollTop-h)>1&&(o=!0)),null!=u.scrollLeft&&(vr(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return r}function lr(t,e){var n=ur(t,e);null!=n.scrollTop&&gr(t,n.scrollTop),null!=n.scrollLeft&&vr(t,n.scrollLeft)}function ur(t,e){var n=t.display,i=Ri(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,s=ti(t),o={};e.bottom-e.top>s&&(e.bottom=e.top+s);var a=t.doc.height+Yn(n),l=e.top<i,u=e.bottom>a-i;if(e.top<r)o.scrollTop=l?0:e.top;else if(e.bottom>r+s){var h=Math.min(e.top,(u?a:e.bottom)-s);h!=r&&(o.scrollTop=h)}var c=t.options.fixedGutter?0:n.gutters.offsetWidth,_=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-c,p=Jn(t)-n.gutters.offsetWidth,f=e.right-e.left>p;return f&&(e.right=e.left+p),e.left<10?o.scrollLeft=0:e.left<_?o.scrollLeft=Math.max(0,e.left+c-(f?0:10)):e.right>p+_-3&&(o.scrollLeft=e.right+(f?0:10)-p),o}function hr(t,e){null!=e&&(fr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function cr(t){fr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function _r(t,e,n){null==e&&null==n||fr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function pr(t,e){fr(t),t.curOp.scrollToPos=e}function fr(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=Ci(t,e.from),i=Ci(t,e.to);dr(t,n,i,e.margin)}}function dr(t,e,n,i){var r=ur(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});_r(t,r.scrollLeft,r.scrollTop)}function gr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Xr(t,{top:e}),mr(t,e,!0),n&&Xr(t),jr(t,100))}function mr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function vr(t,e,n,i){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,Qr(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function yr(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Yn(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:i,scrollHeight:i+Zn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var br=function(t,e,n){this.cm=n;var i=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,t(i),t(r),yt(i,"scroll",(function(){i.clientHeight&&e(i.scrollTop,"vertical")})),yt(r,"scroll",(function(){r.clientWidth&&e(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};br.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var s=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},br.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},br.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},br.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new K,this.disableVert=new K},br.prototype.enableZeroWidthBar=function(t,e,n){function i(){var r=t.getBoundingClientRect(),s="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=t?t.style.visibility="hidden":e.set(1e3,i)}t.style.visibility="",e.set(1e3,i)},br.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var wr=function(){};function xr(t,e){e||(e=yr(t));var n=t.display.barWidth,i=t.display.barHeight;kr(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&ir(t),kr(t,yr(t)),n=t.display.barWidth,i=t.display.barHeight}function kr(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}wr.prototype.update=function(){return{bottom:0,right:0}},wr.prototype.setScrollLeft=function(){},wr.prototype.setScrollTop=function(){},wr.prototype.clear=function(){};var Cr={native:br,null:wr};function Tr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&O(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Cr[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),yt(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?vr(t,e):gr(t,e)}),t),t.display.scrollbars.addClass&&D(t.display.wrapper,t.display.scrollbars.addClass)}var Sr=0;function Or(t){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:++Sr,markArrays:null},En(t.curOp)}function Lr(t){var e=t.curOp;e&&Nn(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;Er(t)}))}function Er(t){for(var e=t.ops,n=0;n<e.length;n++)Ar(e[n]);for(var i=0;i<e.length;i++)Nr(e[i]);for(var r=0;r<e.length;r++)Mr(e[r]);for(var s=0;s<e.length;s++)Rr(e[s]);for(var o=0;o<e.length;o++)Dr(e[o])}function Ar(t){var e=t.cm,n=e.display;Hr(e),t.updateMaxLine&&_n(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Br(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Nr(t){t.updatedDisplay=t.mustUpdate&&Vr(t.cm,t.update)}function Mr(t){var e=t.cm,n=e.display;t.updatedDisplay&&ir(e),t.barMeasure=yr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=ri(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+Zn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Jn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Rr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&vr(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==R(I(e));t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&xr(e,t.barMeasure),t.updatedDisplay&&Yr(e,t.barMeasure),t.selectionChanged&&Zi(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Ji(t.cm)}function Dr(t){var e=t.cm,n=e.display,i=e.doc;if(t.updatedDisplay&&Gr(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&mr(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&vr(e,t.scrollLeft,!0,!0),t.scrollToPos){var r=ar(e,ge(i,t.scrollToPos.from),ge(i,t.scrollToPos.to),t.scrollToPos.margin);or(e,r)}var s=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(s)for(var a=0;a<s.length;++a)s[a].lines.length||xt(s[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&xt(o[l],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&xt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Wr(t,e){if(t.curOp)return e();Or(t);try{return e()}finally{Lr(t)}}function Pr(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Or(t);try{return e.apply(t,arguments)}finally{Lr(t)}}}function zr(t){return function(){if(this.curOp)return t.apply(this,arguments);Or(this);try{return t.apply(this,arguments)}finally{Lr(this)}}}function Ir(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Or(e);try{return t.apply(this,arguments)}finally{Lr(e)}}}function jr(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,B(Fr,t))}function Fr(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,i=ke(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(s){if(i.line>=t.display.viewFrom){var o=s.styles,a=s.text.length>t.options.maxHighlightLength?Qt(e.mode,i.state):null,l=we(t,s,i,!0);a&&(i.state=a),s.styles=l.styles;var u=s.styleClasses,h=l.classes;h?s.styleClasses=h:u&&(s.styleClasses=null);for(var c=!o||o.length!=s.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),_=0;!c&&_<o.length;++_)c=o[_]!=s.styles[_];c&&r.push(i.line),s.stateAfter=i.save(),i.nextLine()}else s.text.length<=t.options.maxHighlightLength&&Ce(t,s.text,i),s.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return jr(t,t.options.workDelay),!0})),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&Wr(t,(function(){for(var e=0;e<r.length;e++)Hi(t,r[e],"text")}))}}var Br=function(t,e,n){var i=t.display;this.viewport=e,this.visible=sr(i,t.doc,e),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Jn(t),this.force=n,this.dims=Wi(t),this.events=[]};function Hr(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Zn(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Zn(t)+"px",e.scrollbarsClipped=!0)}function Ur(t){if(t.hasFocus())return null;var e=R(I(t));if(!e||!M(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var i=F(t).getSelection();i.anchorNode&&i.extend&&M(t.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}function Kr(t){if(t&&t.activeElt&&t.activeElt!=R(j(t.activeElt))&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&M(document.body,t.anchorNode)&&M(document.body,t.focusNode))){var e=t.activeElt.ownerDocument,n=e.defaultView.getSelection(),i=e.createRange();i.setEnd(t.anchorNode,t.anchorOffset),i.collapse(!1),n.removeAllRanges(),n.addRange(i),n.extend(t.focusNode,t.focusOffset)}}function Vr(t,e){var n=t.display,i=t.doc;if(e.editorIsHidden)return Ui(t),!1;if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Gi(t))return!1;Zr(t)&&(Ui(t),e.dims=Wi(t));var r=i.first+i.size,s=Math.max(e.visible.from-t.options.viewportMargin,i.first),o=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFrom<s&&s-n.viewFrom<20&&(s=Math.max(i.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(r,n.viewTo)),De&&(s=on(t.doc,s),o=an(t.doc,o));var a=s!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Vi(t,s,o),n.viewOffset=hn(ee(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=Gi(t);if(!a&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Ur(t);return l>4&&(n.lineDiv.style.display="none"),$r(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Kr(u),L(n.cursorDiv),L(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,jr(t,400)),n.updateLineNumbers=null,!0}function Gr(t,e){for(var n=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Jn(t))i&&(e.visible=sr(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Yn(t.display)-ti(t),n.top)}),e.visible=sr(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!Vr(t,e))break;ir(t);var r=yr(t);Xi(t),xr(t,r),Yr(t,r),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 Xr(t,e){var n=new Br(t,e);if(Vr(t,n)){ir(t),Gr(t,n);var i=yr(t);Xi(t),xr(t,i),Yr(t,i),n.finish()}}function $r(t,e,n){var i=t.display,r=t.options.lineNumbers,s=i.lineDiv,o=s.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=i.view,h=i.viewFrom,c=0;c<u.length;c++){var _=u[c];if(_.hidden);else if(_.node&&_.node.parentNode==s){while(o!=_.node)o=a(o);var p=r&&null!=e&&e<=h&&_.lineNumber;_.changes&&(V(_.changes,"gutter")>-1&&(p=!1),Wn(t,_,h,n)),p&&(L(_.lineNumber),_.lineNumber.appendChild(document.createTextNode(le(t.options,h)))),o=_.node.nextSibling}else{var f=Un(t,_,h,n);s.insertBefore(f,o)}h+=_.size}while(o)o=a(o)}function qr(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",Rn(t,"gutterChanged",t)}function Yr(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+Zn(t)+"px"}function Qr(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=Pi(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,s=i+"px",o=0;o<n.length;o++)if(!n[o].hidden){t.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=s),n[o].gutterBackground&&(n[o].gutterBackground.style.left=s));var a=n[o].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=s}t.options.fixedGutter&&(e.gutters.style.left=i+r+"px")}}function Zr(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=le(t.options,e.first+e.size-1),i=t.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,o=r.offsetWidth-s;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(s,i.lineGutter.offsetWidth-o)+1,i.lineNumWidth=i.lineNumInnerWidth+o,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",qr(t.display),!0}return!1}function Jr(t,e){for(var n=[],i=!1,r=0;r<t.length;r++){var s=t[r],o=null;if("string"!=typeof s&&(o=s.style,s=s.className),"CodeMirror-linenumbers"==s){if(!e)continue;i=!0}n.push({className:s,style:o})}return e&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ts(t){var e=t.gutters,n=t.gutterSpecs;L(e),t.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],s=r.className,o=r.style,a=e.appendChild(A("div",null,"CodeMirror-gutter "+s));o&&(a.style.cssText=o),"CodeMirror-linenumbers"==s&&(t.lineGutter=a,a.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",qr(t)}function es(t){ts(t.display),Bi(t),Qr(t)}function ns(t,e,i,r){var s=this;this.input=i,s.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),s.scrollbarFiller.setAttribute("cm-not-content","true"),s.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),s.gutterFiller.setAttribute("cm-not-content","true"),s.lineDiv=N("div",null,"CodeMirror-code"),s.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),s.cursorDiv=A("div",null,"CodeMirror-cursors"),s.measure=A("div",null,"CodeMirror-measure"),s.lineMeasure=A("div",null,"CodeMirror-measure"),s.lineSpace=N("div",[s.measure,s.lineMeasure,s.selectionDiv,s.cursorDiv,s.lineDiv],null,"position: relative; outline: none");var u=N("div",[s.lineSpace],"CodeMirror-lines");s.mover=A("div",[u],null,"position: relative"),s.sizer=A("div",[s.mover],"CodeMirror-sizer"),s.sizerWidth=null,s.heightForcer=A("div",null,null,"position: absolute; height: "+G+"px; width: 1px;"),s.gutters=A("div",null,"CodeMirror-gutters"),s.lineGutter=null,s.scroller=A("div",[s.sizer,s.heightForcer,s.gutters],"CodeMirror-scroll"),s.scroller.setAttribute("tabIndex","-1"),s.wrapper=A("div",[s.scrollbarFiller,s.gutterFiller,s.scroller],"CodeMirror"),h&&105===c&&(s.wrapper.style.clipPath="inset(0px)"),s.wrapper.setAttribute("translate","no"),o&&a<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),l||n&&v||(s.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(s.wrapper):t(s.wrapper)),s.viewFrom=s.viewTo=e.first,s.reportedViewFrom=s.reportedViewTo=e.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=Jr(r.gutters,r.lineNumbers),ts(s),i.init(s)}Br.prototype.signal=function(t,e){Tt(t,e)&&this.events.push(arguments)},Br.prototype.finish=function(){for(var t=0;t<this.events.length;t++)xt.apply(null,this.events[t])};var is=0,rs=null;function ss(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function os(t){var e=ss(t);return e.x*=rs,e.y*=rs,e}function as(t,e){h&&102==c&&(null==t.display.chromeScrollHack?t.display.sizer.style.pointerEvents="none":clearTimeout(t.display.chromeScrollHack),t.display.chromeScrollHack=setTimeout((function(){t.display.chromeScrollHack=null,t.display.sizer.style.pointerEvents=""}),100));var i=ss(e),r=i.x,s=i.y,o=rs;0===e.deltaMode&&(r=e.deltaX,s=e.deltaY,o=1);var a=t.display,u=a.scroller,p=u.scrollWidth>u.clientWidth,f=u.scrollHeight>u.clientHeight;if(r&&p||s&&f){if(s&&y&&l)t:for(var d=e.target,g=a.view;d!=u;d=d.parentNode)for(var m=0;m<g.length;m++)if(g[m].node==d){t.display.currentWheelTarget=d;break t}if(r&&!n&&!_&&null!=o)return s&&f&&gr(t,Math.max(0,u.scrollTop+s*o)),vr(t,Math.max(0,u.scrollLeft+r*o)),(!s||s&&f)&&Ot(e),void(a.wheelStartX=null);if(s&&null!=o){var v=s*o,b=t.doc.scrollTop,w=b+a.wrapper.clientHeight;v<0?b=Math.max(0,b+v-50):w=Math.min(t.doc.height,w+v+50),Xr(t,{top:b,bottom:w})}is<20&&0!==e.deltaMode&&(null==a.wheelStartX?(a.wheelStartX=u.scrollLeft,a.wheelStartY=u.scrollTop,a.wheelDX=r,a.wheelDY=s,setTimeout((function(){if(null!=a.wheelStartX){var t=u.scrollLeft-a.wheelStartX,e=u.scrollTop-a.wheelStartY,n=e&&a.wheelDY&&e/a.wheelDY||t&&a.wheelDX&&t/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(rs=(rs*is+n)/(is+1),++is)}}),200)):(a.wheelDX+=r,a.wheelDY+=s))}}o?rs=-.53:n?rs=15:h?rs=-.7:p&&(rs=-1/3);var ls=function(t,e){this.ranges=t,this.primIndex=e};ls.prototype.primary=function(){return this.ranges[this.primIndex]},ls.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],i=t.ranges[e];if(!ce(n.anchor,i.anchor)||!ce(n.head,i.head))return!1}return!0},ls.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new us(_e(this.ranges[e].anchor),_e(this.ranges[e].head));return new ls(t,this.primIndex)},ls.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},ls.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(he(e,i.from())>=0&&he(t,i.to())<=0)return n}return-1};var us=function(t,e){this.anchor=t,this.head=e};function hs(t,e,n){var i=t&&t.options.selectionsMayTouch,r=e[n];e.sort((function(t,e){return he(t.from(),e.from())})),n=V(e,r);for(var s=1;s<e.length;s++){var o=e[s],a=e[s-1],l=he(a.to(),o.from());if(i&&!o.empty()?l>0:l>=0){var u=fe(a.from(),o.from()),h=pe(a.to(),o.to()),c=a.empty()?o.from()==o.head:a.from()==a.head;s<=n&&--n,e.splice(--s,2,new us(c?h:u,c?u:h))}}return new ls(e,n)}function cs(t,e){return new ls([new us(t,e||t)],0)}function _s(t){return t.text?ue(t.from.line+t.text.length-1,tt(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function ps(t,e){if(he(t,e.from)<0)return t;if(he(t,e.to)<=0)return _s(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=_s(e).ch-e.to.ch),ue(n,i)}function fs(t,e){for(var n=[],i=0;i<t.sel.ranges.length;i++){var r=t.sel.ranges[i];n.push(new us(ps(r.anchor,e),ps(r.head,e)))}return hs(t.cm,n,t.sel.primIndex)}function ds(t,e,n){return t.line==e.line?ue(n.line,t.ch-e.ch+n.ch):ue(n.line+(t.line-e.line),t.ch)}function gs(t,e,n){for(var i=[],r=ue(t.first,0),s=r,o=0;o<e.length;o++){var a=e[o],l=ds(a.from,r,s),u=ds(_s(a),r,s);if(r=a.to,s=u,"around"==n){var h=t.sel.ranges[o],c=he(h.head,h.anchor)<0;i[o]=new us(c?u:l,c?l:u)}else i[o]=new us(l,l)}return new ls(i,t.sel.primIndex)}function ms(t){t.doc.mode=$t(t.options,t.doc.modeOption),vs(t)}function vs(t){t.doc.iter((function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)})),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,jr(t,100),t.state.modeGen++,t.curOp&&Bi(t)}function ys(t,e){return 0==e.from.ch&&0==e.to.ch&&""==tt(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function bs(t,e,n,i){function r(t){return n?n[t]:null}function s(t,n,r){fn(t,n,r,i),Rn(t,"change",t,e)}function o(t,e){for(var n=[],s=t;s<e;++s)n.push(new pn(u[s],r(s),i));return n}var a=e.from,l=e.to,u=e.text,h=ee(t,a.line),c=ee(t,l.line),_=tt(u),p=r(u.length-1),f=l.line-a.line;if(e.full)t.insert(0,o(0,u.length)),t.remove(u.length,t.size-u.length);else if(ys(t,e)){var d=o(0,u.length-1);s(c,c.text,p),f&&t.remove(a.line,f),d.length&&t.insert(a.line,d)}else if(h==c)if(1==u.length)s(h,h.text.slice(0,a.ch)+_+h.text.slice(l.ch),p);else{var g=o(1,u.length-1);g.push(new pn(_+h.text.slice(l.ch),p,i)),s(h,h.text.slice(0,a.ch)+u[0],r(0)),t.insert(a.line+1,g)}else if(1==u.length)s(h,h.text.slice(0,a.ch)+u[0]+c.text.slice(l.ch),r(0)),t.remove(a.line+1,f);else{s(h,h.text.slice(0,a.ch)+u[0],r(0)),s(c,_+c.text.slice(l.ch),p);var m=o(1,u.length-1);f>1&&t.remove(a.line+1,f-1),t.insert(a.line+1,m)}Rn(t,"change",t,e)}function ws(t,e,n){function i(t,r,s){if(t.linked)for(var o=0;o<t.linked.length;++o){var a=t.linked[o];if(a.doc!=r){var l=s&&a.sharedHist;n&&!l||(e(a.doc,l),i(a.doc,t,l))}}}i(t,null,!0)}function xs(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,Ii(t),ms(t),ks(t),t.options.direction=e.direction,t.options.lineWrapping||_n(t),t.options.mode=e.modeOption,Bi(t)}function ks(t){("rtl"==t.doc.direction?D:O)(t.display.lineDiv,"CodeMirror-rtl")}function Cs(t){Wr(t,(function(){ks(t),Bi(t)}))}function Ts(t){this.done=[],this.undone=[],this.undoDepth=t?t.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t?t.maxGeneration:1}function Ss(t,e){var n={from:_e(e.from),to:_s(e),text:ne(t,e.from,e.to)};return Rs(t,n,e.from.line,e.to.line+1),ws(t,(function(t){return Rs(t,n,e.from.line,e.to.line+1)}),!0),n}function Os(t){while(t.length){var e=tt(t);if(!e.ranges)break;t.pop()}}function Ls(t,e){return e?(Os(t.done),tt(t.done)):t.done.length&&!tt(t.done).ranges?tt(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),tt(t.done)):void 0}function Es(t,e,n,i){var r=t.history;r.undone.length=0;var s,o,a=+new Date;if((r.lastOp==i||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(s=Ls(r,r.lastOp==i)))o=tt(s.changes),0==he(e.from,e.to)&&0==he(e.from,o.to)?o.to=_s(e):s.changes.push(Ss(t,e));else{var l=tt(r.done);l&&l.ranges||Ms(t.sel,r.done),s={changes:[Ss(t,e)],generation:r.generation},r.done.push(s);while(r.done.length>r.undoDepth)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,o||xt(t,"historyAdded")}function As(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Ns(t,e,n,i){var r=t.history,s=i&&i.origin;n==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||As(t,s,tt(r.done),e))?r.done[r.done.length-1]=e:Ms(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=n,i&&!1!==i.clearRedo&&Os(r.undone)}function Ms(t,e){var n=tt(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Rs(t,e,n,i){var r=e["spans_"+t.id],s=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),(function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[s]=n.markedSpans),++s}))}function Ds(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function Ws(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var i=[],r=0;r<e.text.length;++r)i.push(Ds(n[r]));return i}function Ps(t,e){var n=Ws(t,e),i=Ue(t,e);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var s=n[r],o=i[r];if(s&&o)t:for(var a=0;a<o.length;++a){for(var l=o[a],u=0;u<s.length;++u)if(s[u].marker==l.marker)continue t;s.push(l)}else o&&(n[r]=o)}return n}function zs(t,e,n){for(var i=[],r=0;r<t.length;++r){var s=t[r];if(s.ranges)i.push(n?ls.prototype.deepCopy.call(s):s);else{var o=s.changes,a=[];i.push({changes:a});for(var l=0;l<o.length;++l){var u=o[l],h=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),e)for(var c in u)(h=c.match(/^spans_(\d+)$/))&&V(e,Number(h[1]))>-1&&(tt(a)[c]=u[c],delete u[c])}}}return i}function Is(t,e,n,i){if(i){var r=t.anchor;if(n){var s=he(e,r)<0;s!=he(n,r)<0?(r=e,e=n):s!=he(e,n)<0&&(e=n)}return new us(r,e)}return new us(n||e,e)}function js(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),Vs(t,new ls([Is(t.sel.primary(),e,n,r)],0),i)}function Fs(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),s=0;s<t.sel.ranges.length;s++)i[s]=Is(t.sel.ranges[s],e[s],null,r);var o=hs(t.cm,i,t.sel.primIndex);Vs(t,o,n)}function Bs(t,e,n,i){var r=t.sel.ranges.slice(0);r[e]=n,Vs(t,hs(t.cm,r,t.sel.primIndex),i)}function Hs(t,e,n,i){Vs(t,cs(e,n),i)}function Us(t,e,n){var i={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new us(ge(t,e[n].anchor),ge(t,e[n].head))},origin:n&&n.origin};return xt(t,"beforeSelectionChange",t,i),t.cm&&xt(t.cm,"beforeSelectionChange",t.cm,i),i.ranges!=e.ranges?hs(t.cm,i.ranges,i.ranges.length-1):e}function Ks(t,e,n){var i=t.history.done,r=tt(i);r&&r.ranges?(i[i.length-1]=e,Gs(t,e,n)):Vs(t,e,n)}function Vs(t,e,n){Gs(t,e,n),Ns(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function Gs(t,e,n){(Tt(t,"beforeSelectionChange")||t.cm&&Tt(t.cm,"beforeSelectionChange"))&&(e=Us(t,e,n));var i=n&&n.bias||(he(e.primary().head,t.sel.primary().head)<0?-1:1);Xs(t,qs(t,e,i,!0)),n&&!1===n.scroll||!t.cm||"nocursor"==t.cm.getOption("readOnly")||cr(t.cm)}function Xs(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,Ct(t.cm)),Rn(t,"cursorActivity",t))}function $s(t){Xs(t,qs(t,t.sel,null,!1))}function qs(t,e,n,i){for(var r,s=0;s<e.ranges.length;s++){var o=e.ranges[s],a=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[s],l=Qs(t,o.anchor,a&&a.anchor,n,i),u=o.head==o.anchor?l:Qs(t,o.head,a&&a.head,n,i);(r||l!=o.anchor||u!=o.head)&&(r||(r=e.ranges.slice(0,s)),r[s]=new us(l,u))}return r?hs(t.cm,r,e.primIndex):e}function Ys(t,e,n,i,r){var s=ee(t,e.line);if(s.markedSpans)for(var o=0;o<s.markedSpans.length;++o){var a=s.markedSpans[o],l=a.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,h="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==a.from||(u?a.from<=e.ch:a.from<e.ch))&&(null==a.to||(h?a.to>=e.ch:a.to>e.ch))){if(r&&(xt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(s.markedSpans){--o;continue}break}if(!l.atomic)continue;if(n){var c=l.find(i<0?1:-1),_=void 0;if((i<0?h:u)&&(c=Zs(t,c,-i,c&&c.line==e.line?s:null)),c&&c.line==e.line&&(_=he(c,n))&&(i<0?_<0:_>0))return Ys(t,c,e,i,r)}var p=l.find(i<0?-1:1);return(i<0?u:h)&&(p=Zs(t,p,i,p.line==e.line?s:null)),p?Ys(t,p,e,i,r):null}}return e}function Qs(t,e,n,i,r){var s=i||1,o=Ys(t,e,n,s,r)||!r&&Ys(t,e,n,s,!0)||Ys(t,e,n,-s,r)||!r&&Ys(t,e,n,-s,!0);return o||(t.cantEdit=!0,ue(t.first,0))}function Zs(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?ge(t,ue(e.line-1)):null:n>0&&e.ch==(i||ee(t,e.line)).text.length?e.line<t.first+t.size-1?ue(e.line+1,0):null:new ue(e.line,e.ch+n)}function Js(t){t.setSelection(ue(t.firstLine(),0),ue(t.lastLine()),$)}function to(t,e,n){var i={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(e,n,r,s){e&&(i.from=ge(t,e)),n&&(i.to=ge(t,n)),r&&(i.text=r),void 0!==s&&(i.origin=s)}),xt(t,"beforeChange",t,i),t.cm&&xt(t.cm,"beforeChange",t.cm,i),i.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function eo(t,e,n){if(t.cm){if(!t.cm.curOp)return Pr(t.cm,eo)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(Tt(t,"beforeChange")||t.cm&&Tt(t.cm,"beforeChange"))||(e=to(t,e,!0),e)){var i=Re&&!n&&Ve(t,e.from,e.to);if(i)for(var r=i.length-1;r>=0;--r)no(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else no(t,e)}}function no(t,e){if(1!=e.text.length||""!=e.text[0]||0!=he(e.from,e.to)){var n=fs(t,e);Es(t,e,n,t.cm?t.cm.curOp.id:NaN),so(t,e,n,Ue(t,e));var i=[];ws(t,(function(t,n){n||-1!=V(i,t.history)||(ho(t.history,e),i.push(t.history)),so(t,e,null,Ue(t,e))}))}}function io(t,e,n){var i=t.cm&&t.cm.state.suppressEdits;if(!i||n){for(var r,s=t.history,o=t.sel,a="undo"==e?s.done:s.undone,l="undo"==e?s.undone:s.done,u=0;u<a.length;u++)if(r=a[u],n?r.ranges&&!r.equals(t.sel):!r.ranges)break;if(u!=a.length){for(s.lastOrigin=s.lastSelOrigin=null;;){if(r=a.pop(),!r.ranges){if(i)return void a.push(r);break}if(Ms(r,l),n&&!r.equals(t.sel))return void Vs(t,r,{clearRedo:!1});o=r}var h=[];Ms(o,l),l.push({changes:h,generation:s.generation}),s.generation=r.generation||++s.maxGeneration;for(var c=Tt(t,"beforeChange")||t.cm&&Tt(t.cm,"beforeChange"),_=function(n){var i=r.changes[n];if(i.origin=e,c&&!to(t,i,!1))return a.length=0,{};h.push(Ss(t,i));var s=n?fs(t,i):tt(a);so(t,i,s,Ps(t,i)),!n&&t.cm&&t.cm.scrollIntoView({from:i.from,to:_s(i)});var o=[];ws(t,(function(t,e){e||-1!=V(o,t.history)||(ho(t.history,i),o.push(t.history)),so(t,i,null,Ps(t,i))}))},p=r.changes.length-1;p>=0;--p){var f=_(p);if(f)return f.v}}}}function ro(t,e){if(0!=e&&(t.first+=e,t.sel=new ls(et(t.sel.ranges,(function(t){return new us(ue(t.anchor.line+e,t.anchor.ch),ue(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Bi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;i<n.viewTo;i++)Hi(t.cm,i,"gutter")}}function so(t,e,n,i){if(t.cm&&!t.cm.curOp)return Pr(t.cm,so)(t,e,n,i);if(e.to.line<t.first)ro(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var r=e.text.length-1-(t.first-e.from.line);ro(t,r),e={from:ue(t.first,0),to:ue(e.to.line+r,e.to.ch),text:[tt(e.text)],origin:e.origin}}var s=t.lastLine();e.to.line>s&&(e={from:e.from,to:ue(s,ee(t,s).text.length),text:[e.text[0]],origin:e.origin}),e.removed=ne(t,e.from,e.to),n||(n=fs(t,e)),t.cm?oo(t.cm,e,i):bs(t,e,i),Gs(t,n,$),t.cantEdit&&Qs(t,ue(t.firstLine(),0))&&(t.cantEdit=!1)}}function oo(t,e,n){var i=t.doc,r=t.display,s=e.from,o=e.to,a=!1,l=s.line;t.options.lineWrapping||(l=se(nn(ee(i,s.line))),i.iter(l,o.line+1,(function(t){if(t==r.maxLine)return a=!0,!0}))),i.sel.contains(e.from,e.to)>-1&&Ct(t),bs(i,e,n,zi(t)),t.options.lineWrapping||(i.iter(l,s.line+e.text.length,(function(t){var e=cn(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,a=!1)})),a&&(t.curOp.updateMaxLine=!0)),Me(i,s.line),jr(t,400);var u=e.text.length-(o.line-s.line)-1;e.full?Bi(t):s.line!=o.line||1!=e.text.length||ys(t.doc,e)?Bi(t,s.line,o.line+1,u):Hi(t,s.line,"text");var h=Tt(t,"changes"),c=Tt(t,"change");if(c||h){var _={from:s,to:o,text:e.text,removed:e.removed,origin:e.origin};c&&Rn(t,"change",t,_),h&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(_)}t.display.selForContextMenu=null}function ao(t,e,n,i,r){var s;i||(i=n),he(i,n)<0&&(s=[i,n],n=s[0],i=s[1]),"string"==typeof e&&(e=t.splitLines(e)),eo(t,{from:n,to:i,text:e,origin:r})}function lo(t,e,n,i){n<t.line?t.line+=i:e<t.line&&(t.line=e,t.ch=0)}function uo(t,e,n,i){for(var r=0;r<t.length;++r){var s=t[r],o=!0;if(s.ranges){s.copied||(s=t[r]=s.deepCopy(),s.copied=!0);for(var a=0;a<s.ranges.length;a++)lo(s.ranges[a].anchor,e,n,i),lo(s.ranges[a].head,e,n,i)}else{for(var l=0;l<s.changes.length;++l){var u=s.changes[l];if(n<u.from.line)u.from=ue(u.from.line+i,u.from.ch),u.to=ue(u.to.line+i,u.to.ch);else if(e<=u.to.line){o=!1;break}}o||(t.splice(0,r+1),r=0)}}}function ho(t,e){var n=e.from.line,i=e.to.line,r=e.text.length-(i-n)-1;uo(t.done,n,i,r),uo(t.undone,n,i,r)}function co(t,e,n,i){var r=e,s=e;return"number"==typeof e?s=ee(t,de(t,e)):r=se(e),null==r?null:(i(s,r)&&t.cm&&Hi(t.cm,r,n),s)}function _o(t){this.lines=t,this.parent=null;for(var e=0,n=0;n<t.length;++n)t[n].parent=this,e+=t[n].height;this.height=e}function po(t){this.children=t;for(var e=0,n=0,i=0;i<t.length;++i){var r=t[i];e+=r.chunkSize(),n+=r.height,r.parent=this}this.size=e,this.height=n,this.parent=null}us.prototype.from=function(){return fe(this.anchor,this.head)},us.prototype.to=function(){return pe(this.anchor,this.head)},us.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},_o.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,i=t+e;n<i;++n){var r=this.lines[n];this.height-=r.height,dn(r),Rn(r,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var i=0;i<e.length;++i)e[i].parent=this},iterN:function(t,e,n){for(var i=t+e;t<i;++t)if(n(this.lines[t]))return!0}},po.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(t<r){var s=Math.min(e,r-t),o=i.height;if(i.removeInner(t,s),this.height-=o-i.height,r==s&&(this.children.splice(n--,1),i.parent=null),0==(e-=s))break;t=0}else t-=r}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof _o))){var a=[];this.collapse(a),this.children=[new _o(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],s=r.chunkSize();if(t<=s){if(r.insertInner(t,e,n),r.lines&&r.lines.length>50){for(var o=r.lines.length%25+25,a=o;a<r.lines.length;){var l=new _o(r.lines.slice(a,a+=25));r.height-=l.height,this.children.splice(++i,0,l),l.parent=this}r.lines=r.lines.slice(0,o),this.maybeSpill()}break}t-=s}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new po(e);if(t.parent){t.size-=n.size,t.height-=n.height;var i=V(t.parent.children,t);t.parent.children.splice(i+1,0,n)}else{var r=new po(t.children);r.parent=t,t.children=[r,n],t=r}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],s=r.chunkSize();if(t<s){var o=Math.min(e,s-t);if(r.iterN(t,o,n))return!0;if(0==(e-=o))break;t=0}else t-=s}}};var fo=function(t,e,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=t,this.node=e};function go(t,e,n){hn(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&hr(t,n)}function mo(t,e,n,i){var r=new fo(t,n,i),s=t.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),co(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length,Math.max(0,r.insertAt)),0,r),r.line=e,s&&!ln(t,e)){var i=hn(e)<t.scrollTop;re(e,e.height+Xn(r)),i&&hr(s,r.height),s.curOp.forceUpdate=!0}return!0})),s&&Rn(s,"lineWidgetAdded",s,r,"number"==typeof e?e:se(e)),r}fo.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,i=se(n);if(null!=i&&e){for(var r=0;r<e.length;++r)e[r]==this&&e.splice(r--,1);e.length||(n.widgets=null);var s=Xn(this);re(n,Math.max(0,n.height-s)),t&&(Wr(t,(function(){go(t,n,-s),Hi(t,i,"widget")})),Rn(t,"lineWidgetCleared",t,this,i))}},fo.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=Xn(this)-e;r&&(ln(this.doc,i)||re(i,i.height+r),n&&Wr(n,(function(){n.curOp.forceUpdate=!0,go(n,i,r),Rn(n,"lineWidgetChanged",n,t,se(i))})))},St(fo);var vo=0,yo=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++vo};function bo(t,e,n,i,r){if(i&&i.shared)return xo(t,e,n,i,r);if(t.cm&&!t.cm.curOp)return Pr(t.cm,bo)(t,e,n,i,r);var s=new yo(t,r),o=he(e,n);if(i&&H(i,s,!1),o>0||0==o&&!1!==s.clearWhenEmpty)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=N("span",[s.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(en(t,e.line,e,n,s)||e.line!=n.line&&en(t,n.line,e,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Pe()}s.addToHistory&&Es(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(i){u&&s.collapsed&&!u.options.lineWrapping&&nn(i)==u.display.maxLine&&(a=!0),s.collapsed&&l!=e.line&&re(i,0),Fe(i,new ze(s,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l})),s.collapsed&&t.iter(e.line,n.line+1,(function(e){ln(t,e)&&re(e,0)})),s.clearOnEnter&&yt(s,"beforeCursorEnter",(function(){return s.clear()})),s.readOnly&&(We(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),s.collapsed&&(s.id=++vo,s.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),s.collapsed)Bi(u,e.line,n.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var h=e.line;h<=n.line;h++)Hi(u,h,"text");s.atomic&&$s(u.doc),Rn(u,"markerAdded",u,s)}return s}yo.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Or(t),Tt(this,"clear")){var n=this.find();n&&Rn(this,"clear",n.from,n.to)}for(var i=null,r=null,s=0;s<this.lines.length;++s){var o=this.lines[s],a=Ie(o.markedSpans,this);t&&!this.collapsed?Hi(t,se(o),"text"):t&&(null!=a.to&&(r=se(o)),null!=a.from&&(i=se(o))),o.markedSpans=je(o.markedSpans,a),null==a.from&&this.collapsed&&!ln(this.doc,o)&&t&&re(o,Ri(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=nn(this.lines[l]),h=cn(u);h>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=h,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Bi(t,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&$s(t.doc)),t&&Rn(t,"markerCleared",t,this,i,r),e&&Lr(t),this.parent&&this.parent.clear()}},yo.prototype.find=function(t,e){var n,i;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r<this.lines.length;++r){var s=this.lines[r],o=Ie(s.markedSpans,this);if(null!=o.from&&(n=ue(e?s:se(s),o.from),-1==t))return n;if(null!=o.to&&(i=ue(e?s:se(s),o.to),1==t))return i}return n&&{from:n,to:i}},yo.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,i=this.doc.cm;e&&i&&Wr(i,(function(){var r=e.line,s=se(e.line),o=si(i,s);if(o&&(fi(o),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!ln(n.doc,r)&&null!=n.height){var a=n.height;n.height=null;var l=Xn(n)-a;l&&re(r,r.height+l)}Rn(i,"markerChanged",i,t)}))},yo.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=V(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},yo.prototype.detachLine=function(t){if(this.lines.splice(V(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},St(yo);var wo=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function xo(t,e,n,i,r){i=H(i),i.shared=!1;var s=[bo(t,e,n,i,r)],o=s[0],a=i.widgetNode;return ws(t,(function(t){a&&(i.widgetNode=a.cloneNode(!0)),s.push(bo(t,ge(t,e),ge(t,n),i,r));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;o=tt(s)})),new wo(s,o)}function ko(t){return t.findMarks(ue(t.first,0),t.clipPos(ue(t.lastLine())),(function(t){return t.parent}))}function Co(t,e){for(var n=0;n<e.length;n++){var i=e[n],r=i.find(),s=t.clipPos(r.from),o=t.clipPos(r.to);if(he(s,o)){var a=bo(t,s,o,i.primary,i.primary.type);i.markers.push(a),a.parent=i}}}function To(t){for(var e=function(e){var n=t[e],i=[n.primary.doc];ws(n.primary.doc,(function(t){return i.push(t)}));for(var r=0;r<n.markers.length;r++){var s=n.markers[r];-1==V(i,s.doc)&&(s.parent=null,n.markers.splice(r--,1))}},n=0;n<t.length;n++)e(n)}wo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();Rn(this,"clear")}},wo.prototype.find=function(t,e){return this.primary.find(t,e)},St(wo);var So=0,Oo=function(t,e,n,i,r){if(!(this instanceof Oo))return new Oo(t,e,n,i,r);null==n&&(n=0),po.call(this,[new _o([new pn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var s=ue(n,0);this.sel=cs(s),this.history=new Ts(null),this.id=++So,this.modeOption=e,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),bs(this,{from:s,to:s,text:t}),Vs(this,cs(s),$)};Oo.prototype=rt(po.prototype,{constructor:Oo,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,i=0;i<e.length;++i)n+=e[i].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=ie(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:Ir((function(t){var e=ue(this.first,0),n=this.first+this.size-1;eo(this,{from:e,to:ue(n,ee(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&_r(this.cm,0,0),Vs(this,cs(e),$)})),replaceRange:function(t,e,n,i){e=ge(this,e),n=n?ge(this,n):e,ao(this,t,e,n,i)},getRange:function(t,e,n){var i=ne(this,ge(this,t),ge(this,e));return!1===n?i:""===n?i.join(""):i.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(ae(this,t))return ee(this,t)},getLineNumber:function(t){return se(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=ee(this,t)),nn(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return ge(this,t)},getCursor:function(t){var e,n=this.sel.primary();return e=null==t||"head"==t?n.head:"anchor"==t?n.anchor:"end"==t||"to"==t||!1===t?n.to():n.from(),e},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ir((function(t,e,n){Hs(this,ge(this,"number"==typeof t?ue(t,e||0):t),null,n)})),setSelection:Ir((function(t,e,n){Hs(this,ge(this,t),ge(this,e||t),n)})),extendSelection:Ir((function(t,e,n){js(this,ge(this,t),e&&ge(this,e),n)})),extendSelections:Ir((function(t,e){Fs(this,ve(this,t),e)})),extendSelectionsBy:Ir((function(t,e){var n=et(this.sel.ranges,t);Fs(this,ve(this,n),e)})),setSelections:Ir((function(t,e,n){if(t.length){for(var i=[],r=0;r<t.length;r++)i[r]=new us(ge(this,t[r].anchor),ge(this,t[r].head||t[r].anchor));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Vs(this,hs(this.cm,i,e),n)}})),addSelection:Ir((function(t,e,n){var i=this.sel.ranges.slice(0);i.push(new us(ge(this,t),ge(this,e||t))),Vs(this,hs(this.cm,i,i.length-1),n)})),getSelection:function(t){for(var e,n=this.sel.ranges,i=0;i<n.length;i++){var r=ne(this,n[i].from(),n[i].to());e=e?e.concat(r):r}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=ne(this,n[i].from(),n[i].to());!1!==t&&(r=r.join(t||this.lineSeparator())),e[i]=r}return e},replaceSelection:function(t,e,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=t;this.replaceSelections(i,e,n||"+input")},replaceSelections:Ir((function(t,e,n){for(var i=[],r=this.sel,s=0;s<r.ranges.length;s++){var o=r.ranges[s];i[s]={from:o.from(),to:o.to(),text:this.splitLines(t[s]),origin:n}}for(var a=e&&"end"!=e&&gs(this,i,e),l=i.length-1;l>=0;l--)eo(this,i[l]);a?Ks(this,a):this.cm&&cr(this.cm)})),undo:Ir((function(){io(this,"undo")})),redo:Ir((function(){io(this,"redo")})),undoSelection:Ir((function(){io(this,"undo",!0)})),redoSelection:Ir((function(){io(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,i=0;i<t.done.length;i++)t.done[i].ranges||++e;for(var r=0;r<t.undone.length;r++)t.undone[r].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new Ts(this.history),ws(this,(function(e){return e.history=t.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:zs(this.history.done),undone:zs(this.history.undone)}},setHistory:function(t){var e=this.history=new Ts(this.history);e.done=zs(t.done.slice(0),null,!0),e.undone=zs(t.undone.slice(0),null,!0)},setGutterMarker:Ir((function(t,e,n){return co(this,t,"gutter",(function(t){var i=t.gutterMarkers||(t.gutterMarkers={});return i[e]=n,!n&<(i)&&(t.gutterMarkers=null),!0}))})),clearGutter:Ir((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&co(e,n,"gutter",(function(){return n.gutterMarkers[t]=null,lt(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!ae(this,t))return null;if(e=t,t=ee(this,t),!t)return null}else if(e=se(t),null==e)return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:Ir((function(t,e,n){return co(this,t,"gutter"==e?"gutter":"class",(function(t){var i="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[i]){if(T(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0}))})),removeLineClass:Ir((function(t,e,n){return co(this,t,"gutter"==e?"gutter":"class",(function(t){var i="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",r=t[i];if(!r)return!1;if(null==n)t[i]=null;else{var s=r.match(T(n));if(!s)return!1;var o=s.index+s[0].length;t[i]=r.slice(0,s.index)+(s.index&&o!=r.length?" ":"")+r.slice(o)||null}return!0}))})),addLineWidget:Ir((function(t,e,n){return mo(this,t,e,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return bo(this,ge(this,t),ge(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return t=ge(this,t),bo(this,t,t,n,"bookmark")},findMarksAt:function(t){t=ge(this,t);var e=[],n=ee(this,t.line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=t.ch)&&(null==r.to||r.to>=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=ge(this,t),e=ge(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,(function(s){var o=s.markedSpans;if(o)for(var a=0;a<o.length;a++){var l=o[a];null!=l.to&&r==t.line&&t.ch>=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&t.push(n[i].marker)})),t},posFromIndex:function(t){var e,n=this.first,i=this.lineSeparator().length;return this.iter((function(r){var s=r.text.length+i;if(s>t)return e=t,!0;t-=s,++n})),ge(this,ue(n,e))},indexFromPos:function(t){t=ge(this,t);var e=t.ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,(function(t){e+=t.text.length+n})),e},copy:function(t){var e=new Oo(ie(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var i=new Oo(ie(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:t.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],Co(i,ko(this)),i},unlinkDoc:function(t){if(t instanceof Ba&&(t=t.doc),this.linked)for(var e=0;e<this.linked.length;++e){var n=this.linked[e];if(n.doc==t){this.linked.splice(e,1),t.unlinkDoc(this),To(ko(this));break}}if(t.history==this.history){var i=[t.id];ws(t,(function(t){return i.push(t.id)}),!0),t.history=new Ts(null),t.history.done=zs(this.history.done,i),t.history.undone=zs(this.history.undone,i)}},iterLinkedDocs:function(t){ws(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):It(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Ir((function(t){"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&Cs(this.cm))}))}),Oo.prototype.eachLine=Oo.prototype.iter;var Lo=0;function Eo(t){var e=this;if(Mo(e),!kt(e,t)&&!$n(e.display,t)){Ot(t),o&&(Lo=+new Date);var n=ji(e,t,!0),i=t.dataTransfer.files;if(n&&!e.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,s=Array(r),a=0,l=function(){++a==r&&Pr(e,(function(){n=ge(e.doc,n);var t={from:n,to:n,text:e.doc.splitLines(s.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};eo(e.doc,t),Ks(e.doc,cs(ge(e.doc,n),ge(e.doc,_s(t))))}))()},u=function(t,n){if(e.options.allowDropFileTypes&&-1==V(e.options.allowDropFileTypes,t.type))l();else{var i=new FileReader;i.onerror=function(){return l()},i.onload=function(){var t=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(s[n]=t),l()},i.readAsText(t)}},h=0;h<i.length;h++)u(i[h],h);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-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 _;if(e.state.draggingText&&!e.state.draggingText.copy&&(_=e.listSelections()),Gs(e.doc,cs(n,n)),_)for(var p=0;p<_.length;++p)ao(e.doc,"",_[p].anchor,_[p].head,"drag");e.replaceSelection(c,"around","paste"),e.display.input.focus()}}catch(f){}}}}function Ao(t,e){if(o&&(!t.state.draggingText||+new Date-Lo<100))At(e);else if(!kt(t,e)&&!$n(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!p)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",_&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),_&&n.parentNode.removeChild(n)}}function No(t,e){var n=ji(t,e);if(n){var i=document.createDocumentFragment();qi(t,n,i),t.display.dragCursor||(t.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),E(t.display.dragCursor,i)}}function Mo(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Ro(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<e.length;i++){var r=e[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation((function(){for(var e=0;e<n.length;e++)t(n[e])}))}}var Do=!1;function Wo(){Do||(Po(),Do=!0)}function Po(){var t;yt(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,Ro(zo)}),100))})),yt(window,"blur",(function(){return Ro(nr)}))}function zo(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var Io={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},jo=0;jo<10;jo++)Io[jo+48]=Io[jo+96]=String(jo);for(var Fo=65;Fo<=90;Fo++)Io[Fo]=String.fromCharCode(Fo);for(var Bo=1;Bo<=12;Bo++)Io[Bo+111]=Io[Bo+63235]="F"+Bo;var Ho={};function Uo(t){var e,n,i,r,s=t.split(/-(?!$)/);t=s[s.length-1];for(var o=0;o<s.length-1;o++){var a=s[o];if(/^(cmd|meta|m)$/i.test(a))r=!0;else if(/^a(lt)?$/i.test(a))e=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);i=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),r&&(t="Cmd-"+t),i&&(t="Shift-"+t),t}function Ko(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete t[n];continue}for(var r=et(n.split(" "),Uo),s=0;s<r.length;s++){var o=void 0,a=void 0;s==r.length-1?(a=r.join(" "),o=i):(a=r.slice(0,s+1).join(" "),o="...");var l=e[a];if(l){if(l!=o)throw new Error("Inconsistent bindings for "+a)}else e[a]=o}delete t[n]}for(var u in e)t[u]=e[u];return t}function Vo(t,e,n,i){e=qo(e);var r=e.call?e.call(t,i):e[t];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Vo(t,e.fallthrough,n,i);for(var s=0;s<e.fallthrough.length;s++){var o=Vo(t,e.fallthrough[s],n,i);if(o)return o}}}function Go(t){var e="string"==typeof t?t:Io[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function Xo(t,e,n){var i=t;return e.altKey&&"Alt"!=i&&(t="Alt-"+t),(k?e.metaKey:e.ctrlKey)&&"Ctrl"!=i&&(t="Ctrl-"+t),(k?e.ctrlKey:e.metaKey)&&"Mod"!=i&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=i&&(t="Shift-"+t),t}function $o(t,e){if(_&&34==t.keyCode&&t["char"])return!1;var n=Io[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),Xo(n,t,e))}function qo(t){return"string"==typeof t?Ho[t]:t}function Yo(t,e){for(var n=t.doc.sel.ranges,i=[],r=0;r<n.length;r++){var s=e(n[r]);while(i.length&&he(s.from,tt(i).to)<=0){var o=i.pop();if(he(o.from,s.from)<0){s.from=o.from;break}}i.push(s)}Wr(t,(function(){for(var e=i.length-1;e>=0;e--)ao(t.doc,"",i[e].from,i[e].to,"+delete");cr(t)}))}function Qo(t,e,n){var i=ct(t.text,e+n,n);return i<0||i>t.text.length?null:i}function Zo(t,e,n){var i=Qo(t,e.ch,n);return null==i?null:new ue(e.line,i,n<0?"after":"before")}function Jo(t,e,n,i,r){if(t){"rtl"==e.doc.direction&&(r=-r);var s=mt(n,e.doc.direction);if(s){var o,a=r<0?tt(s):s[0],l=r<0==(1==a.level),u=l?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var h=oi(e,n);o=r<0?n.text.length-1:0;var c=ai(e,h,o).top;o=_t((function(t){return ai(e,h,t).top==c}),r<0==(1==a.level)?a.from:a.to-1,o),"before"==u&&(o=Qo(n,o,1))}else o=r<0?a.to:a.from;return new ue(i,o,u)}}return new ue(i,r<0?n.text.length:0,r<0?"before":"after")}function ta(t,e,n,i){var r=mt(e,t.doc.direction);if(!r)return Zo(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var s=dt(r,n.ch,n.sticky),o=r[s];if("ltr"==t.doc.direction&&o.level%2==0&&(i>0?o.to>n.ch:o.from<n.ch))return Zo(e,n,i);var a,l=function(t,n){return Qo(e,t instanceof ue?t.ch:t,n)},u=function(n){return t.options.lineWrapping?(a=a||oi(t,e),Li(t,e,a,n)):{begin:0,end:e.text.length}},h=u("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==o.level){var c=1==o.level==i<0,_=l(n,c?1:-1);if(null!=_&&(c?_<=o.to&&_<=h.end:_>=o.from&&_>=h.begin)){var p=c?"before":"after";return new ue(n.line,_,p)}}var f=function(t,e,i){for(var s=function(t,e){return e?new ue(n.line,l(t,1),"before"):new ue(n.line,t,"after")};t>=0&&t<r.length;t+=e){var o=r[t],a=e>0==(1!=o.level),u=a?i.begin:l(i.end,-1);if(o.from<=u&&u<o.to)return s(u,a);if(u=a?o.from:l(o.to,-1),i.begin<=u&&u<i.end)return s(u,a)}},d=f(s+i,i,h);if(d)return d;var g=i>0?h.end:l(h.begin,-1);return null==g||i>0&&g==e.text.length||(d=f(i>0?0:r.length-1,i,u(g)),!d)?null:d}Ho.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"},Ho.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"},Ho.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ho.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"]},Ho["default"]=y?Ho.macDefault:Ho.pcDefault;var ea={selectAll:Js,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),$)},killLine:function(t){return Yo(t,(function(e){if(e.empty()){var n=ee(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:ue(e.head.line+1,0)}:{from:e.head,to:ue(e.head.line,n)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return Yo(t,(function(e){return{from:ue(e.from().line,0),to:ge(t.doc,ue(e.to().line+1,0))}}))},delLineLeft:function(t){return Yo(t,(function(t){return{from:ue(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Yo(t,(function(e){var n=t.charCoords(e.head,"div").top+5,i=t.coordsChar({left:0,top:n},"div");return{from:i,to:e.from()}}))},delWrappedLineRight:function(t){return Yo(t,(function(e){var n=t.charCoords(e.head,"div").top+5,i=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:i}}))},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(ue(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(ue(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return na(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return ra(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return ia(t,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")}),Y)},goLineLeft:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")}),Y)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5,i=t.coordsChar({left:0,top:n},"div");return i.ch<t.getLine(i.line).search(/\S/)?ra(t,e.head):i}),Y)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),i=t.options.tabSize,r=0;r<n.length;r++){var s=n[r].from(),o=U(t.getLine(s.line),s.ch,i);e.push(J(i-o%i))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Wr(t,(function(){for(var e=t.listSelections(),n=[],i=0;i<e.length;i++)if(e[i].empty()){var r=e[i].head,s=ee(t.doc,r.line).text;if(s)if(r.ch==s.length&&(r=new ue(r.line,r.ch-1)),r.ch>0)r=new ue(r.line,r.ch+1),t.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),ue(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var o=ee(t.doc,r.line-1).text;o&&(r=new ue(r.line,1),t.replaceRange(s.charAt(0)+t.doc.lineSeparator()+o.charAt(o.length-1),ue(r.line-1,o.length-1),r,"+transpose"))}n.push(new us(r,r))}t.setSelections(n)}))},newlineAndIndent:function(t){return Wr(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 i=0;i<e.length;i++)t.indentLine(e[i].from().line,null,!0);cr(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function na(t,e){var n=ee(t.doc,e),i=nn(n);return i!=n&&(e=se(i)),Jo(!0,t,i,e,1)}function ia(t,e){var n=ee(t.doc,e),i=rn(n);return i!=n&&(e=se(i)),Jo(!0,t,n,e,-1)}function ra(t,e){var n=na(t,e.line),i=ee(t.doc,n.line),r=mt(i,t.doc.direction);if(!r||0==r[0].level){var s=Math.max(n.ch,i.text.search(/\S/)),o=e.line==n.line&&e.ch<=s&&e.ch;return ue(n.line,o?0:s,n.sticky)}return n}function sa(t,e,n){if("string"==typeof e&&(e=ea[e],!e))return!1;t.display.input.ensurePolled();var i=t.display.shift,r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),r=e(t)!=X}finally{t.display.shift=i,t.state.suppressEdits=!1}return r}function oa(t,e,n){for(var i=0;i<t.state.keyMaps.length;i++){var r=Vo(e,t.state.keyMaps[i],n,t);if(r)return r}return t.options.extraKeys&&Vo(e,t.options.extraKeys,n,t)||Vo(e,t.options.keyMap,n,t)}var aa=new K;function la(t,e,n,i){var r=t.state.keySeq;if(r){if(Go(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:aa.set(50,(function(){t.state.keySeq==r&&(t.state.keySeq=null,t.display.input.reset())})),ua(t,r+" "+e,n,i))return!0}return ua(t,e,n,i)}function ua(t,e,n,i){var r=oa(t,e,i);return"multi"==r&&(t.state.keySeq=e),"handled"==r&&Rn(t,"keyHandled",t,e,n),"handled"!=r&&"multi"!=r||(Ot(n),Zi(t)),!!r}function ha(t,e){var n=$o(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?la(t,"Shift-"+n,e,(function(e){return sa(t,e,!0)}))||la(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return sa(t,e)})):la(t,n,e,(function(e){return sa(t,e)})))}function ca(t,e,n){return la(t,"'"+n+"'",e,(function(e){return sa(t,e,!0)}))}var _a=null;function pa(t){var e=this;if((!t.target||t.target==e.display.input.getField())&&(e.curOp.focus=R(I(e)),!kt(e,t))){o&&a<11&&27==t.keyCode&&(t.returnValue=!1);var i=t.keyCode;e.display.shift=16==i||t.shiftKey;var r=ha(e,t);_&&(_a=r?i:null,r||88!=i||Ft||!(y?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),n&&!y&&!r&&46==i&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||fa(e)}}function fa(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(O(e,"CodeMirror-crosshair"),wt(document,"keyup",n),wt(document,"mouseover",n))}D(e,"CodeMirror-crosshair"),yt(document,"keyup",n),yt(document,"mouseover",n)}function da(t){16==t.keyCode&&(this.doc.sel.shift=!1),kt(this,t)}function ga(t){var e=this;if((!t.target||t.target==e.display.input.getField())&&!($n(e.display,t)||kt(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var n=t.keyCode,i=t.charCode;if(_&&n==_a)return _a=null,void Ot(t);if(!_||t.which&&!(t.which<10)||!ha(e,t)){var r=String.fromCharCode(null==i?n:i);"\b"!=r&&(ca(e,t,r)||e.display.input.onKeyPress(t))}}}var ma,va,ya=400,ba=function(t,e,n){this.time=t,this.pos=e,this.button=n};function wa(t,e){var n=+new Date;return va&&va.compare(n,t,e)?(ma=va=null,"triple"):ma&&ma.compare(n,t,e)?(va=new ba(n,t,e),ma=null,"double"):(ma=new ba(n,t,e),va=null,"single")}function xa(t){var e=this,n=e.display;if(!(kt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,$n(n,t))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Na(e,t)){var i=ji(e,t),r=Mt(t),s=i?wa(i,r):"single";F(e).focus(),1==r&&e.state.selectingText&&e.state.selectingText(t),i&&ka(e,r,i,s,t)||(1==r?i?Ta(e,i,s,t):Nt(t)==n.scroller&&Ot(t):2==r?(i&&js(e.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(C?e.display.input.onContextMenu(t):tr(e)))}}function ka(t,e,n,i,r){var s="Click";return"double"==i?s="Double"+s:"triple"==i&&(s="Triple"+s),s=(1==e?"Left":2==e?"Middle":"Right")+s,la(t,Xo(s,r),r,(function(e){if("string"==typeof e&&(e=ea[e]),!e)return!1;var i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),i=e(t,n)!=X}finally{t.state.suppressEdits=!1}return i}))}function Ca(t,e,n){var i=t.getOption("configureMouse"),r=i?i(t,e,n):{};if(null==r.unit){var s=b?n.shiftKey&&n.metaKey:n.altKey;r.unit=s?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==r.extend||t.doc.extend)&&(r.extend=t.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=y?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(y?n.altKey:n.ctrlKey)),r}function Ta(t,e,n,i){o?setTimeout(B(Ji,t),0):t.curOp.focus=R(I(t));var r,s=Ca(t,n,i),a=t.doc.sel;t.options.dragDrop&&Wt&&!t.isReadOnly()&&"single"==n&&(r=a.contains(e))>-1&&(he((r=a.ranges[r]).from(),e)<0||e.xRel>0)&&(he(r.to(),e)>0||e.xRel<0)?Sa(t,i,e,s):La(t,i,e,s)}function Sa(t,e,n,i){var r=t.display,s=!1,u=Pr(t,(function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:tr(t)),wt(r.wrapper.ownerDocument,"mouseup",u),wt(r.wrapper.ownerDocument,"mousemove",h),wt(r.scroller,"dragstart",c),wt(r.scroller,"drop",u),s||(Ot(e),i.addNew||js(t.doc,n,null,null,i.extend),l&&!p||o&&9==a?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),h=function(t){s=s||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},c=function(){return s=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=u,u.copy=!i.moveOnDrag,yt(r.wrapper.ownerDocument,"mouseup",u),yt(r.wrapper.ownerDocument,"mousemove",h),yt(r.scroller,"dragstart",c),yt(r.scroller,"drop",u),t.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}function Oa(t,e,n){if("char"==n)return new us(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new us(ue(e.line,0),ge(t.doc,ue(e.line+1,0)));var i=n(t,e);return new us(i.from,i.to)}function La(t,e,n,i){o&&tr(t);var r=t.display,s=t.doc;Ot(e);var a,l,u=s.sel,h=u.ranges;if(i.addNew&&!i.extend?(l=s.sel.contains(n),a=l>-1?h[l]:new us(n,n)):(a=s.sel.primary(),l=s.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new us(n,n)),n=ji(t,e,!0,!0),l=-1;else{var c=Oa(t,n,i.unit);a=i.extend?Is(a,c.anchor,c.head,i.extend):c}i.addNew?-1==l?(l=h.length,Vs(s,hs(t,h.concat([a]),l),{scroll:!1,origin:"*mouse"})):h.length>1&&h[l].empty()&&"char"==i.unit&&!i.extend?(Vs(s,hs(t,h.slice(0,l).concat(h.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=s.sel):Bs(s,l,a,q):(l=0,Vs(s,new ls([a],0),q),u=s.sel);var _=n;function p(e){if(0!=he(_,e))if(_=e,"rectangle"==i.unit){for(var r=[],o=t.options.tabSize,h=U(ee(s,n.line).text,n.ch,o),c=U(ee(s,e.line).text,e.ch,o),p=Math.min(h,c),f=Math.max(h,c),d=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));d<=g;d++){var m=ee(s,d).text,v=Q(m,p,o);p==f?r.push(new us(ue(d,v),ue(d,v))):m.length>v&&r.push(new us(ue(d,v),ue(d,Q(m,f,o))))}r.length||r.push(new us(n,n)),Vs(s,hs(t,u.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var y,b=a,w=Oa(t,e,i.unit),x=b.anchor;he(w.anchor,x)>0?(y=w.head,x=fe(b.from(),w.anchor)):(y=w.anchor,x=pe(b.to(),w.head));var k=u.ranges.slice(0);k[l]=Ea(t,new us(ge(s,x),y)),Vs(s,hs(t,k,l),q)}}var f=r.wrapper.getBoundingClientRect(),d=0;function g(e){var n=++d,o=ji(t,e,!0,"rectangle"==i.unit);if(o)if(0!=he(o,_)){t.curOp.focus=R(I(t)),p(o);var a=sr(r,s);(o.line>=a.to||o.line<a.from)&&setTimeout(Pr(t,(function(){d==n&&g(e)})),150)}else{var l=e.clientY<f.top?-20:e.clientY>f.bottom?20:0;l&&setTimeout(Pr(t,(function(){d==n&&(r.scroller.scrollTop+=l,g(e))})),50)}}function m(e){t.state.selectingText=!1,d=1/0,e&&(Ot(e),r.input.focus()),wt(r.wrapper.ownerDocument,"mousemove",v),wt(r.wrapper.ownerDocument,"mouseup",y),s.history.lastSelOrigin=null}var v=Pr(t,(function(t){0!==t.buttons&&Mt(t)?g(t):m(t)})),y=Pr(t,m);t.state.selectingText=y,yt(r.wrapper.ownerDocument,"mousemove",v),yt(r.wrapper.ownerDocument,"mouseup",y)}function Ea(t,e){var n=e.anchor,i=e.head,r=ee(t.doc,n.line);if(0==he(n,i)&&n.sticky==i.sticky)return e;var s=mt(r);if(!s)return e;var o=dt(s,n.ch,n.sticky),a=s[o];if(a.from!=n.ch&&a.to!=n.ch)return e;var l,u=o+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==s.length)return e;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var h=dt(s,i.ch,i.sticky),c=h-o||(i.ch-n.ch)*(1==a.level?-1:1);l=h==u-1||h==u?c<0:c>0}var _=s[u+(l?-1:0)],p=l==(1==_.level),f=p?_.from:_.to,d=p?"after":"before";return n.ch==f&&n.sticky==d?e:new us(new ue(n.line,f,d),i)}function Aa(t,e,n,i){var r,s;if(e.touches)r=e.touches[0].clientX,s=e.touches[0].clientY;else try{r=e.clientX,s=e.clientY}catch(_){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&Ot(e);var o=t.display,a=o.lineDiv.getBoundingClientRect();if(s>a.bottom||!Tt(t,n))return Et(e);s-=a.top-o.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var u=o.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=r){var h=oe(t.doc,s),c=t.display.gutterSpecs[l];return xt(t,n,t,h,c.className,e),Et(e)}}}function Na(t,e){return Aa(t,e,"gutterClick",!0)}function Ma(t,e){$n(t.display,e)||Ra(t,e)||kt(t,e,"contextmenu")||C||t.display.input.onContextMenu(e)}function Ra(t,e){return!!Tt(t,"gutterContextMenu")&&Aa(t,e,"gutterContextMenu",!1)}function Da(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gi(t)}ba.prototype.compare=function(t,e,n){return this.time+ya>t&&0==he(e,this.pos)&&n==this.button};var Wa={toString:function(){return"CodeMirror.Init"}},Pa={},za={};function Ia(t){var e=t.optionHandlers;function n(n,i,r,s){t.defaults[n]=i,r&&(e[n]=s?function(t,e,n){n!=Wa&&r(t,e,n)}:r)}t.defineOption=n,t.Init=Wa,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,ms(t)}),!0),n("indentUnit",2,ms,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){vs(t),gi(t),Bi(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter((function(t){for(var r=0;;){var s=t.text.indexOf(e,r);if(-1==s)break;r=s+e.length,n.push(ue(i,s))}i++}));for(var r=n.length-1;r>=0;r--)ao(t.doc,e,n[r],ue(n[r].line,n[r].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Wa&&t.refresh()})),n("specialCharPlaceholder",bn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"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",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Da(t),es(t)}),!0),n("keyMap","default",(function(t,e,n){var i=qo(e),r=n!=Wa&&qo(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Fa,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Jr(e,t.options.lineNumbers),es(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Pi(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return xr(t)}),!0),n("scrollbarStyle","native",(function(t){Tr(t),xr(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=Jr(t.options.gutters,e),es(t)}),!0),n("firstLineNumber",1,es,!0),n("lineNumberFormatter",(function(t){return t}),es,!0),n("showCursorWhenSelecting",!1,Xi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(nr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,ja),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Xi,!0),n("singleCursorHeightPerLine",!0,Xi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,vs,!0),n("addModeClass",!1,vs,!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,vs,!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)}function ja(t,e,n){var i=n&&n!=Wa;if(!e!=!i){var r=t.display.dragFunctions,s=e?yt:wt;s(t.display.scroller,"dragstart",r.start),s(t.display.scroller,"dragenter",r.enter),s(t.display.scroller,"dragover",r.over),s(t.display.scroller,"dragleave",r.leave),s(t.display.scroller,"drop",r.drop)}}function Fa(t){t.options.lineWrapping?(D(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(O(t.display.wrapper,"CodeMirror-wrap"),_n(t)),Ii(t),Bi(t),gi(t),setTimeout((function(){return xr(t)}),100)}function Ba(t,e){var n=this;if(!(this instanceof Ba))return new Ba(t,e);this.options=e=e?H(e):{},H(Pa,e,!1);var i=e.value;"string"==typeof i?i=new Oo(i,e.mode,null,e.lineSeparator,e.direction):e.mode&&(i.modeOption=e.mode),this.doc=i;var r=new Ba.inputStyles[e.inputStyle](this),s=this.display=new ns(t,i,r,e);for(var u in s.wrapper.CodeMirror=this,Da(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Tr(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 K,keySeq:null,specialChars:null},e.autofocus&&!v&&s.input.focus(),o&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Ha(this),Wo(),Or(this),this.curOp.forceUpdate=!0,xs(this,i),e.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&er(n)}),20):nr(this),za)za.hasOwnProperty(u)&&za[u](this,e[u],Wa);Zr(this),e.finishInit&&e.finishInit(this);for(var h=0;h<Ua.length;++h)Ua[h](this);Lr(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(s.lineDiv).textRendering&&(s.lineDiv.style.textRendering="auto")}function Ha(t){var e=t.display;yt(e.scroller,"mousedown",Pr(t,xa)),yt(e.scroller,"dblclick",o&&a<11?Pr(t,(function(e){if(!kt(t,e)){var n=ji(t,e);if(n&&!Na(t,e)&&!$n(t.display,e)){Ot(e);var i=t.findWordAt(n);js(t.doc,i.anchor,i.head)}}})):function(e){return kt(t,e)||Ot(e)}),yt(e.scroller,"contextmenu",(function(e){return Ma(t,e)})),yt(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||Ma(t,n)}));var n,i={end:0};function r(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),i=e.activeTouch,i.end=+new Date)}function s(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}function l(t,e){if(null==e.left)return!0;var n=e.left-t.left,i=e.top-t.top;return n*n+i*i>400}yt(e.scroller,"touchstart",(function(r){if(!kt(t,r)&&!s(r)&&!Na(t,r)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}})),yt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),yt(e.scroller,"touchend",(function(n){var i=e.activeTouch;if(i&&!$n(e,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var s,o=t.coordsChar(e.activeTouch,"page");s=!i.prev||l(i,i.prev)?new us(o,o):!i.prev.prev||l(i,i.prev.prev)?t.findWordAt(o):new us(ue(o.line,0),ge(t.doc,ue(o.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),Ot(n)}r()})),yt(e.scroller,"touchcancel",r),yt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(gr(t,e.scroller.scrollTop),vr(t,e.scroller.scrollLeft,!0),xt(t,"scroll",t))})),yt(e.scroller,"mousewheel",(function(e){return as(t,e)})),yt(e.scroller,"DOMMouseScroll",(function(e){return as(t,e)})),yt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){kt(t,e)||At(e)},over:function(e){kt(t,e)||(No(t,e),At(e))},start:function(e){return Ao(t,e)},drop:Pr(t,Eo),leave:function(e){kt(t,e)||Mo(t)}};var u=e.input.getField();yt(u,"keyup",(function(e){return da.call(t,e)})),yt(u,"keydown",Pr(t,pa)),yt(u,"keypress",Pr(t,ga)),yt(u,"focus",(function(e){return er(t,e)})),yt(u,"blur",(function(e){return nr(t,e)}))}Ba.defaults=Pa,Ba.optionHandlers=za;var Ua=[];function Ka(t,e,n,i){var r,s=t.doc;null==n&&(n="add"),"smart"==n&&(s.mode.indent?r=ke(t,e).state:n="prev");var o=t.options.tabSize,a=ee(s,e),l=U(a.text,null,o);a.stateAfter&&(a.stateAfter=null);var u,h=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&(u=s.mode.indent(r,a.text.slice(h.length),a.text),u==X||u>150)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>s.first?U(ee(s,e-1).text,null,o):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 c="",_=0;if(t.options.indentWithTabs)for(var p=Math.floor(u/o);p;--p)_+=o,c+="\t";if(_<u&&(c+=J(u-_)),c!=h)return ao(s,c,ue(e,0),ue(e,h.length),"+input"),a.stateAfter=null,!0;for(var f=0;f<s.sel.ranges.length;f++){var d=s.sel.ranges[f];if(d.head.line==e&&d.head.ch<h.length){var g=ue(e,h.length);Bs(s,f,new us(g,g));break}}}Ba.defineInitHook=function(t){return Ua.push(t)};var Va=null;function Ga(t){Va=t}function Xa(t,e,n,i,r){var s=t.doc;t.display.shift=!1,i||(i=s.sel);var o=+new Date-200,a="paste"==r||t.state.pasteIncoming>o,l=It(e),u=null;if(a&&i.ranges.length>1)if(Va&&Va.text.join("\n")==e){if(i.ranges.length%Va.text.length==0){u=[];for(var h=0;h<Va.text.length;h++)u.push(s.splitLines(Va.text[h]))}}else l.length==i.ranges.length&&t.options.pasteLinesPerSelection&&(u=et(l,(function(t){return[t]})));for(var c=t.curOp.updateInput,_=i.ranges.length-1;_>=0;_--){var p=i.ranges[_],f=p.from(),d=p.to();p.empty()&&(n&&n>0?f=ue(f.line,f.ch-n):t.state.overwrite&&!a?d=ue(d.line,Math.min(ee(s,d.line).text.length,d.ch+tt(l).length)):a&&Va&&Va.lineWise&&Va.text.join("\n")==l.join("\n")&&(f=d=ue(f.line,0)));var g={from:f,to:d,text:u?u[_%u.length]:l,origin:r||(a?"paste":t.state.cutIncoming>o?"cut":"+input")};eo(t.doc,g),Rn(t,"inputRead",t,g)}e&&!a&&qa(t,e),cr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=c),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function $a(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||!e.hasFocus()||Wr(e,(function(){return Xa(e,n,0,null,"paste")})),!0}function qa(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var s=t.getModeAt(r.head),o=!1;if(s.electricChars){for(var a=0;a<s.electricChars.length;a++)if(e.indexOf(s.electricChars.charAt(a))>-1){o=Ka(t,r.head.line,"smart");break}}else s.electricInput&&s.electricInput.test(ee(t.doc,r.head.line).text.slice(0,r.head.ch))&&(o=Ka(t,r.head.line,"smart"));o&&Rn(t,"electricInput",t,r.head.line)}}}function Ya(t){for(var e=[],n=[],i=0;i<t.doc.sel.ranges.length;i++){var r=t.doc.sel.ranges[i].head.line,s={anchor:ue(r,0),head:ue(r+1,0)};n.push(s),e.push(t.getRange(s.anchor,s.head))}return{text:e,ranges:n}}function Qa(t,e,n,i){t.setAttribute("autocorrect",n?"on":"off"),t.setAttribute("autocapitalize",i?"on":"off"),t.setAttribute("spellcheck",!!e)}function Za(){var t=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),e=A("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),g&&(t.style.border="1px solid black"),e}function Ja(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){F(this).focus(),this.display.input.focus()},setOption:function(t,n){var i=this.options,r=i[t];i[t]==n&&"mode"!=t||(i[t]=n,e.hasOwnProperty(t)&&Pr(this,e[t])(this,n,r),xt(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"](qo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:zr((function(e,n){var i=e.token?e:t.getMode(this.options,e);if(i.startState)throw new Error("Overlays may not be stateful.");nt(this.state.overlays,{mode:i,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority})),this.state.modeGen++,Bi(this)})),removeOverlay:zr((function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var i=e[n].modeSpec;if(i==t||"string"==typeof t&&i.name==t)return e.splice(n,1),this.state.modeGen++,void Bi(this)}})),indentLine:zr((function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),ae(this.doc,t)&&Ka(this,t,e,n)})),indentSelection:zr((function(t){for(var e=this.doc.sel.ranges,n=-1,i=0;i<e.length;i++){var r=e[i];if(r.empty())r.head.line>n&&(Ka(this,r.head.line,t,!0),n=r.head.line,i==this.doc.sel.primIndex&&cr(this));else{var s=r.from(),o=r.to(),a=Math.max(n,s.line);n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var l=a;l<n;++l)Ka(this,l,t);var u=this.doc.sel.ranges;0==s.ch&&e.length==u.length&&u[i].from().ch>0&&Bs(this.doc,i,new us(s,u[i].to()),$)}}})),getTokenAt:function(t,e){return Le(this,t,e)},getLineTokens:function(t,e){return Le(this,ue(t),e,!0)},getTokenTypeAt:function(t){t=ge(this.doc,t);var e,n=xe(this,ee(this.doc,t.line)),i=0,r=(n.length-1)/2,s=t.ch;if(0==s)e=n[2];else for(;;){var o=i+r>>1;if((o?n[2*o-1]:0)>=s)r=o;else{if(!(n[2*o+1]<s)){e=n[2*o+2];break}i=o+1}}var a=e?e.indexOf("overlay "):-1;return a<0?e:0==a?null:e.slice(0,a-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var i=[];if(!n.hasOwnProperty(e))return i;var r=n[e],s=this.getModeAt(t);if("string"==typeof s[e])r[s[e]]&&i.push(r[s[e]]);else if(s[e])for(var o=0;o<s[e].length;o++){var a=r[s[e][o]];a&&i.push(a)}else s.helperType&&r[s.helperType]?i.push(r[s.helperType]):r[s.name]&&i.push(r[s.name]);for(var l=0;l<r._global.length;l++){var u=r._global[l];u.pred(s,this)&&-1==V(i,u.val)&&i.push(u.val)}return i},getStateAfter:function(t,e){var n=this.doc;return t=de(n,null==t?n.first+n.size-1:t),ke(this,t+1,e).state},cursorCoords:function(t,e){var n,i=this.doc.sel.primary();return n=null==t?i.head:"object"==typeof t?ge(this.doc,t):t?i.from():i.to(),ki(this,n,e||"page")},charCoords:function(t,e){return xi(this,ge(this.doc,t),e||"page")},coordsChar:function(t,e){return t=wi(this,t,e||"page"),Si(this,t.left,t.top)},lineAtHeight:function(t,e){return t=wi(this,{top:t,left:0},e||"page").top,oe(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var i,r=!1;if("number"==typeof t){var s=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>s&&(t=s,r=!0),i=ee(this.doc,t)}else i=t;return bi(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-hn(i):0)},defaultTextHeight:function(){return Ri(this.display)},defaultCharWidth:function(){return Di(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var s=this.display;t=ki(this,ge(this.doc,t));var o=t.bottom,a=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),s.sizer.appendChild(e),"over"==i)o=t.top;else if("above"==i||"near"==i){var l=Math.max(s.wrapper.clientHeight,this.doc.height),u=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?o=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(o=t.bottom),a+e.offsetWidth>u&&(a=u-e.offsetWidth)}e.style.top=o+"px",e.style.left=e.style.right="","right"==r?(a=s.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?a=0:"middle"==r&&(a=(s.sizer.clientWidth-e.offsetWidth)/2),e.style.left=a+"px"),n&&lr(this,{left:a,top:o,right:a+e.offsetWidth,bottom:o+e.offsetHeight})},triggerOnKeyDown:zr(pa),triggerOnKeyPress:zr(ga),triggerOnKeyUp:da,triggerOnMouseDown:zr(xa),execCommand:function(t){if(ea.hasOwnProperty(t))return ea[t].call(null,this)},triggerElectric:zr((function(t){qa(this,t)})),findPosH:function(t,e,n,i){var r=1;e<0&&(r=-1,e=-e);for(var s=ge(this.doc,t),o=0;o<e;++o)if(s=tl(this.doc,s,r,n,i),s.hitSide)break;return s},moveH:zr((function(t,e){var n=this;this.extendSelectionsBy((function(i){return n.display.shift||n.doc.extend||i.empty()?tl(n.doc,i.head,t,e,n.options.rtlMoveVisually):t<0?i.from():i.to()}),Y)})),deleteH:zr((function(t,e){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Yo(this,(function(n){var r=tl(i,n.head,t,e,!1);return t<0?{from:r,to:n.head}:{from:n.head,to:r}}))})),findPosV:function(t,e,n,i){var r=1,s=i;e<0&&(r=-1,e=-e);for(var o=ge(this.doc,t),a=0;a<e;++a){var l=ki(this,o,"div");if(null==s?s=l.left:l.left=s,o=el(this,l,r,n),o.hitSide)break}return o},moveV:zr((function(t,e){var n=this,i=this.doc,r=[],s=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(o){if(s)return t<0?o.from():o.to();var a=ki(n,o.head,"div");null!=o.goalColumn&&(a.left=o.goalColumn),r.push(a.left);var l=el(n,a,t,e);return"page"==e&&o==i.sel.primary()&&hr(n,xi(n,l,"div").top-a.top),l}),Y),r.length)for(var o=0;o<i.sel.ranges.length;o++)i.sel.ranges[o].goalColumn=r[o]})),findWordAt:function(t){var e=this.doc,n=ee(e,t.line).text,i=t.ch,r=t.ch;if(n){var s=this.getHelper(t,"wordChars");"before"!=t.sticky&&r!=n.length||!i?++r:--i;var o=n.charAt(i),a=at(o,s)?function(t){return at(t,s)}:/\s/.test(o)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!at(t)};while(i>0&&a(n.charAt(i-1)))--i;while(r<n.length&&a(n.charAt(r)))++r}return new us(ue(t.line,i),ue(t.line,r))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?D(this.display.cursorDiv,"CodeMirror-overwrite"):O(this.display.cursorDiv,"CodeMirror-overwrite"),xt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==R(I(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:zr((function(t,e){_r(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Zn(this)-this.display.barHeight,width:t.scrollWidth-Zn(this)-this.display.barWidth,clientHeight:ti(this),clientWidth:Jn(this)}},scrollIntoView:zr((function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:ue(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?pr(this,t):dr(this,t.from,t.to,t.margin)})),setSize:zr((function(t,e){var n=this,i=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=i(t)),null!=e&&(this.display.wrapper.style.height=i(e)),this.options.lineWrapping&&di(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){Hi(n,r,"widget");break}++r})),this.curOp.forceUpdate=!0,xt(this,"refresh",this)})),operation:function(t){return Wr(this,t)},startOperation:function(){return Or(this)},endOperation:function(){return Lr(this)},refresh:zr((function(){var t=this.display.cachedTextHeight;Bi(this),this.curOp.forceUpdate=!0,gi(this),_r(this,this.doc.scrollLeft,this.doc.scrollTop),qr(this.display),(null==t||Math.abs(t-Ri(this.display))>.5||this.options.lineWrapping)&&Ii(this),xt(this,"refresh",this)})),swapDoc:zr((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),xs(this,t),gi(this),this.display.input.reset(),_r(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Rn(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}},St(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,s){t.registerHelper(e,i,s),n[e]._global.push({pred:r,val:s})}}function tl(t,e,n,i,r){var s=e,o=n,a=ee(t,e.line),l=r&&"rtl"==t.direction?-n:n;function u(){var n=e.line+l;return!(n<t.first||n>=t.first+t.size)&&(e=new ue(n,e.ch,e.sticky),a=ee(t,n))}function h(s){var o;if("codepoint"==i){var h=a.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(h))o=null;else{var c=n>0?h>=55296&&h<56320:h>=56320&&h<57343;o=new ue(e.line,Math.max(0,Math.min(a.text.length,e.ch+n*(c?2:1))),-n)}}else o=r?ta(t.cm,a,e,n):Zo(a,e,n);if(null==o){if(s||!u())return!1;e=Jo(r,t.cm,a,e.line,l)}else e=o;return!0}if("char"==i||"codepoint"==i)h();else if("column"==i)h(!0);else if("word"==i||"group"==i)for(var c=null,_="group"==i,p=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;;f=!1){if(n<0&&!h(!f))break;var d=a.text.charAt(e.ch)||"\n",g=at(d,p)?"w":_&&"\n"==d?"n":!_||/\s/.test(d)?null:"p";if(!_||f||g||(g="s"),c&&c!=g){n<0&&(n=1,h(),e.sticky="after");break}if(g&&(c=g),n>0&&!h(!f))break}var m=Qs(t,e,s,o,!0);return ce(s,m)&&(m.hitSide=!0),m}function el(t,e,n,i){var r,s,o=t.doc,a=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,F(t).innerHeight||o(t).documentElement.clientHeight),u=Math.max(l-.5*Ri(t.display),3);r=(n>0?e.bottom:e.top)+n*u}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(;;){if(s=Si(t,a,r),!s.outside)break;if(n<0?r<=0:r>=o.height){s.hitSide=!0;break}r+=5*n}return s}var nl=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new K,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function il(t,e){var n=si(t,e.line);if(!n||n.hidden)return null;var i=ee(t.doc,e.line),r=ni(n,i,e.line),s=mt(i,t.doc.direction),o="left";if(s){var a=dt(s,e.ch);o=a%2?"right":"left"}var l=hi(r.map,e.ch,o);return l.offset="right"==l.collapse?l.end:l.start,l}function rl(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function sl(t,e){return e&&(t.bad=!0),t}function ol(t,e,n,i,r){var s="",o=!1,a=t.doc.lineSeparator(),l=!1;function u(t){return function(e){return e.id==t}}function h(){o&&(s+=a,l&&(s+=a),o=l=!1)}function c(t){t&&(h(),s+=t)}function _(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void c(n);var s,p=e.getAttribute("cm-marker");if(p){var f=t.findMarks(ue(i,0),ue(r+1,0),u(+p));return void(f.length&&(s=f[0].find(0))&&c(ne(t.doc,s.from,s.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&&h();for(var g=0;g<e.childNodes.length;g++)_(e.childNodes[g]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),d&&(o=!0)}else 3==e.nodeType&&c(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;;){if(_(e),e==n)break;e=e.nextSibling,l=!1}return s}function al(t,e,n){var i;if(e==t.display.lineDiv){if(i=t.display.lineDiv.childNodes[n],!i)return sl(t.clipPos(ue(t.display.viewTo-1)),!0);e=null,n=0}else for(i=e;;i=i.parentNode){if(!i||i==t.display.lineDiv)return null;if(i.parentNode&&i.parentNode==t.display.lineDiv)break}for(var r=0;r<t.display.view.length;r++){var s=t.display.view[r];if(s.node==i)return ll(s,e,n)}}function ll(t,e,n){var i=t.text.firstChild,r=!1;if(!e||!M(i,e))return sl(ue(se(t.line),0),!0);if(e==i&&(r=!0,e=i.childNodes[n],n=0,!e)){var s=t.rest?tt(t.rest):t.line;return sl(ue(se(s),s.text.length),r)}var o=3==e.nodeType?e:null,a=e;o||1!=e.childNodes.length||3!=e.firstChild.nodeType||(o=e.firstChild,n&&(n=o.nodeValue.length));while(a.parentNode!=i)a=a.parentNode;var l=t.measure,u=l.maps;function h(e,n,i){for(var r=-1;r<(u?u.length:0);r++)for(var s=r<0?l.map:u[r],o=0;o<s.length;o+=3){var a=s[o+2];if(a==e||a==n){var h=se(r<0?t.line:t.rest[r]),c=s[o]+i;return(i<0||a!=e)&&(c=s[o+(i?1:0)]),ue(h,c)}}}var c=h(o,a,n);if(c)return sl(c,r);for(var _=a.nextSibling,p=o?o.nodeValue.length-n:0;_;_=_.nextSibling){if(c=h(_,_.firstChild,0),c)return sl(ue(c.line,c.ch-p),r);p+=_.textContent.length}for(var f=a.previousSibling,d=n;f;f=f.previousSibling){if(c=h(f,f.firstChild,-1),c)return sl(ue(c.line,c.ch+d),r);d+=f.textContent.length}}nl.prototype.init=function(t){var e=this,n=this,i=n.cm,r=n.div=t.lineDiv;function s(t){for(var e=t.target;e;e=e.parentNode){if(e==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function o(t){if(s(t)&&!kt(i,t)){if(i.somethingSelected())Ga({lineWise:!1,text:i.getSelections()}),"cut"==t.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var e=Ya(i);Ga({lineWise:!0,text:e.text}),"cut"==t.type&&i.operation((function(){i.setSelections(e.ranges,0,$),i.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var o=Va.text.join("\n");if(t.clipboardData.setData("Text",o),t.clipboardData.getData("Text")==o)return void t.preventDefault()}var a=Za(),l=a.firstChild;Qa(l),i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),l.value=Va.text.join("\n");var u=R(j(r));P(l),setTimeout((function(){i.display.lineSpace.removeChild(a),u.focus(),u==r&&n.showPrimarySelection()}),50)}}r.contentEditable=!0,Qa(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),yt(r,"paste",(function(t){!s(t)||kt(i,t)||$a(t,i)||a<=11&&setTimeout(Pr(i,(function(){return e.updateFromDOM()})),20)})),yt(r,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),yt(r,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),yt(r,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),yt(r,"touchstart",(function(){return n.forceCompositionEnd()})),yt(r,"input",(function(){e.composing||e.readFromDOMSoon()})),yt(r,"copy",o),yt(r,"cut",o)},nl.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},nl.prototype.prepareSelection=function(){var t=$i(this.cm,!1);return t.focus=R(j(this.div))==this.div,t},nl.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},nl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},nl.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,i=e.doc.sel.primary(),r=i.from(),s=i.to();if(e.display.viewTo==e.display.viewFrom||r.line>=e.display.viewTo||s.line<e.display.viewFrom)t.removeAllRanges();else{var o=al(e,t.anchorNode,t.anchorOffset),a=al(e,t.focusNode,t.focusOffset);if(!o||o.bad||!a||a.bad||0!=he(fe(o,a),r)||0!=he(pe(o,a),s)){var l=e.display.view,u=r.line>=e.display.viewFrom&&il(e,r)||{node:l[0].measure.map[2],offset:0},h=s.line<e.display.viewTo&&il(e,s);if(!h){var c=l[l.length-1].measure,_=c.maps?c.maps[c.maps.length-1]:c.map;h={node:_[_.length-1],offset:_[_.length-2]-_[_.length-3]}}if(u&&h){var p,f=t.rangeCount&&t.getRangeAt(0);try{p=S(u.node,u.offset,h.offset,h.node)}catch(d){}p&&(!n&&e.state.focused?(t.collapse(u.node,u.offset),p.collapsed||(t.removeAllRanges(),t.addRange(p))):(t.removeAllRanges(),t.addRange(p)),f&&null==t.anchorNode?t.addRange(f):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},nl.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation((function(){return t.cm.curOp.selectionChanged=!0}))}),20)},nl.prototype.showMultipleSelections=function(t){E(this.cm.display.cursorDiv,t.cursors),E(this.cm.display.selectionDiv,t.selection)},nl.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},nl.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return M(this.div,e)},nl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&R(j(this.div))==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},nl.prototype.blur=function(){this.div.blur()},nl.prototype.getField=function(){return this.div},nl.prototype.supportsTouch=function(){return!0},nl.prototype.receivedFocus=function(){var t=this,e=this;function n(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,n))}this.selectionInEditor()?setTimeout((function(){return t.pollSelection()}),20):Wr(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,n)},nl.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},nl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(m&&h&&this.cm.display.gutterSpecs.length&&rl(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=al(e,t.anchorNode,t.anchorOffset),i=al(e,t.focusNode,t.focusOffset);n&&i&&Wr(e,(function(){Vs(e.doc,cs(n,i),$),(n.bad||i.bad)&&(e.curOp.selectionChanged=!0)}))}}},nl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,i=this.cm,r=i.display,s=i.doc.sel.primary(),o=s.from(),a=s.to();if(0==o.ch&&o.line>i.firstLine()&&(o=ue(o.line-1,ee(i.doc,o.line-1).length)),a.ch==ee(i.doc,a.line).text.length&&a.line<i.lastLine()&&(a=ue(a.line+1,0)),o.line<r.viewFrom||a.line>r.viewTo-1)return!1;o.line==r.viewFrom||0==(t=Fi(i,o.line))?(e=se(r.view[0].line),n=r.view[0].node):(e=se(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,u,h=Fi(i,a.line);if(h==r.view.length-1?(l=r.viewTo-1,u=r.lineDiv.lastChild):(l=se(r.view[h+1].line)-1,u=r.view[h+1].node.previousSibling),!n)return!1;var c=i.doc.splitLines(ol(i,n,u,e,l)),_=ne(i.doc,ue(e,0),ue(l,ee(i.doc,l).text.length));while(c.length>1&&_.length>1)if(tt(c)==tt(_))c.pop(),_.pop(),l--;else{if(c[0]!=_[0])break;c.shift(),_.shift(),e++}var p=0,f=0,d=c[0],g=_[0],m=Math.min(d.length,g.length);while(p<m&&d.charCodeAt(p)==g.charCodeAt(p))++p;var v=tt(c),y=tt(_),b=Math.min(v.length-(1==c.length?p:0),y.length-(1==_.length?p:0));while(f<b&&v.charCodeAt(v.length-f-1)==y.charCodeAt(y.length-f-1))++f;if(1==c.length&&1==_.length&&e==o.line)while(p&&p>o.ch&&v.charCodeAt(v.length-f-1)==y.charCodeAt(y.length-f-1))p--,f++;c[c.length-1]=v.slice(0,v.length-f).replace(/^\u200b+/,""),c[0]=c[0].slice(p).replace(/\u200b+$/,"");var w=ue(e,p),x=ue(l,_.length?tt(_).length-f:0);return c.length>1||c[0]||he(w,x)?(ao(i.doc,c,w,x,"+input"),!0):void 0},nl.prototype.ensurePolled=function(){this.forceCompositionEnd()},nl.prototype.reset=function(){this.forceCompositionEnd()},nl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},nl.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))},nl.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Wr(this.cm,(function(){return Bi(t.cm)}))},nl.prototype.setUneditable=function(t){t.contentEditable="false"},nl.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Pr(this.cm,Xa)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},nl.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},nl.prototype.onContextMenu=function(){},nl.prototype.resetPosition=function(){},nl.prototype.needsContentAttribute=!0;var ul=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new K,this.hasSelection=!1,this.composing=null,this.resetting=!1};function hl(t,e){if(e=e?H(e):{},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=R(j(t));e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function i(){t.value=a.getValue()}var r;if(t.form&&(yt(t.form,"submit",i),!e.leaveSubmitMethodAlone)){var s=t.form;r=s.submit;try{var o=s.submit=function(){i(),s.submit=r,s.submit(),s.submit=o}}catch(l){}}e.finishInit=function(n){n.save=i,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,i(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(wt(t.form,"submit",i),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=r))}},t.style.display="none";var a=Ba((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return a}function cl(t){t.off=wt,t.on=yt,t.wheelEventPixels=os,t.Doc=Oo,t.splitLines=It,t.countColumn=U,t.findColumn=Q,t.isWordChar=ot,t.Pass=X,t.signal=xt,t.Line=pn,t.changeEnd=_s,t.scrollbarModel=Cr,t.Pos=ue,t.cmpPos=he,t.modes=Ut,t.mimeModes=Kt,t.resolveMode=Xt,t.getMode=$t,t.modeExtensions=qt,t.extendMode=Yt,t.copyState=Qt,t.startState=Jt,t.innerMode=Zt,t.commands=ea,t.keyMap=Ho,t.keyName=$o,t.isModifierKey=Go,t.lookupKey=Vo,t.normalizeKeyMap=Ko,t.StringStream=te,t.SharedTextMarker=wo,t.TextMarker=yo,t.LineWidget=fo,t.e_preventDefault=Ot,t.e_stopPropagation=Lt,t.e_stop=At,t.addClass=D,t.contains=M,t.rmClass=O,t.keyNames=Io}ul.prototype.init=function(t){var e=this,n=this,i=this.cm;this.createField(t);var r=this.textarea;function s(t){if(!kt(i,t)){if(i.somethingSelected())Ga({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=Ya(i);Ga({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,$):(n.prevInput="",r.value=e.text.join("\n"),P(r))}"cut"==t.type&&(i.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(r.style.width="0px"),yt(r,"input",(function(){o&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),yt(r,"paste",(function(t){kt(i,t)||$a(t,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),yt(r,"cut",s),yt(r,"copy",s),yt(t.scroller,"paste",(function(e){if(!$n(t,e)&&!kt(i,e)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var s=new Event("paste");s.clipboardData=e.clipboardData,r.dispatchEvent(s)}})),yt(t.lineSpace,"selectstart",(function(e){$n(t,e)||Ot(e)})),yt(r,"compositionstart",(function(){var t=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}})),yt(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ul.prototype.createField=function(t){this.wrapper=Za(),this.textarea=this.wrapper.firstChild;var e=this.cm.options;Qa(this.textarea,e.spellcheck,e.autocorrect,e.autocapitalize)},ul.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},ul.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=$i(t);if(t.options.moveInputWithCursor){var r=ki(t,n.sel.primary().head,"div"),s=e.wrapper.getBoundingClientRect(),o=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+o.top-s.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+o.left-s.left))}return i},ul.prototype.showSelection=function(t){var e=this.cm,n=e.display;E(n.cursorDiv,t.cursors),E(n.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},ul.prototype.reset=function(t){if(!(this.contextMenuPending||this.composing&&t)){var e=this.cm;if(this.resetting=!0,e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&P(this.textarea),o&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",o&&a>=9&&(this.hasSelection=null));this.resetting=!1}},ul.prototype.getField=function(){return this.textarea},ul.prototype.supportsTouch=function(){return!1},ul.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||R(j(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(t){}},ul.prototype.blur=function(){this.textarea.blur()},ul.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ul.prototype.receivedFocus=function(){this.slowPoll()},ul.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},ul.prototype.fastPoll=function(){var t=!1,e=this;function n(){var i=e.poll();i||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},ul.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!e.state.focused||jt(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(o&&a>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var s=r.charCodeAt(0);if(8203!=s||i||(i=""),8666==s)return this.reset(),this.cm.execCommand("undo")}var l=0,u=Math.min(i.length,r.length);while(l<u&&i.charCodeAt(l)==r.charCodeAt(l))++l;return Wr(e,(function(){Xa(e,r.slice(l),i.length-l,null,t.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ul.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ul.prototype.onKeyPress=function(){o&&a>=9&&(this.hasSelection=null),this.fastPoll()},ul.prototype.onContextMenu=function(t){var e=this,n=e.cm,i=n.display,r=e.textarea;e.contextMenuPending&&e.contextMenuPending();var s=ji(n,t),u=i.scroller.scrollTop;if(s&&!_){var h=n.options.resetSelectionOnContextMenu;h&&-1==n.doc.sel.contains(s)&&Pr(n,Vs)(n.doc,cs(s),$);var c,p=r.style.cssText,f=e.wrapper.style.cssText,d=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",r.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: "+(o?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=r.ownerDocument.defaultView.scrollY),i.input.focus(),l&&r.ownerDocument.defaultView.scrollTo(null,c),i.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),o&&a>=9&&m(),C){At(t);var g=function(){wt(window,"mouseup",g),setTimeout(v,20)};yt(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=r.selectionStart){var t=n.somethingSelected(),s=""+(t?r.value:"");r.value="⇚",r.value=s,e.prevInput=t?"":"",r.selectionStart=1,r.selectionEnd=s.length,i.selForContextMenu=n.doc.sel}}function v(){if(e.contextMenuPending==v&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,r.style.cssText=p,o&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=u),null!=r.selectionStart)){(!o||o&&a<9)&&m();var t=0,s=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==e.prevInput?Pr(n,Js)(n):t++<10?i.detectingSelectAll=setTimeout(s,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(s,200)}}},ul.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},ul.prototype.setUneditable=function(){},ul.prototype.needsContentAttribute=!1,Ia(Ba),Ja(Ba);var _l="iter insert remove copy getEditor constructor".split(" ");for(var pl in Oo.prototype)Oo.prototype.hasOwnProperty(pl)&&V(_l,pl)<0&&(Ba.prototype[pl]=function(t){return function(){return t.apply(this.doc,arguments)}}(Oo.prototype[pl]));return St(Oo),Ba.inputStyles={textarea:ul,contenteditable:nl},Ba.defineMode=function(t){Ba.defaults.mode||"null"==t||(Ba.defaults.mode=t),Vt.apply(this,arguments)},Ba.defineMIME=Gt,Ba.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ba.defineMIME("text/plain","null"),Ba.defineExtension=function(t,e){Ba.prototype[t]=e},Ba.defineDocExtension=function(t,e){Oo.prototype[t]=e},Ba.fromTextArea=hl,cl(Ba),Ba.version="5.65.21",Ba}))},a16b:function(t,e,n){var i,r;(function(){var n;(function(){"use strict";var t=[,,function(t){function e(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function i(t,i){this.__indent_cache=new n(t,i),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},e.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},e.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},e.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){while(" "===this.last())this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},n.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e,n},n.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e],n},n.prototype.__ensure_cache=function(t){while(t>=this.__cache.length)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},i.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(t){var e=this.__lines.length;while(t<e)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(t){t=void 0!==t&&t,this.current_line.trim();while(t&&this.__lines.length>1&&this.current_line.is_empty())this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(t,n){var i=this.__lines.length-2;while(i>=0){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(t)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},t.exports.Output=i},,,,function(t){function e(t,e){this.raw_options=n(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function n(t,e){var n,r={};for(n in t=i(t),t)n!==e&&(r[n]=t[n]);if(e&&t[e])for(n in t[e])r[n]=t[e][n];return r}function i(t){var e,n={};for(e in t){var i=e.replace(/-/g,"_");n[i]=t[e]}return n}e.prototype._get_array=function(t,e){var n=this.raw_options[t],i=e||[];return"object"===typeof n?null!==n&&"function"===typeof n.concat&&(i=n.concat()):"string"===typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},e.prototype._get_boolean=function(t,e){var n=this.raw_options[t],i=void 0===n?!!e:!!n;return i},e.prototype._get_characters=function(t,e){var n=this.raw_options[t],i=e||"";return"string"===typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},e.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var i=parseInt(n,10);return isNaN(i)&&(i=e),i},e.prototype._get_selection=function(t,e,n){var i=this._get_selection_list(t,e,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i[0]},e.prototype._get_selection_list=function(t,e,n){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var i=this._get_array(t,n);if(!this._is_valid_selection(i,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i},e.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},t.exports.Options=e,t.exports.normalizeOpts=i,t.exports.mergeOpts=n},,function(t){var e=RegExp.prototype.hasOwnProperty("sticky");function n(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},n.prototype.peek=function(t){var e=null;return t=t||0,t+=this.__position,t>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},n.prototype.__match=function(t,n){t.lastIndex=n;var i=t.exec(this.__input);return!i||e&&t.sticky||i.index!==n&&(i=null),i},n.prototype.test=function(t,e){return e=e||0,e+=this.__position,e>=0&&e<this.__input_length&&!!this.__match(t,e)},n.prototype.testChar=function(t,e){var n=this.peek(e);return t.lastIndex=0,null!==n&&t.test(n)},n.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},n.prototype.read=function(t,e,n){var i,r="";return t&&(i=this.match(t),i&&(r+=i[0])),!e||!i&&t||(r+=this.readUntil(e,n)),r},n.prototype.readUntil=function(t,e){var n="",i=this.__position;t.lastIndex=this.__position;var r=t.exec(this.__input);return r?(i=r.index,e&&(i+=r[0].length)):i=this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},n.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},n.prototype.get_regexp=function(t,n){var i=null,r="g";return n&&e&&(r="y"),"string"===typeof t&&""!==t?i=new RegExp(t,r):t&&(i=new RegExp(t.source,r)),i},n.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(t){var e=this.__position,n=this.readUntilAfter(t);return this.__position=e,n},n.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=n},,,,,function(t){function e(t,e){t="string"===typeof t?t:t.source,e="string"===typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}e.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;var n=this.__directive_pattern.exec(t);while(n)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},e.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=e},,function(t,e,n){var i=n(16).Beautifier,r=n(17).Options;function s(t,e){var n=new i(t,e);return n.beautify()}t.exports=s,t.exports.defaultOptions=function(){return new r}},function(t,e,n){var i=n(17).Options,r=n(2).Output,s=n(8).InputScanner,o=n(13).Directives,a=new o(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,h=/\s/,c=/(?:\s|\n)+/g,_=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,p=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function f(t,e){this._source_text=t||"",this._options=new i(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}f.prototype.eatString=function(t){var e="";this._ch=this._input.next();while(this._ch){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},f.prototype.eatWhitespace=function(t){var e=h.test(this._input.peek()),n=0;while(h.test(this._input.peek()))this._ch=this._input.next(),t&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return e},f.prototype.foundNestedPseudoClass=function(){var t=0,e=1,n=this._input.peek(e);while(n){if("{"===n)return!0;if("("===n)t+=1;else if(")"===n){if(0===t)return!1;t-=1}else if(";"===n||"}"===n)return!1;e++,n=this._input.peek(e)}return!1},f.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},f.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},f.prototype.indent=function(){this._indentLevel++},f.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},f.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&l.test(t||"")&&(e=t.match(l)[0])),t=t.replace(u,"\n");var n=t.match(/^[\t ]*/)[0];this._output=new r(this._options,n),this._input=new s(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;var i,o,f,d=0,g=!1,m=!1,v=!1,y=!1,b=!1,w=this._ch,x=!1;while(1){if(i=this._input.read(c),o=""!==i,f=w,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),w=this._ch,!this._ch)break;if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var k=this._input.read(_),C=a.get_directives(k);C&&"start"===C.ignore&&(k+=a.readIgnored(this._input)),this.print_string(k),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(p)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(o),this.print_string(this._ch);var T=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);T.match(/[ :]$/)&&(T=this.eatString(": ").replace(/\s+$/,""),this.print_string(T),this._output.space_before_token=!0),0===d&&-1!==T.indexOf(":")&&(m=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(o),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var S=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);S.match(/[ :]$/)&&(S=this.eatString(": ").replace(/\s+$/,""),this.print_string(S),this._output.space_before_token=!0),0===d&&-1!==S.indexOf(":")?(m=!0,this.indent()):S in this.NESTED_AT_RULE?(this._nestedLevel+=1,S in this.CONDITIONAL_GROUP_RULE&&(v=!0)):0!==d||m||(y=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(o),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)m&&(m=!1,this.outdent()),y=!1,v?(v=!1,g=this._indentLevel>=this._nestedLevel):g=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&g&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===f?this._output.space_before_token=!1:","!==f&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===f&&this._output.trim(!0),m&&(this.outdent(),m=!1),this.print_string(this._ch),g=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var O=0;O<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;O++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[O])){x=!0;break}!g&&!v||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||y||0!==d?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),m||(m=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var L='"'===f||"'"===f;this.preserveSingleSpace(L||o),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)x=!1,0===d?(m&&(this.outdent(),m=!1),y=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),d++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),d&&(d--,this.outdent()));else{var E=!1;this._input.lookBack("with")&&(E=!0),this.preserveSingleSpace(o||E),this.print_string(this._ch),m&&"$"===f&&this._options.selector_separator_newline?(this._output.add_new_line(),b=!0):(this.eatWhitespace(),d++,this.indent())}else if(")"===this._ch)d&&(d--,this.outdent()),b&&";"===this._input.peek()&&this._options.selector_separator_newline&&(b=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||m&&!b||0!==d||y?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||m||0!==d)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(o),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),h.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var A='"'===f||"'"===f;this.preserveSingleSpace(A||o),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&x&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&h.test(this._ch)&&(this._ch=""))}var N=this._output.get_code(e);return N},t.exports.Beautifier=f},function(t,e,n){var i=n(6).Options;function r(t){i.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r<n.length;r++)"expand"!==n[r]?this.brace_style="collapse":this.brace_style=n[r]}r.prototype=new i,t.exports.Options=r}],e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}var r=i(15);n=r})();var s=n;i=[],r=function(){return{css_beautify:s}}.apply(e,i),void 0===r||(t.exports=r)})()},a179:function(t,e,n){var i,r;(function(){var n;(function(){"use strict";var t=[function(t,e,n){var i=n(1).Beautifier,r=n(5).Options;function s(t,e){var n=new i(t,e);return n.beautify()}t.exports=s,t.exports.defaultOptions=function(){return new r}},function(t,e,n){var i=n(2).Output,r=n(3).Token,s=n(4),o=n(5).Options,a=n(7).Tokenizer,l=n(7).line_starters,u=n(7).positionable_operators,h=n(7).TOKEN;function c(t,e){return-1!==e.indexOf(t)}function _(t){return t.replace(/^\s+/g,"")}function p(t){for(var e={},n=0;n<t.length;n++)e[t[n].replace(/-/g,"_")]=t[n];return e}function f(t,e){return t&&t.type===h.RESERVED&&t.text===e}function d(t,e){return t&&t.type===h.RESERVED&&c(t.text,e)}var g=["case","return","do","if","throw","else","await","break","continue","async"],m=["before-newline","after-newline","preserve-newline"],v=p(m),y=[v.before_newline,v.preserve_newline],b={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function w(t,e){e.multiline_frame||e.mode===b.ForInitializer||e.mode===b.Conditional||t.remove_indent(e.start_line_index)}function x(t){t=t.replace(s.allLineBreaks,"\n");var e=[],n=t.indexOf("\n");while(-1!==n)e.push(t.substring(0,n)),t=t.substring(n+1),n=t.indexOf("\n");return t.length&&e.push(t),e}function k(t){return t===b.ArrayLiteral}function C(t){return c(t,[b.Expression,b.ForInitializer,b.Conditional])}function T(t,e){for(var n=0;n<t.length;n++){var i=t[n].trim();if(i.charAt(0)!==e)return!1}return!0}function S(t,e){for(var n,i=0,r=t.length;i<r;i++)if(n=t[i],n&&0!==n.indexOf(e))return!1;return!0}function O(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(e)}O.prototype.create_flags=function(t,e){var n=0;t&&(n=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>n&&(n=t.line_indent_level));var i={mode:e,parent:t,last_token:t?t.last_token:new r(h.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:n,alignment:0,line_indent_level:t?t.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0};return i},O.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new i(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(b.BlockStatement);var n=new a(t,this._options);return this._tokens=n.tokenize(),t},O.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t,e=this._reset(this._source_text),n=this._options.eol;"auto"===this._options.eol&&(n="\n",e&&s.lineBreak.test(e||"")&&(n=e.match(s.lineBreak)[0]));var i=this._tokens.next();while(i)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return t=this._output.get_code(n),t},O.prototype.handle_token=function(t,e){t.type===h.START_EXPR?this.handle_start_expr(t):t.type===h.END_EXPR?this.handle_end_expr(t):t.type===h.START_BLOCK?this.handle_start_block(t):t.type===h.END_BLOCK?this.handle_end_block(t):t.type===h.WORD||t.type===h.RESERVED?this.handle_word(t):t.type===h.SEMICOLON?this.handle_semicolon(t):t.type===h.STRING?this.handle_string(t):t.type===h.EQUALS?this.handle_equals(t):t.type===h.OPERATOR?this.handle_operator(t):t.type===h.COMMA?this.handle_comma(t):t.type===h.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===h.COMMENT?this.handle_comment(t,e):t.type===h.DOT?this.handle_dot(t):t.type===h.EOF?this.handle_eof(t):(t.type,h.UNKNOWN,this.handle_unknown(t,e))},O.prototype.handle_whitespace_and_comments=function(t,e){var n=t.newlines,i=this._options.keep_array_indentation&&k(this._flags.mode);if(t.comments_before){var r=t.comments_before.next();while(r)this.handle_whitespace_and_comments(r,e),this.handle_token(r,e),r=t.comments_before.next()}if(i)for(var s=0;s<n;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,e);for(var o=1;o<n;o+=1)this.print_newline(!0,e)}};var L=["async","break","continue","return","throw","yield"];O.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&t.newlines||e,i=c(this._flags.last_token.text,u)||c(t.text,u);if(i){var r=c(this._flags.last_token.text,u)&&c(this._options.operator_position,y)||c(t.text,u);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(d(this._flags.last_token,L))return;this._output.set_wrap_point()}}},O.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==h.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text)){var n=this._tokens.peek();while(this._flags.mode===b.Statement&&(!this._flags.if_block||!f(n,"else"))&&!this._flags.do_block)this.restore_mode()}this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},O.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||k(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},O.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===h.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},O.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},O.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},O.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},O.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===b.Statement&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},O.prototype.start_of_object_property=function(){return this._flags.parent.mode===b.ObjectLiteral&&this._flags.mode===b.Statement&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"]))},O.prototype.start_of_statement=function(t){var e=!1;return e=e||d(this._flags.last_token,["var","let","const"])&&t.type===h.WORD,e=e||f(this._flags.last_token,"do"),e=e||!(this._flags.parent.mode===b.ObjectLiteral&&this._flags.mode===b.Statement)&&d(this._flags.last_token,L)&&!t.newlines,e=e||f(this._flags.last_token,"else")&&!(f(t,"if")&&!t.comments_before),e=e||this._flags.last_token.type===h.END_EXPR&&(this._previous_flags.mode===b.ForInitializer||this._previous_flags.mode===b.Conditional),e=e||this._flags.last_token.type===h.WORD&&this._flags.mode===b.BlockStatement&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==h.WORD&&t.type!==h.RESERVED,e=e||this._flags.mode===b.ObjectLiteral&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"])),!!e&&(this.set_mode(b.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,d(t,["do","for","if","while"])),!0)},O.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=b.Expression;if("["===t.text){if(this._flags.last_token.type===h.WORD||")"===this._flags.last_token.text)return d(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=b.ArrayLiteral,k(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),c(this._flags.last_token.type,[h.START_EXPR,h.END_EXPR,h.WORD,h.OPERATOR,h.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===h.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=b.ForInitializer):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=b.Conditional):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(c(this._flags.last_token.text,l)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===h.EQUALS||this._flags.last_token.type===h.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===h.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var i=this._tokens.peek(-4);d(n,["async","function"])||"*"===n.text&&d(i,["async","function"])?this._output.space_before_token=!0:this._flags.mode===b.ObjectLiteral?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==i.text&&","!==i.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===h.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===b.ObjectLiteral&&c(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===h.START_BLOCK?this.print_newline():this._flags.last_token.type!==h.END_EXPR&&this._flags.last_token.type!==h.START_EXPR&&this._flags.last_token.type!==h.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==h.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},O.prototype.handle_end_expr=function(t){while(this._flags.mode===b.Statement)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&k(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==h.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===b.Conditional&&(this._previous_flags.mode=b.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},O.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===h.END_EXPR?(this.set_mode(b.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(b.BlockStatement):n&&(c(n.text,[":",","])&&c(e.type,[h.STRING,h.WORD,h.RESERVED])||c(e.text,["get","set","..."])&&c(n.type,[h.WORD,h.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(n.text,[":",","])?this.set_mode(b.BlockStatement):this.set_mode(b.ObjectLiteral):this._flags.last_token.type===h.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(b.BlockStatement):c(this._flags.last_token.type,[h.EQUALS,h.START_EXPR,h.COMMA,h.OPERATOR])||d(this._flags.last_token,["return","throw","import","default"])?this.set_mode(b.ObjectLiteral):this.set_mode(b.BlockStatement),this._flags.last_token&&d(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var i=!e.comments_before&&"}"===e.text,r=i&&"function"===this._flags.last_word&&this._flags.last_token.type===h.END_EXPR;if(this._options.brace_preserve_inline){var s=0,o=null;this._flags.inline_frame=!0;do{if(s+=1,o=this._tokens.peek(s-1),o.newlines){this._flags.inline_frame=!1;break}}while(o.type!==h.EOF&&(o.type!==h.END_BLOCK||o.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==h.OPERATOR&&(r||this._flags.last_token.type===h.EQUALS||d(this._flags.last_token,g)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!k(this._previous_flags.mode)||this._flags.last_token.type!==h.START_EXPR&&this._flags.last_token.type!==h.COMMA||((this._flags.last_token.type===h.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===h.COMMA||this._flags.last_token.type===h.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==h.OPERATOR&&this._flags.last_token.type!==h.START_EXPR&&(c(this._flags.last_token.type,[h.START_BLOCK,h.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),i||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},O.prototype.handle_end_block=function(t){this.handle_whitespace_and_comments(t);while(this._flags.mode===b.Statement)this.restore_mode();var e=this._flags.last_token.type===h.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(k(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},O.prototype.handle_word=function(t){if(t.type===h.RESERVED)if(c(t.text,["set","get"])&&this._flags.mode!==b.ObjectLiteral)t.type=h.WORD;else if("import"===t.text&&c(this._tokens.peek().text,["(","."]))t.type=h.WORD;else if(c(t.text,["as","from"])&&!this._flags.import_block)t.type=h.WORD;else if(this._flags.mode===b.ObjectLiteral){var e=this._tokens.peek();":"===e.text&&(t.type=h.WORD)}if(this.start_of_statement(t)?d(this._flags.last_token,["var","let","const"])&&t.type===h.WORD&&(this._flags.declaration_statement=!0):!t.newlines||C(this._flags.mode)||this._flags.last_token.type===h.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===h.EQUALS||!this._options.preserve_newlines&&d(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(f(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&f(t,"else"))this._flags.else_block=!0;else{while(this._flags.mode===b.Statement)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&d(t,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==h.COMMA&&this._flags.last_token.type!==h.START_EXPR&&this._flags.last_token.type!==h.EQUALS&&this._flags.last_token.type!==h.OPERATOR||this.start_of_object_property()||c(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===b.ObjectLiteral||this.allow_wrap_or_preserved_newline(t),f(t,"function"))return(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!c(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==h.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===h.RESERVED||this._flags.last_token.type===h.WORD?d(this._flags.last_token,["get","set","new","export"])||d(this._flags.last_token,L)||f(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===h.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!C(this._flags.mode)&&!k(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var n="NONE";if(this._flags.last_token.type===h.END_BLOCK?this._previous_flags.inline_frame?n="SPACE":d(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?n="NEWLINE":(n="SPACE",this._output.space_before_token=!0):n="NEWLINE":this._flags.last_token.type===h.SEMICOLON&&this._flags.mode===b.BlockStatement?n="NEWLINE":this._flags.last_token.type===h.SEMICOLON&&C(this._flags.mode)?n="SPACE":this._flags.last_token.type===h.STRING?n="NEWLINE":this._flags.last_token.type===h.RESERVED||this._flags.last_token.type===h.WORD||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===b.ObjectLiteral&&c(this._last_last_text,["{",","]))?n="SPACE":this._flags.last_token.type===h.START_BLOCK?n=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===h.END_EXPR&&(this._output.space_before_token=!0,n="NEWLINE"),d(t,l)&&")"!==this._flags.last_token.text&&(n=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),d(t,["else","catch","finally"]))if((this._flags.last_token.type!==h.END_BLOCK||this._previous_flags.mode!==b.BlockStatement||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var i=this._output.current_line;"}"!==i.last()&&this.print_newline(),this._output.space_before_token=!0}else"NEWLINE"===n?d(this._flags.last_token,g)||"declare"===this._flags.last_token.text&&d(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==h.END_EXPR?this._flags.last_token.type===h.START_EXPR&&d(t,["var","let","const"])||":"===this._flags.last_token.text||(f(t,"if")&&f(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):d(t,l)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&k(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===n&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==h.WORD&&t.previous.type!==h.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===h.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&f(t,"from")&&(this._flags.import_block=!1))},O.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);var e=this._tokens.peek();while(this._flags.mode===b.Statement&&(!this._flags.if_block||!f(e,"else"))&&!this._flags.do_block)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},O.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==h.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===h.RESERVED||this._flags.last_token.type===h.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===h.COMMA||this._flags.last_token.type===h.START_EXPR||this._flags.last_token.type===h.EQUALS||this._flags.last_token.type===h.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==h.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},O.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},O.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(C(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===b.ObjectLiteral||this._flags.mode===b.Statement&&this._flags.parent.mode===b.ObjectLiteral?(this._flags.mode===b.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},O.prototype.handle_operator=function(t){var e="*"===t.text&&(d(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[h.START_BLOCK,h.COMMA,h.END_BLOCK,h.SEMICOLON])),n=c(t.text,["-","+"])&&(c(this._flags.last_token.type,[h.START_BLOCK,h.START_EXPR,h.EQUALS,h.OPERATOR])||c(this._flags.last_token.text,l)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var i=!e;this.handle_whitespace_and_comments(t,i)}if("*"!==t.text||this._flags.last_token.type!==h.DOT)if("::"!==t.text)if(c(t.text,["-","+"])&&this.start_of_object_property())this.print_token(t);else{if(this._flags.last_token.type===h.OPERATOR&&c(this._options.operator_position,y)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==h.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var r=!0,s=!0,o=!1;if(":"===t.text?0===this._flags.ternary_depth?r=!1:(this._flags.ternary_depth-=1,o=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!n&&!e&&this._options.preserve_newlines&&c(t.text,u)){var a=":"===t.text,_=a&&o,p=a&&!o;switch(this._options.operator_position){case v.before_newline:return this._output.space_before_token=!p,this.print_token(t),a&&!_||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case v.after_newline:return this._output.space_before_token=!0,!a||_?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case v.preserve_newline:return p||this.allow_wrap_or_preserved_newline(t),r=!(this._output.just_added_newline()||p),this._output.space_before_token=r,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),r=!1;var f=this._tokens.peek();s=f&&c(f.type,[h.WORD,h.RESERVED])}else if("..."===t.text)this.allow_wrap_or_preserved_newline(t),r=this._flags.last_token.type===h.START_BLOCK,s=!1;else if(c(t.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==h.COMMA&&this._flags.last_token.type!==h.START_EXPR||this.allow_wrap_or_preserved_newline(t),r=!1,s=!1,t.newlines&&("--"===t.text||"++"===t.text||"~"===t.text)){var m=d(this._flags.last_token,g)&&t.newlines;m&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(m,!0)}";"===this._flags.last_token.text&&C(this._flags.mode)&&(r=!0),this._flags.last_token.type===h.RESERVED?r=!0:this._flags.last_token.type===h.END_EXPR?r=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===h.OPERATOR&&(r=c(t.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(t.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==b.BlockStatement||this._flags.inline_frame)&&this._flags.mode!==b.Statement||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||r,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},O.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):s.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},O.prototype.print_block_commment=function(t,e){var n,i=x(t.text),r=!1,s=!1,o=t.whitespace_before,a=o.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(i[0]),this.print_newline(!1,e),i.length>1){for(i=i.slice(1),r=T(i,"*"),s=S(i,o),r&&(this._flags.alignment=1),n=0;n<i.length;n++)r?(this.print_token_line_indentation(t),this._output.add_token(_(i[n]))):s&&i[n]?(this.print_token_line_indentation(t),this._output.add_token(i[n].substring(a))):(this._output.current_line.set_indent(-1),this._output.add_token(i[n])),this.print_newline(!1,e);this._flags.alignment=0}},O.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},O.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),d(this._flags.last_token,g)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},O.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},O.prototype.handle_eof=function(t){while(this._flags.mode===b.Statement)this.restore_mode();this.handle_whitespace_and_comments(t)},t.exports.Beautifier=O},function(t){function e(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function i(t,i){this.__indent_cache=new n(t,i),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},e.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},e.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},e.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){while(" "===this.last())this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},n.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e,n},n.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e],n},n.prototype.__ensure_cache=function(t){while(t>=this.__cache.length)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},i.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(t){var e=this.__lines.length;while(t<e)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(t){t=void 0!==t&&t,this.current_line.trim();while(t&&this.__lines.length>1&&this.current_line.is_empty())this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(t,n){var i=this.__lines.length-2;while(i>=0){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(t)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},t.exports.Output=i},function(t){function e(t,e,n,i){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}t.exports.Token=e},function(t,e){var n="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",i="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",s="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",a="(?:"+o+"|["+n+r+"])",l="(?:"+o+"|["+i+r+s+"])*";e.identifier=new RegExp(a+l,"g"),e.identifierStart=new RegExp(a),e.identifierMatch=new RegExp("(?:"+o+"|["+i+r+s+"])+");e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")},function(t,e,n){var i=n(6).Options,r=["before-newline","after-newline","preserve-newline"];function s(t){i.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s<n.length;s++)"preserve-inline"===n[s]?this.brace_preserve_inline=!0:this.brace_style=n[s];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",r),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}s.prototype=new i,t.exports.Options=s},function(t){function e(t,e){this.raw_options=n(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function n(t,e){var n,r={};for(n in t=i(t),t)n!==e&&(r[n]=t[n]);if(e&&t[e])for(n in t[e])r[n]=t[e][n];return r}function i(t){var e,n={};for(e in t){var i=e.replace(/-/g,"_");n[i]=t[e]}return n}e.prototype._get_array=function(t,e){var n=this.raw_options[t],i=e||[];return"object"===typeof n?null!==n&&"function"===typeof n.concat&&(i=n.concat()):"string"===typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},e.prototype._get_boolean=function(t,e){var n=this.raw_options[t],i=void 0===n?!!e:!!n;return i},e.prototype._get_characters=function(t,e){var n=this.raw_options[t],i=e||"";return"string"===typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},e.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var i=parseInt(n,10);return isNaN(i)&&(i=e),i},e.prototype._get_selection=function(t,e,n){var i=this._get_selection_list(t,e,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i[0]},e.prototype._get_selection_list=function(t,e,n){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var i=this._get_array(t,n);if(!this._is_valid_selection(i,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i},e.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},t.exports.Options=e,t.exports.normalizeOpts=i,t.exports.mergeOpts=n},function(t,e,n){var i=n(8).InputScanner,r=n(9).Tokenizer,s=n(9).TOKEN,o=n(13).Directives,a=n(4),l=n(12).Pattern,u=n(14).TemplatablePattern;function h(t,e){return-1!==e.indexOf(t)}var c={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},_=new o(/\/\*/,/\*\//),p=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,f=/[0-9]/,d=/[^\d\.]/,g=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),m=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";m=m.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),m="\\?\\.(?!\\d) "+m,m=m.replace(/ /g,"|");var v,y=new RegExp(m),b="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),w=b.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),x=new RegExp("^(?:"+w.join("|")+")$"),k=function(t,e){r.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new l(this._input),i=new u(this._input).read_options(this._options);this.__patterns={template:i,identifier:i.starting_with(a.identifier).matching(a.identifierMatch),number:n.matching(p),punct:n.matching(y),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(/<!--/),html_comment_end:n.matching(/-->/),include:n.starting_with(/#include/).until_after(a.lineBreak),shebang:n.starting_with(/#!/).until_after(a.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:i.until(/['\\\n\r\u2028\u2029]/),double_quote:i.until(/["\\\n\r\u2028\u2029]/),template_text:i.until(/[`\\$]/),template_expression:i.until(/[`}\\]/)}};function C(t){var e="",n=0,r=new i(t),s=null;while(r.hasNext())if(s=r.match(/([\s]|[^\\]|\\\\)+/g),s&&(e+=s[0]),"\\"===r.peek()){if(r.next(),"x"===r.peek())s=r.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==r.peek()){e+="\\",r.hasNext()&&(e+=r.next());continue}s=r.match(/u([0-9A-Fa-f]{4})/g),s||(s=r.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!s)return t;if(n=parseInt(s[1],16),n>126&&n<=255&&0===s[0].indexOf("x"))return t;e+=n>=0&&n<32||n>1114111?"\\"+s[0]:34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return e}k.prototype=new r,k.prototype._is_comment=function(t){return t.type===c.COMMENT||t.type===c.BLOCK_COMMENT||t.type===c.UNKNOWN},k.prototype._is_opening=function(t){return t.type===c.START_BLOCK||t.type===c.START_EXPR},k.prototype._is_closing=function(t,e){return(t.type===c.END_BLOCK||t.type===c.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},k.prototype._reset=function(){v=!1},k.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(c.EOF,""):(n=n||this._read_non_javascript(i),n=n||this._read_string(i),n=n||this._read_pair(i,this._input.peek(1)),n=n||this._read_word(t),n=n||this._read_singles(i),n=n||this._read_comment(i),n=n||this._read_regexp(i,t),n=n||this._read_xml(i,t),n=n||this._read_punctuation(),n=n||this._create_token(c.UNKNOWN,this._input.next()),n)},k.prototype._read_word=function(t){var e;return e=this.__patterns.identifier.read(),""!==e?(e=e.replace(a.allLineBreaks,"\n"),t.type!==c.DOT&&(t.type!==c.RESERVED||"set"!==t.text&&"get"!==t.text)&&x.test(e)?"in"!==e&&"of"!==e||t.type!==c.WORD&&t.type!==c.STRING?this._create_token(c.RESERVED,e):this._create_token(c.OPERATOR,e):this._create_token(c.WORD,e)):(e=this.__patterns.number.read(),""!==e?this._create_token(c.WORD,e):void 0)},k.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(c.START_EXPR,t):")"===t||"]"===t?e=this._create_token(c.END_EXPR,t):"{"===t?e=this._create_token(c.START_BLOCK,t):"}"===t?e=this._create_token(c.END_BLOCK,t):";"===t?e=this._create_token(c.SEMICOLON,t):"."===t&&d.test(this._input.peek(1))?e=this._create_token(c.DOT,t):","===t&&(e=this._create_token(c.COMMA,t)),e&&this._input.next(),e},k.prototype._read_pair=function(t,e){var n=null;return"#"===t&&"{"===e&&(n=this._create_token(c.START_BLOCK,t+e)),n&&(this._input.next(),this._input.next()),n},k.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(c.EQUALS,t):"?."===t?this._create_token(c.DOT,t):this._create_token(c.OPERATOR,t)},k.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read(),e))return this._create_token(c.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read(),e)return this._create_token(c.UNKNOWN,e.trim()+"\n");t=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(f)){do{t=this._input.next(),n+=t}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,n)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read(),e){while(this._input.hasNext()&&!this._input.testChar(a.newline))e+=this._input.next();return v=!0,this._create_token(c.COMMENT,e)}}else if(v&&"-"===t&&(e=this.__patterns.html_comment_end.read(),e))return v=!1,this._create_token(c.COMMENT,e);return null},k.prototype._read_comment=function(t){var e=null;if("/"===t){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var i=_.get_directives(n);i&&"start"===i.ignore&&(n+=_.readIgnored(this._input)),n=n.replace(a.allLineBreaks,"\n"),e=this._create_token(c.BLOCK_COMMENT,n),e.directives=i}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),e=this._create_token(c.COMMENT,n))}return e},k.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=C(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,e)}return null},k.prototype._allow_regexp_or_xml=function(t){return t.type===c.RESERVED&&h(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===c.END_EXPR&&")"===t.text&&t.opened.previous.type===c.RESERVED&&h(t.opened.previous.text,["if","while","for"])||h(t.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},k.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){var n=this._input.next(),i=!1,r=!1;while(this._input.hasNext()&&(i||r||this._input.peek()!==t)&&!this._input.testChar(a.newline))n+=this._input.peek(),i?i=!1:(i="\\"===this._input.peek(),"["===this._input.peek()?r=!0:"]"===this._input.peek()&&(r=!1)),this._input.next();return this._input.peek()===t&&(n+=this._input.next(),n+=this._input.read(a.identifier)),this._create_token(c.STRING,n)}return null},k.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var n="",i=this.__patterns.xml.read_match();if(i){var r=i[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===r.indexOf("{"),o=0;while(i){var l=!!i[1],u=i[2],h=!!i[i.length-1]||"![CDATA["===u.slice(0,8);if(!h&&(u===r||s&&u.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(l?--o:++o),n+=i[0],o<=0)break;i=this.__patterns.xml.read_match()}return i||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,n)}}return null},k.prototype._read_string_recursive=function(t,e,n){var i,r;"'"===t?r=this.__patterns.single_quote:'"'===t?r=this.__patterns.double_quote:"`"===t?r=this.__patterns.template_text:"}"===t&&(r=this.__patterns.template_expression);var s=r.read(),o="";while(this._input.hasNext()){if(o=this._input.next(),o===t||!e&&a.newline.test(o)){this._input.back();break}"\\"===o&&this._input.hasNext()?(i=this._input.peek(),"x"===i||"u"===i?this.has_char_escapes=!0:"\r"===i&&"\n"===this._input.peek(1)&&this._input.next(),o+=this._input.next()):n&&("${"===n&&"$"===o&&"{"===this._input.peek()&&(o+=this._input.next()),n===o&&(o+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(o+=this._input.next()))),o+=r.read(),s+=o}return s},t.exports.Tokenizer=k,t.exports.TOKEN=c,t.exports.positionable_operators=g.slice(),t.exports.line_starters=b.slice()},function(t){var e=RegExp.prototype.hasOwnProperty("sticky");function n(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},n.prototype.peek=function(t){var e=null;return t=t||0,t+=this.__position,t>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},n.prototype.__match=function(t,n){t.lastIndex=n;var i=t.exec(this.__input);return!i||e&&t.sticky||i.index!==n&&(i=null),i},n.prototype.test=function(t,e){return e=e||0,e+=this.__position,e>=0&&e<this.__input_length&&!!this.__match(t,e)},n.prototype.testChar=function(t,e){var n=this.peek(e);return t.lastIndex=0,null!==n&&t.test(n)},n.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},n.prototype.read=function(t,e,n){var i,r="";return t&&(i=this.match(t),i&&(r+=i[0])),!e||!i&&t||(r+=this.readUntil(e,n)),r},n.prototype.readUntil=function(t,e){var n="",i=this.__position;t.lastIndex=this.__position;var r=t.exec(this.__input);return r?(i=r.index,e&&(i+=r[0].length)):i=this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},n.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},n.prototype.get_regexp=function(t,n){var i=null,r="g";return n&&e&&(r="y"),"string"===typeof t&&""!==t?i=new RegExp(t,r):t&&(i=new RegExp(t.source,r)),i},n.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(t){var e=this.__position,n=this.readUntilAfter(t);return this.__position=e,n},n.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=n},function(t,e,n){var i=n(8).InputScanner,r=n(3).Token,s=n(10).TokenStream,o=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(t,e){this._input=new i(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new s,this._reset();var e=new r(a.START,""),n=null,i=[],o=new s;while(e.type!==a.EOF){t=this._get_next_token(e,n);while(this._is_comment(t))o.add(t),t=this._get_next_token(e,n);o.isEmpty()||(t.comments_before=o,o=new s),t.parent=n,this._is_opening(t)?(i.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=i.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},l.prototype._is_comment=function(t){return!1},l.prototype._is_opening=function(t){return!1},l.prototype._is_closing=function(t,e){return!1},l.prototype._create_token=function(t,e){var n=new r(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=l,t.exports.TOKEN=a},function(t){function e(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},e.prototype.peek=function(t){var e=null;return t=t||0,t+=this.__position,t>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},e.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},t.exports.TokenStream=e},function(t,e,n){var i=n(12).Pattern;function r(t,e){i.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new i,r.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},r.prototype.matching=function(t,e){var n=this._create();return n.__set_whitespace_patterns(t,e),n._update(),n},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(t,e){t.lastIndex=0;var n=0,i=[],r=t.exec(e);while(r)i.push(e.substring(n,r.index)),n=r.index+r[0].length,r=t.exec(e);return n<e.length?i.push(e.substring(n,e.length)):i.push(""),i},t.exports.WhitespacePattern=r},function(t){function e(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}e.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},e.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},e.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},e.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},t.exports.Pattern=e},function(t){function e(t,e){t="string"===typeof t?t:t.source,e="string"===typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}e.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;var n=this.__directive_pattern.exec(t);while(n)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},e.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=e},function(t,e,n){var i=n(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function s(t,e){i.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var n=new i(t);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new i,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e=this._create();for(var n in r)e._disabled[n]=-1===t.templating.indexOf(n);return e._update(),e},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);var e=this._read_template();while(e)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},t.exports.TemplatablePattern=s}],e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}var r=i(0);n=r})();var s=n;i=[],r=function(){return{js_beautify:s}}.apply(e,i),void 0===r||(t.exports=r)})()},a69e:function(t,e,n){var i,r;(function(){var s;(function(){"use strict";var t=[,,function(t){function e(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function i(t,i){this.__indent_cache=new n(t,i),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},e.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},e.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},e.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){while(" "===this.last())this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},n.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e,n},n.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e],n},n.prototype.__ensure_cache=function(t){while(t>=this.__cache.length)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},i.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(t){var e=this.__lines.length;while(t<e)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(t){t=void 0!==t&&t,this.current_line.trim();while(t&&this.__lines.length>1&&this.current_line.is_empty())this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(t,n){var i=this.__lines.length-2;while(i>=0){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(t)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},t.exports.Output=i},function(t){function e(t,e,n,i){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}t.exports.Token=e},,,function(t){function e(t,e){this.raw_options=n(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function n(t,e){var n,r={};for(n in t=i(t),t)n!==e&&(r[n]=t[n]);if(e&&t[e])for(n in t[e])r[n]=t[e][n];return r}function i(t){var e,n={};for(e in t){var i=e.replace(/-/g,"_");n[i]=t[e]}return n}e.prototype._get_array=function(t,e){var n=this.raw_options[t],i=e||[];return"object"===typeof n?null!==n&&"function"===typeof n.concat&&(i=n.concat()):"string"===typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},e.prototype._get_boolean=function(t,e){var n=this.raw_options[t],i=void 0===n?!!e:!!n;return i},e.prototype._get_characters=function(t,e){var n=this.raw_options[t],i=e||"";return"string"===typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},e.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var i=parseInt(n,10);return isNaN(i)&&(i=e),i},e.prototype._get_selection=function(t,e,n){var i=this._get_selection_list(t,e,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i[0]},e.prototype._get_selection_list=function(t,e,n){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var i=this._get_array(t,n);if(!this._is_valid_selection(i,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i},e.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},t.exports.Options=e,t.exports.normalizeOpts=i,t.exports.mergeOpts=n},,function(t){var e=RegExp.prototype.hasOwnProperty("sticky");function n(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},n.prototype.peek=function(t){var e=null;return t=t||0,t+=this.__position,t>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},n.prototype.__match=function(t,n){t.lastIndex=n;var i=t.exec(this.__input);return!i||e&&t.sticky||i.index!==n&&(i=null),i},n.prototype.test=function(t,e){return e=e||0,e+=this.__position,e>=0&&e<this.__input_length&&!!this.__match(t,e)},n.prototype.testChar=function(t,e){var n=this.peek(e);return t.lastIndex=0,null!==n&&t.test(n)},n.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},n.prototype.read=function(t,e,n){var i,r="";return t&&(i=this.match(t),i&&(r+=i[0])),!e||!i&&t||(r+=this.readUntil(e,n)),r},n.prototype.readUntil=function(t,e){var n="",i=this.__position;t.lastIndex=this.__position;var r=t.exec(this.__input);return r?(i=r.index,e&&(i+=r[0].length)):i=this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},n.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},n.prototype.get_regexp=function(t,n){var i=null,r="g";return n&&e&&(r="y"),"string"===typeof t&&""!==t?i=new RegExp(t,r):t&&(i=new RegExp(t.source,r)),i},n.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(t){var e=this.__position,n=this.readUntilAfter(t);return this.__position=e,n},n.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=n},function(t,e,n){var i=n(8).InputScanner,r=n(3).Token,s=n(10).TokenStream,o=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(t,e){this._input=new i(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new s,this._reset();var e=new r(a.START,""),n=null,i=[],o=new s;while(e.type!==a.EOF){t=this._get_next_token(e,n);while(this._is_comment(t))o.add(t),t=this._get_next_token(e,n);o.isEmpty()||(t.comments_before=o,o=new s),t.parent=n,this._is_opening(t)?(i.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=i.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},l.prototype._is_comment=function(t){return!1},l.prototype._is_opening=function(t){return!1},l.prototype._is_closing=function(t,e){return!1},l.prototype._create_token=function(t,e){var n=new r(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=l,t.exports.TOKEN=a},function(t){function e(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},e.prototype.peek=function(t){var e=null;return t=t||0,t+=this.__position,t>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},e.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},t.exports.TokenStream=e},function(t,e,n){var i=n(12).Pattern;function r(t,e){i.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new i,r.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},r.prototype.matching=function(t,e){var n=this._create();return n.__set_whitespace_patterns(t,e),n._update(),n},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(t,e){t.lastIndex=0;var n=0,i=[],r=t.exec(e);while(r)i.push(e.substring(n,r.index)),n=r.index+r[0].length,r=t.exec(e);return n<e.length?i.push(e.substring(n,e.length)):i.push(""),i},t.exports.WhitespacePattern=r},function(t){function e(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}e.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},e.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},e.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},e.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},t.exports.Pattern=e},function(t){function e(t,e){t="string"===typeof t?t:t.source,e="string"===typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}e.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;var n=this.__directive_pattern.exec(t);while(n)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},e.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=e},function(t,e,n){var i=n(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function s(t,e){i.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var n=new i(t);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new i,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e=this._create();for(var n in r)e._disabled[n]=-1===t.templating.indexOf(n);return e._update(),e},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);var e=this._read_template();while(e)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},t.exports.TemplatablePattern=s},,,,function(t,e,n){var i=n(19).Beautifier,r=n(20).Options;function s(t,e,n,r){var s=new i(t,e,n,r);return s.beautify()}t.exports=s,t.exports.defaultOptions=function(){return new r}},function(t,e,n){var i=n(20).Options,r=n(2).Output,s=n(21).Tokenizer,o=n(21).TOKEN,a=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,u=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new r(t,e)};u.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},u.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},u.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},u.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},u.prototype.print_preserved_newlines=function(t){var e=0;t.type!==o.TEXT&&t.previous.type!==o.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var n=0;n<e;n++)this.print_newline(n>0);return 0!==e},u.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},u.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},u.prototype.print_newline=function(t){this._output.add_new_line(t)},u.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},u.prototype.indent=function(){this.indent_level++},u.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},u.prototype.get_full_indent=function(t){return t=this.indent_level+(t||0),t<1?"":this._output.get_indent_string(t)};var h=function(t){var e=null,n=t.next;while(n.type!==o.EOF&&t.closed!==n){if(n.type===o.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===o.EQUALS&&n.next.next&&n.next.next.type===o.VALUE&&(e=n.next.next.text);break}n=n.next}return e},c=function(t,e){var n=null,i=null;return e.closed?("script"===t?n="text/javascript":"style"===t&&(n="text/css"),n=h(e)||n,n.search("text/css")>-1?i="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?i="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?i="html":n.search(/test\/null/)>-1&&(i="null"),i):null};function _(t,e){return-1!==e.indexOf(t)}function p(t,e,n){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=n||0,this.parser_token=e||null}function f(t){this._printer=t,this._current_frame=null}function d(t,e,n,r){this._source_text=t||"",e=e||{},this._js_beautify=n,this._css_beautify=r,this._tag_stack=null;var s=new i(e,"html");this._options=s,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}f.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},f.prototype.record_tag=function(t){var e=new p(this._current_frame,t,this._printer.indent_level);this._current_frame=e},f.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},f.prototype._get_frame=function(t,e){var n=this._current_frame;while(n){if(-1!==t.indexOf(n.tag))break;if(e&&-1!==e.indexOf(n.tag)){n=null;break}n=n.parent}return n},f.prototype.try_pop=function(t,e){var n=this._get_frame([t],e);return this._try_pop_frame(n)},f.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&a.test(t)&&(e=t.match(a)[0])),t=t.replace(l,"\n");var n=t.match(/^[\t ]*/)[0],i={text:"",type:""},r=new g(this._options),h=new u(this._options,n),c=new s(t,this._options).tokenize();this._tag_stack=new f(h);var _=null,p=c.next();while(p.type!==o.EOF)p.type===o.TAG_OPEN||p.type===o.COMMENT?(_=this._handle_tag_open(h,p,r,i,c),r=_):p.type===o.ATTRIBUTE||p.type===o.EQUALS||p.type===o.VALUE||p.type===o.TEXT&&!r.tag_complete?_=this._handle_inside_tag(h,p,r,i):p.type===o.TAG_CLOSE?_=this._handle_tag_close(h,p,r):p.type===o.TEXT?_=this._handle_text(h,p,r):p.type===o.CONTROL_FLOW_OPEN?_=this._handle_control_flow_open(h,p):p.type===o.CONTROL_FLOW_CLOSE?_=this._handle_control_flow_close(h,p):h.add_raw_token(p),i=_,p=c.next();var d=h._output.get_code(e);return d},d.prototype._handle_control_flow_open=function(t,e){var n={text:e.text,type:e.type};return t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),e.newlines?t.print_preserved_newlines(e):t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),t.print_token(e),t.indent(),n},d.prototype._handle_control_flow_close=function(t,e){var n={text:e.text,type:e.type};return t.deindent(),e.newlines?t.print_preserved_newlines(e):t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),t.print_token(e),n},d.prototype._handle_tag_close=function(t,e,n){var i={text:e.text,type:e.type};return t.alignment_size=0,n.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),n.is_unformatted?t.add_raw_token(e):("<"===n.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(t.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||t.set_wrap_point(),i},d.prototype._handle_inside_tag=function(t,e,n,i){var r=n.has_wrapped_attrs,s={text:e.text,type:e.type};return t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),n.is_unformatted?t.add_raw_token(e):"{"===n.tag_start_char&&e.type===o.TEXT?t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e):(e.type===o.ATTRIBUTE?t.set_space_before_token(!0):(e.type===o.EQUALS||e.type===o.VALUE&&e.previous.type===o.EQUALS)&&t.set_space_before_token(!1),e.type===o.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),r=r||0!==e.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(i.type!==o.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(t.print_newline(!1),r=!0)),t.print_token(e),r=r||t.previous_token_wrapped(),n.has_wrapped_attrs=r),s},d.prototype._handle_text=function(t,e,n){var i={text:e.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(t,e,n):n.is_unformatted||n.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),i},d.prototype._print_custom_beatifier_text=function(t,e,n){var i=this;if(""!==e.text){var r,s=e.text,o=1,a="",l="";"javascript"===n.custom_beautifier_name&&"function"===typeof this._js_beautify?r=this._js_beautify:"css"===n.custom_beautifier_name&&"function"===typeof this._css_beautify?r=this._css_beautify:"html"===n.custom_beautifier_name&&(r=function(t,e){var n=new d(t,e,i._js_beautify,i._css_beautify);return n.beautify()}),"keep"===this._options.indent_scripts?o=0:"separate"===this._options.indent_scripts&&(o=-t.indent_level);var u=t.get_full_indent(o);if(s=s.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var h=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!h)return void t.add_raw_token(e);a=u+h[1]+"\n",s=h[4],h[5]&&(l=u+h[5]),s=s.replace(/\n[ \t]*$/,""),(h[2]||-1!==h[3].indexOf("\n"))&&(h=h[3].match(/[ \t]+$/),h&&(e.whitespace_before=h[0]))}if(s)if(r){var c=function(){this.eol="\n"};c.prototype=this._options.raw_options;var _=new c;s=r(u+s,_)}else{var p=e.whitespace_before;p&&(s=s.replace(new RegExp("\n("+p+")?","g"),"\n")),s=u+s.replace(/\n/g,"\n"+u)}a&&(s=s?a+s+"\n"+l:a+l),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},d.prototype._handle_tag_open=function(t,e,n,i,r){var s=this._get_tag_open_token(e);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||e.type!==o.TAG_OPEN||s.is_start_tag?(t.traverse_whitespace(e),this._set_tag_position(t,e,s,n,i),s.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),s.start_tag_token=this._tag_stack.try_pop(s.tag_name)),s.is_start_tag&&this._is_wrap_attributes_force){var a,l=0;do{a=r.peek(l),a.type===o.ATTRIBUTE&&(s.attr_count+=1),l+=1}while(a.type!==o.EOF&&a.type!==o.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(s.alignment_size=e.text.length+1),s.tag_complete||s.is_unformatted||(t.alignment_size=s.alignment_size),s};var g=function(t,e,n){if(this.parent=e||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",n){var i;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(i=n.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===o.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||n.closed&&"/>"===n.closed.text;var r=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(r=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!t.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(r)))}else this.tag_complete=!0};d.prototype._get_tag_open_token=function(t){var e=new g(this._options,this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||_(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&_(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&_(e.tag_check,this._options.content_unformatted),e.is_inline_element=_(e.tag_name,this._options.inline)||this._options.inline_custom_elements&&e.tag_name.includes("-")||"{"===e.tag_start_char,e},d.prototype._set_tag_position=function(t,e,n,i,r){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=c(n.tag_check,e)))),_(n.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check){this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0;var s=t.current_line_has_match(/{{#if/);s||t.print_newline(!1)}"!--"===n.tag_name&&r.type===o.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))}else if(n.is_end_tag){var a=!1;a=n.start_tag_token&&n.start_tag_token.multiline_content,a=a||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(r.type===o.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==r.type,(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&t.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===r.type&&!n.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n)},d.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var m=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],v=["a","audio","del","ins","map","noscript","video"];d.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=e||this._tag_stack.try_pop("dt",["dl"]),e=e||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==m.indexOf(t.tag_name)){var n=t.parent.parent;n&&-1!==v.indexOf(n.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]),e=e||this._tag_stack.try_pop("rp",["ruby","rtc"])):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"])):"tbody"===t.tag_name||"tfoot"===t.tag_name?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("thead",["table"]),e=e||this._tag_stack.try_pop("tbody",["table"])):"tr"===t.tag_name?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):"th"!==t.tag_name&&"td"!==t.tag_name||(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),e=e||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},t.exports.Beautifier=d},function(t,e,n){var i=n(6).Options;function r(t){i.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}r.prototype=new i,t.exports.Options=r},function(t,e,n){var i=n(9).Tokenizer,r=n(9).TOKEN,s=n(13).Directives,o=n(14).TemplatablePattern,a=n(12).Pattern,l={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},u=new s(/<\!--/,/-->/),h=function(t,e){i.call(this,t,e),this._current_tag_name="";var n=new o(this._input).read_options(this._options),r=new a(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),word_control_flow_close_excluded:n.until(/[\n\r\t <}]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),angular_control_flow_start:r.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(/<!--/).until_after(/-->/),cdata:r.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:r.starting_with(/<!\[/).until_after(/]>/),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var s=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(s).until_after(s)}};h.prototype=new i,h.prototype._is_comment=function(t){return!1},h.prototype._is_opening=function(t){return t.type===l.TAG_OPEN||t.type===l.CONTROL_FLOW_OPEN},h.prototype._is_closing=function(t,e){return t.type===l.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])||t.type===l.CONTROL_FLOW_CLOSE&&"}"===t.text&&e.text.endsWith("{")},h.prototype._reset=function(){this._current_tag_name=""},h.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(l.EOF,""):(n=n||this._read_open_handlebars(i,e),n=n||this._read_attribute(i,t,e),n=n||this._read_close(i,e),n=n||this._read_script_and_style(i,t),n=n||this._read_control_flows(i,e),n=n||this._read_raw_content(i,t,e),n=n||this._read_content_word(i,e),n=n||this._read_comment_or_cdata(i),n=n||this._read_processing(i),n=n||this._read_open(i,e),n=n||this._create_token(l.UNKNOWN,this._input.next()),n)},h.prototype._read_comment_or_cdata=function(t){var e=null,n=null,i=null;if("<"===t){var r=this._input.peek(1);"!"===r&&(n=this.__patterns.comment.read(),n?(i=u.get_directives(n),i&&"start"===i.ignore&&(n+=u.readIgnored(this._input))):n=this.__patterns.cdata.read()),n&&(e=this._create_token(l.COMMENT,n),e.directives=i)}return e},h.prototype._read_processing=function(t){var e=null,n=null,i=null;if("<"===t){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=this.__patterns.conditional_comment.read(),n=n||this.__patterns.processing.read()),n&&(e=this._create_token(l.COMMENT,n),e.directives=i)}return e},h.prototype._read_open=function(t,e){var n=null,i=null;return e&&e.type!==l.CONTROL_FLOW_OPEN||"<"===t&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),i=this._create_token(l.TAG_OPEN,n)),i},h.prototype._read_open_handlebars=function(t,e){var n=null,i=null;return e&&e.type!==l.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===t&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars.read(),i=this._create_token(l.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),i=this._create_token(l.TAG_OPEN,n))),i},h.prototype._read_control_flows=function(t,e){var n="",i=null;if(!this._options.templating.includes("angular"))return i;if("@"===t){if(n=this.__patterns.angular_control_flow_start.read(),""===n)return i;var r=n.endsWith("(")?1:0,s=0;while(!n.endsWith("{")||r!==s){var o=this._input.next();if(null===o)break;"("===o?r++:")"===o&&s++,n+=o}i=this._create_token(l.CONTROL_FLOW_OPEN,n)}else"}"===t&&e&&e.type===l.CONTROL_FLOW_OPEN&&(n=this._input.next(),i=this._create_token(l.CONTROL_FLOW_CLOSE,n));return i},h.prototype._read_close=function(t,e){var n=null,i=null;return e&&e.type===l.TAG_OPEN&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(n=this._input.next(),"/"===t&&(n+=this._input.next()),i=this._create_token(l.TAG_CLOSE,n)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),i=this._create_token(l.TAG_CLOSE,"}}"))),i},h.prototype._read_attribute=function(t,e,n){var i=null,r="";if(n&&"<"===n.text[0])if("="===t)i=this._create_token(l.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),i=this._create_token(l.VALUE,s)}else r=this.__patterns.attribute.read(),r&&(i=e.type===l.EQUALS?this._create_token(l.VALUE,r):this._create_token(l.ATTRIBUTE,r));return i},h.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},h.prototype._read_raw_content=function(t,e,n){var i="";if(n&&"{"===n.text[0])i=this.__patterns.handlebars_raw_close.read();else if(e.type===l.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var r=e.opened.text.substr(1).toLowerCase();this._is_content_unformatted(r)&&(i=this._input.readUntil(new RegExp("</"+r+"[\\n\\r\\t ]*?>","ig")))}return i?this._create_token(l.TEXT,i):null},h.prototype._read_script_and_style=function(t,e){if(e.type===l.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var n=e.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var i=this._read_comment_or_cdata(t);if(i)return i.type=l.TEXT,i;var r=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(r)return this._create_token(l.TEXT,r)}}return null},h.prototype._read_content_word=function(t,e){var n="";return this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=e&&e.type===l.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(l.TEXT,n):null},t.exports.Tokenizer=h,t.exports.TOKEN=l}],e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}var i=n(18);s=i})();var o=s;i=[n,n("a179"),n("a16b")],r=function(t){var e=n("a179"),i=n("a16b");return{html_beautify:function(t,n){return o(t,n,e.js_beautify,i.css_beautify)}}}.apply(e,i),void 0===r||(t.exports=r)})()},af0e:function(t,e,n){},b2dd:function(t,e,n){},cbed:function(t,e,n){(function(t){t(n("69713"))})((function(t){"use strict";t.defineMode("javascript",(function(e,n){var i,r,s=e.indentUnit,o=n.statementIndent,a=n.jsonld,l=n.json||a,u=!1!==n.trackScope,h=n.typescript,c=n.wordCharacters||/[\w$\xa1-\uffff]/,_=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),i=t("keyword c"),r=t("keyword d"),s=t("operator"),o={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:r,break:r,continue:r,new:t("new"),delete:i,void:i,throw:i,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:s,typeof:s,instanceof:s,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:t("this"),class:t("class"),super:t("atom"),yield:i,export:t("export"),import:t("import"),extends:i,await:i}}(),p=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function d(t){var e,n=!1,i=!1;while(null!=(e=t.next())){if(!n){if("/"==e&&!i)return;"["==e?i=!0:i&&"]"==e&&(i=!1)}n=!n&&"\\"==e}}function g(t,e,n){return i=t,r=n,e}function m(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=v(n),e.tokenize(t,e);if("."==n&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==n&&t.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if("="==n&&t.eat(">"))return g("=>","operator");if("0"==n&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(n))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==n)return t.eat("*")?(e.tokenize=y,y(t,e)):t.eat("/")?(t.skipToEnd(),g("comment","comment")):re(t,e,1)?(d(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(t.eat("="),g("operator","operator",t.current()));if("`"==n)return e.tokenize=b,b(t,e);if("#"==n&&"!"==t.peek())return t.skipToEnd(),g("meta","meta");if("#"==n&&t.eatWhile(c))return g("variable","property");if("<"==n&&t.match("!--")||"-"==n&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),g("comment","comment");if(p.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-|&?]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),"?"==n&&t.eat(".")?g("."):g("operator","operator",t.current());if(c.test(n)){t.eatWhile(c);var i=t.current();if("."!=e.lastType){if(_.propertyIsEnumerable(i)){var r=_[i];return g(r.type,r.style,i)}if("async"==i&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",i)}return g("variable","variable",i)}}function v(t){return function(e,n){var i,r=!1;if(a&&"@"==e.peek()&&e.match(f))return n.tokenize=m,g("jsonld-keyword","meta");while(null!=(i=e.next())){if(i==t&&!r)break;r=!r&&"\\"==i}return r||(n.tokenize=m),g("string","string")}}function y(t,e){var n,i=!1;while(n=t.next()){if("/"==n&&i){e.tokenize=m;break}i="*"==n}return g("comment","comment")}function b(t,e){var n,i=!1;while(null!=(n=t.next())){if(!i&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=m;break}i=!i&&"\\"==n}return g("quasi","string-2",t.current())}var w="([{}])";function x(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(h){var i=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));i&&(n=i.index)}for(var r=0,s=!1,o=n-1;o>=0;--o){var a=t.string.charAt(o),l=w.indexOf(a);if(l>=0&&l<3){if(!r){++o;break}if(0==--r){"("==a&&(s=!0);break}}else if(l>=3&&l<6)++r;else if(c.test(a))s=!0;else if(/["'\/`]/.test(a))for(;;--o){if(0==o)return;var u=t.string.charAt(o-1);if(u==a&&"\\"!=t.string.charAt(o-2)){o--;break}}else if(s&&!r){++o;break}}s&&!r&&(e.fatArrowAt=o)}}var k={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function C(t,e,n,i,r,s){this.indented=t,this.column=e,this.type=n,this.prev=r,this.info=s,null!=i&&(this.align=i)}function T(t,e){if(!u)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var i=t.context;i;i=i.prev)for(n=i.vars;n;n=n.next)if(n.name==e)return!0}function S(t,e,n,i,r){var s=t.cc;O.state=t,O.stream=r,O.marked=null,O.cc=s,O.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);while(1){var o=s.length?s.pop():l?V:U;if(o(n,i)){while(s.length&&s[s.length-1].lex)s.pop()();return O.marked?O.marked:"variable"==n&&T(t,i)?"variable-2":e}}}var O={state:null,column:null,marked:null,cc:null};function L(){for(var t=arguments.length-1;t>=0;t--)O.cc.push(arguments[t])}function E(){return L.apply(null,arguments),!0}function A(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function N(t){var e=O.state;if(O.marked="def",u){if(e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var i=M(t,e.context);if(null!=i)return void(e.context=i)}else if(!A(t,e.localVars))return void(e.localVars=new W(t,e.localVars));n.globalVars&&!A(t,e.globalVars)&&(e.globalVars=new W(t,e.globalVars))}}function M(t,e){if(e){if(e.block){var n=M(t,e.prev);return n?n==e.prev?e:new D(n,e.vars,!0):null}return A(t,e.vars)?e:new D(e.prev,new W(t,e.vars),!1)}return null}function R(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function D(t,e,n){this.prev=t,this.vars=e,this.block=n}function W(t,e){this.name=t,this.next=e}var P=new W("this",new W("arguments",null));function z(){O.state.context=new D(O.state.context,O.state.localVars,!1),O.state.localVars=P}function I(){O.state.context=new D(O.state.context,O.state.localVars,!0),O.state.localVars=null}function j(){O.state.localVars=O.state.context.vars,O.state.context=O.state.context.prev}function F(t,e){var n=function(){var n=O.state,i=n.indented;if("stat"==n.lexical.type)i=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)i=r.indented;n.lexical=new C(i,O.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function B(){var t=O.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function H(t){function e(n){return n==t?E():";"==t||"}"==n||")"==n||"]"==n?L():E(e)}return e}function U(t,e){return"var"==t?E(F("vardef",e),Lt,H(";"),B):"keyword a"==t?E(F("form"),X,U,B):"keyword b"==t?E(F("form"),U,B):"keyword d"==t?O.stream.match(/^\s*$/,!1)?E():E(F("stat"),q,H(";"),B):"debugger"==t?E(H(";")):"{"==t?E(F("}"),I,_t,B,j):";"==t?E():"if"==t?("else"==O.state.lexical.info&&O.state.cc[O.state.cc.length-1]==B&&O.state.cc.pop()(),E(F("form"),X,U,B,Dt)):"function"==t?E(It):"for"==t?E(F("form"),I,Wt,U,j,B):"class"==t||h&&"interface"==e?(O.marked="keyword",E(F("form","class"==t?t:e),Ut,B)):"variable"==t?h&&"declare"==e?(O.marked="keyword",E(U)):h&&("module"==e||"enum"==e||"type"==e)&&O.stream.match(/^\s*\w/,!1)?(O.marked="keyword","enum"==e?E(ee):"type"==e?E(Ft,H("operator"),mt,H(";")):E(F("form"),Et,H("{"),F("}"),_t,B,B)):h&&"namespace"==e?(O.marked="keyword",E(F("form"),V,U,B)):h&&"abstract"==e?(O.marked="keyword",E(U)):E(F("stat"),st):"switch"==t?E(F("form"),X,H("{"),F("}","switch"),I,_t,B,B,j):"case"==t?E(V,H(":")):"default"==t?E(H(":")):"catch"==t?E(F("form"),z,K,U,B,j):"export"==t?E(F("stat"),Xt,B):"import"==t?E(F("stat"),qt,B):"async"==t?E(U):"@"==e?E(V,U):L(F("stat"),V,H(";"),B)}function K(t){if("("==t)return E(Bt,H(")"))}function V(t,e){return $(t,e,!1)}function G(t,e){return $(t,e,!0)}function X(t){return"("!=t?L():E(F(")"),q,H(")"),B)}function $(t,e,n){if(O.state.fatArrowAt==O.stream.start){var i=n?et:tt;if("("==t)return E(z,F(")"),ht(Bt,")"),B,H("=>"),i,j);if("variable"==t)return L(z,Et,H("=>"),i,j)}var r=n?Q:Y;return k.hasOwnProperty(t)?E(r):"function"==t?E(It,r):"class"==t||h&&"interface"==e?(O.marked="keyword",E(F("form"),Ht,B)):"keyword c"==t||"async"==t?E(n?G:V):"("==t?E(F(")"),q,H(")"),B,r):"operator"==t||"spread"==t?E(n?G:V):"["==t?E(F("]"),te,B,r):"{"==t?ct(at,"}",null,r):"quasi"==t?L(Z,r):"new"==t?E(nt(n)):E()}function q(t){return t.match(/[;\}\)\],]/)?L():L(V)}function Y(t,e){return","==t?E(q):Q(t,e,!1)}function Q(t,e,n){var i=0==n?Y:Q,r=0==n?V:G;return"=>"==t?E(z,n?et:tt,j):"operator"==t?/\+\+|--/.test(e)||h&&"!"==e?E(i):h&&"<"==e&&O.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?E(F(">"),ht(mt,">"),B,i):"?"==e?E(V,H(":"),r):E(r):"quasi"==t?L(Z,i):";"!=t?"("==t?ct(G,")","call",i):"."==t?E(ot,i):"["==t?E(F("]"),q,H("]"),B,i):h&&"as"==e?(O.marked="keyword",E(mt,i)):"regexp"==t?(O.state.lastType=O.marked="operator",O.stream.backUp(O.stream.pos-O.stream.start-1),E(r)):void 0:void 0}function Z(t,e){return"quasi"!=t?L():"${"!=e.slice(e.length-2)?E(Z):E(q,J)}function J(t){if("}"==t)return O.marked="string-2",O.state.tokenize=b,E(Z)}function tt(t){return x(O.stream,O.state),L("{"==t?U:V)}function et(t){return x(O.stream,O.state),L("{"==t?U:G)}function nt(t){return function(e){return"."==e?E(t?rt:it):"variable"==e&&h?E(Tt,t?Q:Y):L(t?G:V)}}function it(t,e){if("target"==e)return O.marked="keyword",E(Y)}function rt(t,e){if("target"==e)return O.marked="keyword",E(Q)}function st(t){return":"==t?E(B,U):L(Y,H(";"),B)}function ot(t){if("variable"==t)return O.marked="property",E()}function at(t,e){return"async"==t?(O.marked="property",E(at)):"variable"==t||"keyword"==O.style?(O.marked="property","get"==e||"set"==e?E(lt):(h&&O.state.fatArrowAt==O.stream.start&&(n=O.stream.match(/^\s*:\s*/,!1))&&(O.state.fatArrowAt=O.stream.pos+n[0].length),E(ut))):"number"==t||"string"==t?(O.marked=a?"property":O.style+" property",E(ut)):"jsonld-keyword"==t?E(ut):h&&R(e)?(O.marked="keyword",E(at)):"["==t?E(V,pt,H("]"),ut):"spread"==t?E(G,ut):"*"==e?(O.marked="keyword",E(at)):":"==t?L(ut):void 0;var n}function lt(t){return"variable"!=t?L(ut):(O.marked="property",E(It))}function ut(t){return":"==t?E(G):"("==t?L(It):void 0}function ht(t,e,n){function i(r,s){if(n?n.indexOf(r)>-1:","==r){var o=O.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),E((function(n,i){return n==e||i==e?L():L(t)}),i)}return r==e||s==e?E():n&&n.indexOf(";")>-1?L(t):E(H(e))}return function(n,r){return n==e||r==e?E():L(t,i)}}function ct(t,e,n){for(var i=3;i<arguments.length;i++)O.cc.push(arguments[i]);return E(F(e,n),ht(t,e),B)}function _t(t){return"}"==t?E():L(U,_t)}function pt(t,e){if(h){if(":"==t)return E(mt);if("?"==e)return E(pt)}}function ft(t,e){if(h&&(":"==t||"in"==e))return E(mt)}function dt(t){if(h&&":"==t)return O.stream.match(/^\s*\w+\s+is\b/,!1)?E(V,gt,mt):E(mt)}function gt(t,e){if("is"==e)return O.marked="keyword",E()}function mt(t,e){return"keyof"==e||"typeof"==e||"infer"==e||"readonly"==e?(O.marked="keyword",E("typeof"==e?G:mt)):"variable"==t||"void"==e?(O.marked="type",E(Ct)):"|"==e||"&"==e?E(mt):"string"==t||"number"==t||"atom"==t?E(Ct):"["==t?E(F("]"),ht(mt,"]",","),B,Ct):"{"==t?E(F("}"),yt,B,Ct):"("==t?E(ht(kt,")"),vt,Ct):"<"==t?E(ht(mt,">"),mt):"quasi"==t?L(wt,Ct):void 0}function vt(t){if("=>"==t)return E(mt)}function yt(t){return t.match(/[\}\)\]]/)?E():","==t||";"==t?E(yt):L(bt,yt)}function bt(t,e){return"variable"==t||"keyword"==O.style?(O.marked="property",E(bt)):"?"==e||"number"==t||"string"==t?E(bt):":"==t?E(mt):"["==t?E(H("variable"),ft,H("]"),bt):"("==t?L(jt,bt):t.match(/[;\}\)\],]/)?void 0:E()}function wt(t,e){return"quasi"!=t?L():"${"!=e.slice(e.length-2)?E(wt):E(mt,xt)}function xt(t){if("}"==t)return O.marked="string-2",O.state.tokenize=b,E(wt)}function kt(t,e){return"variable"==t&&O.stream.match(/^\s*[?:]/,!1)||"?"==e?E(kt):":"==t?E(mt):"spread"==t?E(kt):L(mt)}function Ct(t,e){return"<"==e?E(F(">"),ht(mt,">"),B,Ct):"|"==e||"."==t||"&"==e?E(mt):"["==t?E(mt,H("]"),Ct):"extends"==e||"implements"==e?(O.marked="keyword",E(mt)):"?"==e?E(mt,H(":"),mt):void 0}function Tt(t,e){if("<"==e)return E(F(">"),ht(mt,">"),B,Ct)}function St(){return L(mt,Ot)}function Ot(t,e){if("="==e)return E(mt)}function Lt(t,e){return"enum"==e?(O.marked="keyword",E(ee)):L(Et,pt,Mt,Rt)}function Et(t,e){return h&&R(e)?(O.marked="keyword",E(Et)):"variable"==t?(N(e),E()):"spread"==t?E(Et):"["==t?ct(Nt,"]"):"{"==t?ct(At,"}"):void 0}function At(t,e){return"variable"!=t||O.stream.match(/^\s*:/,!1)?("variable"==t&&(O.marked="property"),"spread"==t?E(Et):"}"==t?L():"["==t?E(V,H("]"),H(":"),At):E(H(":"),Et,Mt)):(N(e),E(Mt))}function Nt(){return L(Et,Mt)}function Mt(t,e){if("="==e)return E(G)}function Rt(t){if(","==t)return E(Lt)}function Dt(t,e){if("keyword b"==t&&"else"==e)return E(F("form","else"),U,B)}function Wt(t,e){return"await"==e?E(Wt):"("==t?E(F(")"),Pt,B):void 0}function Pt(t){return"var"==t?E(Lt,zt):"variable"==t?E(zt):L(zt)}function zt(t,e){return")"==t?E():";"==t?E(zt):"in"==e||"of"==e?(O.marked="keyword",E(V,zt)):L(V,zt)}function It(t,e){return"*"==e?(O.marked="keyword",E(It)):"variable"==t?(N(e),E(It)):"("==t?E(z,F(")"),ht(Bt,")"),B,dt,U,j):h&&"<"==e?E(F(">"),ht(St,">"),B,It):void 0}function jt(t,e){return"*"==e?(O.marked="keyword",E(jt)):"variable"==t?(N(e),E(jt)):"("==t?E(z,F(")"),ht(Bt,")"),B,dt,j):h&&"<"==e?E(F(">"),ht(St,">"),B,jt):void 0}function Ft(t,e){return"keyword"==t||"variable"==t?(O.marked="type",E(Ft)):"<"==e?E(F(">"),ht(St,">"),B):void 0}function Bt(t,e){return"@"==e&&E(V,Bt),"spread"==t?E(Bt):h&&R(e)?(O.marked="keyword",E(Bt)):h&&"this"==t?E(pt,Mt):L(Et,pt,Mt)}function Ht(t,e){return"variable"==t?Ut(t,e):Kt(t,e)}function Ut(t,e){if("variable"==t)return N(e),E(Kt)}function Kt(t,e){return"<"==e?E(F(">"),ht(St,">"),B,Kt):"extends"==e||"implements"==e||h&&","==t?("implements"==e&&(O.marked="keyword"),E(h?mt:V,Kt)):"{"==t?E(F("}"),Vt,B):void 0}function Vt(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||h&&R(e))&&O.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(O.marked="keyword",E(Vt)):"variable"==t||"keyword"==O.style?(O.marked="property",E(Gt,Vt)):"number"==t||"string"==t?E(Gt,Vt):"["==t?E(V,pt,H("]"),Gt,Vt):"*"==e?(O.marked="keyword",E(Vt)):h&&"("==t?L(jt,Vt):";"==t||","==t?E(Vt):"}"==t?E():"@"==e?E(V,Vt):void 0}function Gt(t,e){if("!"==e)return E(Gt);if("?"==e)return E(Gt);if(":"==t)return E(mt,Mt);if("="==e)return E(G);var n=O.state.lexical.prev,i=n&&"interface"==n.info;return L(i?jt:It)}function Xt(t,e){return"*"==e?(O.marked="keyword",E(Jt,H(";"))):"default"==e?(O.marked="keyword",E(V,H(";"))):"{"==t?E(ht($t,"}"),Jt,H(";")):L(U)}function $t(t,e){return"as"==e?(O.marked="keyword",E(H("variable"))):"variable"==t?L(G,$t):void 0}function qt(t){return"string"==t?E():"("==t?L(V):"."==t?L(Y):L(Yt,Qt,Jt)}function Yt(t,e){return"{"==t?ct(Yt,"}"):("variable"==t&&N(e),"*"==e&&(O.marked="keyword"),E(Zt))}function Qt(t){if(","==t)return E(Yt,Qt)}function Zt(t,e){if("as"==e)return O.marked="keyword",E(Yt)}function Jt(t,e){if("from"==e)return O.marked="keyword",E(V)}function te(t){return"]"==t?E():L(ht(G,"]"))}function ee(){return L(F("form"),Et,H("{"),F("}"),ht(ne,"}"),B,B)}function ne(){return L(Et,Mt)}function ie(t,e){return"operator"==t.lastType||","==t.lastType||p.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function re(t,e,n){return e.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return z.lex=I.lex=!0,j.lex=!0,B.lex=!0,{startState:function(t){var e={tokenize:m,lastType:"sof",cc:[],lexical:new C((t||0)-s,0,"block",!1),localVars:n.localVars,context:n.localVars&&new D(null,null,!1),indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),x(t,e)),e.tokenize!=y&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==i?n:(e.lastType="operator"!=i||"++"!=r&&"--"!=r?i:"incdec",S(e,n,i,r,t))},indent:function(e,i){if(e.tokenize==y||e.tokenize==b)return t.Pass;if(e.tokenize!=m)return 0;var r,a=i&&i.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(i))for(var u=e.cc.length-1;u>=0;--u){var h=e.cc[u];if(h==B)l=l.prev;else if(h!=Dt&&h!=j)break}while(("stat"==l.type||"form"==l.type)&&("}"==a||(r=e.cc[e.cc.length-1])&&(r==Y||r==Q)&&!/^[,\.=+\-*:?[\(]/.test(i)))l=l.prev;o&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var c=l.type,_=a==c;return"vardef"==c?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==c&&"{"==a?l.indented:"form"==c?l.indented+s:"stat"==c?l.indented+(ie(e,i)?o||s:0):"switch"!=l.info||_||0==n.doubleIndentSwitch?l.align?l.column+(_?0:1):l.indented+(_?0:s):l.indented+(/^(?:case|default)\b/.test(i)?s:2*s)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:a,jsonMode:l,expressionAllowed:re,skipExpression:function(e){S(e,"atom","atom","true",new t.StringStream("",2,null))}}})),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/manifest+json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}))},f3fe:function(t,e,n){(function(t){t(n("69713"))})((function(t){var e=t.Pos;function n(t,e){for(var n=0,i=t.length;n<i;++n)e(t[n])}function i(t,e){if(!Array.prototype.indexOf){var n=t.length;while(n--)if(t[n]===e)return!0;return!1}return-1!=t.indexOf(e)}function r(n,i,r,s){var o=n.getCursor(),a=r(n,o);if(!/\b(?:string|comment)\b/.test(a.type)){var l=t.innerMode(n.getMode(),a.state);if("json"!==l.mode.helperType){a.state=l.state,/^[\w$_]*$/.test(a.string)?a.end>o.ch&&(a.end=o.ch,a.string=a.string.slice(0,o.ch-a.start)):a={start:o.ch,end:o.ch,string:"",state:a.state,type:"."==a.string?"property":null};var u=a;while("property"==u.type){if(u=r(n,e(o.line,u.start)),"."!=u.string)return;if(u=r(n,e(o.line,u.start)),!h)var h=[];h.push(u)}return{list:f(a,h,i,s),from:e(o.line,a.start),to:e(o.line,a.end)}}}}function s(t,e){return r(t,c,(function(t,e){return t.getTokenAt(e)}),e)}function o(t,e){var n=t.getTokenAt(e);return e.ch==n.start+1&&"."==n.string.charAt(0)?(n.end=n.start,n.string=".",n.type="property"):/^\.[\w$_]*$/.test(n.string)&&(n.type="property",n.start++,n.string=n.string.replace(/\./,"")),n}function a(t,e){return r(t,_,o,e)}t.registerHelper("hint","javascript",s),t.registerHelper("hint","coffeescript",a);var l="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),u="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),h="prototype apply call bind".split(" "),c="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),_="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ");function p(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var n=t;n;n=Object.getPrototypeOf(n))Object.getOwnPropertyNames(n).forEach(e);else for(var i in t)e(i)}function f(t,e,r,s){var o=[],a=t.string,c=s&&s.globalScope||window;function _(t){0!=t.lastIndexOf(a,0)||i(o,t)||o.push(t)}function f(t){"string"==typeof t?n(l,_):t instanceof Array?n(u,_):t instanceof Function&&n(h,_),p(t,_)}if(e&&e.length){var d,g=e.pop();g.type&&0===g.type.indexOf("variable")?(s&&s.additionalContext&&(d=s.additionalContext[g.string]),s&&!1===s.useGlobalScope||(d=d||c[g.string])):"string"==g.type?d="":"atom"==g.type?d=1:"function"==g.type&&(null==c.jQuery||"$"!=g.string&&"jQuery"!=g.string||"function"!=typeof c.jQuery?null!=c._&&"_"==g.string&&"function"==typeof c._&&(d=c._()):d=c.jQuery());while(null!=d&&e.length)d=d[e.pop().string];null!=d&&f(d)}else{for(var m=t.state.localVars;m;m=m.next)_(m.name);for(var v=t.state.context;v;v=v.prev)for(m=v.vars;m;m=m.next)_(m.name);for(m=t.state.globalVars;m;m=m.next)_(m.name);if(s&&null!=s.additionalContext)for(var y in s.additionalContext)_(y);s&&!1===s.useGlobalScope||f(c),n(r,_)}return o}}))},fd90:function(t,e,n){}}]);
|