/*! This file is auto-generated from CodeMirror - v5.65.20
CodeMirror, copyright (c) by Marijn Haverbeke and others
Distributed under an MIT license: http://codemirror.net/LICENSE
This is CodeMirror (http://codemirror.net), a code editor
implemented in JavaScript on top of the browser's DOM.
You can find some technical background for some of the code below
at http://marijnhaverbeke.nl/blog/#cm-internals .
*/(()=>{var e={7829(e,t,n){!function(e){"use strict";var t={},n=/[^\s\u00a0]/,r=e.Pos,i=e.cmpPos;function o(e){var t=e.search(n);return-1==t?0:t}function a(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(r(t.line,0)))&&!/^[\'\"\`]/.test(n)}function s(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=t);for(var n=this,i=1/0,o=this.listSelections(),a=null,s=o.length-1;s>=0;s--){var l=o[s].from(),c=o[s].to();l.line>=i||(c.line>=i&&(c=r(i,0)),i=l.line,null==a?n.uncomment(l,c,e)?a="un":(n.lineComment(l,c,e),a="line"):"un"==a?n.uncomment(l,c,e):n.lineComment(l,c,e))}})),e.defineExtension("lineComment",(function(e,i,l){l||(l=t);var c=this,u=s(c,e),d=c.getLine(e.line);if(null!=d&&!a(c,e,d)){var f=l.lineComment||u.lineComment;if(f){var p=Math.min(0!=i.ch||i.line==e.line?i.line+1:i.line,c.lastLine()+1),h=null==l.padding?" ":l.padding,m=l.commentBlankLines||e.line==i.line;c.operation((function(){if(l.indent){for(var t=null,i=e.line;i
a.length)&&(t=a)}for(i=e.line;i
f||l.operation((function(){if(0!=a.fullLines){var t=n.test(l.getLine(f));l.replaceRange(p+d,r(f)),l.replaceRange(u+p,r(e.line,0));var s=a.blockCommentLead||c.blockCommentLead;if(null!=s)for(var h=e.line+1;h<=f;++h)(h!=f||t)&&l.replaceRange(s+p,r(h,0))}else{var m=0==i(l.getCursor("to"),o),g=!l.somethingSelected();l.replaceRange(d,o),m&&l.setSelection(g?o:l.getCursor("from"),o),l.replaceRange(u,e)}}))}}else(a.lineComment||c.lineComment)&&0!=a.fullLines&&l.lineComment(e,o,a)})),e.defineExtension("uncomment",(function(e,i,o){o||(o=t);var a,l=this,c=s(l,e),u=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,l.lastLine()),d=Math.min(e.line,u),f=o.lineComment||c.lineComment,p=[],h=null==o.padding?" ":o.padding;e:if(f){for(var m=d;m<=u;++m){var g=l.getLine(m),v=g.indexOf(f);if(v>-1&&!/comment/.test(l.getTokenTypeAt(r(m,v+1)))&&(v=-1),-1==v&&n.test(g))break e;if(v>-1&&n.test(g.slice(0,v)))break e;p.push(g)}if(l.operation((function(){for(var e=d;e<=u;++e){var t=p[e-d],n=t.indexOf(f),i=n+f.length;n<0||(t.slice(i,i+h.length)==h&&(i+=h.length),a=!0,l.replaceRange("",r(e,n),r(e,i)))}})),a)return!0}var y=o.blockCommentStart||c.blockCommentStart,b=o.blockCommentEnd||c.blockCommentEnd;if(!y||!b)return!1;var x=o.blockCommentLead||c.blockCommentLead,k=l.getLine(d),w=k.indexOf(y);if(-1==w)return!1;var _=u==d?k:l.getLine(u),C=_.indexOf(b,u==d?w+y.length:0),S=r(d,w+1),M=r(u,C+1);if(-1==C||!/comment/.test(l.getTokenTypeAt(S))||!/comment/.test(l.getTokenTypeAt(M))||l.getRange(S,M,"\n").indexOf(b)>-1)return!1;var L=k.lastIndexOf(y,e.ch),T=-1==L?-1:k.slice(0,e.ch).indexOf(b,L+y.length);if(-1!=L&&-1!=T&&T+b.length!=e.ch)return!1;T=_.indexOf(b,i.ch);var A=_.slice(i.ch).lastIndexOf(y,T-i.ch);return L=-1==T||-1==A?-1:i.ch+A,(-1==T||-1==L||L==i.ch)&&(l.operation((function(){l.replaceRange("",r(u,C-(h&&_.slice(C-h.length,C)==h?h.length:0)),r(u,C+b.length));var e=w+y.length;if(h&&k.slice(e,e+h.length)==h&&(e+=h.length),l.replaceRange("",r(d,w),r(d,e)),x)for(var t=d+1;t<=u;++t){var i=l.getLine(t),o=i.indexOf(x);if(-1!=o&&!n.test(i.slice(0,o))){var a=o+x.length;h&&i.slice(a,a+h.length)==h&&(a+=h.length),l.replaceRange("",r(t,o),r(t,a))}}})),!0)}))}(n(5237))},998(e,t,n){!function(e){var t=/\S/g,n=String.prototype.repeat||function(e){return Array(e+1).join(this)};function r(t){if(t.getOption("disableInput"))return e.Pass;for(var r,a=t.listSelections(),s=[],l=0;l-1&&/\bcomment\b/.test(t.getTokenTypeAt({line:c.line,ch:f+1})));else if(c.ch>=h.length&&(f=d.lastIndexOf(h,c.ch-h.length))>-1&&f>g)if(i(0,d)>=f)p=d.slice(0,f);else{var v,y=t.options.tabSize;f=e.countColumn(d,f,y),p=t.options.indentWithTabs?n.call("\t",v=Math.floor(f/y))+n.call(" ",f-y*v):n.call(" ",f)}else(f=d.indexOf(r.blockCommentContinue))>-1&&f<=c.ch&&f<=i(0,d)&&(p=d.slice(0,f));null!=p&&(p+=r.blockCommentContinue)}if(null==p&&m&&o(t))if(null==d&&(d=t.getLine(c.line)),f=d.indexOf(m),c.ch||f){if(f>-1&&i(0,d)>=f){if(!(p=i(c.ch,d)>-1)){var b=t.getLine(c.line+1)||"",x=b.indexOf(m);p=x>-1&&i(0,b)>=x||null}p&&(p=d.slice(0,f)+m+d.slice(f+m.length).match(/^\s*/)[0])}}else p="";if(null==p)return e.Pass;s[l]="\n"+p}t.operation((function(){for(var e=a.length-1;e>=0;e--)t.replaceRange(s[e],a[e].from(),a[e].to(),"+insert")}))}function i(e,n){t.lastIndex=e;var r=t.exec(n);return r?r.index:-1}function o(e){var t=e.getOption("continueComments");return!t||"object"!=typeof t||!1!==t.continueLineComment}e.defineOption("continueComments",null,(function(t,n,i){if(i&&i!=e.Init&&t.removeKeyMap("continueComment"),n){var o="Enter";"string"==typeof n?o=n:"object"==typeof n&&n.key&&(o=n.key);var a={name:"continueComment"};a[o]=r,t.addKeyMap(a)}}))}(n(5237))},8527(e,t,n){!function(e){function t(t,n,r){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(o,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",(function(r,i,o){o||(o={}),n(this,null);var a=t(this,r,o.bottom),s=!1,l=this;function c(t){if("string"==typeof t)d.value=t;else{if(s)return;s=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),l.focus(),o.onClose&&o.onClose(a)}}var u,d=a.getElementsByTagName("input")[0];return d?(d.focus(),o.value&&(d.value=o.value,!1!==o.selectValueOnOpen&&d.select()),o.onInput&&e.on(d,"input",(function(e){o.onInput(e,d.value,c)})),o.onKeyUp&&e.on(d,"keyup",(function(e){o.onKeyUp(e,d.value,c)})),e.on(d,"keydown",(function(t){o&&o.onKeyDown&&o.onKeyDown(t,d.value,c)||((27==t.keyCode||!1!==o.closeOnEnter&&13==t.keyCode)&&(d.blur(),e.e_stop(t),c()),13==t.keyCode&&i(d.value,t))})),!1!==o.closeOnBlur&&e.on(a,"focusout",(function(e){null!==e.relatedTarget&&c()}))):(u=a.getElementsByTagName("button")[0])&&(e.on(u,"click",(function(){c(),l.focus()})),!1!==o.closeOnBlur&&e.on(u,"blur",c),u.focus()),c})),e.defineExtension("openConfirm",(function(r,i,o){n(this,null);var a=t(this,r,o&&o.bottom),s=a.getElementsByTagName("button"),l=!1,c=this,u=1;function d(){l||(l=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),c.focus())}s[0].focus();for(var f=0;f",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:l,Enter:c};function o(e){for(var t=0;t=0;l--){var u=a[l].head;t.replaceRange("",n(u.line,u.ch-1),n(u.line,u.ch+1),"+delete")}}function c(t){var n=s(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a0?{line:a.head.line,ch:a.head.ch+t}:{line:a.head.line-1};n.push({anchor:s,head:s})}e.setSelections(n,i)}function d(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function f(t,i){var o=s(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=r(o,"pairs"),l=a.indexOf(i);if(-1==l)return e.Pass;for(var c,f=r(o,"closeBefore"),p=r(o,"triples"),m=a.charAt(l+1)==i,g=t.listSelections(),v=l%2==0,y=0;y1&&p.indexOf(i)>=0&&t.getRange(n(k.line,k.ch-2),k)==i+i){if(k.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(k.line,k.ch-2))))return e.Pass;b="addFour"}else if(m){var _=0==k.ch?" ":t.getRange(n(k.line,k.ch-1),k);if(e.isWordChar(w)||_==i||e.isWordChar(_))return e.Pass;b="both"}else{if(!v||!(0===w.length||/\s/.test(w)||f.indexOf(w)>-1))return e.Pass;b="both"}else b=m&&h(t,k)?"both":p.indexOf(i)>=0&&t.getRange(k,n(k.line,k.ch+3))==i+i+i?"skipThree":"skip";if(c){if(c!=b)return e.Pass}else c=b}var C=l%2?a.charAt(l-1):i,S=l%2?i:a.charAt(l+1);t.operation((function(){if("skip"==c)u(t,1);else if("skipThree"==c)u(t,3);else if("surround"==c){for(var e=t.getSelections(),n=0;n'"]=function(e){return r(e)}),t.addKeyMap(a)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function r(r){if(r.getOption("disableInput"))return e.Pass;for(var i=r.listSelections(),o=[],l=r.getOption("autoCloseTags"),c=0;cu.ch&&(m=m.slice(0,m.length-d.end+u.ch));var b=m.toLowerCase();if(!m||"string"==d.type&&(d.end!=u.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&h.close||d.string.indexOf("/")==u.ch-d.start-1||v&&a(v,b)>-1||s(r,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(p)||[],m,u,!0))return e.Pass;var x="object"==typeof l&&l.emptyTags;if(x&&a(x,m)>-1)o[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)};else{var k=y&&a(y,b)>-1;o[c]={indent:k,text:">"+(k?"\n\n":"")+""+m+">",newPos:k?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)}}}var w="object"==typeof l&&l.dontIndentOnAutoClose;for(c=i.length-1;c>=0;c--){var _=o[c];r.replaceRange(_.text,i[c].head,i[c].anchor,"+insert");var C=r.listSelections().slice(0);C[c]={head:_.newPos,anchor:_.newPos},r.setSelections(C),!w&&_.indent&&(r.indentLine(_.newPos.line,null,!0),r.indentLine(_.newPos.line+1,null,!0))}}function i(t,n){for(var r=t.listSelections(),i=[],o=n?"/":"",a=t.getOption("autoCloseTags"),l="object"==typeof a&&a.dontIndentOnSlash,c=0;c"!=t.getLine(u.line).charAt(d.end)&&(h+=">"),i[c]=h}if(t.replaceSelections(i),r=t.listSelections(),!l)for(c=0;c=0&&n[c]==r;c--)++l;for(i=s.to,c=1;c[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;function i(e,n){var r=n.line,i=0,o=0,a=t.exec(e.getLine(r)),s=a[1];do{var l=r+(i+=1),c=e.getLine(l),u=t.exec(c);if(u){var d=u[1],f=parseInt(a[3],10)+i-o,p=parseInt(u[3],10),h=p;if(s!==d||isNaN(p)){if(s.length>d.length)return;if(s.lengthp&&(h=f+1),e.replaceRange(c.replace(t,d+h+u[4]+u[5]),{line:l,ch:0},{line:l,ch:c.length})}}while(u)}e.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return e.Pass;for(var a=o.listSelections(),s=[],l=0;l\s*$/.test(h),y=!/>\s*$/.test(h);(v||y)&&o.replaceRange("",{line:c.line,ch:0},{line:c.line,ch:c.ch+1}),s[l]="\n"}else{var b=m[1],x=m[5],k=!(r.test(m[2])||m[2].indexOf(">")>=0),w=k?parseInt(m[3],10)+1+m[4]:m[2].replace("x"," ");s[l]="\n"+b+w+x,k&&i(o,c)}}o.replaceSelections(s)}}(n(5237))},7923(e,t,n){!function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var s=e.getLineHandle(t.line),l=t.ch-1,c=o&&o.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=i(o),d=!c&&l>=0&&u.test(s.text.charAt(l))&&r[s.text.charAt(l)]||u.test(s.text.charAt(l+1))&&r[s.text.charAt(++l)];if(!d)return null;var f=">"==d.charAt(1)?1:-1;if(o&&o.strict&&f>0!=(l==t.ch))return null;var p=e.getTokenTypeAt(n(t.line,l+1)),h=a(e,n(t.line,l+(f>0?1:0)),f,p,o);return null==h?null:{from:n(t.line,l),to:h&&h.pos,match:h&&h.ch==d.charAt(0),forward:f>0}}function a(e,t,o,a,s){for(var l=s&&s.maxScanLineLength||1e4,c=s&&s.maxScanLines||1e3,u=[],d=i(s),f=o>0?Math.min(t.line+c,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-c),p=t.line;p!=f;p+=o){var h=e.getLine(p);if(h){var m=o>0?0:h.length-1,g=o>0?h.length:-1;if(!(h.length>l))for(p==t.line&&(m=t.ch-(o<0?1:0));m!=g;m+=o){var v=h.charAt(m);if(d.test(v)&&(void 0===a||(e.getTokenTypeAt(n(p,m+1))||"")==(a||""))){var y=r[v];if(y&&">"==y.charAt(1)==o>0)u.push(v);else{if(!u.length)return{pos:n(p,m),ch:v};u.pop()}}}}}return p-o!=(o>0?e.lastLine():e.firstLine())&&null}function s(e,r,i){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=i&&i.highlightNonMatching,l=[],c=e.listSelections(),u=0;ue.pos?(e.pos=n,null):(e.pos=t,"trailingspace")},name:"trailingspace"})}))}(n(5237))},795(e,t,n){!function(e){"use strict";function t(t){return function(n,r){var i=r.line,o=n.getLine(i);function a(t){for(var a,s=r.ch,l=0;;){var c=s<=0?-1:o.lastIndexOf(t[0],s-1);if(-1!=c){if(1==l&&ct.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var l=r(s.line+1);if(null==l)break;s=l.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:s}})),e.registerHelper("fold","include",(function(t,n){function r(n){if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;null!=r(a+1);)++a;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}}))}(n(5237))},9257(e,t,n){!function(e){"use strict";e.registerGlobalHelper("fold","comment",(function(e){return e.blockCommentStart&&e.blockCommentEnd}),(function(t,n){var r=t.getModeAt(n),i=r.blockCommentStart,o=r.blockCommentEnd;if(i&&o){for(var a,s=n.line,l=t.getLine(s),c=n.ch,u=0;;){var d=c<=0?-1:l.lastIndexOf(i,c-1);if(-1!=d){if(1==u&&dt.firstLine();)r=e.Pos(r.line-1,0),u=c(!1);if(u&&!u.cleared&&"unfold"!==a){var d=n(t,o,u);e.on(d,"mousedown",(function(t){f.clear(),e.e_preventDefault(t)}));var f=t.markText(u.from,u.to,{replacedWith:d,clearOnEnter:i(t,o,"clearOnEnter"),__isFold:!0});f.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,u.from,u.to)}}function n(e,t,n){var r=i(e,t,"widget");if("function"==typeof r&&(r=r(n.from,n.to)),"string"==typeof r){var o=document.createTextNode(r);(r=document.createElement("span")).appendChild(o),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n=c){if(f&&s&&f.test(s.className))return;r=o(a.indicatorOpen)}}(r||s)&&e.setGutterMarker(n,a.gutter,r)}))}function s(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function l(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){a(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function c(e,n,r){var o=e.state.foldGutter;if(o){var a=o.options;if(r==a.gutter){var s=i(e,n);s?s.clear():e.foldCode(t(n,0),a)}}}function u(e,t){"mode"==t&&d(e)}function d(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){l(e)}),n.foldOnChangeTimeSpan||600)}}function f(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?l(e):e.operation((function(){n.fromt.to&&(a(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&ri))break;o=a}}return o?{from:e.Pos(r.line,n.getLine(r.line).length),to:e.Pos(o,n.getLine(o).length)}:void 0}}))}(n(5237))},5231(e,t,n){!function(e){"use strict";e.registerHelper("fold","markdown",(function(t,n){var r=100;function i(n){var r=t.getTokenTypeAt(e.Pos(n,0));return r&&/\bheader\b/.test(r)}function o(e,t,n){var o=t&&t.match(/^#+/);return o&&i(e)?o[0].length:(o=n&&n.match(/^[=\-]+\s*$/))&&i(e+1)?"="==n[0]?1:2:r}var a=t.getLine(n.line),s=t.getLine(n.line+1),l=o(n.line,a,s);if(l!==r){for(var c=t.lastLine(),u=n.line,d=t.getLine(u+2);u=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(s(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){i.lastIndex=t,e.ch=t;var n=i.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function d(e){for(;;){i.lastIndex=e.ch;var t=i.exec(e.text);if(!t){if(s(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function p(e,n){for(var r=[];;){var i,o=d(e),a=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(i=c(e)))return;if("selfClose"!=i)if(o[1]){for(var l=r.length-1;l>=0;--l)if(r[l]==o[2]){r.length=l;break}if(l<0&&(!n||n==o[2]))return{tag:o[2],from:t(a,s),to:t(e.line,e.ch)}}else r.push(o[2])}}function h(e,n){for(var r=[];;){var i=f(e);if(!i)return;if("selfClose"!=i){var o=e.line,a=e.ch,s=u(e);if(!s)return;if(s[1])r.push(s[2]);else{for(var l=r.length-1;l>=0;--l)if(r[l]==s[2]){r.length=l;break}if(l<0&&(!n||n==s[2]))return{tag:s[2],from:t(e.line,e.ch),to:t(o,a)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,r){for(var i=new o(e,r.line,0);;){var a=d(i);if(!a||i.line!=r.line)return;var s=c(i);if(!s)return;if(!a[1]&&"selfClose"!=s){var l=t(i.line,i.ch),u=p(i,a[2]);return u&&n(u.from,l)>0?{from:l,to:u.from}:null}}})),e.findMatchingTag=function(e,r,i){var a=new o(e,r.line,r.ch,i);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var s=c(a),l=s&&t(a.line,a.ch),d=s&&u(a);if(s&&d&&!(n(a,r)>0)){var f={from:t(a.line,a.ch),to:l,tag:d[2]};return"selfClose"==s?{open:f,close:null,at:"open"}:d[1]?{open:h(a,d[2]),close:f,at:"close"}:{open:f,close:p(a=new o(e,l.line,l.ch,i),d[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,r){for(var i=new o(e,t.line,t.ch,n);;){var a=h(i,r);if(!a)break;var s=p(new o(e,t.line,t.ch,n),a.tag);if(s)return{open:a,close:s}}},e.scanForClosingTag=function(e,t,n,r){return p(new o(e,t.line,t.ch,r?{from:0,to:r}:null),n)}}(n(5237))},6564(e,t,n){!function(e){"use strict";var t=/[\w$]+/,n=500;e.registerHelper("hint","anyword",(function(r,i){for(var o=i&&i.word||t,a=i&&i.range||n,s=r.getCursor(),l=r.getLine(s.line),c=s.ch,u=c;u&&o.test(l.charAt(u-1));)--u;for(var d=u!=c&&l.slice(u,c),f=i&&i.list||[],p={},h=new RegExp(o.source,"g"),m=-1;m<=1;m+=2)for(var g=s.line,v=Math.min(Math.max(g+m*a,r.firstLine()),r.lastLine())+m;g!=v;g+=m)for(var y,b=r.getLine(g);y=h.exec(b);)g==s.line&&y[0]===d||d&&0!=y[0].lastIndexOf(d,0)||Object.prototype.hasOwnProperty.call(p,y[0])||(p[y[0]]=!0,f.push(y[0]));return{list:f,from:e.Pos(s.line,u),to:e.Pos(s.line,c)}}))}(n(5237))},2927(e,t,n){!function(e){"use strict";var t={active:1,after:1,before:1,checked:1,default:1,disabled:1,empty:1,enabled:1,"first-child":1,"first-letter":1,"first-line":1,"first-of-type":1,focus:1,hover:1,"in-range":1,indeterminate:1,invalid:1,lang:1,"last-child":1,"last-of-type":1,link:1,not:1,"nth-child":1,"nth-last-child":1,"nth-last-of-type":1,"nth-of-type":1,"only-of-type":1,"only-child":1,optional:1,"out-of-range":1,placeholder:1,"read-only":1,"read-write":1,required:1,root:1,selection:1,target:1,valid:1,visited:1};e.registerHelper("hint","css",(function(n){var r=n.getCursor(),i=n.getTokenAt(r),o=e.innerMode(n.getMode(),i.state);if("css"==o.mode.name){if("keyword"==i.type&&0=="!important".indexOf(i.string))return{list:["!important"],from:e.Pos(r.line,i.start),to:e.Pos(r.line,i.end)};var a=i.start,s=r.ch,l=i.string.slice(0,s-a);/[^\w$_-]/.test(l)&&(l="",a=s=r.ch);var c=e.resolveMode("text/css"),u=[],d=o.state.state;return"pseudo"==d||"variable-3"==i.type?f(t):"block"==d||"maybeprop"==d?f(c.propertyKeywords):"prop"==d||"parens"==d||"at"==d||"params"==d?(f(c.valueKeywords),f(c.colorKeywords)):"media"!=d&&"media_parens"!=d||(f(c.mediaTypes),f(c.mediaFeatures)),u.length?{list:u,from:e.Pos(r.line,a),to:e.Pos(r.line,s)}:void 0}function f(e){for(var t in e)l&&0!=t.lastIndexOf(l,0)||u.push(t)}}))}(n(5237),n(8656))},9935(e,t,n){!function(e){"use strict";var t="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),n=["_blank","_self","_top","_parent"],r=["ascii","utf-8","utf-16","latin1","latin1"],i=["get","post","put","delete"],o=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],a=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],s={attrs:{}},l={a:{attrs:{href:null,ping:null,type:null,media:a,target:n,hreflang:t}},abbr:s,acronym:s,address:s,applet:s,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:a,hreflang:t,type:null,shape:["default","rect","circle","poly"]}},article:s,aside:s,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:s,base:{attrs:{href:null,target:n}},basefont:s,bdi:s,bdo:s,big:s,blockquote:{attrs:{cite:null}},body:s,br:s,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:o,formmethod:i,formnovalidate:["","novalidate"],formtarget:n,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:s,center:s,cite:s,code:s,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:s,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:s,dir:s,div:s,dialog:{attrs:{open:null}},dl:s,dt:s,em:s,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:s,figure:s,font:s,footer:s,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:["on","off"],enctype:o,method:i,novalidate:["","novalidate"],target:n}},frame:s,frameset:s,h1:s,h2:s,h3:s,h4:s,h5:s,h6:s,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:s,hgroup:s,hr:s,html:{attrs:{manifest:null},children:["head","body"]},i:s,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:o,formmethod:i,formnovalidate:["","novalidate"],formtarget:n,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:s,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:s,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:t,media:a,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:s,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:r,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:s,noframes:s,noscript:s,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:s,param:{attrs:{name:null,value:null}},pre:s,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:s,rt:s,ruby:s,s,samp:s,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:r}},section:s,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:s,source:{attrs:{src:null,type:null,media:null}},span:s,strike:s,strong:s,style:{attrs:{type:["text/css"],media:a,scoped:null}},sub:s,summary:s,sup:s,table:s,tbody:s,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:s,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:s,time:{attrs:{datetime:null}},title:s,tr:s,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:t}},tt:s,u:s,ul:s,var:s,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:s},c={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],class:null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],autocorrect:["true","false"],autocapitalize:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};function u(e){for(var t in c)c.hasOwnProperty(t)&&(e.attrs[t]=c[t])}for(var d in u(s),l)l.hasOwnProperty(d)&&l[d]!=s&&u(l[d]);function f(t,n){var r={schemaInfo:l};if(n)for(var i in n)r[i]=n[i];return e.hint.xml(t,r)}e.htmlSchema=l,e.registerHelper("hint","html",f)}(n(5237),n(149))},5489(e,t,n){!function(e){var t=e.Pos;function n(e,t){for(var n=0,r=e.length;na.ch&&(s.end=a.ch,s.string=s.string.slice(0,a.ch-s.start)):s={start:a.ch,end:a.ch,string:"",state:s.state,type:"."==s.string?"property":null};for(var c=s;"property"==c.type;){if("."!=(c=i(n,t(a.line,c.start))).string)return;if(c=i(n,t(a.line,c.start)),!u)var u=[];u.push(c)}return{list:h(s,u,r,o),from:t(a.line,s.start),to:t(a.line,s.end)}}}}function o(e,t){return i(e,d,(function(e,t){return e.getTokenAt(t)}),t)}function a(e,t){var n=e.getTokenAt(t);return t.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 s(e,t){return i(e,f,a,t)}e.registerHelper("hint","javascript",o),e.registerHelper("hint","coffeescript",s);var l="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),c="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),u="prototype apply call bind".split(" "),d="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(" "),f="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(e,t){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var n=e;n;n=Object.getPrototypeOf(n))Object.getOwnPropertyNames(n).forEach(t);else for(var r in e)t(r)}function h(e,t,i,o){var a=[],s=e.string,d=o&&o.globalScope||window;function f(e){0!=e.lastIndexOf(s,0)||r(a,e)||a.push(e)}function h(e){"string"==typeof e?n(l,f):e instanceof Array?n(c,f):e instanceof Function&&n(u,f),p(e,f)}if(t&&t.length){var m,g=t.pop();for(g.type&&0===g.type.indexOf("variable")?(o&&o.additionalContext&&(m=o.additionalContext[g.string]),o&&!1===o.useGlobalScope||(m=m||d[g.string])):"string"==g.type?m="":"atom"==g.type?m=1:"function"==g.type&&(null==d.jQuery||"$"!=g.string&&"jQuery"!=g.string||"function"!=typeof d.jQuery?null!=d._&&"_"==g.string&&"function"==typeof d._&&(m=d._()):m=d.jQuery());null!=m&&t.length;)m=m[t.pop().string];null!=m&&h(m)}else{for(var v=e.state.localVars;v;v=v.next)f(v.name);for(var y=e.state.context;y;y=y.prev)for(v=y.vars;v;v=v.next)f(v.name);for(v=e.state.globalVars;v;v=v.next)f(v.name);if(o&&null!=o.additionalContext)for(var b in o.additionalContext)f(b);o&&!1===o.useGlobalScope||h(d),n(i,f)}return a}}(n(5237))},9751(e,t,n){!function(e){"use strict";var t="CodeMirror-hint",n="CodeMirror-hint-active";function r(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",(function(t){t=a(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;if.clientHeight+1;if(setTimeout((function(){E=a.getScrollInfo()})),N.bottom-O>0){var F=N.bottom-N.top,D=N.top-(x.bottom-x.top)-2;O-N.topD&&(f.style.height=(F=D)+"px"),f.style.top=(w=x.top-F)-S+"px",_=!1):f.style.height=O-N.top-2+"px"}var z,I=N.right-A;if(P&&(I+=a.display.nativeBarWidth),I>0&&(N.right-N.left>A&&(f.style.width=A-5+"px",I-=N.right-N.left-A),f.style.left=(k=Math.max(x.left-I-C,0))+"px"),P)for(var R=f.firstChild;R;R=R.nextSibling)R.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=l(r,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:h.length,close:function(){r.close()},pick:function(){o.pick()},data:i})),r.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){z=setTimeout((function(){r.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(z)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),t=a.getWrapperElement().getBoundingClientRect();E||(E=a.getScrollInfo());var n=w+E.top-e.top,i=n-(d.pageYOffset||(u.documentElement||u.body).scrollTop);if(_||(i+=f.offsetHeight),i<=t.top||i>=t.bottom)return r.close();f.style.top=n+"px",f.style.left=k+E.left-e.left+"px"}),e.on(f,"dblclick",(function(e){var t=c(f,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),o.pick())})),e.on(f,"click",(function(e){var t=c(f,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),r.options.completeOnSingleClick&&o.pick())})),e.on(f,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var q=this.getSelectedHintRange();return 0===q.from&&0===q.to||this.scrollToActive(),e.signal(i,"select",h[this.selectedHint],f.childNodes[this.selectedHint]),!0}function d(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):o(i+1)}))}o(0)};return o.async=!0,o.supportsSelection=!0,o}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}r.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n],i=this;this.cm.operation((function(){r.hint?r.hint(i.cm,t,r):i.cm.replaceRange(s(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),i.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(o(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),n=this.cm.getLine(t.line);if(t.line!=this.startPos.line||n.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+n,""),i.removeAttribute("aria-selected")),(i=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,i.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",i.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],r=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:p}),e.registerHelper("hint","fromList",(function(t,n){var r,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(n(5237))},9102(e,t,n){!function(e){"use strict";var t,n,r,i,o={QUERY_DIV:";",ALIAS_KEYWORD:"AS"},a=e.Pos,s=e.cmpPos;function l(e){return"[object Array]"==Object.prototype.toString.call(e)}function c(t,n){return t.getModeAt(t.getCursor()).config[n]||e.resolveMode("text/x-sql")[n]}function u(e){return c(e,"keywords")||[]}function d(e){return c(e,"identifierQuote")||"`"}function f(e){return"string"==typeof e?e:e.text}function p(e,t){return l(t)&&(t={columns:t}),t.text||(t.text=e),t}function h(e){var t={};if(l(e))for(var n=e.length-1;n>=0;n--){var r=e[n];t[f(r).toUpperCase()]=p(f(r),r)}else if(e)for(var i in e)t[i.toUpperCase()]=p(i,e[i]);return t}function m(e){return t[e.toUpperCase()]}function g(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function v(e,t){var n=e.length,r=f(t).substr(0,n);return e.toUpperCase()===r.toUpperCase()}function y(e,t,n,r){if(l(n))for(var i=0;i0)&&s(h,u[g])<=0){d={start:p,end:u[g]};break}p=u[g]}if(d.start){var v=n.getRange(d.start,d.end,!1);for(g=0;gg.ch&&(b.end=g.ch,b.string=b.string.slice(0,g.ch-b.start)),b.string.match(/^[.`"'\w@][\w$#]*$/g)?(p=b.string,c=b.start,f=b.end):(c=f=g.ch,p=""),"."==p.charAt(0)||p.charAt(0)==i)c=k(g,b,v,e);else{var x=function(e,t){return"object"==typeof e?e.className=t:e={text:e,className:t},e};y(v,p,n,(function(e){return x(e,"CodeMirror-hint-table CodeMirror-hint-default-table")})),y(v,p,t,(function(e){return x(e,"CodeMirror-hint-table")})),l||y(v,p,r,(function(e){return x(e.toUpperCase(),"CodeMirror-hint-keyword")}))}return{list:v,from:a(g.line,c),to:a(g.line,f)}}))}(n(5237),n(9532))},149(e,t,n){!function(e){"use strict";var t=e.Pos;function n(e,t,n){return n?e.indexOf(t)>=0:0==e.lastIndexOf(t,0)}function r(r,i){var o=i&&i.schemaInfo,a=i&&i.quoteChar||'"',s=i&&i.matchInMiddle;if(o){var l=r.getCursor(),c=r.getTokenAt(l);if(c.end>l.ch&&(c.end=l.ch,c.string=c.string.slice(0,l.ch-c.start)),(b=e.innerMode(r.getMode(),c.state)).mode.xmlCurrentTag){var u,d,f=[],p=!1,h=/\btag\b/.test(c.type)&&!/>$/.test(c.string),m=h&&/^\w/.test(c.string);if(m){var g=r.getLine(l.line).slice(Math.max(0,c.start-2),c.start),v=/<\/$/.test(g)?"close":/<$/.test(g)?"open":null;v&&(d=c.start-("close"==v?2:1))}else h&&"<"==c.string?v="open":h&&""==c.string&&(v="close");var y=b.mode.xmlCurrentTag(b.state);if(!h&&!y||v){m&&(u=c.string),p=v;var b,x=b.mode.xmlCurrentContext?b.mode.xmlCurrentContext(b.state):[],k=(b=x.length&&x[x.length-1])&&o[b],w=b?k&&k.children:o["!top"];if(w&&"close"!=v)for(var _=0;_")}else{var S=(k=y&&o[y.name])&&k.attrs,M=o["!attrs"];if(!S&&!M)return;if(S){if(M){var L={};for(var T in M)M.hasOwnProperty(T)&&(L[T]=M[T]);for(var T in S)S.hasOwnProperty(T)&&(L[T]=S[T]);S=L}}else S=M;if("string"==c.type||"="==c.string){var A,O=(g=r.getRange(t(l.line,Math.max(0,l.ch-60)),t(l.line,"string"==c.type?c.start:c.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!O||!S.hasOwnProperty(O[1])||!(A=S[O[1]]))return;if("function"==typeof A&&(A=A.call(this,r)),"string"==c.type){u=c.string;var E=0;/['"]/.test(c.string.charAt(0))&&(a=c.string.charAt(0),u=c.string.slice(1),E++);var N=c.string.length;if(/['"]/.test(c.string.charAt(N-1))&&(a=c.string.charAt(N-1),u=c.string.substr(E,N-2)),E){var P=r.getLine(l.line);P.length>c.end&&P.charAt(c.end)==a&&c.end++}p=!0}var F=function(e){if(e)for(var t=0;t1,o.tooltips)),o.highlightLines&&e.addLineClass(s,"wrap",n+u)}}o.onUpdateLinting&&o.onUpdateLinting(r,a,e)}}function y(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){g(e)}),t.options.delay))}function b(e,t,n){for(var r=n.target||n.srcElement,i=document.createDocumentFragment(),o=0;oi)return!1;var o=n.getScrollInfo();if("align"==e.mv.options.connect)g=o.top;else{var a,s,l=.5*o.clientHeight,u=o.top+l,d=n.lineAtHeight(u,"local"),f=F(e.chunks,d,t),p=c(n,t?f.edit:f.orig),h=c(r,t?f.orig:f.edit),m=(u-p.top)/(p.bot-p.top),g=h.top-l+m*(h.bot-h.top);if(g>o.top&&(s=o.top/l)<1)g=g*s+o.top*(1-s);else if((a=o.height-o.clientHeight-o.top)a&&(s=a/l)<1&&(g=g*s+(v.height-v.clientHeight-a)*(1-s))}}return r.scrollTo(o.left,g),r.state.scrollSetAt=i,r.state.scrollSetBy=e,!0}function c(e,t){var n=t.after;return null==n&&(n=e.lastLine()+1),{top:e.heightAtLine(t.before||0,"local"),bot:e.heightAtLine(n,"local")}}function u(t,n,r){t.lockScroll=n,n&&0!=r&&l(t,DIFF_INSERT)&&g(t),(n?e.addClass:e.rmClass)(t.lockButton,"CodeMirror-merge-scrolllock-enabled")}function d(e,t,n){for(var r=n.classLocation,i=0;i20||n.from-o.to>20?(f(e,n.marked,i),m(e,t,r,n.marked,o.from,o.to,i),n.from=o.from,n.to=o.to):(o.fromn.to&&(m(e,t,r,n.marked,n.to,o.to,i),n.to=o.to))}))}function h(e,t,n,r,i,o){for(var a=n.classLocation,s=e.getLineHandle(t),l=0;lx&&(m&&(f(p,x),m=!1),p=k)}else if(m=!0,y==r){var w=W(l,b,!0),_=X(c,l),C=G(u,w);Q(_,C)||i.push(e.markText(_,C,{className:d})),l=w}}m&&f(p,l.line+1)}function g(e){if(e.showDifferences){if(e.svg){B(e.svg);var t=e.gap.offsetWidth;H(e.svg,"width",t,"height",e.gap.offsetHeight)}e.copyButtons&&B(e.copyButtons);for(var n=e.edit.getViewport(),r=e.orig.getViewport(),i=e.mv.wrap.getBoundingClientRect().top,o=i-e.edit.getScrollerElement().getBoundingClientRect().top+e.edit.getScrollInfo().top,a=i-e.orig.getScrollerElement().getBoundingClientRect().top+e.orig.getScrollInfo().top,s=0;s=n.from&&l.origFrom<=r.to&&l.origTo>=r.from&&C(e,l,a,o,t)}}}function v(e,t){for(var n=0,r=0,i=0;ie&&o.editFrom<=e)return null;if(o.editFrom>e)break;n=o.editTo,r=o.origTo}return r+(e-n)}function y(e,t,n){for(var r=e.state.trackAlignable,i=e.firstLine(),o=0,a=[],s=0;;s++){for(var l=t[s],c=l?n?l.origFrom:l.editFrom:1e9;od){o++,i--;continue e}if(f.editTo>u){if(f.editFrom<=u)continue e;break}s+=f.origTo-f.origFrom-(f.editTo-f.editFrom),a++}if(u==d-s)l[r]=d,o++;else if(u1&&r.push(_(e[a],n[a],l))}}function _(e,t,n){var r=!0;t>e.lastLine()&&(t--,r=!1);var i=document.createElement("div");return i.className="CodeMirror-merge-spacer",i.style.height=n+"px",i.style.minWidth="1px",e.addLineWidget(t,i,{height:n,above:r,mergeSpacer:!0,handleMouseEvents:!0})}function C(e,t,r,i,o){var a="left"==e.type,s=e.orig.heightAtLine(t.origFrom,"local",!0)-r;if(e.svg){var l=s,c=e.edit.heightAtLine(t.editFrom,"local",!0)-i;if(a){var u=l;l=c,c=u}var d=e.orig.heightAtLine(t.origTo,"local",!0)-r,f=e.edit.heightAtLine(t.editTo,"local",!0)-i;a&&(u=d,d=f,f=u);var p=" C "+o/2+" "+c+" "+o/2+" "+l+" "+(o+2)+" "+l,h=" C "+o/2+" "+d+" "+o/2+" "+f+" -1 "+f;H(e.svg.appendChild(document.createElementNS(n,"path")),"d","M -1 "+c+p+" L "+(o+2)+" "+d+h+" z","class",e.classes.connect)}if(e.copyButtons){var m=e.copyButtons.appendChild(q("div","left"==e.type?"⇝":"⇜","CodeMirror-merge-copy")),g=e.mv.options.allowEditingOriginals;if(m.title=e.edit.phrase(g?"Push to left":"Revert chunk"),m.chunk=t,m.style.top=(t.origTo>t.origFrom?s:e.edit.heightAtLine(t.editFrom,"local")-i)+"px",m.setAttribute("role","button"),m.setAttribute("tabindex","0"),m.setAttribute("aria-label",m.title),g){var v=e.edit.heightAtLine(t.editFrom,"local")-i,y=e.copyButtons.appendChild(q("div","right"==e.type?"⇝":"⇜","CodeMirror-merge-copy-reverse"));y.title="Push to right",y.chunk={editFrom:t.origFrom,editTo:t.origTo,origFrom:t.editFrom,origTo:t.editTo},y.style.top=v+"px","right"==e.type?y.style.left="2px":y.style.right="2px",y.setAttribute("role","button"),y.setAttribute("tabindex","0"),y.setAttribute("aria-label",y.title)}}}function S(e,n,r,i){if(!e.diffOutOfDate){var o=i.origTo>r.lastLine()?t(i.origFrom-1):t(i.origFrom,0),a=t(i.origTo,0),s=i.editTo>n.lastLine()?t(i.editFrom-1):t(i.editFrom,0),l=t(i.editTo,0),c=e.mv.options.revertChunk;c?c(e.mv,r,o,a,n,s,l):n.replaceRange(r.getRange(o,a),s,l)}}var M,L=e.MergeView=function(t,n){if(!(this instanceof L))return new L(t,n);this.options=n;var i=n.origLeft,o=null==n.origRight?n.orig:n.origRight,a=null!=i,s=null!=o,l=1+(a?1:0)+(s?1:0),c=[],u=this.left=null,d=this.right=null,f=this;if(a){u=this.left=new r(this,"left");var p=q("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");c.push(p),c.push(T(u))}var h=q("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");if(c.push(h),s){d=this.right=new r(this,"right"),c.push(T(d));var m=q("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");c.push(m)}(s?m:h).className+=" CodeMirror-merge-pane-rightmost",c.push(q("div",null,null,"height: 0; clear: both;"));var v=this.wrap=t.appendChild(q("div",c,"CodeMirror-merge CodeMirror-merge-"+l+"pane"));this.edit=e(h,j(n)),u&&u.init(p,i,n),d&&d.init(m,o,n),n.collapseIdentical&&this.editor().operation((function(){R(f,n.collapseIdentical)})),"align"==n.connect&&(this.aligners=[],k(this.left||this.right,!0)),u&&u.registerEvents(d),d&&d.registerEvents(u);var y=function(){u&&g(u),d&&g(d)};e.on(window,"resize",y);var b=setInterval((function(){for(var t=v.parentNode;t&&t!=document.body;t=t.parentNode);t||(clearInterval(b),e.off(window,"resize",y))}),5e3)};function T(t){var r=t.lockButton=q("div",null,"CodeMirror-merge-scrolllock");r.setAttribute("role","button"),r.setAttribute("tabindex","0");var i=q("div",[r],"CodeMirror-merge-scrolllock-wrap");e.on(r,"click",(function(){u(t,!t.lockScroll)})),e.on(r,"keyup",(function(e){("Enter"===e.key||"Space"===e.code)&&u(t,!t.lockScroll)}));var o=[i];if(!1!==t.mv.options.revertButtons){t.copyButtons=q("div",null,"CodeMirror-merge-copybuttons-"+t.type);var a=function(e){var n=e.target||e.srcElement;n.chunk&&("CodeMirror-merge-copy-reverse"!=n.className?S(t,t.edit,t.orig,n.chunk):S(t,t.orig,t.edit,n.chunk))};e.on(t.copyButtons,"click",a),e.on(t.copyButtons,"keyup",(function(e){("Enter"===e.key||"Space"===e.code)&&a(e)})),o.unshift(t.copyButtons)}if("align"!=t.mv.options.connect){var s=document.createElementNS&&document.createElementNS(n,"svg");s&&!s.createSVGRect&&(s=null),t.svg=s,s&&o.push(s)}return t.gap=q("div",o,"CodeMirror-merge-gap")}function A(e){return"string"==typeof e?e:e.getValue()}function O(e,t,n){M||(M=new diff_match_patch);for(var r=M.diff_main(e,t),i=0;id&&(s&&n.push({origFrom:i,origTo:f,editFrom:r,editTo:d}),r=h,i=m)}else W(c==DIFF_INSERT?o:a,l[1])}return(r<=o.line||i<=a.line)&&n.push({origFrom:i,origTo:a.line+1,editFrom:r,editTo:o.line+1}),n}function N(e,t){if(t==e.length-1)return!0;var n=e[t+1][1];return!(1==n.length&&t1||t==e.length-3)&&10==n.charCodeAt(0))}function P(e,t){if(0==t)return!0;var n=e[t-1][1];return 10==n.charCodeAt(n.length-1)&&(1==t||10==(n=e[t-2][1]).charCodeAt(n.length-1))}function F(e,t,n){for(var r,i,o,a,s=0;st?(i=l.editFrom,a=l.origFrom):u>t&&(i=l.editTo,a=l.origTo)),u<=t?(r=l.editTo,o=l.origTo):c<=t&&(r=l.editFrom,o=l.origFrom)}return{edit:{before:r,after:i},orig:{before:o,after:a}}}function D(n,r,i){n.addLineClass(r,"wrap","CodeMirror-merge-collapsed-line");var o=document.createElement("span");o.className="CodeMirror-merge-collapsed-widget",o.title=n.phrase("Identical text collapsed. Click to expand.");var a=n.markText(t(r,0),t(i-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:o,clearOnEnter:!0});function s(){a.clear(),n.removeLineClass(r,"wrap","CodeMirror-merge-collapsed-line")}return a.explicitlyCleared&&s(),e.on(o,"click",s),a.on("clear",s),e.on(o,"click",s),{mark:a,clear:s}}function z(e,t){var n=[];function r(){for(var e=0;e=0&&st){var u=[{line:l,cm:r}];e.left&&u.push({line:v(l,e.left.chunks),cm:e.left.orig}),e.right&&u.push({line:v(l,e.right.chunks),cm:e.right.orig});var d=z(c,u);e.options.onCollapse&&e.options.onCollapse(e,l,c,d)}}}function q(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild)}function H(e){for(var t=1;t0?e:t}function Q(e,t){return e.line==t.line&&e.ch==t.ch}function Y(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],o=(n?i.origTo:i.editTo)-1;if(ot)return o}}function Z(t,n){var r=null,o=t.state.diffViews,a=t.getCursor().line;if(o)for(var s=0;sr:u0)break}this.signal(),this.alignable.splice(n,0,e,t)},find:function(e){for(var t=0;t-1){var c=this.alignable[o+1];c==U?this.alignable.splice(o,2):this.alignable[o+1]=c&~U}a>-1&&n&&this.set(e+n,U)}},e.commands.goNextDiff=function(e){return Z(e,1)},e.commands.goPrevDiff=function(e){return Z(e,-1)}}(n(5237))},4285(e,t,n){!function(e,t){e.modeURL||(e.modeURL="../mode/%N/%N.js");var r={};function i(e,t){var n=t;return function(){0==--n&&e()}}function o(t,n,r){var o=e.modes[t],a=o&&o.dependencies;if(!a)return n();for(var s=[],l=0;l-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null,startingInner:!1}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner),startingInner:n.startingInner}},token:function(i,o){if(o.innerActive){var a=o.innerActive;if(c=i.string,!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);if((d=a.close&&!o.startingInner?r(c,a.close,i.pos,a.parseDelimiters):-1)==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";d>-1&&(i.string=c.slice(0,d));var s=a.mode.token(i,o.inner);return d>-1?i.string=c:i.pos>i.start&&(o.startingInner=!1),d==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(s=s?s+" "+a.innerStyle:a.innerStyle),s}for(var l=1/0,c=i.string,u=0;u2&&u.token&&"string"!=typeof u.token){for(var p=2;p-1)return e.Pass;var a=r.indent.length-1,s=t[r.state];e:for(;;){for(var c=0;c[],t.resolve=t,t.id=4301,e.exports=t},1660(e,t,n){!function(e){"use strict";var t=/^(p|li|div|h\\d|pre|blockquote|td)$/;function n(e,r){if(3==e.nodeType)return r.push(e.nodeValue);for(var i=e.firstChild;i;i=i.nextSibling)n(i,r),t.test(e.nodeType)&&r.push("\n")}e.colorize=function(t,r){t||(t=document.body.getElementsByTagName("pre"));for(var i=0;i=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}function r(){}var i=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};i.prototype.eol=function(){return this.pos>=this.string.length},i.prototype.sol=function(){return this.pos==this.lineStart},i.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},i.prototype.next=function(){if(this.post},i.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},i.prototype.skipToEnd=function(){this.pos=this.string.length},i.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},i.prototype.backUp=function(e){this.pos-=e},i.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},i.prototype.current=function(){return this.string.slice(this.start,this.pos)},i.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},i.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},i.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var o={},a={};function s(t){if("string"==typeof t&&a.hasOwnProperty(t))t=a[t];else if(t&&"string"==typeof t.name&&a.hasOwnProperty(t.name)){var n=a[t.name];"string"==typeof n&&(n={name:n}),i=n,o=t,Object.create?l=Object.create(i):(r.prototype=i,l=new r),o&&e(o,l),(t=l).name=n.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return s("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return s("application/json")}var i,o,l;return"string"==typeof t?{name:t}:t||{name:"null"}}var l={};var c={__proto__:null,modes:o,mimeModes:a,defineMode:function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),o[e]=t},defineMIME:function(e,t){a[e]=t},resolveMode:s,getMode:function e(t,n){n=s(n);var r=o[n.name];if(!r)return e(t,"text/plain");var i=r(t,n);if(l.hasOwnProperty(n.name)){var a=l[n.name];for(var c in a)a.hasOwnProperty(c)&&(i.hasOwnProperty(c)&&(i["_"+c]=i[c]),i[c]=a[c])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var u in n.modeProps)i[u]=n.modeProps[u];return i},modeExtensions:l,extendMode:function(t,n){e(n,l.hasOwnProperty(t)?l[t]:l[t]={})},copyState:function(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},innerMode:function(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}},startState:function(e,t,n){return!e.startState||e.startState(t,n)}},u="undefined"!=typeof globalThis?globalThis:window;for(var d in u.CodeMirror={},CodeMirror.StringStream=i,c)CodeMirror[d]=c[d];CodeMirror.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),CodeMirror.defineMIME("text/plain","null"),CodeMirror.registerHelper=CodeMirror.registerGlobalHelper=Math.min,CodeMirror.splitLines=function(e){return e.split(/\r?\n|\r/)},CodeMirror.countColumn=t,CodeMirror.defaults={indentUnit:2},function(e){e.runMode=function(t,n,r,i){var o=e.getMode(e.defaults,n),a=i&&i.tabSize||e.defaults.tabSize;if(r.appendChild){var s=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),l=r,c=0;l.textContent="",r=function(e,t){if("\n"==e)return l.appendChild(document.createTextNode(s?"\r":e)),void(c=0);for(var n="",r=0;;){var i=e.indexOf("\t",r);if(-1==i){n+=e.slice(r),c+=e.length-r;break}c+=i-r,n+=e.slice(r,i);var o=a-c%a;c+=o;for(var u=0;ua?t.charCoords(e,"local")[n?"top":"bottom"]:t.heightAtLine(l,"local")+(n?0:l.height)}var u=t.lastLine();if(t.display.barWidth)for(var d,f=0;fu)){for(var h=d||c(p.from,!0)*n,m=c(p.to,!1)*n;fu)&&!((d=c(i[f+1].from,!0)*n)>m+.9);)m=c((p=i[++f]).to,!1)*n;if(m!=h){var g=Math.max(m-h,3),v=r.appendChild(document.createElement("div"));v.style.cssText="position: absolute; right: 0px; width: "+Math.max(t.display.barWidth-1,2)+"px; top: "+(h+this.buttonHeight)+"px; height: "+g+"px",v.className=this.options.className,p.id&&v.setAttribute("annotation-id",p.id)}}}this.div.textContent="",this.div.appendChild(r)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}}(n(5237))},6272(e,t,n){!function(e){"use strict";function t(t,r){e.changeEnd(r).line==t.lastLine()&&n(t)}function n(e){var t="";e.lineCount()>1&&(t=e.display.scroller.clientHeight-30-e.getLineHandle(e.lastLine()).height+"px"),e.state.scrollPastEndPadding!=t&&(e.state.scrollPastEndPadding=t,e.display.lineSpace.parentNode.style.paddingBottom=t,e.off("refresh",n),e.setSize(),e.on("refresh",n))}e.defineOption("scrollPastEnd",!1,(function(r,i,o){o&&o!=e.Init&&(r.off("change",t),r.off("refresh",n),r.display.lineSpace.parentNode.style.paddingBottom="",r.state.scrollPastEndPadding=null),i&&(r.on("change",t),r.on("refresh",n),n(r))}))}(n(5237))},5841(e,t,n){!function(e){"use strict";function t(t,n,r){this.orientation=n,this.scroll=r,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=t+"-"+n,this.inner=this.node.appendChild(document.createElement("div"));var i=this;function o(t){var n=e.wheelEventPixels(t)["horizontal"==i.orientation?"x":"y"],r=i.pos;i.moveTo(i.pos+n),i.pos!=r&&e.e_preventDefault(t)}e.on(this.inner,"mousedown",(function(t){if(1==t.which){e.e_preventDefault(t);var n="horizontal"==i.orientation?"pageX":"pageY",r=t[n],o=i.pos;e.on(document,"mousemove",s),e.on(document,"mouseup",a)}function a(){e.off(document,"mousemove",s),e.off(document,"mouseup",a)}function s(e){if(1!=e.which)return a();i.moveTo(o+(e[n]-r)*(i.total/i.size))}})),e.on(this.node,"click",(function(t){e.e_preventDefault(t);var n,r=i.inner.getBoundingClientRect();n="horizontal"==i.orientation?t.clientXr.right?1:0:t.clientYr.bottom?1:0,i.moveTo(i.pos+n*i.screen)})),e.on(this.node,"mousewheel",o),e.on(this.node,"DOMMouseScroll",o)}t.prototype.setPos=function(e,t){return e<0&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),!(!t&&e==this.pos||(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",0))},t.prototype.moveTo=function(e){this.setPos(e)&&this.scroll(e,this.orientation)};var n=10;function r(e,n,r){this.addClass=e,this.horiz=new t(e,"horizontal",r),n(this.horiz.node),this.vert=new t(e,"vertical",r),n(this.vert.node),this.width=null}t.prototype.update=function(e,t,r){var i=this.screen!=t||this.total!=e||this.size!=r;i&&(this.screen=t,this.total=e,this.size=r);var o=this.screen*(this.size/this.total);oe.clientWidth+1,i=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=i?"block":"none",this.horiz.node.style.display=r?"block":"none",i&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(r?n:0)),this.vert.node.style.bottom=r?n+"px":"0"),r&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(i?n:0)-e.barLeft),this.horiz.node.style.right=i?n+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:i?n:0,bottom:r?n:0}},r.prototype.setScrollTop=function(e){this.vert.setPos(e)},r.prototype.setScrollLeft=function(e){this.horiz.setPos(e)},r.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new r("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new r("CodeMirror-overlayscroll",e,t)}}(n(5237))},8820(e,t,n){!function(e){"use strict";function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function n(e){return e.phrase("Jump to line:")+' '+e.phrase("(Use line:column or scroll% syntax)")+""}function r(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}e.defineOption("search",{bottom:!1}),e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,n(e),e.phrase("Jump to line:"),i.line+1+":"+i.ch,(function(t){var n;if(t)if(n=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(r(e,n[1]),Number(n[2]));else if(n=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(n[1])/100);/^[-+]/.test(n[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(n=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(r(e,n[1]),i.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}(n(5237),n(8527))},6700(e,t,n){!function(e){"use strict";var t={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function n(e){for(var n in this.options={},t)this.options[n]=(e&&e.hasOwnProperty(n)?e:t)[n];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function r(e){var t=e.state.matchHighlighter;(t.active||e.hasFocus())&&o(e,t)}function i(e){var t=e.state.matchHighlighter;t.active||(t.active=!0,o(e,t))}function o(e,t){clearTimeout(t.timeout),t.timeout=setTimeout((function(){l(e)}),t.options.delay)}function a(e,t,n,r){var i=e.state.matchHighlighter;if(e.addOverlay(i.overlay=d(t,n,r)),i.options.annotateScrollbar&&e.showMatchesOnScrollbar){var o=n?new RegExp((/\w/.test(t.charAt(0))?"\\b":"")+t.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(t.charAt(t.length-1))?"\\b":"")):t;i.matchesonscroll=e.showMatchesOnScrollbar(o,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function s(e){var t=e.state.matchHighlighter;t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null,t.matchesonscroll&&(t.matchesonscroll.clear(),t.matchesonscroll=null))}function l(e){e.operation((function(){var t=e.state.matchHighlighter;if(s(e),e.somethingSelected()||!t.options.showToken){var n=e.getCursor("from"),r=e.getCursor("to");if(n.line==r.line&&(!t.options.wordsOnly||c(e,n,r))){var i=e.getRange(n,r);t.options.trim&&(i=i.replace(/^\s+|\s+$/g,"")),i.length>=t.options.minChars&&a(e,i,!1,t.options.style)}}else{for(var o=!0===t.options.showToken?/[\w$]/:t.options.showToken,l=e.getCursor(),u=e.getLine(l.line),d=l.ch,f=d;d&&o.test(u.charAt(d-1));)--d;for(;f0){var r={line:t.line,ch:t.ch-1};if(null===e.getRange(r,t).match(/\W/))return!1}return!(n.ch=this.gap.to);t++)o.to.line>=this.gap.from&&this.matches.splice(t--,1);for(var r=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),i=this.options&&this.options.maxMatches||n;r.findNext();){var o;if((o={from:r.from(),to:r.to()}).from.line>=this.gap.to)break;if(this.matches.splice(t++,0,o),this.matches.length>i)break}this.gap=null}},t.prototype.onChange=function(t){var n=t.from.line,i=e.changeEnd(t).line,o=i-t.to.line;if(this.gap?(this.gap.from=Math.min(r(this.gap.from,n,o),t.from.line),this.gap.to=Math.max(r(this.gap.to,n,o),t.from.line)):this.gap={from:t.from.line,to:i+1},o)for(var a=0;at.cursorCoords(n,"window").top&&((u=r).style.opacity=.4)})))};a(t,g(t),c,f,(function(n,i){var o=e.keyName(n),a=t.getOption("extraKeys"),s=a&&a[o]||e.keyMap[t.getOption("keyMap")][o];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(n),d(t,r(t),i),t.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(n),f(i,n))})),o&&c&&(d(t,l,c),p(t,n))}else s(t,g(t),"Search for:",c,(function(e){e&&!l.query&&t.operation((function(){d(t,l,e),l.posFrom=l.posTo=t.getCursor(),p(t,n)}))}))}function p(t,n,i){t.operation((function(){var a=r(t),s=o(t,a.query,n?a.posFrom:a.posTo);(s.find(n)||(s=o(t,a.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(n))&&(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))}))}function h(e){e.operation((function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function m(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var r in t)n[r]=t[r];for(var i=2;iu);d++){var f=e.getLine(c++);i=null==i?f:i+"\n"+f}l*=2,t.lastIndex=n.ch;var p=t.exec(i);if(p){var h=i.slice(0,p.index).split("\n"),m=p[0].split("\n"),g=n.line+h.length-1,v=h[h.length-1].length;return{from:r(g,v),to:r(g+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:p}}}}function c(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function u(e,t,n){t=o(t,"g");for(var i=n.line,a=n.ch,s=e.firstLine();i>=s;i--,a=-1){var l=e.getLine(i),u=c(l,t,a<0?0:l.length-a);if(u)return{from:r(i,u.index),to:r(i,u.index+u[0].length),match:u}}}function d(e,t,n){if(!a(t))return u(e,t,n);t=o(t,"gm");for(var i,s=1,l=e.getLine(n.line).length-n.ch,d=n.line,f=e.firstLine();d>=f;){for(var p=0;p=f;p++){var h=e.getLine(d--);i=null==i?h:h+"\n"+i}s*=2;var m=c(i,t,l);if(m){var g=i.slice(0,m.index).split("\n"),v=m[0].split("\n"),y=d+g.length,b=g[g.length-1].length;return{from:r(y,b),to:r(y+v.length-1,1==v.length?b+v[0].length:v[v.length-1].length),match:m}}}}function f(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function p(e,i,o,a){if(!i.length)return null;var s=a?t:n,l=s(i).split(/\r|\n\r?/);e:for(var c=o.line,u=o.ch,d=e.lastLine()+1-l.length;c<=d;c++,u=0){var p=e.getLine(c).slice(u),h=s(p);if(1==l.length){var m=h.indexOf(l[0]);if(-1==m)continue e;return o=f(p,h,m,s)+u,{from:r(c,f(p,h,m,s)+u),to:r(c,f(p,h,m+l[0].length,s)+u)}}var g=h.length-l[0].length;if(h.slice(g)==l[0]){for(var v=1;v=d;c--,u=-1){var p=e.getLine(c);u>-1&&(p=p.slice(0,u));var h=s(p);if(1==l.length){var m=h.lastIndexOf(l[0]);if(-1==m)continue e;return{from:r(c,f(p,h,m,s)),to:r(c,f(p,h,m+l[0].length,s))}}var g=l[l.length-1];if(h.slice(0,g.length)==g){var v=1;for(o=c-l.length+1;v(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=e.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var i=this.matches(t,n);if(this.afterEmptyMatch=i&&0==e.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=r(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new m(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new m(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}(n(5237))},436(e,t,n){!function(e){"use strict";var t="CodeMirror-activeline",n="CodeMirror-activeline-background",r="CodeMirror-activeline-gutter";function i(e){for(var i=0;i=n.line,p=f?n:i(d,0),h=e.markText(u,p,{className:l});if(null==a?s.push(h):s.splice(a++,0,h),f)break;c=d}}function s(e){for(var t=e.state.markedSelection,n=0;n1)return l(e);var t=e.getCursor("start"),n=e.getCursor("end"),i=e.state.markedSelection;if(!i.length)return a(e,t,n);var c=i[0].find(),u=i[i.length-1].find();if(!c||!u||n.line-t.line<=r||o(t,u.to)>=0||o(n,c.from)<=0)return l(e);for(;o(t,c.from)>0;)i.shift().clear(),c=i[0].find();for(o(t,c.from)<0&&(c.to.line-t.line0&&(n.line-u.from.line=t.mouseX&&o.top<=t.mouseY&&o.bottom>=t.mouseY&&(r=!0)}var a=r?t.value:"";e.display.lineDiv.style.cursor!=a&&(e.display.lineDiv.style.cursor=a)}}e.defineOption("selectionPointer",!1,(function(i,o){var a=i.state.selectionPointer;a&&(e.off(i.getWrapperElement(),"mousemove",a.mousemove),e.off(i.getWrapperElement(),"mouseout",a.mouseout),e.off(window,"scroll",a.windowScroll),i.off("cursorActivity",r),i.off("scroll",r),i.state.selectionPointer=null,i.display.lineDiv.style.cursor=""),o&&(a=i.state.selectionPointer={value:"string"==typeof o?o:"default",mousemove:function(e){t(i,e)},mouseout:function(e){n(i,e)},windowScroll:function(){r(i)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},e.on(i.getWrapperElement(),"mousemove",a.mousemove),e.on(i.getWrapperElement(),"mouseout",a.mouseout),e.on(window,"scroll",a.windowScroll),i.on("cursorActivity",r),i.on("scroll",r))}))}(n(5237))},6666(e,t,n){!function(e){"use strict";e.TernServer=function(e){var t=this;this.options=e||{};var n=this.options.plugins||(this.options.plugins={});n.doc_comment||(n.doc_comment=!0),this.docs=Object.create(null),this.options.useWorker?this.server=new I(this):this.server=new tern.Server({getFile:function(e,n){return i(t,e,n)},async:!0,defs:this.options.defs||[],plugins:n}),this.trackChange=function(e,n){s(t,e,n)},this.cachedArgHints=null,this.activeArgHints=null,this.jumpStack=[],this.getHint=function(e,n){return c(t,e,n)},this.getHint.async=!0},e.TernServer.prototype={addDoc:function(t,n){var r={doc:n,name:t,changed:null};return this.server.addFile(t,z(this,r)),e.on(n,"change",this.trackChange),this.docs[t]=r},delDoc:function(t){var n=a(this,t);n&&(e.off(n.doc,"change",this.trackChange),delete this.docs[n.name],this.server.delFile(n.name))},hideDoc:function(e){D(this);var t=a(this,e);t&&t.changed&&l(this,t)},complete:function(e){e.showHint({hint:this.getHint})},showType:function(e,t,n){d(this,e,t,"type",n)},showDocs:function(e,t,n){d(this,e,t,"documentation",n)},updateArgHints:function(e){f(this,e)},jumpToDef:function(e){m(this,e)},jumpBack:function(e){g(this,e)},rename:function(e){x(this,e)},selectName:function(e){k(this,e)},request:function(e,t,n,r){var i=this,a=o(this,e.getDoc()),s=C(this,a,t,r),l=s.query&&this.options.queryOptions&&this.options.queryOptions[s.query.type];if(l)for(var c in l)s.query[c]=l[c];this.server.request(s,(function(e,r){!e&&i.options.responseFilter&&(r=i.options.responseFilter(a,t,s,e,r)),n(e,r)}))},destroy:function(){D(this),this.worker&&(this.worker.terminate(),this.worker=null)}};var t=e.Pos,n="CodeMirror-Tern-",r=250;function i(e,t,n){var r=e.docs[t];r?n(z(e,r)):e.options.getFile?e.options.getFile(t,n):n(null)}function o(e,t,n){for(var r in e.docs){var i=e.docs[r];if(i.doc==t)return i}if(!n)for(var o=0;;++o)if(r="[doc"+(o||"")+"]",!e.docs[r]){n=r;break}return e.addDoc(n,t)}function a(t,n){return"string"==typeof n?t.docs[n]:(n instanceof e&&(n=n.getDoc()),n instanceof e.Doc?o(t,n):void 0)}function s(e,t,n){var i=o(e,t),a=e.cachedArgHints;a&&a.doc==t&&M(a.start,n.to)>=0&&(e.cachedArgHints=null);var s=i.changed;null==s&&(i.changed=s={from:n.from.line,to:n.from.line});var c=n.from.line+(n.text.length-1);n.from.line=s.to&&(s.to=c+1),s.from>n.from.line&&(s.from=n.from.line),t.lineCount()>r&&n.to-s.from>100&&setTimeout((function(){i.changed&&i.changed.to-i.changed.from>100&&l(e,i)}),200)}function l(e,t){e.server.request({files:[{type:"full",name:t.name,text:z(e,t)}]},(function(e){e?window.console.error(e):t.changed=null}))}function c(r,i,o){r.request(i,{type:"completions",types:!0,docs:!0,urls:!0},(function(a,s){if(a)return F(r,i,a);var l=[],c="",d=s.start,f=s.end;'["'==i.getRange(t(d.line,d.ch-2),d)&&'"]'!=i.getRange(f,t(f.line,f.ch+2))&&(c='"]');for(var p=0;p=d;--u){for(var m=r.getLine(u),g=0,v=0;;){var y=m.indexOf("\t",v);if(-1==y)break;g+=c-(y+g)%c-1,v=y+1}if(s=a.column-g,"("==m.charAt(s)){f=!0;break}}if(f){var b=t(u,s),x=n.cachedArgHints;if(x&&x.doc==r.getDoc()&&0==M(b,x.start))return p(n,r,l);n.request(r,{type:"type",preferFunction:!0,end:b},(function(e,t){!e&&t.type&&/^fn\(/.test(t.type)&&(n.cachedArgHints={start:b,type:h(t.type),name:t.exprName||t.name||"fn",guess:t.guess,doc:r.getDoc()},p(n,r,l))}))}}}}}function p(e,t,r){D(e);for(var i=e.cachedArgHints,o=i.type,a=L("span",i.guess?n+"fhint-guess":null,L("span",n+"fname",i.name),"("),s=0;s ":")")),o.rettype&&a.appendChild(L("span",n+"type",o.rettype));var c=t.cursorCoords(null,"page"),u=e.activeArgHints=E(c.right+1,c.bottom,a,t);setTimeout((function(){u.clear=O(t,(function(){e.activeArgHints==u&&D(e)}))}),20)}function h(e){var t=[],n=3;function r(t){for(var r=0,i=n;;){var o=e.charAt(n);if(t.test(o)&&!r)return e.slice(i,n);/[{\[\(]/.test(o)?++r:/[}\]\)]/.test(o)&&--r,++n}}if(")"!=e.charAt(n))for(;;){var i=e.slice(n).match(/^([^, \(\[\{]+): /);if(i&&(n+=i[0].length,i=i[1]),t.push({name:i,type:r(/[\),]/)}),")"==e.charAt(n))break;n+=2}var o=e.slice(n).match(/^\) -> (.*)$/);return{args:t,rettype:o&&o[1]}}function m(e,t){function n(n){var r={type:"definition",variable:n||null},i=o(e,t.getDoc());e.server.request(C(e,i,r),(function(n,r){if(n)return F(e,t,n);if(r.file||!r.url){if(r.file){var o,a=e.docs[r.file];if(a&&(o=y(a.doc,r)))return e.jumpStack.push({file:i.name,start:t.getCursor("from"),end:t.getCursor("to")}),void v(e,i,a,o.start,o.end)}F(e,t,"Could not find a definition.")}else window.open(r.url)}))}b(t)?n():T(t,"Jump to variable",(function(e){e&&n(e)}))}function g(e,t){var n=e.jumpStack.pop(),r=n&&e.docs[n.file];r&&v(e,o(e,t.getDoc()),r,n.start,n.end)}function v(e,t,n,r,i){n.doc.setSelection(r,i),t!=n&&e.options.switchToDoc&&(D(e),e.options.switchToDoc(n.name,n.doc))}function y(e,n){for(var r=n.context.slice(0,n.contextOffset).split("\n"),i=n.start.line-(r.length-1),o=t(i,(1==r.length?n.start.ch:e.getLine(i).length)-r[0].length),a=e.getLine(i).slice(o.ch),s=i+1;s=0&&M(s,c.end)<=0&&(a=o.length-1))}t.setSelections(o,a)}))}var w=0;function _(e,t){for(var n=Object.create(null),r=0;rr&&!1!==l&&n.changed.to-n.changed.from<100&&n.changed.from<=c.line&&n.changed.to>i.end.line?(a.push(S(n,c,i.end)),i.file="#0",s=a[0].offsetLines,null!=i.start&&(i.start=t(i.start.line- -s,i.start.ch)),i.end=t(i.end.line-s,i.end.ch)):(a.push({type:"full",name:n.name,text:z(e,n)}),i.file=n.name,n.changed=null):i.file=n.name,e.docs){var d=e.docs[u];d.changed&&d!=n&&(a.push({type:"full",name:d.name,text:z(e,d)}),d.changed=null)}return{query:i,files:a}}function S(n,r,i){for(var o,a=n.doc,s=null,l=null,c=4,u=r.line-1,d=Math.max(0,u-50);u>=d;--u){var f=a.getLine(u);if(!(f.search(/\bfunction\b/)<0)){var p=e.countColumn(f,null,c);null!=s&&s<=p||(s=p,l=u)}}null==l&&(l=d);var h=Math.min(a.lastLine(),i.line+20);if(null==s||s==e.countColumn(a.getLine(r.line),null,c))o=h;else for(o=i.line+1;o0&&(a.style.left=0,u=a.getBoundingClientRect(),a.style.left=(e=e-d.offsetWidth-u.width)+"px",p=u.right-l),f>0){var h=u.bottom-u.top;s.top-(s.bottom-u.top)-h>0?a.style.top=s.top-h+"px":h>c&&(a.style.height=c-5+"px",a.style.top=s.bottom-u.top+"px")}return p>0&&(u.right-u.left>l&&(a.style.width=l-5+"px",p-=u.right-u.left-l),a.style.left=e-p+"px"),a}function N(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function P(e){e.style.opacity="0",setTimeout((function(){N(e)}),1100)}function F(e,t,n){e.options.showError?e.options.showError(t,n):A(t,String(n),e)}function D(e){e.activeArgHints&&(e.activeArgHints.clear&&e.activeArgHints.clear(),N(e.activeArgHints),e.activeArgHints=null)}function z(e,t){var n=t.doc.getValue();return e.options.fileFilter&&(n=e.options.fileFilter(n,t.name,t.doc)),n}function I(e){var t=e.worker=new Worker(e.options.workerScript);t.postMessage({type:"init",defs:e.options.defs,plugins:e.options.plugins,scripts:e.options.workerDeps});var n=0,r={};function o(e,i){i&&(e.id=++n,r[n]=i),t.postMessage(e)}t.onmessage=function(t){var n=t.data;"getFile"==n.type?i(e,n.name,(function(e,t){o({type:"getFile",err:String(e),text:t,id:n.id})})):"debug"==n.type?window.console.log(n.message):n.id&&r[n.id]&&(r[n.id](n.err,n.body),delete r[n.id])},t.onerror=function(e){for(var t in r)r[t](e);r={}},this.addFile=function(e,t){o({type:"add",name:e,text:t})},this.delFile=function(e){o({type:"del",name:e})},this.request=function(e,t){o({type:"req",body:e},t)}}}(n(5237))},7604(){var e;var t=0,n={};function r(e,r){postMessage({type:"getFile",name:e,id:++t}),n[t]=r}},3874(e,t,n){!function(e){"use strict";var t=e.Pos;function n(e,t,n){for(var r=n.paragraphStart||e.getHelper(t,"paragraphStart"),i=t.line,o=e.firstLine();i>o;--i){var a=e.getLine(i);if(r&&r.test(a))break;if(!/\S/.test(a)){++i;break}}for(var s=n.paragraphEnd||e.getHelper(t,"paragraphEnd"),l=t.line+1,c=e.lastLine();l<=c;++l){if(a=e.getLine(l),s&&s.test(a)){++l;break}if(!/\S/.test(a))break}return{from:i,to:l}}function r(e,t,n,r,i){for(var o=t;o0&&!n.test(e.slice(o-1,o+1));--o);if(!i&&o<=e.match(/^[ \t]*/)[0].length)for(o=t+1;o=s&&(s=m.length+1);for(var g=0;gs&&m==x&&r(f,s,l,u,c);k&&k.from==y&&k.to==y+b?(f=m+v,++p):d.push({text:[b?" ":""],from:t(p,y),to:t(p+1,x.length)})}for(;f.length>s;){var w=r(f,s,l,u,c);if(!(w.from!=w.to||c&&m!==f.slice(0,w.to)))break;d.push({text:["",m],from:t(p,w.from),to:t(p,w.to)}),f=m+f.slice(w.to),++p}}return d.length&&n.operation((function(){for(var t=0;t=0;a--){var s,l=r[a];if(l.empty()){var c=n(e,l.head,{});s={from:t(c.from,0),to:t(c.to-1)}}else s={from:l.from(),to:l.to()};s.to.line>=o||(o=s.from.line,i(e,s.from,s.to,{}))}}))},e.defineExtension("wrapRange",(function(e,t,n){return i(this,e,t,n||{})})),e.defineExtension("wrapParagraphsInRange",(function(e,r,o){o=o||{};for(var a=this,s=[],l=e.line;l<=r.line;){var c=n(a,t(l,0),o);s.push(c),l=c.to}var u=!1;return s.length&&a.operation((function(){for(var e=s.length-1;e>=0;--e)u=u||i(a,t(s[e].from,0),t(s[e].to-1),o)})),u}))}(n(5237))},3944(e,t,n){!function(e){"use strict";var t=e.commands,n=e.Pos;function r(e,t){return e.line==t.line&&e.ch==t.ch}var i=[];function o(e){i.push(e),i.length>50&&i.shift()}function a(e){if(!i.length)return o(e);i[i.length-1]+=e}function s(e){return i[i.length-(e?Math.min(e,1):1)]||""}function l(){return i.length>1&&i.pop(),s()}var c=null;function u(e,t,n,i,s){null==s&&(s=e.getRange(t,n)),"grow"==i&&c&&c.cm==e&&r(t,c.pos)&&e.isClean(c.gen)?a(s):!1!==i&&o(s),e.replaceRange("",t,n,"+delete"),c="grow"==i?{cm:e,pos:t,gen:e.changeGeneration()}:null}function d(e,t,n){return e.findPosH(t,n,"char",!0)}function f(e,t,n){return e.findPosH(t,n,"word",!0)}function p(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function h(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function m(e,t,r){for(var i=t.line,o=e.getLine(i),a=/\S/.test(r<0?o.slice(0,t.ch):o.slice(t.ch)),s=e.firstLine(),l=e.lastLine();;){if((i+=r)l)return e.clipPos(n(i-r,r<0?0:null));if(o=e.getLine(i),/\S/.test(o))a=!0;else if(a)return n(i,0)}}function g(e,t,r){for(var i=t.line,o=t.ch,a=e.getLine(t.line),s=!1;;){var l=a.charAt(o+(r<0?-1:0));if(l){if(s&&/[!?.]/.test(l))return n(i,o+(r>0?1:0));s||(s=/\w/.test(l)),o+=r}else{if(i==(r<0?e.firstLine():e.lastLine()))return n(i,o);if(a=e.getLine(i+r),!/\S/.test(a))return n(i,o);i+=r,o=r<0?a.length:0}}}function v(e,t,i){var o;if(e.findMatchingBracket&&(o=e.findMatchingBracket(t,{strict:!0}))&&o.match&&(o.forward?1:-1)==i)return i>0?n(o.to.line,o.to.ch+1):o.to;for(var a=!0;;a=!1){var s=e.getTokenAt(t),l=n(t.line,i<0?s.start:s.end);if(!(a&&i>0&&s.end==t.ch)&&/\w/.test(s.string))return l;var c=e.findPosH(l,i,"char");if(r(l,c))return t;t=c}}function y(e,t){var n=e.state.emacsPrefix;return n?(L(e),"-"==n?-1:Number(n)):t?null:1}function b(e){var t="string"==typeof e?function(t){t.execCommand(e)}:e;return function(e){var n=y(e);t(e);for(var r=1;r1&&"+input"==t.origin){for(var r=t.text.join("\n"),i="",o=1;o=e.firstLine();){for(var a=e.getLine(r),s=null==i?a.length:i;s>0;)if(")"==(i=a.charAt(--s)))o.push("(");else if("]"==i)o.push("[");else if("}"==i)o.push("{");else if(/[\(\{\[]/.test(i)&&(!o.length||o.pop()!=i))return e.extendSelection(n(r,s));--r,i=null}}t.setMark=function(e){e.setCursor(e.getCursor()),e.setExtending(!e.getExtending()),e.on("change",(function(){e.setExtending(!1)}))},t.killRegion=function(e){u(e,e.getCursor("start"),e.getCursor("end"),!0)},t.killLineEmacs=b((function(e){var t=e.getCursor(),r=e.clipPos(n(t.line)),i=e.getRange(t,r);/\S/.test(i)||(i+="\n",r=n(t.line+1,0)),u(e,t,r,"grow",i)})),t.killRingSave=function(e){o(e.getSelection()),O(e)},t.yank=function(e){var t=e.getCursor();e.replaceRange(s(y(e)),t,t,"paste"),e.setSelection(t,e.getCursor())},t.yankPop=function(e){e.replaceSelection(l(),"around","paste")},t.forwardChar=k(d,1),t.backwardChar=k(d,-1),t.deleteChar=function(e){w(e,d,1,!1)},t.deleteForwardChar=function(e){_(e,!1)||w(e,d,1,!1)},t.deleteBackwardChar=function(e){_(e,!1)||w(e,d,-1,!1)},t.forwardWord=k(f,1),t.backwardWord=k(f,-1),t.killWord=function(e){w(e,f,1,"grow")},t.backwardKillWord=function(e){w(e,f,-1,"grow")},t.nextLine=k(p,1),t.previousLine=k(p,-1),t.scrollDownCommand=k(h,-1),t.scrollUpCommand=k(h,1),t.backwardParagraph=k(m,-1),t.forwardParagraph=k(m,1),t.backwardSentence=k(g,-1),t.forwardSentence=k(g,1),t.killSentence=function(e){w(e,g,1,"grow")},t.backwardKillSentence=function(e){u(e,e.getCursor(),g(e,e.getCursor(),1),"grow")},t.killSexp=function(e){w(e,v,1,"grow")},t.backwardKillSexp=function(e){w(e,v,-1,"grow")},t.forwardSexp=k(v,1),t.backwardSexp=k(v,-1),t.markSexp=function(e){var t=e.getCursor();e.setSelection(x(e,t,v,1),t)},t.transposeSexps=function(e){var t=v(e,e.getCursor(),-1),n=v(e,t,1),r=v(e,n,1),i=v(e,r,-1);e.replaceRange(e.getRange(i,r)+e.getRange(n,i)+e.getRange(t,n),t,r)},t.backwardUpList=b(F),t.justOneSpace=function(e){for(var t=e.getCursor(),r=t.ch,i=t.ch,o=e.getLine(t.line);r&&/\s/.test(o.charAt(r-1));)--r;for(;i0)return e.setCursor(t-1);N(e,"Goto line",(function(t){var n;t&&!isNaN(n=Number(t))&&n==(0|n)&&n>0&&e.setCursor(n-1)}))},t.indentRigidly=function(e){e.indentSelection(y(e,!0)||e.getOption("indentUnit"))},t.exchangePointAndMark=function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},t.quotedInsertTab=b("insertTab"),t.universalArgument=function(e){e.state.emacsPrefixMap=!0,e.addKeyMap(z),e.on("keyHandled",A),e.on("inputRead",A)},e.emacs={kill:u,killRegion:_,repeated:b};var D=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":"killRegion","Ctrl-K":"killLineEmacs","Alt-W":"killRingSave","Ctrl-Y":"yank","Alt-Y":"yankPop","Ctrl-Space":"setMark","Ctrl-Shift-2":"setMark","Ctrl-F":"forwardChar","Ctrl-B":"backwardChar",Right:"forwardChar",Left:"backwardChar","Ctrl-D":"deleteChar",Delete:"deleteForwardChar","Ctrl-H":"deleteBackwardChar",Backspace:"deleteBackwardChar","Alt-F":"forwardWord","Alt-B":"backwardWord","Alt-Right":"forwardWord","Alt-Left":"backwardWord","Alt-D":"killWord","Alt-Backspace":"backwardKillWord","Ctrl-N":"nextLine","Ctrl-P":"previousLine",Down:"nextLine",Up:"previousLine","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":"scrollDownCommand","Ctrl-V":"scrollUpCommand",PageUp:"scrollDownCommand",PageDown:"scrollUpCommand","Ctrl-Up":"backwardParagraph","Ctrl-Down":"forwardParagraph","Alt-{":"backwardParagraph","Alt-}":"forwardParagraph","Alt-A":"backwardSentence","Alt-E":"forwardSentence","Alt-K":"killSentence","Ctrl-X Delete":"backwardKillSentence","Ctrl-Alt-K":"killSexp","Ctrl-Alt-Backspace":"backwardKillSexp","Ctrl-Alt-F":"forwardSexp","Ctrl-Alt-B":"backwardSexp","Shift-Ctrl-Alt-2":"markSexp","Ctrl-Alt-T":"transposeSexps","Ctrl-Alt-U":"backwardUpList","Alt-Space":"justOneSpace","Ctrl-O":"openLine","Ctrl-T":"transposeCharsRepeatable","Alt-C":"capitalizeWord","Alt-U":"upcaseWord","Alt-L":"downcaseWord","Alt-;":"toggleComment","Ctrl-/":"undoRepeatable","Shift-Ctrl--":"undoRepeatable","Ctrl-Z":"undoRepeatable","Cmd-Z":"undoRepeatable","Ctrl-X U":"undoRepeatable","Shift-Ctrl-Z":"redo","Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findPersistentNext","Ctrl-R":"findPersistentPrev","Ctrl-G":"keyboardQuit","Shift-Alt-5":"replace","Alt-/":"autocomplete",Enter:"newlineAndIndent","Ctrl-J":"newline",Tab:"indentAuto","Alt-G G":"gotoLine","Ctrl-X Tab":"indentRigidly","Ctrl-X Ctrl-X":"exchangePointAndMark","Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X K":"close","Ctrl-X H":"selectAll","Ctrl-Q Tab":"quotedInsertTab","Ctrl-U":"universalArgument",fallthrough:"default"}),z={"Ctrl-G":L};function I(e){z[e]=function(t){C(t,e)},D["Ctrl-"+e]=function(t){C(t,e)},S["Ctrl-"+e]=!0}for(var R=0;R<10;++R)I(String(R));I("-")}(n(5237))},8208(e,t,n){!function(e){"use strict";var t=e.commands,n=e.Pos;function r(t,r,i){if(i<0&&0==r.ch)return t.clipPos(n(r.line-1));var o=t.getLine(r.line);if(i>0&&r.ch>=o.length)return t.clipPos(n(r.line+1,0));for(var a,s="start",l=r.ch,c=l,u=i<0?0:o.length,d=0;c!=u;c+=i,d++){var f=o.charAt(i<0?c-1:c),p="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==p&&f.toUpperCase()==f&&(p="W"),"start"==s)"o"!=p?(s="in",a=p):l=c+i;else if("in"==s&&a!=p){if("w"==a&&"W"==p&&i<0&&c--,"W"==a&&"w"==p&&i>0){if(c==l+1){a="w";continue}c--}break}}return n(r.line,c)}function i(e,t){e.extendSelectionsBy((function(n){return e.display.shift||e.doc.extend||n.empty()?r(e.doc,n.head,t):t<0?n.from():n.to()}))}function o(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,i=[],o=-1,a=0;a=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],i=0;io.line&&s==a.line&&0==a.ch||r.push({anchor:s==o.line?o:n(s,0),head:s==a.line?a:n(s)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;s--){var c=r[i[s]];if(!(l&&e.cmpPos(c.head,l)>0)){var u=a(t,c.head);l=u.from,t.replaceRange(n(u.word),u.from,u.to)}}}))}function h(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=a(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function m(e,t){var r=h(e);if(r){var i=r.query,o=e.getSearchCursor(i,t?r.to:r.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(i,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):r.word&&e.setSelection(r.from,r.to))}}t.selectScope=function(e){u(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!u(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy((function(r){var i=t.scanForBracket(r.head,1,d(t.getTokenTypeAt(r.head)));if(i&&0!=e.cmpPos(i.pos,r.head))return i.pos;var o=t.scanForBracket(r.head,-1,d(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.firstLine()-1,a=[],s=0;so?i.push(c,u):i.length&&(i[i.length-1]=u),o=u}t.operation((function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+s,n(t.lastLine()),null,"+swapLine"):t.replaceRange(s+"\n",n(o,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],l=s.to().line+1,c=s.from().line;0!=s.to().ch||s.empty()||l--,l=0;e-=2){var r=i[e],o=i[e+1],a=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;o--){var a=r[o].head,s=t.getRange({line:a.line,ch:0},a),l=e.countColumn(s,null,t.getOption("tabSize")),c=t.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&l%i==0){var u=new n(a.line,e.findColumn(s,l-i,i));u.ch!=a.ch&&(c=u)}t.replaceRange("",c,a,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){p(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){p(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){m(e,!0)},t.findUnderPrevious=function(e){m(e,!1)},t.findAllUnder=function(e){var t=h(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var g=e.keyMap;g.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(g.macSublime),g.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(g.pcSublime);var v=g.default==g.macDefault;g.sublime=v?g.macSublime:g.pcSublime}(n(5237),n(3653),n(7923))},1275(e,t,n){!function(e){"use strict";function t(e){var t=e.Pos;function n(e,n){var r=e.state.vim;if(!r||r.insertMode)return n.head;var i=r.sel.head;return i?r.visualBlock&&n.head.line!=i.line?void 0:n.from()!=n.anchor||n.empty()||n.head.line!=i.line||n.head.ch==i.ch?n.head:new t(n.head.line,n.head.ch-1):n.head}var r=[{keys:"",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"g",type:"keyToKey",toKeys:"gk"},{keys:"g",type:"keyToKey",toKeys:"gj"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"idle",context:"normal"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:'"',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],i=r.length,o=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"global",shortName:"g"}];function a(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",Bt),j(t),e.on(t.getInputField(),"paste",h(t))}function s(t){t.setOption("disableInput",!1),t.off("cursorActivity",Bt),e.off(t.getInputField(),"paste",h(t)),t.state.vim=null,bt&&clearTimeout(bt)}function l(t,n){this==e.keyMap.vim&&(t.options.$customCursor=null,e.rmClass(t.getWrapperElement(),"cm-fat-cursor")),n&&n.attach==c||s(t)}function c(t,r){this==e.keyMap.vim&&(t.curOp&&(t.curOp.selectionChanged=!0),t.options.$customCursor=n,e.addClass(t.getWrapperElement(),"cm-fat-cursor")),r&&r.attach==c||a(t)}function u(t,n){if(n){if(this[t])return this[t];var r=p(t);if(!r)return!1;var i=K.findKey(n,r);return"function"==typeof i&&e.signal(n,"vim-keypress",r),i}}e.defineOption("vimMode",!1,(function(t,n,r){n&&"vim"!=t.getOption("keyMap")?t.setOption("keyMap","vim"):!n&&r!=e.Init&&/^vim/.test(t.getOption("keyMap"))&&t.setOption("keyMap","default")}));var d={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A",CapsLock:""},f={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"};function p(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var r=!1,i=0;i")}function h(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(se(e.getCursor(),0,1)),re.enterInsertMode(e,{},t))}),t.onPasteFn}var m=/[\d]/,g=[e.isWordChar,function(t){return t&&!e.isWordChar(t)&&!/\s/.test(t)}],v=[function(e){return/\S/.test(e)}];function y(e,t){for(var n=[],r=e;r"]),C=[].concat(x,k,w,["-",'"',".",":","_","/"]);try{b=new RegExp("^[\\p{Lu}]$","u")}catch(e){b=/^[A-Z]$/}function S(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function M(e){return/^[a-z]$/.test(e)}function L(e){return-1!="()[]{}".indexOf(e)}function T(e){return m.test(e)}function A(e){return b.test(e)}function O(e){return/^\s*$/.test(e)}function E(e){return-1!=".?!".indexOf(e)}function N(e,t){for(var n=0;nn?t=n:t0?1:-1,u=o.getCursor();do{if((s=i[(e+(t+=c))%e])&&(l=s.find())&&!pe(u,l))break}while(tr)}return s}function s(e,n){var r=t,i=a(e,n);return t=r,i&&i.find()}return{cachedCursor:void 0,add:o,find:s,move:a}},B=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function H(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=B()}function j(e){return e.state.vim||(e.state.vim={inputState:new U,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function W(){for(var e in I={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:q(),macroModeState:new H,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new X({}),searchHistoryController:new Q,exCommandHistoryController:new Q},P){var t=P[e];t.value=t.defaultValue}}H.prototype={exitMacroRecordMode:function(){var e=I.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=I.registerController.getRegister(t);if(n){if(n.clear(),this.latestRegister=t,e.openDialog){var r=ft("span",{class:"cm-vim-message"},"recording @"+t);this.onRecordingDone=e.openDialog(r,null,{bottom:!0})}this.isRecording=!0}}};var K={enterVimMode:a,buildKeyMap:function(){},getRegisterController:function(){return I.registerController},resetVimGlobalState_:W,getVimGlobalState_:function(){return I},maybeInitVimState_:j,suppressErrorLogging:!1,InsertModeKey:jt,map:function(e,t,n){Ot.map(e,t,n)},unmap:function(e,t){return Ot.unmap(e,t)},noremap:function(e,t,n){function o(e){return e?[e]:["normal","insert","visual"]}for(var a=o(n),s=r.length,l=s-i;l=0;a--){var s=o[a];if(e!==s.context)if(s.context)this._mapCommand(s);else{var l=["normal","insert","visual"];for(var c in l)if(l[c]!==e){var u={};for(var d in s)u[d]=s[d];u.context=l[c],this._mapCommand(u)}}}},setOption:D,getOption:z,defineOption:F,defineEx:function(e,t,n){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;At[e]=n,Ot.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var r=this.findKey(e,t,n);if("function"==typeof r)return r()},multiSelectHandleKey:Vt,findKey:function(e,t,n){var i,o=j(e);function a(){var r=I.macroModeState;if(r.isRecording){if("q"==t)return r.exitMacroRecordMode(),$(e),!0;"mapping"!=n&&zt(r,t)}}function s(){if(""==t){if(o.visualMode)Ee(e);else{if(!o.insertMode)return;Nt(e)}return $(e),!0}}function l(n){for(var r;n;)r=/<\w+-.+?>|<\w+>|./.exec(n),t=r[0],n=n.substring(r.index+t.length),K.handleKey(e,t,"mapping")}function c(){if(s())return!0;for(var n=o.inputState.keyBuffer=o.inputState.keyBuffer+t,i=1==t.length,a=Y.matchCommand(n,r,o.inputState,"insert");n.length>1&&"full"!=a.type;){n=o.inputState.keyBuffer=n.slice(1);var l=Y.matchCommand(n,r,o.inputState,"insert");"none"!=l.type&&(a=l)}if("none"==a.type)return $(e),!1;if("partial"==a.type)return R&&window.clearTimeout(R),R=window.setTimeout((function(){o.insertMode&&o.inputState.keyBuffer&&$(e)}),z("insertModeEscKeysTimeout")),!i;if(R&&window.clearTimeout(R),i){for(var c=e.listSelections(),u=0;u0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},V.prototype={setText:function(e,t,n){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!n},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(B(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},X.prototype={pushText:function(e,t,n,r,i){if("_"!==e){r&&"\n"!==n.charAt(n.length-1)&&(n+="\n");var o=this.isValidRegister(e)?this.getRegister(e):null;if(o)A(e)?o.pushText(n,r):o.setText(n,r,i),this.unnamedRegister.setText(o.toString(),r);else{switch(t){case"yank":this.registers[0]=new V(n,r,i);break;case"delete":case"change":-1==n.indexOf("\n")?this.registers["-"]=new V(n,r):(this.shiftNumericRegisters_(),this.registers[1]=new V(n,r))}this.unnamedRegister.setText(n,r,i)}}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new V),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&N(e,C)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},Q.prototype={nextMatch:function(e,t){var n=this.historyBuffer,r=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var i=this.iterator+r;t?i>=0:i=n.length?(this.iterator=n.length,this.initialPrefix):i<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var Y={matchCommand:function(e,t,n,r){var i,o=le(e,t,r,n);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var a=0;a"==i.keys.slice(-11)){var l=ue(e);if(!l||l.length>1)return{type:"clear"};n.selectedCharacter=l}return{type:"full",command:i}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n)}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=ae(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var r=t.inputState;if(r.operator){if(r.operator==n.operator)return r.motion="expandToLine",r.motionArgs={linewise:!0},void this.evalInput(e,t);$(e)}r.operator=n.operator,r.operatorArgs=ae(n.operatorArgs),n.keys.length>1&&(r.operatorShortcut=n.keys),n.exitVisualBlock&&(t.visualBlock=!1,Te(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var r=t.visualMode,i=ae(n.operatorMotionArgs);i&&r&&i.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),r||this.processMotion(e,t,n)},processAction:function(e,t,n){var r=t.inputState,i=r.getRepeat(),o=!!i,a=ae(n.actionArgs)||{};r.selectedCharacter&&(a.selectedCharacter=r.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),a.repeat=i||1,a.repeatIsExplicit=o,a.registerName=r.registerName,$(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,r,n),re[n.action](e,a,t)},processSearch:function(t,n,r){if(t.getSearchCursor){var i=r.searchArgs.forward,o=r.searchArgs.wholeWordOnly;tt(t).setReversed(!i);var a=i?"/":"?",s=tt(t).getQuery(),l=t.getScrollInfo();switch(r.searchArgs.querySrc){case"prompt":var c=I.macroModeState;c.isPlaying?p(f=c.replaySearchQueries.shift(),!0,!1):mt(t,{onClose:h,prefix:a,desc:"(JavaScript regexp)",onKeyUp:m,onKeyDown:g});break;case"wordUnderCursor":var u=De(t,!1,!0,!1,!0),d=!0;if(u||(u=De(t,!1,!0,!1,!1),d=!1),!u)return;var f=t.getLine(u.start.line).substring(u.start.ch,u.end.ch);f=d&&o?"\\b"+f+"\\b":xe(f),I.jumpList.cachedCursor=t.getCursor(),t.setCursor(u.start),p(f,!0,!1)}}function p(e,i,o){I.searchHistoryController.pushInput(e),I.searchHistoryController.reset();try{vt(t,e,i,o)}catch(n){return pt(t,"Invalid regex: "+e),void $(t)}Y.processMotion(t,n,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:r.searchArgs.toJumplist}})}function h(e){t.scrollTo(l.left,l.top),p(e,!0,!0);var n=I.macroModeState;n.isRecording&&Rt(n,e)}function m(n,r,o){var a,s,c,u=e.keyName(n);"Up"==u||"Down"==u?(a="Up"==u,s=n.target?n.target.selectionEnd:0,o(r=I.searchHistoryController.nextMatch(r,a)||""),s&&n.target&&(n.target.selectionEnd=n.target.selectionStart=Math.min(s,n.target.value.length))):"Left"!=u&&"Right"!=u&&"Ctrl"!=u&&"Alt"!=u&&"Shift"!=u&&I.searchHistoryController.reset();try{c=vt(t,r,!0,!0)}catch(n){}c?t.scrollIntoView(kt(t,!i,c),30):(_t(t),t.scrollTo(l.left,l.top))}function g(n,r,i){var o=e.keyName(n);"Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==r?(I.searchHistoryController.pushInput(r),I.searchHistoryController.reset(),vt(t,s),_t(t),t.scrollTo(l.left,l.top),e.e_stop(n),$(t),i(),t.focus()):"Up"==o||"Down"==o?e.e_stop(n):"Ctrl-U"==o&&(e.e_stop(n),i(""))}},processEx:function(t,n,r){function i(e){I.exCommandHistoryController.pushInput(e),I.exCommandHistoryController.reset(),Ot.processCommand(t,e),$(t)}function o(n,r,i){var o,a,s=e.keyName(n);("Esc"==s||"Ctrl-C"==s||"Ctrl-["==s||"Backspace"==s&&""==r)&&(I.exCommandHistoryController.pushInput(r),I.exCommandHistoryController.reset(),e.e_stop(n),$(t),i(),t.focus()),"Up"==s||"Down"==s?(e.e_stop(n),o="Up"==s,a=n.target?n.target.selectionEnd:0,i(r=I.exCommandHistoryController.nextMatch(r,o)||""),a&&n.target&&(n.target.selectionEnd=n.target.selectionStart=Math.min(a,n.target.value.length))):"Ctrl-U"==s?(e.e_stop(n),i("")):"Left"!=s&&"Right"!=s&&"Ctrl"!=s&&"Alt"!=s&&"Shift"!=s&&I.exCommandHistoryController.reset()}"keyToEx"==r.type?Ot.processCommand(t,r.exArgs.input):n.visualMode?mt(t,{onClose:i,prefix:":",value:"'<,'>",onKeyDown:o,selectValueOnOpen:!1}):mt(t,{onClose:i,prefix:":",onKeyDown:o})},evalInput:function(e,n){var r,i,o,a=n.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},d=a.registerName,f=n.sel,p=fe(n.visualMode?oe(e,f.head):e.getCursor("head")),h=fe(n.visualMode?oe(e,f.anchor):e.getCursor("anchor")),m=fe(p),g=fe(h);if(c&&this.recordLastEdit(n,a),(o=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat())>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===o)&&(o=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=o,$(e),s){var v=J[s](e,p,l,n,a);if(n.lastMotion=J[s],!v)return;if(l.toJumplist){var y=I.jumpList,b=y.cachedCursor;b?(Ie(e,b,v),delete y.cachedCursor):Ie(e,p,v)}v instanceof Array?(i=v[0],r=v[1]):r=v,r||(r=fe(p)),n.visualMode?(n.visualBlock&&r.ch===1/0||(r=oe(e,r)),i&&(i=oe(e,i)),i=i||g,f.anchor=i,f.head=r,Te(e),Ve(e,n,"<",he(i,r)?i:r),Ve(e,n,">",he(i,r)?r:i)):c||(r=oe(e,r),e.setCursor(r.line,r.ch))}if(c){if(u.lastSel){i=g;var x=u.lastSel,k=Math.abs(x.head.line-x.anchor.line),w=Math.abs(x.head.ch-x.anchor.ch);r=x.visualLine?new t(g.line+k,g.ch):x.visualBlock?new t(g.line+k,g.ch+w):x.head.line==x.anchor.line?new t(g.line,g.ch+w):new t(g.line+k,g.ch),n.visualMode=!0,n.visualLine=x.visualLine,n.visualBlock=x.visualBlock,f=n.sel={anchor:i,head:r},Te(e)}else n.visualMode&&(u.lastSel={anchor:fe(f.anchor),head:fe(f.head),visualBlock:n.visualBlock,visualLine:n.visualLine});var _,C,S,M,L;if(n.visualMode){if(_=me(f.head,f.anchor),C=ge(f.head,f.anchor),S=n.visualLine||u.linewise,L=Ae(e,{anchor:_,head:C},M=n.visualBlock?"block":S?"line":"char"),S){var T=L.ranges;if("block"==M)for(var A=0;Al:d.lineu&&o.line==u?Ke(e,n,r,i,!0):(r.toFirstChar&&(a=Fe(e.getLine(l)),i.lastHPos=a),i.lastHSPos=e.charCoords(new t(l,a),"div").left,new t(l,a))},moveByDisplayLines:function(e,n,r,i){var o=n;switch(i.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:i.lastHSPos=e.charCoords(o,"div").left}var a=r.repeat;if((l=e.findPosV(o,r.forward?a:-a,"line",i.lastHSPos)).hitSide)if(r.forward)var s={top:e.charCoords(l,"div").top+8,left:i.lastHSPos},l=e.coordsChar(s,"div");else{var c=e.charCoords(new t(e.firstLine(),0),"div");c.left=i.lastHSPos,l=e.coordsChar(c,"div")}return i.lastHPos=l.ch,l},moveByPage:function(e,t,n){var r=t,i=n.repeat;return e.findPosV(r,n.forward?i:-i,"page")},moveByParagraph:function(e,t,n){var r=n.forward?1:-1;return Xe(e,t,n.repeat,r)},moveBySentence:function(e,t,n){var r=n.forward?1:-1;return Ye(e,t,n.repeat,r)},moveByScroll:function(e,t,n,r){var i=e.getScrollInfo(),o=null,a=n.repeat;a||(a=i.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");if(n.repeat=a,!(o=J.moveByDisplayLines(e,t,n,r)))return null;var l=e.charCoords(o,"local");return e.scrollTo(null,i.top+l.top-s.top),o},moveByWords:function(e,t,n){return We(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var r=Ue(e,n.repeat,n.forward,n.selectedCharacter),i=n.forward?-1:1;return Re(i,n),r?(r.ch+=i,r):null},moveToCharacter:function(e,t,n){var r=n.repeat;return Re(0,n),Ue(e,r,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){return He(e,n.repeat,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,r){var i=n.repeat;return r.lastHPos=i-1,r.lastHSPos=e.charCoords(t,"div").left,$e(e,i)},moveToEol:function(e,t,n,r){return Ke(e,t,n,r,!1)},moveToFirstNonWhiteSpaceCharacter:function(e,n){var r=n;return new t(r.line,Fe(e.getLine(r.line)))},moveToMatchedSymbol:function(e,n){for(var r,i=n,o=i.line,a=i.ch,s=e.getLine(o);a"===a?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(new t(o,a),{bracketRegex:c}).to}return i},moveToStartOfLine:function(e,n){return new t(n.line,0)},moveToLineOrEdgeOfDocument:function(e,n,r){var i=r.forward?e.lastLine():e.firstLine();return r.repeatIsExplicit&&(i=r.repeat-e.getOption("firstLineNumber")),new t(i,Fe(e.getLine(i)))},moveToStartOfDisplayLine:function(e){return e.execCommand("goLineLeft"),e.getCursor()},moveToEndOfDisplayLine:function(e){e.execCommand("goLineRight");var t=e.getCursor();return"before"==t.sticky&&t.ch--,t},textObjectManipulation:function(e,t,n,r){var i={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},o={"'":!0,'"':!0,"`":!0},a=n.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!n.textObjectInner;if(i[a])s=Je(e,t,a,l);else if(o[a])s=Ze(e,t,a,l);else if("W"===a)s=De(e,l,!0,!0);else if("w"===a)s=De(e,l,!0,!1);else if("p"===a)if(s=Xe(e,t,n.repeat,0,l),n.linewise=!0,r.visualMode)r.visualLine||(r.visualLine=!0);else{var c=r.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}else if("t"===a)s=ze(e,t,l);else{if("s"!==a)return null;var u=e.getLine(t.line);t.ch>0&&E(u[t.ch])&&(t.ch-=1);var d=Qe(e,t,n.repeat,1,l),f=Qe(e,t,n.repeat,-1,l);O(e.getLine(f.line)[f.ch])&&O(e.getLine(d.line)[d.ch-1])&&(f={line:f.line,ch:f.ch+1}),s={start:f,end:d}}return e.state.vim.visualMode?Le(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,n){var r=I.lastCharacterSearch,i=n.repeat,o=n.forward===r.forward,a=(r.increment?1:0)*(o?-1:1);e.moveH(-a,"char"),n.inclusive=!!o;var s=Ue(e,i,o,r.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}};function Z(e,t){J[e]=t}function ee(e,t){for(var n=[],r=0;rn.lastLine()&&r.linewise&&!h?n.replaceRange("",p,c):n.replaceRange("",l,c),r.linewise&&(h||(n.setCursor(p),e.commands.newlineAndIndent(n)),l.ch=Number.MAX_VALUE),o=l}I.registerController.pushText(r.registerName,"change",a,r.linewise,i.length>1),re.enterInsertMode(n,{head:o},n.state.vim)},delete:function(e,n,r){var i,o,a=e.state.vim;if(a.visualBlock){o=e.getSelection();var s=ee("",r.length);e.replaceSelections(s),i=me(r[0].head,r[0].anchor)}else{var l=r[0].anchor,c=r[0].head;n.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=new t(l.line-1,ye(e,l.line-1))),o=e.getRange(l,c),e.replaceRange("",l,c),i=l,n.linewise&&(i=J.moveToFirstNonWhiteSpaceCharacter(e,l))}return I.registerController.pushText(n.registerName,"delete",o,n.linewise,a.visualBlock),oe(e,i)},indent:function(e,t,n){var r=e.state.vim;if(e.indentMore)for(var i=r.visualMode?t.repeat:1,o=0;oc.top?(l.line+=(s-c.top)/i,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?se(a.head,0,1):new t(a.anchor.line,0)}else if("inplace"==o){if(i.visualMode)return}else"lastEdit"==o&&(s=Lt(n)||s);n.setOption("disableInput",!1),r&&r.replace?(n.toggleOverwrite(!0),n.setOption("keyMap","vim-replace"),e.signal(n,"vim-mode-change",{mode:"replace"})):(n.toggleOverwrite(!1),n.setOption("keyMap","vim-insert"),e.signal(n,"vim-mode-change",{mode:"insert"})),I.macroModeState.isPlaying||(n.on("change",qt),e.on(n.getInputField(),"keydown",Wt)),i.visualMode&&Ee(n),_e(n,s,l)}},toggleVisualMode:function(n,r,i){var o,a=r.repeat,s=n.getCursor();i.visualMode?i.visualLine^r.linewise||i.visualBlock^r.blockwise?(i.visualLine=!!r.linewise,i.visualBlock=!!r.blockwise,e.signal(n,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),Te(n)):Ee(n):(i.visualMode=!0,i.visualLine=!!r.linewise,i.visualBlock=!!r.blockwise,o=oe(n,new t(s.line,s.ch+a-1)),i.sel={anchor:s,head:o},e.signal(n,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),Te(n),Ve(n,i,"<",me(s,o)),Ve(n,i,">",ge(s,o)))},reselectLastSelection:function(t,n,r){var i=r.lastSelection;if(r.visualMode&&Me(t,r),i){var o=i.anchorMark.find(),a=i.headMark.find();if(!o||!a)return;r.sel={anchor:o,head:a},r.visualMode=!0,r.visualLine=i.visualLine,r.visualBlock=i.visualBlock,Te(t),Ve(t,r,"<",me(o,a)),Ve(t,r,">",ge(o,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""})}},joinLines:function(e,n,r){var i,o;if(r.visualMode){if(i=e.getCursor("anchor"),he(o=e.getCursor("head"),i)){var a=o;o=i,i=a}o.ch=ye(e,o.line)-1}else{var s=Math.max(n.repeat,2);i=e.getCursor(),o=oe(e,new t(i.line+s-1,1/0))}for(var l=0,c=i.line;c1&&(p=Array(n.repeat+1).join(p));var h,m,g=o.linewise,v=o.blockwise;if(v){p=p.split("\n"),g&&p.pop();for(var y=0;ye.lastLine()&&e.replaceRange("\n",new t(M,0)),ye(e,M)u.length&&(o=u.length),a=new t(l.line,o)}if("\n"==s)i.visualMode||n.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(n);else{var d=n.getRange(l,a);if(d=d.replace(/[^\n]/g,s),i.visualBlock){var f=new Array(n.getOption("tabSize")+1).join(" ");d=(d=n.getSelection()).replace(/\t/g,f).replace(/[^\n]/g,s).split("\n"),n.replaceSelections(d)}else n.replaceRange(d,l,a);i.visualMode?(l=he(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,n.setCursor(l),Ee(n,!1)):n.setCursor(se(a,0,-1))}},incrementNumberToken:function(e,n){for(var r,i,o,a,s=e.getCursor(),l=e.getLine(s.line),c=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(r=c.exec(l))&&(o=(i=r.index)+r[0].length,!(s.ch"==t.slice(-11)){var n=t.length-11,r=e.slice(0,n),i=t.slice(0,n);return r==i&&e.length>n?"full":0==i.indexOf(r)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function ue(e){var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case"":n="\n";break;case"":n=" ";break;default:n=""}return n}function de(e,t,n){return function(){for(var r=0;r2&&(t=me.apply(void 0,Array.prototype.slice.call(arguments,1))),he(e,t)?e:t}function ge(e,t){return arguments.length>2&&(t=ge.apply(void 0,Array.prototype.slice.call(arguments,1))),he(e,t)?t:e}function ve(e,t,n){var r=he(e,t),i=he(t,n);return r&&i}function ye(e,t){return e.getLine(t).length}function be(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function xe(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function ke(e,n,r){var i=ye(e,n),o=new Array(r-i+1).join(" ");e.setCursor(new t(n,i)),e.replaceRange(o,e.getCursor())}function we(e,n){var r=[],i=e.listSelections(),o=fe(e.clipPos(n)),a=!pe(n,o),s=Ce(i,e.getCursor("head")),l=pe(i[s].head,i[s].anchor),c=i.length-1,u=c-s>s?c:0,d=i[u].anchor,f=Math.min(d.line,o.line),p=Math.max(d.line,o.line),h=d.ch,m=o.ch,g=i[u].head.ch-h,v=m-h;g>0&&v<=0?(h++,a||m--):g<0&&v>=0?(h--,l||m++):g<0&&-1==v&&(h--,m++);for(var y=f;y<=p;y++){var b={anchor:new t(y,h),head:new t(y,m)};r.push(b)}return e.setSelections(r),n.ch=m,d.ch=h,d}function _e(e,t,n){for(var r=[],i=0;ic&&(o.line=c),o.ch=ye(e,o.line)}return{ranges:[{anchor:a,head:o}],primary:0}}if("block"==r){var u=Math.min(a.line,o.line),d=a.ch,f=Math.max(a.line,o.line),p=o.ch;d