mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-15 07:05:37 +01:00
29 lines
572 KiB
JavaScript
29 lines
572 KiB
JavaScript
|
/*! This file is auto-generated from CodeMirror - github:codemirror/CodeMirror#ee20357d279bf9edfed0047d3bf2a75b5f0a040f
|
||
|
|
||
|
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 .
|
||
|
*/
|
||
|
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)}(function(a){"use strict";function b(a){var b=a.search(f);return b==-1?0:b}function c(a,b,c){return/\bstring\b/.test(a.getTokenTypeAt(g(b.line,0)))&&!/^[\'\"\`]/.test(c)}function d(a,b){var c=a.getMode();return c.useInnerComments!==!1&&c.innerMode?a.getModeAt(b):c}var e={},f=/[^\s\u00a0]/,g=a.Pos;a.commands.toggleComment=function(a){a.toggleComment()},a.defineExtension("toggleComment",function(a){a||(a=e);for(var b=this,c=1/0,d=this.listSelections(),f=null,h=d.length-1;h>=0;h--){var i=d[h].from(),j=d[h].to();i.line>=c||(j.line>=c&&(j=g(c,0)),c=i.line,null==f?b.uncomment(i,j,a)?f="un":(b.lineComment(i,j,a),f="line"):"un"==f?b.uncomment(i,j,a):b.lineComment(i,j,a))}}),a.defineExtension("lineComment",function(a,h,i){i||(i=e);var j=this,k=d(j,a),l=j.getLine(a.line);if(null!=l&&!c(j,a,l)){var m=i.lineComment||k.lineComment;if(!m)return void((i.blockCommentStart||k.blockCommentStart)&&(i.fullLines=!0,j.blockComment(a,h,i)));var n=Math.min(0!=h.ch||h.line==a.line?h.line+1:h.line,j.lastLine()+1),o=null==i.padding?" ":i.padding,p=i.commentBlankLines||a.line==h.line;j.operation(function(){if(i.indent){for(var c=null,d=a.line;d<n;++d){var e=j.getLine(d),h=e.slice(0,b(e));(null==c||c.length>h.length)&&(c=h)}for(var d=a.line;d<n;++d){var e=j.getLine(d),k=c.length;(p||f.test(e))&&(e.slice(0,k)!=c&&(k=b(e)),j.replaceRange(c+m+o,g(d,0),g(d,k)))}}else for(var d=a.line;d<n;++d)(p||f.test(j.getLine(d)))&&j.replaceRange(m+o,g(d,0))})}}),a.defineExtension("blockComment",function(a,b,c){c||(c=e);var h=this,i=d(h,a),j=c.blockCommentStart||i.blockCommentStart,k=c.blockCommentEnd||i.blockCommentEnd;if(!j||!k)return void((c.lineComment||i.lineComment)&&0!=c.fullLines&&h.lineComment(a,b,c));if(!/\bcomment\b/.test(h.getTokenTypeAt(g(a.line,0)))){var l=Math.min(b.line,h.lastLine());l!=a.line&&0==b.ch&&f.test(h.getLine(l))&&--l;var m=null==c.padding?" ":c.padding;a.line>l||h.operation(function(){if(0!=c.fullLines){var d=f.test(h.getLine(l));h.replaceRange(m+k,g(l)),h.replaceRange(j+m,g(a.line,0));var e=c.blockCommentLead||i.blockCommentLead;if(null!=e)for(var n=a.line+1;n<=l;++n)(n!=l||d)&&h.replaceRange(e+m,g(n,0))}else h.replaceRange(k,b),h.replaceRange(j,a)})}}),a.defineExtension("uncomment",function(a,b,c){c||(c=e);var h,i=this,j=d(i,a),k=Math.min(0!=b.ch||b.line==a.line?b.line:b.line-1,i.lastLine()),l=Math.min(a.line,k),m=c.lineComment||j.lineComment,n=[],o=null==c.padding?" ":c.padding;a:if(m){for(var p=l;p<=k;++p){var q=i.getLine(p),r=q.indexOf(m);if(r>-1&&!/comment/.test(i.getTokenTypeAt(g(p,r+1)))&&(r=-1),r==-1&&f.test(q))break a;if(r>-1&&f.test(q.slice(0,r)))break a;n.push(q)}if(i.operation(function(){for(var a=l;a<=k;++a){var b=n[a-l],c=b.indexOf(m),d=c+m.length;c<0||(b.slice(d,d+o.length)==o&&(d+=o.length),h=!0,i.replaceRange("",g(a,c),g(a,d)))}}),h)return!0}var s=c.blockCommentStart||j.blockCommentStart,t=c.blockCommentEnd||j.blockCommentEnd;if(!s||!t)return!1;var u=c.blockCommentLead||j.blockCommentLead,v=i.getLine(l),w=v.indexOf(s);if(w==-1)return!1;var x=k==l?v:i.getLine(k),y=x.indexOf(t,k==l?w+s.length:0);y==-1&&l!=k&&(x=i.getLine(--k),y=x.indexOf(t));var z=g(l,w+1),A=g(k,y+1);if(y==-1||!/comment/.test(i.getTokenTypeAt(z))||!/comment/.test(i.getTokenTypeAt(A))||i.getRange(z,A,"\n").indexOf(t)>-1)return!1;var B=v.lastIndexOf(s,a.ch),C=B==-1?-1:v.slice(0,a.ch).indexOf(t,B+s.length);if(B!=-1&&C!=-1&&C+t.length!=a.ch)return!1;C=x.indexOf(t,b.ch);var D=x.slice(b.ch).lastIndexOf(s,C-b.ch);return B=C==-1||D==-1?-1:b.ch+D,(C==
|
||
|
widget:c})}},a.defineExtension("foldCode",function(a,c,d){b(this,a,c,d)}),a.defineExtension("isFolded",function(a){for(var b=this.findMarksAt(a),c=0;c<b.length;++c)if(b[c].__isFold)return!0}),a.commands.toggleFold=function(a){a.foldCode(a.getCursor())},a.commands.fold=function(a){a.foldCode(a.getCursor(),null,"fold")},a.commands.unfold=function(a){a.foldCode(a.getCursor(),null,"unfold")},a.commands.foldAll=function(b){b.operation(function(){for(var c=b.firstLine(),d=b.lastLine();c<=d;c++)b.foldCode(a.Pos(c,0),null,"fold")})},a.commands.unfoldAll=function(b){b.operation(function(){for(var c=b.firstLine(),d=b.lastLine();c<=d;c++)b.foldCode(a.Pos(c,0),null,"unfold")})},a.registerHelper("fold","combine",function(){var a=Array.prototype.slice.call(arguments,0);return function(b,c){for(var d=0;d<a.length;++d){var e=a[d](b,c);if(e)return e}}}),a.registerHelper("fold","auto",function(a,b){for(var c=a.getHelpers(b,"fold"),d=0;d<c.length;d++){var e=c[d](a,b);if(e)return e}});var e={rangeFinder:a.fold.auto,widget:"\u2194",minFoldSize:0,scanUp:!1,clearOnEnter:!0};a.defineOption("foldOptions",null),a.defineExtension("foldOption",function(a,b){return d(this,a,b)})})},{"../../lib/codemirror":59}],18:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror"),a("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],d):d(CodeMirror)}(function(a){"use strict";function b(a){this.options=a,this.from=this.to=0}function c(a){return a===!0&&(a={}),null==a.gutter&&(a.gutter="CodeMirror-foldgutter"),null==a.indicatorOpen&&(a.indicatorOpen="CodeMirror-foldgutter-open"),null==a.indicatorFolded&&(a.indicatorFolded="CodeMirror-foldgutter-folded"),a}function d(a,b){for(var c=a.findMarks(l(b,0),l(b+1,0)),d=0;d<c.length;++d)if(c[d].__isFold&&c[d].find().from.line==b)return c[d]}function e(a){if("string"==typeof a){var b=document.createElement("div");return b.className=a+" CodeMirror-guttermarker-subtle",b}return a.cloneNode(!0)}function f(a,b,c){var f=a.state.foldGutter.options,g=b,h=a.foldOption(f,"minFoldSize"),i=a.foldOption(f,"rangeFinder");a.eachLine(b,c,function(b){var c=null;if(d(a,g))c=e(f.indicatorFolded);else{var j=l(g,0),k=i&&i(a,j);k&&k.to.line-k.from.line>=h&&(c=e(f.indicatorOpen))}a.setGutterMarker(b,f.gutter,c),++g})}function g(a){var b=a.getViewport(),c=a.state.foldGutter;c&&(a.operation(function(){f(a,b.from,b.to)}),c.from=b.from,c.to=b.to)}function h(a,b,c){var e=a.state.foldGutter;if(e){var f=e.options;if(c==f.gutter){var g=d(a,b);g?g.clear():a.foldCode(l(b,0),f.rangeFinder)}}}function i(a){var b=a.state.foldGutter;if(b){var c=b.options;b.from=b.to=0,clearTimeout(b.changeUpdate),b.changeUpdate=setTimeout(function(){g(a)},c.foldOnChangeTimeSpan||600)}}function j(a){var b=a.state.foldGutter;if(b){var c=b.options;clearTimeout(b.changeUpdate),b.changeUpdate=setTimeout(function(){var c=a.getViewport();b.from==b.to||c.from-b.to>20||b.from-c.to>20?g(a):a.operation(function(){c.from<b.from&&(f(a,c.from,b.from),b.from=c.from),c.to>b.to&&(f(a,b.to,c.to),b.to=c.to)})},c.updateViewportTimeSpan||400)}}function k(a,b){var c=a.state.foldGutter;if(c){var d=b.line;d>=c.from&&d<c.to&&f(a,d,d+1)}}a.defineOption("foldGutter",!1,function(d,e,f){f&&f!=a.Init&&(d.clearGutter(d.state.foldGutter.options.gutter),d.state.foldGutter=null,d.off("gutterClick",h),d.off("change",i),d.off("viewportChange",j),d.off("fold",k),d.off("unfold",k),d.off("swapDoc",i)),e&&(d.state.foldGutter=new b(c(e)),g(d),d.on("gutterClick",h),d.on("change",i),d.on("viewportChange",j),d.on("fold",k),d.on("unfold",k),d.on("swapDoc",i))});var l=a.Pos})},{"../../lib/codemirror":59,"./foldcode":17}],19:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)}(function(a){"use strict";function b(b,c){var d=b.getLine(c),e=d.search(/\S/);return e==-1||/\bcomment\b/.test(b.getTokenTypeAt(a.Pos(c,e+1)))?-1:a.countColumn(d,null,b.getOption("tabSize"))}a.registerHelper("fold","indent",function
|
||
|
if(!h(o)){var w=o;o=p(o,d),o!==w&&(s=!0)}var x=h(o);return x&&x.columns&&(x=x.columns),x&&k(c,n,x,function(a){var b=o;return 1==s&&(b=u),"string"==typeof a?a=b+"."+a:(a=i(a),a.text=b+"."+a.text),e?m(a):a}),g}function o(a,b){for(var c=a.split(/\s+/),d=0;d<c.length;d++)c[d]&&b(c[d].replace(/[,;]/g,""))}function p(a,b){for(var c=b.doc,d=c.getValue(),e=a.toUpperCase(),f="",g="",i=[],j={start:v(0,0),end:v(b.lastLine(),b.getLineHandle(b.lastLine()).length)},k=d.indexOf(u.QUERY_DIV);k!=-1;)i.push(c.posFromIndex(k)),k=d.indexOf(u.QUERY_DIV,k+1);i.unshift(v(0,0)),i.push(v(b.lastLine(),b.getLineHandle(b.lastLine()).text.length));for(var l=null,m=b.getCursor(),n=0;n<i.length;n++){if((null==l||w(m,l)>0)&&w(m,i[n])<=0){j={start:l,end:i[n]};break}l=i[n]}for(var p=c.getRange(j.start,j.end,!1),n=0;n<p.length;n++){var q=p[n];if(o(q,function(a){var b=a.toUpperCase();b===e&&h(f)&&(g=f),b!==u.ALIAS_KEYWORD&&(f=a)}),g)break}return g}var q,r,s,t,u={QUERY_DIV:";",ALIAS_KEYWORD:"AS"},v=a.Pos,w=a.cmpPos;a.registerHelper("hint","sql",function(a,b){q=g(b&&b.tables);var e=b&&b.defaultTable,f=b&&b.disableKeywords;r=e&&h(e),s=c(a),t=d(a),e&&!r&&(r=p(e,a)),r=r||[],r.columns&&(r=r.columns);var i,j,l,m=a.getCursor(),o=[],u=a.getTokenAt(m);return u.end>m.ch&&(u.end=m.ch,u.string=u.string.slice(0,m.ch-u.start)),u.string.match(/^[.`"\w@]\w*$/)?(l=u.string,i=u.start,j=u.end):(i=j=m.ch,l=""),"."==l.charAt(0)||l.charAt(0)==t?i=n(m,u,o,a):(k(o,l,q,function(a){return a}),k(o,l,r,function(a){return a}),f||k(o,l,s,function(a){return a.toUpperCase()})),{list:o,from:v(m.line,i),to:v(m.line,j)}})})},{"../../lib/codemirror":59,"../../mode/sql/sql":74}],28:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)}(function(a){"use strict";function b(b,d){var e=d&&d.schemaInfo,f=d&&d.quoteChar||'"';if(e){var g=b.getCursor(),h=b.getTokenAt(g);h.end>g.ch&&(h.end=g.ch,h.string=h.string.slice(0,g.ch-h.start));var i=a.innerMode(b.getMode(),h.state);if("xml"==i.mode.name){var j,k,l=[],m=!1,n=/\btag\b/.test(h.type)&&!/>$/.test(h.string),o=n&&/^\w/.test(h.string);if(o){var p=b.getLine(g.line).slice(Math.max(0,h.start-2),h.start),q=/<\/$/.test(p)?"close":/<$/.test(p)?"open":null;q&&(k=h.start-("close"==q?2:1))}else n&&"<"==h.string?q="open":n&&"</"==h.string&&(q="close");if(!n&&!i.state.tagName||q){o&&(j=h.string),m=q;var r=i.state.context,s=r&&e[r.tagName],t=r?s&&s.children:e["!top"];if(t&&"close"!=q)for(var u=0;u<t.length;++u)j&&0!=t[u].lastIndexOf(j,0)||l.push("<"+t[u]);else if("close"!=q)for(var v in e)!e.hasOwnProperty(v)||"!top"==v||"!attrs"==v||j&&0!=v.lastIndexOf(j,0)||l.push("<"+v);r&&(!j||"close"==q&&0==r.tagName.lastIndexOf(j,0))&&l.push("</"+r.tagName+">")}else{var s=e[i.state.tagName],w=s&&s.attrs,x=e["!attrs"];if(!w&&!x)return;if(w){if(x){var y={};for(var z in x)x.hasOwnProperty(z)&&(y[z]=x[z]);for(var z in w)w.hasOwnProperty(z)&&(y[z]=w[z]);w=y}}else w=x;if("string"==h.type||"="==h.string){var A,p=b.getRange(c(g.line,Math.max(0,g.ch-60)),c(g.line,"string"==h.type?h.start:h.end)),B=p.match(/([^\s\u00a0=<>\"\']+)=$/);if(!B||!w.hasOwnProperty(B[1])||!(A=w[B[1]]))return;if("function"==typeof A&&(A=A.call(this,b)),"string"==h.type){j=h.string;var C=0;/['"]/.test(h.string.charAt(0))&&(f=h.string.charAt(0),j=h.string.slice(1),C++);var D=h.string.length;/['"]/.test(h.string.charAt(D-1))&&(f=h.string.charAt(D-1),j=h.string.substr(C,D-2)),m=!0}for(var u=0;u<A.length;++u)j&&0!=A[u].lastIndexOf(j,0)||l.push(f+A[u]+f)}else{"attribute"==h.type&&(j=h.string,m=!0);for(var E in w)!w.hasOwnProperty(E)||j&&0!=E.lastIndexOf(j,0)||l.push(E)}}return{list:l,from:m?c(g.line,null==k?h.start:k):g,to:m?c(g.line,h.end):g}}}}var c=a.Pos;a.registerHelper("hint","xml",b)})},{"../../lib/codemirror":59}],29:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)}(function(a){"use strict";a.registerHelper("lint","css",function(b,c){var d=[];if(
|
||
|
function c(a,b,c,d){if("string"==typeof b){var e=a.indexOf(b,c);return d&&e>-1?e+b.length:e}var f=b.exec(c?a.slice(c):a);return f?f.index+c+(d?f[0].length:0):-1}var d=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:a.startState(b),innerActive:null,inner:null}},copyState:function(c){return{outer:a.copyState(b,c.outer),innerActive:c.innerActive,inner:c.innerActive&&a.copyState(c.innerActive.mode,c.inner)}},token:function(e,f){if(f.innerActive){var g=f.innerActive,h=e.string;if(!g.close&&e.sol())return f.innerActive=f.inner=null,this.token(e,f);var i=g.close?c(h,g.close,e.pos,g.parseDelimiters):-1;if(i==e.pos&&!g.parseDelimiters)return e.match(g.close),f.innerActive=f.inner=null,g.delimStyle&&g.delimStyle+" "+g.delimStyle+"-close";i>-1&&(e.string=h.slice(0,i));var j=g.mode.token(e,f.inner);return i>-1&&(e.string=h),i==e.pos&&g.parseDelimiters&&(f.innerActive=f.inner=null),g.innerStyle&&(j=j?j+" "+g.innerStyle:g.innerStyle),j}for(var k=1/0,h=e.string,l=0;l<d.length;++l){var m=d[l],i=c(h,m.open,e.pos);if(i==e.pos)return m.parseDelimiters||e.match(m.open),f.innerActive=m,f.inner=a.startState(m.mode,b.indent?b.indent(f.outer,""):0),m.delimStyle&&m.delimStyle+" "+m.delimStyle+"-open";i!=-1&&i<k&&(k=i)}k!=1/0&&(e.string=h.slice(0,k));var n=b.token(e,f.outer);return k!=1/0&&(e.string=h),n},indent:function(c,d){var e=c.innerActive?c.innerActive.mode:b;return e.indent?e.indent(c.innerActive?c.inner:c.outer,d):a.Pass},blankLine:function(c){var e=c.innerActive?c.innerActive.mode:b;if(e.blankLine&&e.blankLine(c.innerActive?c.inner:c.outer),c.innerActive)"\n"===c.innerActive.close&&(c.innerActive=c.inner=null);else for(var f=0;f<d.length;++f){var g=d[f];"\n"===g.open&&(c.innerActive=g,c.inner=a.startState(g.mode,e.indent?e.indent(c.outer,""):0))}},electricChars:b.electricChars,innerMode:function(a){return a.inner?{state:a.inner,mode:a.innerActive.mode}:{state:a.outer,mode:b}}}}})},{"../../lib/codemirror":59}],37:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)}(function(a){"use strict";a.overlayMode=function(b,c,d){return{startState:function(){return{base:a.startState(b),overlay:a.startState(c),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(d){return{base:a.copyState(b,d.base),overlay:a.copyState(c,d.overlay),basePos:d.basePos,baseCur:null,overlayPos:d.overlayPos,overlayCur:null}},token:function(a,e){return(a!=e.streamSeen||Math.min(e.basePos,e.overlayPos)<a.start)&&(e.streamSeen=a,e.basePos=e.overlayPos=a.start),a.start==e.basePos&&(e.baseCur=b.token(a,e.base),e.basePos=a.pos),a.start==e.overlayPos&&(a.pos=a.start,e.overlayCur=c.token(a,e.overlay),e.overlayPos=a.pos),a.pos=Math.min(e.basePos,e.overlayPos),null==e.overlayCur?e.baseCur:null!=e.baseCur&&e.overlay.combineTokens||d&&null==e.overlay.combineTokens?e.baseCur+" "+e.overlayCur:e.overlayCur},indent:b.indent&&function(a,c){return b.indent(a.base,c)},electricChars:b.electricChars,innerMode:function(a){return{state:a.base,mode:b}},blankLine:function(a){var e,f;return b.blankLine&&(e=b.blankLine(a.base)),c.blankLine&&(f=c.blankLine(a.overlay)),null==f?e:d&&null!=e?e+" "+f:f}}}})},{"../../lib/codemirror":59}],38:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)}(function(a){"use strict";function b(a,b){if(!a.hasOwnProperty(b))throw new Error("Undefined state "+b+" in simple mode")}function c(a,b){if(!a)return/(?:)/;var c="";return a instanceof RegExp?(a.ignoreCase&&(c="i"),a=a.source):a=String(a),new RegExp((b===!1?"":"^")+"(?:"+a+")",c)}function d(a){if(!a)return null;if(a.apply)return a;if("string"==typeof a)return a.replace(/\./g," ");for(var b=[],c=0;c<a.length;c++)b.push(a[c]&&a[c].replace(/\./g," "));return b}function e(a,e){(a.next||a.push)&&b(e,a.next||a.push),this.regex=c(a.regex),this.token=d(a.token),this.data=a}function f(a,b){retu
|
||
|
return{from:p(o,q),to:p(o+n.length-1,1==n.length?q+n[0].length:n[n.length-1].length),match:l}}}}function j(a,b,c,d){if(a.length==b.length)return c;for(var e=0,f=c+Math.max(0,a.length-b.length);;){if(e==f)return e;var g=e+f>>1,h=d(a.slice(0,g)).length;if(h==c)return g;h>c?f=g:e=g+1}}function k(a,b,c,d){if(!b.length)return null;var e=d?n:o,f=e(b).split(/\r|\n\r?/);a:for(var g=c.line,h=c.ch,i=a.lastLine()+1-f.length;g<=i;g++,h=0){var k=a.getLine(g).slice(h),l=e(k);if(1==f.length){var m=l.indexOf(f[0]);if(m==-1)continue a;var c=j(k,l,m,e)+h;return{from:p(g,j(k,l,m,e)+h),to:p(g,j(k,l,m+f[0].length,e)+h)}}var q=l.length-f[0].length;if(l.slice(q)==f[0]){for(var r=1;r<f.length-1;r++)if(e(a.getLine(g+r))!=f[r])continue a;var s=a.getLine(g+f.length-1),t=e(s),u=f[f.length-1];if(s.slice(0,u.length)==u)return{from:p(g,j(k,l,q,e)+h),to:p(g+f.length-1,j(s,t,u.length,e))}}}}function l(a,b,c,d){if(!b.length)return null;var e=d?n:o,f=e(b).split(/\r|\n\r?/);a:for(var g=c.line,h=c.ch,i=a.firstLine()-1+f.length;g>=i;g--,h=-1){var k=a.getLine(g);h>-1&&(k=k.slice(0,h));var l=e(k);if(1==f.length){var m=l.lastIndexOf(f[0]);if(m==-1)continue a;return{from:p(g,j(k,l,m,e)),to:p(g,j(k,l,m+f[0].length,e))}}var q=f[f.length-1];if(l.slice(0,q.length)==q){for(var r=1,c=g-f.length+1;r<f.length-1;r++)if(e(a.getLine(c+r))!=f[r])continue a;var s=a.getLine(g+1-f.length),t=e(s);if(t.slice(t.length-f[0].length)==f[0])return{from:p(g+1-f.length,j(s,t,s.length-f[0].length,e)),to:p(g,j(k,l,q.length,e))}}}}function m(a,b,d,g){this.atOccurrence=!1,this.doc=a,d=d?a.clipPos(d):p(0,0),this.pos={from:d,to:d};var j;"object"==typeof g?j=g.caseFold:(j=g,g=null),"string"==typeof b?(null==j&&(j=!1),this.matches=function(c,d){return(c?l:k)(a,b,d,j)}):(b=c(b),g&&g.multiline===!1?this.matches=function(c,d){return(c?h:e)(a,b,d)}:this.matches=function(c,d){return(c?i:f)(a,b,d)})}var n,o,p=a.Pos;String.prototype.normalize?(n=function(a){return a.normalize("NFD").toLowerCase()},o=function(a){return a.normalize("NFD")}):(n=function(a){return a.toLowerCase()},o=function(a){return a}),m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(b){for(var c=this.matches(b,this.doc.clipPos(b?this.pos.from:this.pos.to));c&&0==a.cmpPos(c.from,c.to);)b?c.from.ch?c.from=p(c.from.line,c.from.ch-1):c=c.from.line==this.doc.firstLine()?null:this.matches(b,this.doc.clipPos(p(c.from.line-1))):c.to.ch<this.doc.getLine(c.to.line).length?c.to=p(c.to.line,c.to.ch+1):c=c.to.line==this.doc.lastLine()?null:this.matches(b,p(c.to.line+1,0));if(c)return this.pos=c,this.atOccurrence=!0,this.pos.match||!0;var d=p(b?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:d,to:d},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(b,c){if(this.atOccurrence){var d=a.splitLines(b);this.doc.replaceRange(d,this.pos.from,this.pos.to,c),this.pos.to=p(this.pos.from.line+d.length-1,d[d.length-1].length+(1==d.length?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(a,b,c){return new m(this.doc,a,b,c)}),a.defineDocExtension("getSearchCursor",function(a,b,c){return new m(this,a,b,c)}),a.defineExtension("selectMatches",function(b,c){for(var d=[],e=this.getSearchCursor(b,this.getCursor("from"),c);e.findNext()&&!(a.cmpPos(e.to(),this.getCursor("to"))>0);)d.push({anchor:e.from(),head:e.to()});d.length&&this.setSelections(d,0)})})},{"../../lib/codemirror":59}],50:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)}(function(a){"use strict";function b(a){for(var b=0;b<a.state.activeLines.length;b++)a.removeLineClass(a.state.activeLines[b],"wrap",f),a.removeLineClass(a.state.activeLines[b],"background",g),a.removeLineClass(a.state.activeLines[b],"gutter",h)}function c(a,b){if(a.length!=b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!=b[c])return!1;return!0}function d(a,d){for(var e=[],i=0;i<d.length;i++){va
|
||
|
d.push({head:h,anchor:h}),e=g.line+1}}b.setSelections(d)}),void b.execCommand("indentAuto"))}function e(b,c){for(var d=c.ch,e=d,f=b.getLine(c.line);d&&a.isWordChar(f.charAt(d-1));)--d;for(;e<f.length&&a.isWordChar(f.charAt(e));)++e;return{from:o(c.line,d),to:o(c.line,e),word:f.slice(d,e)}}function f(a,b){for(var c=a.listSelections(),d=[],e=0;e<c.length;e++){var f=c[e],g=a.findPosV(f.anchor,b,"line"),h=a.findPosV(f.head,b,"line"),i={anchor:g,head:h};d.push(f),d.push(i)}a.setSelections(d)}function g(a,b,c){for(var d=0;d<a.length;d++)if(a[d].from()==b&&a[d].to()==c)return!0;return!1}function h(a){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d],f=e.head,g=a.scanForBracket(f,-1);if(!g)return!1;for(;;){var h=a.scanForBracket(f,1);if(!h)return!1;if(h.ch==u.charAt(u.indexOf(g.ch)+1)){c.push({anchor:o(g.pos.line,g.pos.ch+1),head:h.pos});break}f=o(h.pos.line,h.pos.ch+1)}}return a.setSelections(c),!0}function i(b,c){if(b.isReadOnly())return a.Pass;for(var d,e=b.listSelections(),f=[],g=0;g<e.length;g++){var h=e[g];if(!h.empty()){for(var i=h.from().line,j=h.to().line;g<e.length-1&&e[g+1].from().line==j;)j=e[++g].to().line;e[g].to().ch||j--,f.push(i,j)}}f.length?d=!0:f.push(b.firstLine(),b.lastLine()),b.operation(function(){for(var a=[],e=0;e<f.length;e+=2){var g=f[e],h=f[e+1],i=o(g,0),j=o(h),k=b.getRange(i,j,!1);c?k.sort():k.sort(function(a,b){var c=a.toUpperCase(),d=b.toUpperCase();return c!=d&&(a=c,b=d),a<b?-1:a==b?0:1}),b.replaceRange(k,i,j),d&&a.push({anchor:i,head:o(h+1,0)})}d&&b.setSelections(a,0)})}function j(b,c){b.operation(function(){for(var d=b.listSelections(),f=[],g=[],h=0;h<d.length;h++){var i=d[h];i.empty()?(f.push(h),g.push("")):g.push(c(b.getRange(i.from(),i.to())))}b.replaceSelections(g,"around","case");for(var j,h=f.length-1;h>=0;h--){var i=d[f[h]];if(!(j&&a.cmpPos(i.head,j)>0)){var k=e(b,i.head);j=k.from,b.replaceRange(c(k.word),k.from,k.to)}}})}function k(b){var c=b.getCursor("from"),d=b.getCursor("to");if(0==a.cmpPos(c,d)){var f=e(b,c);if(!f.word)return;c=f.from,d=f.to}return{from:c,to:d,query:b.getRange(c,d),word:f}}function l(a,b){var c=k(a);if(c){var d=c.query,e=a.getSearchCursor(d,b?c.to:c.from);(b?e.findNext():e.findPrevious())?a.setSelection(e.from(),e.to()):(e=a.getSearchCursor(d,b?o(a.firstLine(),0):a.clipPos(o(a.lastLine()))),(b?e.findNext():e.findPrevious())?a.setSelection(e.from(),e.to()):c.word&&a.setSelection(c.from,c.to))}}var m=a.keyMap.sublime={fallthrough:"default"},n=a.commands,o=a.Pos,p=a.keyMap["default"]==a.keyMap.macDefault,q=p?"Cmd-":"Ctrl-",r=p?"Ctrl-":"Alt-";n[m[r+"Left"]="goSubwordLeft"]=function(a){c(a,-1)},n[m[r+"Right"]="goSubwordRight"]=function(a){c(a,1)},p&&(m["Cmd-Left"]="goLineStartSmart");var s=p?"Ctrl-Alt-":"Ctrl-";n[m[s+"Up"]="scrollLineUp"]=function(a){var b=a.getScrollInfo();if(!a.somethingSelected()){var c=a.lineAtHeight(b.top+b.clientHeight,"local");a.getCursor().line>=c&&a.execCommand("goLineUp")}a.scrollTo(null,b.top-a.defaultTextHeight())},n[m[s+"Down"]="scrollLineDown"]=function(a){var b=a.getScrollInfo();if(!a.somethingSelected()){var c=a.lineAtHeight(b.top,"local")+1;a.getCursor().line<=c&&a.execCommand("goLineDown")}a.scrollTo(null,b.top+a.defaultTextHeight())},n[m["Shift-"+q+"L"]="splitSelectionByLine"]=function(a){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++)for(var e=b[d].from(),f=b[d].to(),g=e.line;g<=f.line;++g)f.line>e.line&&g==f.line&&0==f.ch||c.push({anchor:g==e.line?e:o(g,0),head:g==f.line?f:o(g)});a.setSelections(c,0)},m["Shift-Tab"]="indentLess",n[m.Esc="singleSelectionTop"]=function(a){var b=a.listSelections()[0];a.setSelection(b.anchor,b.head,{scroll:!1})},n[m[q+"L"]="selectLine"]=function(a){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d];c.push({anchor:o(e.from().line,0),head:o(e.to().line+1,0)})}a.setSelections(c)},m["Shift-Ctrl-K"]="deleteLine",n[m[q+"Enter"]="insertLineAfter"]=function(a){return d(a,!1)},n[m["Shift-"+q+"Enter"]="insertLineBefore"]=function(a){return d(a,!0)},n[m[q+"D"]="selectNextOccurrence"]=function(b){var c=b.getCursor("from"),d=b.getCursor("to"),f=b.state.sublimeFindFullWord==b.doc.se
|
||
|
headMark:a.setBookmark(d),anchor:R(c),head:R(d),visualMode:b.visualMode,visualLine:b.visualLine,visualBlock:b.visualBlock}}function ea(a,b,c){var e,f=a.state.vim.sel,g=f.head,h=f.anchor;return T(c,b)&&(e=c,c=b,b=e),T(g,h)?(g=U(b,g),h=V(h,c)):(h=U(b,h),g=V(g,c),g=L(g,0,-1),g.ch==-1&&g.line!=a.firstLine()&&(g=d(g.line-1,X(a,g.line-1)))),[h,g]}function fa(a,b,c){var d=a.state.vim;b=b||d.sel;var c=c||d.visualLine?"line":d.visualBlock?"block":"char",e=ga(a,b,c);a.setSelections(e.ranges,e.primary),cb(a)}function ga(a,b,c,e){var f=R(b.head),g=R(b.anchor);if("char"==c){var h=e||T(b.head,b.anchor)?0:1,i=T(b.head,b.anchor)?1:0;return f=L(b.head,0,h),g=L(b.anchor,0,i),{ranges:[{anchor:g,head:f}],primary:0}}if("line"==c){if(T(b.head,b.anchor))f.ch=0,g.ch=X(a,g.line);else{g.ch=0;var j=a.lastLine();f.line>j&&(f.line=j),f.ch=X(a,f.line)}return{ranges:[{anchor:g,head:f}],primary:0}}if("block"==c){for(var k=Math.min(g.line,f.line),l=Math.min(g.ch,f.ch),m=Math.max(g.line,f.line),n=Math.max(g.ch,f.ch)+1,o=m-k+1,p=f.line==k?0:o-1,q=[],r=0;r<o;r++)q.push({anchor:d(k+r,l),head:d(k+r,n)});return{ranges:q,primary:p}}}function ha(a){var b=a.getCursor("head");return 1==a.getSelection().length&&(b=U(b,a.getCursor("anchor"))),b}function ia(b,c){var d=b.state.vim;c!==!1&&b.setCursor(J(b,d.sel.head)),da(b,d),d.visualMode=!1,d.visualLine=!1,d.visualBlock=!1,a.signal(b,"vim-mode-change",{mode:"normal"}),d.fakeCursor&&d.fakeCursor.clear()}function ja(a,b,c){var d=a.getRange(b,c);if(/\n\s*$/.test(d)){var e=d.split("\n");e.pop();for(var f,f=e.pop();e.length>0&&f&&r(f);f=e.pop())c.line--,c.ch=0;f?(c.line--,c.ch=X(a,c.line)):c.ch=0}}function ka(a,b,c){b.ch=0,c.ch=0,c.line++}function la(a){if(!a)return 0;var b=a.search(/\S/);return b==-1?a.length:b}function ma(a,b,c,e,f){for(var g=ha(a),h=a.getLine(g.line),i=g.ch,j=f?lb[0]:mb[0];!j(h.charAt(i));)if(i++,i>=h.length)return null;e?j=mb[0]:(j=lb[0],j(h.charAt(i))||(j=lb[1]));for(var k=i,l=i;j(h.charAt(k))&&k<h.length;)k++;for(;j(h.charAt(l))&&l>=0;)l--;if(l++,b){for(var m=k;/\s/.test(h.charAt(k))&&k<h.length;)k++;if(m==k){for(var n=l;/\s/.test(h.charAt(l-1))&&l>0;)l--;l||(l=n)}}return{start:d(g.line,l),end:d(g.line,k)}}function na(a,b,c){S(b,c)||vb.jumpList.add(a,b,c)}function oa(a,b){vb.lastCharacterSearch.increment=a,vb.lastCharacterSearch.forward=b.forward,vb.lastCharacterSearch.selectedCharacter=b.selectedCharacter}function pa(a,b,c,e){var f=R(a.getCursor()),g=c?1:-1,h=c?a.lineCount():-1,i=f.ch,j=f.line,k=a.getLine(j),l={lineText:k,nextCh:k.charAt(i),lastCh:null,index:i,symb:e,reverseSymb:(c?{")":"(","}":"{"}:{"(":")","{":"}"})[e],forward:c,depth:0,curMoveThrough:!1},m=Cb[e];if(!m)return f;var n=Db[m].init,o=Db[m].isComplete;for(n&&n(l);j!==h&&b;){if(l.index+=g,l.nextCh=l.lineText.charAt(l.index),!l.nextCh){if(j+=g,l.lineText=a.getLine(j)||"",g>0)l.index=0;else{var p=l.lineText.length;l.index=p>0?p-1:0}l.nextCh=l.lineText.charAt(l.index)}o(l)&&(f.line=j,f.ch=l.index,b--)}return l.nextCh||l.curMoveThrough?d(j,l.index):f}function qa(a,b,c,d,e){var f=b.line,g=b.ch,h=a.getLine(f),i=c?1:-1,j=d?mb:lb;if(e&&""==h){if(f+=i,h=a.getLine(f),!m(a,f))return null;g=c?0:h.length}for(;;){if(e&&""==h)return{from:0,to:0,line:f};for(var k=i>0?h.length:-1,l=k,n=k;g!=k;){for(var o=!1,p=0;p<j.length&&!o;++p)if(j[p](h.charAt(g))){for(l=g;g!=k&&j[p](h.charAt(g));)g+=i;if(n=g,o=l!=n,l==b.ch&&f==b.line&&n==l+i)continue;return{from:Math.min(l,n+1),to:Math.max(l,n),line:f}}o||(g+=i)}if(f+=i,!m(a,f))return null;h=a.getLine(f),g=i>0?0:h.length}}function ra(a,b,c,e,f,g){var h=R(b),i=[];(e&&!f||!e&&f)&&c++;for(var j=!(e&&f),k=0;k<c;k++){var l=qa(a,b,e,g,j);if(!l){var m=X(a,a.lastLine());i.push(e?{line:a.lastLine(),from:m,to:m}:{line:0,from:0,to:0});break}i.push(l),b=d(l.line,e?l.to-1:l.from)}var n=i.length!=c,o=i[0],p=i.pop();return e&&!f?(n||o.from==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.from)):e&&f?d(p.line,p.to-1):!e&&f?(n||o.to==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.to)):d(p.line,p.from)}function sa(a,b,c,e){for(var f,g=a.getCursor(),h=g.ch,i=0;i<b;i++){var j=a.getLine(g.line);if(f=va(h,j,e,c,!0),f==-1)return null;h=f}ret
|
||
|
return c.repeatIsExplicit&&(e=c.repeat-a.getOption("firstLineNumber")),d(e,la(a.getLine(e)))},textObjectManipulation:function(a,b,c,d){var e={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},f={"'":!0,'"':!0},g=c.selectedCharacter;"b"==g?g="(":"B"==g&&(g="{");var h,i=!c.textObjectInner;if(e[g])h=xa(a,b,g,i);else if(f[g])h=ya(a,b,g,i);else if("W"===g)h=ma(a,i,!0,!0);else if("w"===g)h=ma(a,i,!0,!1);else{if("p"!==g)return null;if(h=wa(a,b,c.repeat,0,i),c.linewise=!0,d.visualMode)d.visualLine||(d.visualLine=!0);else{var j=d.inputState.operatorArgs;j&&(j.linewise=!0),h.end.line--}}return a.state.vim.visualMode?ea(a,h.start,h.end):[h.start,h.end]},repeatLastCharacterSearch:function(a,b,c){var d=vb.lastCharacterSearch,e=c.repeat,f=c.forward===d.forward,g=(d.increment?1:0)*(f?-1:1);a.moveH(-g,"char"),c.inclusive=!!f;var h=sa(a,e,f,d.selectedCharacter);return h?(h.ch+=g,h):(a.moveH(g,"char"),b)}},Ab={change:function(b,c,e){var f,g,h=b.state.vim;if(vb.macroModeState.lastInsertModeChanges.inVisualBlock=h.visualBlock,h.visualMode){g=b.getSelection();var i=G("",e.length);b.replaceSelections(i),f=U(e[0].head,e[0].anchor)}else{var j=e[0].anchor,k=e[0].head;g=b.getRange(j,k);var l=h.lastEditInputState||{};if("moveByWords"==l.motion&&!r(g)){var m=/\s+$/.exec(g);m&&l.motionArgs&&l.motionArgs.forward&&(k=L(k,0,-m[0].length),g=g.slice(0,-m[0].length))}var n=new d(j.line-1,Number.MAX_VALUE),o=b.firstLine()==b.lastLine();k.line>b.lastLine()&&c.linewise&&!o?b.replaceRange("",n,k):b.replaceRange("",j,k),c.linewise&&(o||(b.setCursor(n),a.commands.newlineAndIndent(b)),j.ch=Number.MAX_VALUE),f=j}vb.registerController.pushText(c.registerName,"change",g,c.linewise,e.length>1),Bb.enterInsertMode(b,{head:f},b.state.vim)},"delete":function(a,b,c){var e,f,g=a.state.vim;if(g.visualBlock){f=a.getSelection();var h=G("",c.length);a.replaceSelections(h),e=c[0].anchor}else{var i=c[0].anchor,j=c[0].head;b.linewise&&j.line!=a.firstLine()&&i.line==a.lastLine()&&i.line==j.line-1&&(i.line==a.firstLine()?i.ch=0:i=d(i.line-1,X(a,i.line-1))),f=a.getRange(i,j),a.replaceRange("",i,j),e=i,b.linewise&&(e=zb.moveToFirstNonWhiteSpaceCharacter(a,i))}return vb.registerController.pushText(b.registerName,"delete",f,b.linewise,g.visualBlock),J(a,e)},indent:function(a,b,c){var d=a.state.vim,e=c[0].anchor.line,f=d.visualBlock?c[c.length-1].anchor.line:c[0].head.line,g=d.visualMode?b.repeat:1;b.linewise&&f--;for(var h=e;h<=f;h++)for(var i=0;i<g;i++)a.indentLine(h,b.indentRight);return zb.moveToFirstNonWhiteSpaceCharacter(a,c[0].anchor)},changeCase:function(a,b,c,d,e){for(var f=a.getSelections(),g=[],h=b.toLower,i=0;i<f.length;i++){var j=f[i],k="";if(h===!0)k=j.toLowerCase();else if(h===!1)k=j.toUpperCase();else for(var l=0;l<j.length;l++){var m=j.charAt(l);k+=q(m)?m.toLowerCase():m.toUpperCase()}g.push(k)}return a.replaceSelections(g),b.shouldMoveCursor?e:!a.state.vim.visualMode&&b.linewise&&c[0].anchor.line+1==c[0].head.line?zb.moveToFirstNonWhiteSpaceCharacter(a,d):b.linewise?d:U(c[0].anchor,c[0].head)},yank:function(a,b,c,d){var e=a.state.vim,f=a.getSelection(),g=e.visualMode?U(e.sel.anchor,e.sel.head,c[0].head,c[0].anchor):d;return vb.registerController.pushText(b.registerName,"yank",f,b.linewise,e.visualBlock),g}},Bb={jumpListWalk:function(a,b,c){if(!c.visualMode){var d=b.repeat,e=b.forward,f=vb.jumpList,g=f.move(a,e?d:-d),h=g?g.find():void 0;h=h?h:a.getCursor(),a.setCursor(h)}},scroll:function(a,b,c){if(!c.visualMode){var d=b.repeat||1,e=a.defaultTextHeight(),f=a.getScrollInfo().top,g=e*d,h=b.forward?f+g:f-g,i=R(a.getCursor()),j=a.charCoords(i,"local");if(b.forward)h>j.top?(i.line+=(h-j.top)/e,i.line=Math.ceil(i.line),a.setCursor(i),j=a.charCoords(i,"local"),a.scrollTo(null,j.top)):a.scrollTo(null,h);else{var k=h+a.getScrollInfo().clientHeight;k<j.bottom?(i.line-=(j.bottom-k)/e,i.line=Math.floor(i.line),a.setCursor(i),j=a.charCoords(i,"local"),a.scrollTo(null,j.bottom-a.getScrollInfo().clientHeight)):a.scrollTo(null,h)}}},scrollToCursor:function(a,b){var c=a.getCursor().line,e=a.charCoords(d(c,0),"local"),f=a.getScrollInfo().clientHeight,g=e.top,h=e.bottom-g;switch(b.positi
|
||
|
if(!(k>=0&&l<=0||k<=0&&l>=0)&&(k<=0&&(i.marker.inclusiveRight&&e.inclusiveLeft?K(j.to,c)>=0:K(j.to,c)>0)||k>=0&&(i.marker.inclusiveRight&&e.inclusiveLeft?K(j.from,d)<=0:K(j.from,d)<0)))return!0}}}function la(a){for(var b;b=ia(a);)a=b.find(-1,!0).line;return a}function ma(a){for(var b;b=ja(a);)a=b.find(1,!0).line;return a}function na(a){for(var b,c;b=ja(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function oa(a,b){var c=B(a,b),d=la(c);return c==d?b:F(d)}function pa(a,b){if(b>a.lastLine())return b;var c,d=B(a,b);if(!qa(a,d))return b;for(;c=ja(d);)d=c.find(1,!0).line;return F(d)+1}function qa(a,b){var c=Ug&&b.markedSpans;if(c)for(var d=void 0,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&ra(a,b,d))return!0}}function ra(a,b,c){if(null==c.to){var d=c.marker.find(1,!0);return ra(a,d.line,W(d.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var e=void 0,f=0;f<b.markedSpans.length;++f)if(e=b.markedSpans[f],e.marker.collapsed&&!e.marker.widgetNode&&e.from==c.to&&(null==e.to||e.to!=c.from)&&(e.marker.inclusiveLeft||c.marker.inclusiveRight)&&ra(a,b,e))return!0}function sa(a){a=la(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;b+=e.height}for(var f=c.parent;f;c=f,f=c.parent)for(var g=0;g<f.children.length;++g){var h=f.children[g];if(h==c)break;b+=h.height}return b}function ta(a){if(0==a.height)return 0;for(var b,c=a.text.length,d=a;b=ia(d);){var e=b.find(0,!0);d=e.from.line,c+=e.from.ch-e.to.ch}for(d=a;b=ja(d);){var f=b.find(0,!0);c-=d.text.length-f.from.ch,d=f.to.line,c+=d.text.length-f.to.ch}return c}function ua(a){var b=a.display,c=a.doc;b.maxLine=B(c,c.first),b.maxLineLength=ta(b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var c=ta(a);c>b.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function va(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function wa(a,b,c){var d;Vg=null;for(var e=0;e<a.length;++e){var f=a[e];if(f.from<b&&f.to>b)return e;f.to==b&&(f.from!=f.to&&"before"==c?d=e:Vg=e),f.from==b&&(f.from!=f.to&&"before"!=c?d=e:Vg=e)}return null!=d?d:Vg}function xa(a,b){var c=a.order;return null==c&&(c=a.order=Wg(a.text,b)),c}function ya(a,b,c){var d=y(a.text,b+c,c);return d<0||d>a.text.length?null:d}function za(a,b,c){var d=ya(a,b.ch,c);return null==d?null:new J(b.line,d,c<0?"after":"before")}function Aa(a,b,c,d,e){if(a){var f=xa(c,b.doc.direction);if(f){var g,h=e<0?p(f):f[0],i=e<0==(1==h.level),j=i?"after":"before";if(h.level>0){var k=Zb(b,c);g=e<0?c.text.length-1:0;var l=$b(b,k,g).top;g=z(function(a){return $b(b,k,a).top==l},e<0==(1==h.level)?h.from:h.to-1,g),"before"==j&&(g=ya(c,g,1))}else g=e<0?h.to:h.from;return new J(d,g,j)}}return new J(d,e<0?c.text.length:0,e<0?"before":"after")}function Ba(a,b,c,d){var e=xa(b,a.doc.direction);if(!e)return za(b,c,d);c.ch>=b.text.length?(c.ch=b.text.length,c.sticky="before"):c.ch<=0&&(c.ch=0,c.sticky="after");var f=wa(e,c.ch,c.sticky),g=e[f];if("ltr"==a.doc.direction&&g.level%2==0&&(d>0?g.to>c.ch:g.from<c.ch))return za(b,c,d);var h,i=function(a,c){return ya(b,a instanceof J?a.ch:a,c)},j=function(c){return a.options.lineWrapping?(h=h||Zb(a,b),qc(a,b,h,c)):{begin:0,end:b.text.length}},k=j("before"==c.sticky?i(c,-1):c.ch);if("rtl"==a.doc.direction||1==g.level){var l=1==g.level==d<0,m=i(c,l?1:-1);if(null!=m&&(l?m<=g.to&&m<=k.end:m>=g.from&&m>=k.begin)){var n=l?"before":"after";return new J(c.line,m,n)}}var o=function(a,b,d){for(var f=function(a,b){return b?new J(c.line,i(a,1),"before"):new J(c.line,a,"after")};a>=0&&a<e.length;a+=b){var g=e[a],h=b>0==(1!=g.level),j=h?d.begin:i(d.end,-1);if(g.from<=j&&j<g.to)return f(j,h);if(j=h?g.from:i(g.to,-1),d.begin<=j&&j<d.end)return f(j,h)}},p=o(f+d,d,k);if(p)return p;var q=d>0?k.end:i(k.begin,-1);return null==q||d>0&&q==b.text.length||!(p=o(d>0?0:e.length-1,d,j(q)))?null:p}function Ca(a,b){return a._handlers&&a._handlers[b]||X
|
||
|
function e(a,b,c,e){b<0&&(b=0),b=Math.round(b),e=Math.round(e),i.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px;\n top: "+b+"px; width: "+(null==c?l-a:c)+"px;\n height: "+(e-b)+"px"))}function f(b,c,d){function f(c,d){return kc(a,J(b,c),"div",j,d)}var g,i,j=B(h,b),m=j.text.length;return va(xa(j,h.direction),c||0,null==d?m:d,function(a,b,h){var j,n;if("ltr"==h){j=f(a,"left"),n=f(b-1,"right");var o=null==c&&0==a?k:j.left,p=null==d&&b==m?l:n.right;n.top-j.top<=3?e(o,n.top,p-o,n.bottom):(e(o,j.top,null,j.bottom),j.bottom<n.top&&e(k,j.bottom,null,n.top),e(k,n.top,n.right,n.bottom))}else{j=f(a,"right"),n=f(b-1,"left");var q=null==c&&0==a?l:j.right,r=null==d&&b==m?k:n.left;n.top-j.top<=3?e(r,n.top,q-r,n.bottom):(e(k,j.top,q-k,j.bottom),j.bottom<n.top&&e(k,j.bottom,null,n.top),e(r,n.top,null,n.bottom))}(!g||Dc(j,g)<0)&&(g=j),Dc(n,g)<0&&(g=n),(!i||Dc(j,i)<0)&&(i=j),Dc(n,i)<0&&(i=n)}),{start:g,end:i}}var g=a.display,h=a.doc,i=document.createDocumentFragment(),j=Qb(a.display),k=j.left,l=Math.max(g.sizerWidth,Sb(a)-g.sizer.offsetLeft)-j.right,m=b.from(),n=b.to();if(m.line==n.line)f(m.line,m.ch,n.ch);else{var o=B(h,m.line),p=B(h,n.line),q=la(o)==la(p),r=f(m.line,m.ch,q?o.text.length+1:null).end,s=f(n.line,q?0:null,n.ch).start;q&&(r.top<s.top-2?(e(r.right,r.top,null,r.bottom),e(k,s.top,s.left,s.bottom)):e(r.right,r.top,s.left-r.right,r.bottom)),r.bottom<s.top&&e(k,r.bottom,null,s.top)}c.appendChild(i)}function Fc(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="",a.options.cursorBlinkRate>0?b.blinker=setInterval(function(){return b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Gc(a){a.state.focused||(a.display.input.focus(),Ic(a))}function Hc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,Jc(a))},100)}function Ic(a,b){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(Ea(a,"focus",a,b),a.state.focused=!0,h(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),pg&&setTimeout(function(){return a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Fc(a))}function Jc(a,b){a.state.delayingBlurEvent||(a.state.focused&&(Ea(a,"blur",a,b),a.state.focused=!1,Gg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function Kc(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;d<b.view.length;d++){var e=b.view[d],f=void 0;if(!e.hidden){if(ng&&og<8){var g=e.node.offsetTop+e.node.offsetHeight;f=g-c,c=g}else{var h=e.node.getBoundingClientRect();f=h.bottom-h.top}var i=e.line.height-f;if(f<2&&(f=sc(b)),(i>.005||i<-.005)&&(E(e.line,f),Lc(e.line),e.rest))for(var j=0;j<e.rest.length;j++)Lc(e.rest[j])}}}function Lc(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.parentNode.offsetHeight}function Mc(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Ob(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=G(b,d),g=G(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;h<f?(f=h,g=G(b,sa(B(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=G(b,sa(B(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function Nc(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=vc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&(c[g].gutter&&(c[g].gutter.style.left=f),c[g].gutterBackground&&(c[g].gutterBackground.style.left=f));var h=c[g].alignable;if(h)for(var i=0;i<h.length;i++)h[i].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function Oc(a){if(!a.options.lineNumbers)return
|
||
|
k&&!Ce(a,e,!1))return g.length=0,{};j.push(ae(a,e));var f=c?Qd(a,e):p(g);He(a,e,f,ke(a,e)),!c&&a.cm&&a.cm.scrollIntoView({from:e.from,to:Od(e)});var h=[];Xd(a,function(a,b){b||m(h,a.history)!=-1||(Me(a.history,e),h.push(a.history)),He(a,e,null,ke(a,e))})},n=d.changes.length-1;n>=0;--n){var o=l(n);if(o)return o.v}}}}function Ge(a,b){if(0!=b&&(a.first+=b,a.sel=new xh(q(a.sel.ranges,function(a){return new yh(J(a.anchor.line+b,a.anchor.ch),J(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){qd(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)rd(a.cm,d,"gutter")}}function He(a,b,c,d){if(a.cm&&!a.cm.curOp)return nd(a.cm,He)(a,b,c,d);if(b.to.line<a.first)return void Ge(a,b.text.length-1-(b.to.line-b.from.line));if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);Ge(a,e),b={from:J(a.first,0),to:J(b.to.line+e,b.to.ch),text:[p(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:J(f,B(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=C(a,b.from,b.to),c||(c=Qd(a,b)),a.cm?Ie(a.cm,b,d):Wd(a,b,d),ue(a,c,Ng)}}function Ie(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,i=f.line;a.options.lineWrapping||(i=F(la(B(d,f.line))),d.iter(i,g.line+1,function(a){if(a==e.maxLine)return h=!0,!0})),d.sel.contains(b.from,b.to)>-1&&Ga(a),Wd(d,b,c,wc(a)),a.options.lineWrapping||(d.iter(i,f.line+b.text.length,function(a){var b=ta(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0)),ib(d,f.line),wd(a,400);var j=b.text.length-(g.line-f.line)-1;b.full?qd(a):f.line!=g.line||1!=b.text.length||Vd(a.doc,b)?qd(a,f.line,g.line+1,j):rd(a,f.line,"text");var k=Ha(a,"changes"),l=Ha(a,"change");if(l||k){var m={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin};l&&yb(a,"change",a,m),k&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(m)}a.display.selForContextMenu=null}function Je(a,b,c,d,e){if(d||(d=c),K(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=a.splitLines(b)),De(a,{from:c,to:d,text:b,origin:e})}function Ke(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Le(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<f.ranges.length;h++)Ke(f.ranges[h].anchor,b,c,d),Ke(f.ranges[h].head,b,c,d)}else{for(var i=0;i<f.changes.length;++i){var j=f.changes[i];if(c<j.from.line)j.from=J(j.from.line+d,j.from.ch),j.to=J(j.to.line+d,j.to.ch);else if(b<=j.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function Me(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Le(a.done,c,d,e),Le(a.undone,c,d,e)}function Ne(a,b,c,d){var e=b,f=b;return"number"==typeof b?f=B(a,P(a,b)):e=F(b),null==e?null:(d(f,e)&&a.cm&&rd(a.cm,e,c),f)}function Oe(a){var b=this;this.lines=a,this.parent=null;for(var c=0,d=0;d<a.length;++d)a[d].parent=b,c+=a[d].height;this.height=c}function Pe(a){var b=this;this.children=a;for(var c=0,d=0,e=0;e<a.length;++e){var f=a[e];c+=f.chunkSize(),d+=f.height,f.parent=b}this.size=c,this.height=d,this.parent=null}function Qe(a,b,c){sa(b)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Tc(a,c)}function Re(a,b,c,d){var e=new zh(a,c,d),f=a.cm;return f&&e.noHScroll&&(f.display.alignWidgets=!0),Ne(a,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,f&&!qa(a,b)){var d=sa(b)<a.scrollTop;E(b,b.height+Mb(e)),d&&Tc(f,e.height),f.curOp.forceUpdate=!0}return!0}),yb(f,"lineWidgetAdded",f,e,"number"==typeof b?b:F(b)),e}function Se(a,b,c,d,f){if(d&&d.shared)return Te(a,b,c,d,f);if(a.cm&&!a.cm.curOp)return nd(a.cm,Se)(a,b,c,d,f);var g=new Bh(a,f),h=K(b,c);if(d&&k(d,g,!1),h>0||0==h&&g.clearWhenEmpty!==!1)return g;if(g.replacedWith&&(g.collapsed=!0,g.widgetNode=e("span",[g.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||g.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(g.widgetNode.insertLeft=!0)),g.collapsed){if(ka(a,b.line,b,c,g)||b.line!=c.line&&ka(a,c.line,b,c,g))throw new Error("Inserting
|
||
|
c(),a.parentNode.removeChild(b.getWrapperElement()),a.style.display="",a.form&&(Da(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=e))}},a.style.display="none";var j=Pf(function(b){return a.parentNode.insertBefore(b,a.nextSibling)},b);return j}function gg(a){a.off=Da,a.on=Yg,a.wheelEventPixels=Kd,a.Doc=Eh,a.splitLines=$g,a.countColumn=l,a.findColumn=n,a.isWordChar=u,a.Pass=Mg,a.signal=Ea,a.Line=jh,a.changeEnd=Od,a.scrollbarModel=sh,a.Pos=J,a.cmpPos=K,a.modes=ch,a.mimeModes=dh,a.resolveMode=Ua,a.getMode=Va,a.modeExtensions=eh,a.extendMode=Wa,a.copyState=Xa,a.startState=Za,a.innerMode=Ya,a.commands=Mh,a.keyMap=Lh,a.keyName=jf,a.isModifierKey=gf,a.lookupKey=ff,a.normalizeKeyMap=ef,a.StringStream=fh,a.SharedTextMarker=Ch,a.TextMarker=Bh,a.LineWidget=zh,a.e_preventDefault=Ja,a.e_stopPropagation=Ka,a.e_stop=Ma,a.addClass=h,a.contains=f,a.rmClass=Gg,a.keyNames=Hh}var hg=navigator.userAgent,ig=navigator.platform,jg=/gecko\/\d/i.test(hg),kg=/MSIE \d/.test(hg),lg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hg),mg=/Edge\/(\d+)/.exec(hg),ng=kg||lg||mg,og=ng&&(kg?document.documentMode||6:+(mg||lg)[1]),pg=!mg&&/WebKit\//.test(hg),qg=pg&&/Qt\/\d+\.\d+/.test(hg),rg=!mg&&/Chrome\//.test(hg),sg=/Opera\//.test(hg),tg=/Apple Computer/.test(navigator.vendor),ug=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(hg),vg=/PhantomJS/.test(hg),wg=!mg&&/AppleWebKit/.test(hg)&&/Mobile\/\w+/.test(hg),xg=/Android/.test(hg),yg=wg||xg||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(hg),zg=wg||/Mac/.test(ig),Ag=/\bCrOS\b/.test(hg),Bg=/win/i.test(ig),Cg=sg&&hg.match(/Version\/(\d*\.\d*)/);Cg&&(Cg=Number(Cg[1])),Cg&&Cg>=15&&(sg=!1,pg=!0);var Dg,Eg=zg&&(qg||sg&&(null==Cg||Cg<12.11)),Fg=jg||ng&&og>=9,Gg=function(b,c){var d=b.className,e=a(c).exec(d);if(e){var f=d.slice(e.index+e[0].length);b.className=d.slice(0,e.index)+(f?e[1]+f:"")}};Dg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Hg=function(a){a.select()};wg?Hg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:ng&&(Hg=function(a){try{a.select()}catch(b){}});var Ig=function(){this.id=null};Ig.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Jg,Kg,Lg=30,Mg={toString:function(){return"CodeMirror.Pass"}},Ng={scroll:!1},Og={origin:"*mouse"},Pg={origin:"+move"},Qg=[""],Rg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Sg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c3
|
||
|
return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:J(b.head.line+1,0)}:{from:b.head,to:J(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){return lf(a,function(b){return{from:J(b.from().line,0),to:Q(a.doc,J(b.to().line+1,0))}})},delLineLeft:function(a){return lf(a,function(a){return{from:J(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){return lf(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return{from:d,to:b.from()}})},delWrappedLineRight:function(a){return lf(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:d}})},undo:function(a){return a.undo()},redo:function(a){return a.redo()},undoSelection:function(a){return a.undoSelection()},redoSelection:function(a){return a.redoSelection()},goDocStart:function(a){return a.extendSelection(J(a.firstLine(),0))},goDocEnd:function(a){return a.extendSelection(J(a.lastLine()))},goLineStart:function(a){return a.extendSelectionsBy(function(b){return mf(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){return a.extendSelectionsBy(function(b){return of(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){return a.extendSelectionsBy(function(b){return nf(a,b.head.line)},{origin:"+move",bias:-1})},goLineRight:function(a){return a.extendSelectionsBy(function(b){var c=a.cursorCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div")},Pg)},goLineLeft:function(a){return a.extendSelectionsBy(function(b){var c=a.cursorCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:c},"div")},Pg)},goLineLeftSmart:function(a){return a.extendSelectionsBy(function(b){var c=a.cursorCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return d.ch<a.getLine(d.line).search(/\S/)?of(a,b.head):d},Pg)},goLineUp:function(a){return a.moveV(-1,"line")},goLineDown:function(a){return a.moveV(1,"line")},goPageUp:function(a){return a.moveV(-1,"page")},goPageDown:function(a){return a.moveV(1,"page")},goCharLeft:function(a){return a.moveH(-1,"char")},goCharRight:function(a){return a.moveH(1,"char")},goColumnLeft:function(a){return a.moveH(-1,"column")},goColumnRight:function(a){return a.moveH(1,"column")},goWordLeft:function(a){return a.moveH(-1,"word")},goGroupRight:function(a){return a.moveH(1,"group")},goGroupLeft:function(a){return a.moveH(-1,"group")},goWordRight:function(a){return a.moveH(1,"word")},delCharBefore:function(a){return a.deleteH(-1,"char")},delCharAfter:function(a){return a.deleteH(1,"char")},delWordBefore:function(a){return a.deleteH(-1,"word")},delWordAfter:function(a){return a.deleteH(1,"word")},delGroupBefore:function(a){return a.deleteH(-1,"group")},delGroupAfter:function(a){return a.deleteH(1,"group")},indentAuto:function(a){return a.indentSelection("smart")},indentMore:function(a){return a.indentSelection("add")},indentLess:function(a){return a.indentSelection("subtract")},insertTab:function(a){return a.replaceSelection("\t")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),g=l(a.getLine(f.line),f.ch,d);b.push(o(d-g%d))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){return md(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++)if(b[d].empty()){var e=b[d].head,f=B(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new J(e.line,e.ch-1)),e.ch>0)e=new J(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),J(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=B(a.doc,e.line-1).text;g&&(e=new J(e.line,1),a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),J(e.line-1,g.length-1),e,"+transpose"))}c.push(new yh(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){return md(a,function(){for(var b=a.listSelections(),c=b.length-1;c>=0;c--)a.replaceRange(a.doc.lineSeparator(),b[c].anchor,b[c].head,"+input");b=a.list
|
||
|
startOfLine:!0,prevToken:null}},token:function(a,b){var g=b.context;if(a.sol()&&(null==g.align&&(g.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return m(a,b),null;n=o=null;var h=(b.tokenize||j)(a,b);if("comment"==h||"meta"==h)return h;if(null==g.align&&(g.align=!0),";"==n||":"==n||","==n&&a.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==b.context.type;)d(b);else if("{"==n)c(b,a.column(),"}");else if("["==n)c(b,a.column(),"]");else if("("==n)c(b,a.column(),")");else if("}"==n){for(;"statement"==g.type;)g=d(b);for("}"==g.type&&(g=d(b));"statement"==g.type;)g=d(b)}else n==g.type?d(b):A&&(("}"==g.type||"top"==g.type)&&";"!=n||"statement"==g.type&&"newstatement"==n)&&c(b,a.column(),"statement",a.current());if("variable"==h&&("def"==b.prevToken||i.typeFirstDefinitions&&e(a,b,a.start)&&f(b.context)&&a.match(/^\s*\(/,!1))&&(h="def"),y.token){var k=y.token(a,b,h);void 0!==k&&(h=k)}return"def"==h&&i.styleDefs===!1&&(h="variable"),b.startOfLine=!1,b.prevToken=o?"def":h||n,m(a,b),h},indent:function(b,c){if(b.tokenize!=j&&null!=b.tokenize||b.typeAtEndOfLine)return a.Pass;var d=b.context,e=c&&c.charAt(0);if("statement"==d.type&&"}"==e&&(d=d.prev),i.dontIndentStatements)for(;"statement"==d.type&&i.dontIndentStatements.test(d.info);)d=d.prev;if(y.indent){var f=y.indent(b,d,c);if("number"==typeof f)return f}var g=e==d.type,h=d.prev&&"switch"==d.prev.info;if(i.allmanIndentation&&/[{(]/.test(e)){for(;"top"!=d.type&&"}"!=d.type;)d=d.prev;return d.indented}return"statement"==d.type?d.indented+("{"==e?0:q):!d.align||r&&")"==d.type?")"!=d.type||g?d.indented+(g?0:p)+(g||!h||/^(?:case|default)\b/.test(c)?0:p):d.indented+q:d.column+(g?0:1)},electricInput:B?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var t="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",u="int long char short double float unsigned signed void size_t ptrdiff_t";p(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:g(t),types:g(u+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:g("case do else for if switch while struct"),defKeywords:g("struct"),typeFirstDefinitions:!0,atoms:g("null true false"),hooks:{"#":i,"*":j},modeProps:{fold:["brace","include"]}}),p(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:g(t+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:g(u+" bool wchar_t"),blockKeywords:g("catch class do else finally for if struct switch try while"),defKeywords:g("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:g("true false null"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{"#":i,"*":j,u:l,U:l,L:l,R:l,0:k,1:k,2:k,3:k,4:k,5:k,6:k,7:k,8:k,9:k,token:function(a,b,c){if("variable"==c&&"("==a.peek()&&(";"==b.prevToken||null==b.prevToken||"}"==b.prevToken)&&m(a.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),p("text/x-java",{name:"clike",keywords:g("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:g("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:g("catch class do else finally for if switch try while"),defKeywords:g("class interface package enum @interface"),typeFirstDefinitions:!0,atoms:g("true false null"),number:/^(?:
|
||
|
a.registerHelper("hintWords","css",x),a.defineMIME("text/css",{documentTypes:e,mediaTypes:g,mediaFeatures:i,mediaValueKeywords:k,propertyKeywords:m,nonStandardPropertyKeywords:o,fontProperties:q,counterDescriptors:s,colorKeywords:u,valueKeywords:w,tokenHooks:{"/":function(a,b){return!!a.eat("*")&&(b.tokenize=c,c(a,b))}},name:"css"}),a.defineMIME("text/x-scss",{mediaTypes:g,mediaFeatures:i,mediaValueKeywords:k,propertyKeywords:m,nonStandardPropertyKeywords:o,colorKeywords:u,valueKeywords:w,fontProperties:q,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=c,c(a,b)):["operator","operator"]},":":function(a){return!!a.match(/\s*\{/,!1)&&[null,null]},$:function(a){return a.match(/^[\w-]+/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(a){return!!a.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),a.defineMIME("text/x-less",{mediaTypes:g,mediaFeatures:i,mediaValueKeywords:k,propertyKeywords:m,nonStandardPropertyKeywords:o,colorKeywords:u,valueKeywords:w,fontProperties:q,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=c,c(a,b)):["operator","operator"]},"@":function(a){return a.eat("{")?[null,"interpolation"]:!a.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),a.defineMIME("text/x-gss",{documentTypes:e,mediaTypes:g,mediaFeatures:i,propertyKeywords:m,nonStandardPropertyKeywords:o,fontProperties:q,counterDescriptors:s,colorKeywords:u,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(a,b){return!!a.eat("*")&&(b.tokenize=c,c(a,b))}},name:"css",helperType:"gss"})})},{"../../lib/codemirror":59}],62:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)}(function(a){"use strict";a.defineMode("diff",function(){var a={"+":"positive","-":"negative","@":"meta"};return{token:function(b){var c=b.string.search(/[\t ]+?$/);if(!b.sol()||0===c)return b.skipToEnd(),("error "+(a[b.string.charAt(0)]||"")).replace(/ $/,"");var d=a[b.peek()]||b.skipToEnd();return c===-1?b.skipToEnd():b.pos=c,d}}}),a.defineMIME("text/x-diff","diff")})},{"../../lib/codemirror":59}],63:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror"),a("../markdown/markdown"),a("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],d):d(CodeMirror)}(function(a){"use strict";var b=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))/i;
|
||
|
l(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&b.match(/^#+$/,!0))return c.highlightFormatting&&(d.formatting="header"),l(d);var h=b.next();if(d.linkTitle){d.linkTitle=!1;var i=h;"("===h&&(i=")"),i=(i+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var k="^\\s*(?:[^"+i+"\\\\]+|\\\\\\\\|\\\\.)"+i;if(b.match(new RegExp(k),!0))return w.linkHref}if("`"===h){var m=d.formatting;c.highlightFormatting&&(d.formatting="code"),b.eatWhile("`");var q=b.current().length;if(0!=d.code||d.quote&&1!=q){if(q==d.code){var r=l(d);return d.code=0,r}return d.formatting=m,l(d)}return d.code=q,l(d)}if(d.code)return l(d);if("\\"===h&&(b.next(),c.highlightFormatting)){var s=l(d),t=w.formatting+"-escape";return s?s+" "+t:t}if("!"===h&&b.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,c.highlightFormatting&&(d.formatting="image"),l(d);if("["===h&&d.imageMarker&&b.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,c.highlightFormatting&&(d.formatting="image"),l(d);if("]"===h&&d.imageAltText){c.highlightFormatting&&(d.formatting="image");var s=l(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=p,s}if("["===h&&!d.image)return d.linkText=!0,c.highlightFormatting&&(d.formatting="link"),l(d);if("]"===h&&d.linkText){c.highlightFormatting&&(d.formatting="link");var s=l(d);return d.linkText=!1,d.inline=d.f=b.match(/\(.*?\)| ?\[.*?\]/,!1)?p:n,s}if("<"===h&&b.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var s=l(d);return s?s+=" ":s="",s+w.linkInline}if("<"===h&&b.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var s=l(d);return s?s+=" ":s="",s+w.linkEmail}if(c.xml&&"<"===h&&b.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i,!1)){var v=b.string.indexOf(">",b.pos);if(v!=-1){var x=b.string.substring(b.start,v);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(d.md_inside=!0)}return b.backUp(1),d.htmlState=a.startState(u),f(b,d,j)}if(c.xml&&"<"===h&&b.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if("*"===h||"_"===h){for(var y=1,z=1==b.pos?" ":b.string.charAt(b.pos-2);y<3&&b.eat(h);)y++;var B=b.peek()||" ",C=!/\s/.test(B)&&(!G.test(B)||/\s/.test(z)||G.test(z)),D=!/\s/.test(z)&&(!G.test(z)||/\s/.test(B)||G.test(B)),E=null,F=null;if(y%2&&(d.em||!C||"*"!==h&&D&&!G.test(z)?d.em!=h||!D||"*"!==h&&C&&!G.test(B)||(E=!1):E=!0),y>1&&(d.strong||!C||"*"!==h&&D&&!G.test(z)?d.strong!=h||!D||"*"!==h&&C&&!G.test(B)||(F=!1):F=!0),null!=F||null!=E){c.highlightFormatting&&(d.formatting=null==E?"strong":null==F?"em":"strong em"),E===!0&&(d.em=h),F===!0&&(d.strong=h);var r=l(d);return E===!1&&(d.em=!1),F===!1&&(d.strong=!1),r}}else if(" "===h&&(b.eat("*")||b.eat("_"))){if(" "===b.peek())return l(d);b.backUp(1)}if(c.strikethrough)if("~"===h&&b.eatWhile(h)){if(d.strikethrough){c.highlightFormatting&&(d.formatting="strikethrough");var r=l(d);return d.strikethrough=!1,r}if(b.match(/^[^\s]/,!1))return d.strikethrough=!0,c.highlightFormatting&&(d.formatting="strikethrough"),l(d)}else if(" "===h&&b.match(/^~~/,!0)){if(" "===b.peek())return l(d);b.backUp(2)}if(c.emoji&&":"===h&&b.match(/^[a-z_\d+-]+:/)){d.emoji=!0,c.highlightFormatting&&(d.formatting="emoji");var H=l(d);return d.emoji=!1,H}return" "===h&&(b.match(/ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),l(d)}function o(a,b){var d=a.next();if(">"===d){b.f=b.inline=n,c.highlightFormatting&&(b.formatting="link");var e=l(b);return e?e+=" ":e="",e+w.linkInline}return a.match(/^[^>]+/,!0),w.linkInline}function p(a,b){if(a.eatSpace())return null;var d=a.next();return"("===d||"["===d?(b.f=b.inline=q("("===d?")":"]"),c.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,l(b)):"error"}function q(a){return function(b,d){var e=b.next();if(e===a){d.f=d.inline=n,c.highlightFormatting&&(d.formatting="link-string");var f=l(d);return d.linkHref=!1,f}return b.match(I[a]),d.linkHref=!0,l(d)}}function r(a,b){return a.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=s,a.next(),c.highlightFormatting&&(b.formatting="link"),b.linkText=!0,l(b)):e(a,b,n)}
|
||
|
a.registerHelper("hintWords","php",[f,g,h].join(" ").split(" ")),a.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:b(f),blockKeywords:b("catch do else elseif for foreach if switch try while finally"),defKeywords:b("class function interface namespace trait"),atoms:b(g),builtin:b(h),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,b){var c;if(c=a.match(/<<\s*/)){var e=a.eat(/['"]/);a.eatWhile(/[\w\.]/);var f=a.current().slice(c[0].length+(e?2:1));if(e&&a.eat(e),f)return(b.tokStack||(b.tokStack=[])).push(f,0),b.tokenize=d(f,"'"!=e),"string"}return!1},"#":function(a){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1},'"':function(a,b){return(b.tokStack||(b.tokStack=[])).push('"',0),b.tokenize=d('"'),"string"},"{":function(a,b){return b.tokStack&&b.tokStack.length&&b.tokStack[b.tokStack.length-1]++,!1},"}":function(a,b){return b.tokStack&&b.tokStack.length>0&&!--b.tokStack[b.tokStack.length-1]&&(b.tokenize=d(b.tokStack[b.tokStack.length-2])),!1}}};a.defineMode("php",function(b,c){function d(b,c){var d=c.curMode==f;if(b.sol()&&c.pending&&'"'!=c.pending&&"'"!=c.pending&&(c.pending=null),d)return d&&null==c.php.tokenize&&b.match("?>")?(c.curMode=e,c.curState=c.html,c.php.context.prev||(c.php=null),"meta"):f.token(b,c.curState);if(b.match(/^<\?\w*/))return c.curMode=f,c.php||(c.php=a.startState(f,e.indent(c.html,""))),c.curState=c.php,"meta";if('"'==c.pending||"'"==c.pending){for(;!b.eol()&&b.next()!=c.pending;);var g="string"}else if(c.pending&&b.pos<c.pending.end){b.pos=c.pending.end;var g=c.pending.style}else var g=e.token(b,c.curState);c.pending&&(c.pending=null);var h,i=b.current(),j=i.search(/<\?/);return j!=-1&&("string"==g&&(h=i.match(/[\'\"]$/))&&!/\?>/.test(i)?c.pending=h[0]:c.pending={end:b.pos,style:g},b.backUp(i.length-j)),g}var e=a.getMode(b,"text/html"),f=a.getMode(b,i);return{startState:function(){var b=a.startState(e),d=c.startOpen?a.startState(f):null;return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var c,d=b.html,g=a.copyState(e,d),h=b.php,i=h&&a.copyState(f,h);return c=b.curMode==e?g:i,{html:g,php:i,curMode:b.curMode,curState:c,pending:b.pending}},token:d,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",i)})},{"../../lib/codemirror":59,"../clike/clike":60,"../htmlmixed/htmlmixed":64}],72:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror"),a("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../css/css"],d):d(CodeMirror)}(function(a){"use strict";a.defineMode("sass",function(b){function c(a){return new RegExp("^"+a.join("|"))}function d(a){return!a.peek()||a.match(/\s+$/,!1)}function e(a,b){var c=a.peek();return")"===c?(a.next(),b.tokenizer=k,"operator"):"("===c?(a.next(),a.eatSpace(),"operator"):"'"===c||'"'===c?(b.tokenizer=g(a.next()),"string"):(b.tokenizer=g(")",!1),"string")}function f(a,b){return function(c,d){return c.sol()&&c.indentation()<=a?(d.tokenizer=k,k(c,d)):(b&&c.skipTo("*/")?(c.next(),c.next(),d.tokenizer=k):c.skipToEnd(),"comment")}}function g(a,b){function c(e,f){var g=e.next(),i=e.peek(),j=e.string.charAt(e.pos-2),l="\\"!==g&&i===a||g===a&&"\\"!==j;return l?(g!==a&&b&&e.next(),d(e)&&(f.cursorHalf=0),f.tokenizer=k,"string"):"#"===g&&"{"===i?(f.tokenizer=h(c),e.next(),"operator"):"string"}return null==b&&(b=!0),c}function h(a){return function(b,c){return"}"===b.peek()?(b.next(),c.tokenizer=a,"operator"):k(b,c)}}function i(a){if(0==a.indentCount){a.indentCount++;var c=a.scopes[0].offset,d=c
|
||
|
builtin:f("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),a.defineMIME("text/x-gql",{name:"sql",keywords:f("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:f("false true"),builtin:f("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),a.defineMIME("text/x-gpsql",{name:"sql",client:f("source"),keywords:f("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing tran
|