• /home/barbar84/www/wp-inclu.../js/codemirr...
• File: codemirror.min.js
• Dòng [
15/
28]:
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++){var j=d[i],k=a.getOption("styleActiveLine");if("object"==typeof k&&k.nonEmpty?j.anchor.line==j.head.line:j.empty()){var l=a.getLineHandleVisualStart(j.head.line);e[e.length-1]!=l&&e.push(l)}}c(a.state.activeLines,e)||a.operation(function(){b(a);for(var c=0;c<e.length;c++)a.addLineClass(e[c],"wrap",f),a.addLineClass(e[c],"background",g),a.addLineClass(e[c],"gutter",h);a.state.activeLines=e})}function e(a,b){d(a,b.ranges)}var f="CodeMirror-activeline",g="CodeMirror-activeline-background",h="CodeMirror-activeline-gutter";a.defineOption("styleActiveLine",!1,function(c,f,g){var h=g!=a.Init&&g;f!=h&&(h&&(c.off("beforeSelectionChange",e),b(c),delete c.state.activeLines),f&&(c.state.activeLines=[],d(c,c.listSelections()),c.on("beforeSelectionChange",e)))})})},{"../../lib/codemirror":59}],51:[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){a.state.markedSelection&&a.operation(function(){g(a)})}function c(a){a.state.markedSelection&&a.state.markedSelection.length&&a.operation(function(){e(a)})}function d(a,b,c,d){if(0!=j(b,c))for(var e=a.state.markedSelection,f=a.state.markedSelectionStyle,g=b.line;;){var k=g==b.line?b:i(g,0),l=g+h,m=l>=c.line,n=m?c:i(l,0),o=a.markText(k,n,{className:f});if(null==d?e.push(o):e.splice(d++,0,o),m)break;g=l}}function e(a){for(var b=a.state.markedSelection,c=0;c<b.length;++c)b[c].clear();b.length=0}function f(a){e(a);for(var b=a.listSelections(),c=0;c<b.length;c++)d(a,b[c].from(),b[c].to())}function g(a){if(!a.somethingSelected())return e(a);if(a.listSelections().length>1)return f(a);var b=a.getCursor("start"),c=a.getCursor("end"),g=a.state.markedSelection;if(!g.length)return d(a,b,c);var i=g[0].find(),k=g[g.length-1].find();if(!i||!k||c.line-b.line<=h||j(b,k.to)>=0||j(c,i.from)<=0)return f(a);for(;j(b,i.from)>0;)g.shift().clear(),i=g[0].find();for(j(b,i.from)<0&&(i.to.line-b.line<h?(g.shift().clear(),d(a,b,i.to,0)):d(a,b,i.from,0));j(c,k.to)<0;)g.pop().clear(),k=g[g.length-1].find();j(c,k.to)>0&&(c.line-k.from.line<h?(g.pop().clear(),d(a,k.from,c)):d(a,k.to,c))}a.defineOption("styleSelectedText",!1,function(d,g,h){var i=h&&h!=a.Init;g&&!i?(d.state.markedSelection=[],d.state.markedSelectionStyle="string"==typeof g?g:"CodeMirror-selectedtext",f(d),d.on("cursorActivity",b),d.on("change",c)):!g&&i&&(d.off("cursorActivity",b),d.off("change",c),e(d),d.state.markedSelection=d.state.markedSelectionStyle=null)});var h=8,i=a.Pos,j=a.cmpPos})},{"../../lib/codemirror":59}],52:[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){var c=a.state.selectionPointer;(null==b.buttons?b.which:b.buttons)?c.mouseX=c.mouseY=null:(c.mouseX=b.clientX,c.mouseY=b.clientY),e(a)}function c(a,b){if(!a.getWrapperElement().contains(b.relatedTarget)){var c=a.state.selectionPointer;c.mouseX=c.mouseY=null,e(a)}}function d(a){a.state.selectionPointer.rects=null,e(a)}function e(a){a.state.selectionPointer.willUpdate||(a.state.selectionPointer.willUpdate=!0,setTimeout(function(){f(a),a.state.selectionPointer.willUpdate=!1},50))}function f(a){var b=a.state.selectionPointer;if(b){if(null==b.rects&&null!=b.mouseX&&(b.rects=[],a.somethingSelected()))for(var c=a.display.selectionDiv.firstChild;c;c=c.nextSibling)b.rects.push(c.getBoundingClientRect());var d=!1;if(null!=b.mouseX)for(var e=0;e<b.rects.length;e++){var f=b.rects[e];f.left<=b.mouseX&&f.right>=b.mouseX&&f.top<=b.mouseY&&f.bottom>=b.mouseY&&(d=!0)}var g=d?b.value:"";a.display.lineDiv.style.cursor!=g&&(a.display.lineDiv.style.cursor=g)}}a.defineOption("selectionPointer",!1,function(e,f){var g=e.state.selectionPointer;g&&(a.off(e.getWrapperElement(),"mousemove",g.mousemove),a.off(e.getWrapperElement(),"mouseout",g.mouseout),a.off(window,"scroll",g.windowScroll),e.off("cursorActivity",d),e.off("scroll",d),e.state.selectionPointer=null,e.display.lineDiv.style.cursor=""),f&&(g=e.state.selectionPointer={value:"string"==typeof f?f:"default",mousemove:function(a){b(e,a)},mouseout:function(a){c(e,a)},windowScroll:function(){d(e)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},a.on(e.getWrapperElement(),"mousemove",g.mousemove),a.on(e.getWrapperElement(),"mouseout",g.mouseout),a.on(window,"scroll",g.windowScroll),e.on("cursorActivity",d),e.on("scroll",d))})})},{"../../lib/codemirror":59}],53:[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,c){var d=a.docs[b];d?c(F(a,d)):a.options.getFile?a.options.getFile(b,c):c(null)}function c(a,b,c){for(var d in a.docs){var e=a.docs[d];if(e.doc==b)return e}if(!c)for(var f=0;;++f)if(d="[doc"+(f||"")+"]",!a.docs[d]){c=d;break}return a.addDoc(c,b)}function d(b,d){return"string"==typeof d?b.docs[d]:(d instanceof a&&(d=d.getDoc()),d instanceof a.Doc?c(b,d):void 0)}function e(a,b,d){var e=c(a,b),g=a.cachedArgHints;g&&g.doc==b&&L(g.start,d.to)>=0&&(a.cachedArgHints=null);var h=e.changed;null==h&&(e.changed=h={from:d.from.line,to:d.from.line});var i=d.from.line+(d.text.length-1);d.from.line<h.to&&(h.to=h.to-(d.to.line-i)),i>=h.to&&(h.to=i+1),h.from>d.from.line&&(h.from=d.from.line),b.lineCount()>J&&d.to-h.from>100&&setTimeout(function(){e.changed&&e.changed.to-e.changed.from>100&&f(a,e)},200)}function f(a,b){a.server.request({files:[{type:"full",name:b.name,text:F(a,b)}]},function(a){a?window.console.error(a):b.changed=null})}function g(b,c,d){b.request(c,{type:"completions",types:!0,docs:!0,urls:!0},function(e,f){if(e)return D(b,c,e);var g=[],i="",j=f.start,k=f.end;'["'==c.getRange(H(j.line,j.ch-2),j)&&'"]'!=c.getRange(k,H(k.line,k.ch+2))&&(i='"]');for(var l=0;l<f.completions.length;++l){var m=f.completions[l],n=h(m.type);f.guess&&(n+=" "+I+"guess"),g.push({text:m.name+i,displayText:m.displayName||m.name,className:n,data:m})}var o={from:j,to:k,list:g},p=null;a.on(o,"close",function(){B(p)}),a.on(o,"update",function(){B(p)}),a.on(o,"select",function(a,c){B(p);var d=b.options.completionTip?b.options.completionTip(a.data):a.data.doc;d&&(p=A(c.parentNode.getBoundingClientRect().right+window.pageXOffset,c.getBoundingClientRect().top+window.pageYOffset,d),p.className+=" "+I+"hint-doc")}),d(o)})}function h(a){var b;return b="?"==a?"unknown":"number"==a||"string"==a||"bool"==a?a:/^fn\(/.test(a)?"fn":/^\[/.test(a)?"array":"object",I+"completion "+I+"completion-"+b}function i(a,b,c,d,e){a.request(b,d,function(c,d){if(c)return D(a,b,c);if(a.options.typeTip)var f=a.options.typeTip(d);else{var f=w("span",null,w("strong",null,d.type||"not found"));if(d.doc&&f.appendChild(document.createTextNode(" \u2014 "+d.doc)),d.url){f.appendChild(document.createTextNode(" "));var g=f.appendChild(w("a",null,"[docs]"));g.href=d.url,g.target="_blank"}}y(b,f,a),e&&e()},c)}function j(b,c){if(E(b),!c.somethingSelected()){var d=c.getTokenAt(c.getCursor()).state,e=a.innerMode(c.getMode(),d);if("javascript"==e.mode.name){var f=e.state.lexical;if("call"==f.info){for(var g,h=f.pos||0,i=c.getOption("tabSize"),j=c.getCursor().line,m=Math.max(0,j-9),n=!1;j>=m;--j){for(var o=c.getLine(j),p=0,q=0;;){var r=o.indexOf("\t",q);if(r==-1)break;p+=i-(r+p)%i-1,q=r+1}if(g=f.column-p,"("==o.charAt(g)){n=!0;break}}if(n){var s=H(j,g),t=b.cachedArgHints;return t&&t.doc==c.getDoc()&&0==L(s,t.start)?k(b,c,h):void b.request(c,{type:"type",preferFunction:!0,end:s},function(a,d){!a&&d.type&&/^fn\(/.test(d.type)&&(b.cachedArgHints={start:s,type:l(d.type),name:d.exprName||d.name||"fn",guess:d.guess,doc:c.getDoc()},k(b,c,h))})}}}}}function k(a,b,c){E(a);for(var d=a.cachedArgHints,e=d.type,f=w("span",d.guess?I+"fhint-guess":null,w("span",I+"fname",d.name),"("),g=0;g<e.args.length;++g){g&&f.appendChild(document.createTextNode(", "));var h=e.args[g];f.appendChild(w("span",I+"farg"+(g==c?" "+I+"farg-current":""),h.name||"?")),"?"!=h.type&&(f.appendChild(document.createTextNode(":\xa0")),f.appendChild(w("span",I+"type",h.type)))}f.appendChild(document.createTextNode(e.rettype?") ->\xa0":")")),e.rettype&&f.appendChild(w("span",I+"type",e.rettype));var i=b.cursorCoords(null,"page"),j=a.activeArgHints=A(i.right+1,i.bottom,f);setTimeout(function(){j.clear=z(b,function(){a.activeArgHints==j&&E(a)})},20)}function l(a){function b(b){for(var c=0,e=d;;){var f=a.charAt(d);if(b.test(f)&&!c)return a.slice(e,d);/[{\[\(]/.test(f)?++c:/[}\]\)]/.test(f)&&--c,++d}}var c=[],d=3;if(")"!=a.charAt(d))for(;;){var e=a.slice(d).match(/^([^, \(\[\{]+): /);if(e&&(d+=e[0].length,e=e[1]),c.push({name:e,type:b(/[\),]/)}),")"==a.charAt(d))break;d+=2}var f=a.slice(d).match(/^\) -> (.*)$/);return{args:c,rettype:f&&f[1]}}function m(a,b){function d(d){var e={type:"definition",variable:d||null},f=c(a,b.getDoc());a.server.request(u(a,f,e),function(c,d){if(c)return D(a,b,c);if(!d.file&&d.url)return void window.open(d.url);if(d.file){var e,g=a.docs[d.file];if(g&&(e=p(g.doc,d)))return a.jumpStack.push({file:f.name,start:b.getCursor("from"),end:b.getCursor("to")}),void o(a,f,g,e.start,e.end)}D(a,b,"Could not find a definition.")})}q(b)?d():x(b,"Jump to variable",function(a){a&&d(a)})}function n(a,b){var d=a.jumpStack.pop(),e=d&&a.docs[d.file];e&&o(a,c(a,b.getDoc()),e,d.start,d.end)}function o(a,b,c,d,e){c.doc.setSelection(d,e),b!=c&&a.options.switchToDoc&&(E(a),a.options.switchToDoc(c.name,c.doc))}function p(a,b){for(var c=b.context.slice(0,b.contextOffset).split("\n"),d=b.start.line-(c.length-1),e=H(d,(1==c.length?b.start.ch:a.getLine(d).length)-c[0].length),f=a.getLine(d).slice(e.ch),g=d+1;g<a.lineCount()&&f.length<b.context.length;++g)f+="\n"+a.getLine(g);if(f.slice(0,b.context.length)==b.context)return b;for(var h,i=a.getSearchCursor(b.context,0,!1),j=1/0;i.findNext();){var k=i.from(),l=1e4*Math.abs(k.line-e.line);l||(l=Math.abs(k.ch-e.ch)),l<j&&(h=k,j=l)}if(!h)return null;if(1==c.length?h.ch+=c[0].length:h=H(h.line+(c.length-1),c[c.length-1].length),b.start.line==b.end.line)var m=H(h.line,h.ch+(b.end.ch-b.start.ch));else var m=H(h.line+(b.end.line-b.start.line),b.end.ch);return{start:h,end:m}}function q(a){var b=a.getCursor("end"),c=a.getTokenAt(b);return!(c.start<b.ch&&"comment"==c.type)&&/[\w)\]]/.test(a.getLine(b.line).slice(Math.max(b.ch-1,0),b.ch+1))}function r(a,b){var c=b.getTokenAt(b.getCursor());return/\w/.test(c.string)?void x(b,"New name for "+c.string,function(c){a.request(b,{type:"rename",newName:c,fullDocs:!0},function(c,d){return c?D(a,b,c):void t(a,d.changes)})}):D(a,b,"Not at a variable")}function s(a,b){var d=c(a,b.doc).name;a.request(b,{type:"refs"},function(c,e){if(c)return D(a,b,c);for(var f=[],g=0,h=b.getCursor(),i=0;i<e.refs.length;i++){var j=e.refs[i];j.file==d&&(f.push({anchor:j.start,head:j.end}),L(h,j.start)>=0&&L(h,j.end)<=0&&(g=f.length-1))}b.setSelections(f,g)})}function t(a,b){for(var c=Object.create(null),d=0;d<b.length;++d){var e=b[d];(c[e.file]||(c[e.file]=[])).push(e)}for(var f in c){var g=a.docs[f],h=c[f];if(g){h.sort(function(a,b){return L(b.start,a.start)});for(var i="*rename"+ ++K,d=0;d<h.length;++d){var e=h[d];g.doc.replaceRange(e.text,e.start,e.end,i)}}}}function u(a,b,c,d){var e=[],f=0,g=!c.fullDocs;g||delete c.fullDocs,"string"==typeof c&&(c={type:c}),c.lineCharPositions=!0,null==c.end&&(c.end=d||b.doc.getCursor("end"),b.doc.somethingSelected()&&(c.start=b.doc.getCursor("start")));var h=c.start||c.end;if(b.changed)if(b.doc.lineCount()>J&&g!==!1&&b.changed.to-b.changed.from<100&&b.changed.from<=h.line&&b.changed.to>c.end.line){e.push(v(b,h,c.end)),c.file="#0";var f=e[0].offsetLines;null!=c.start&&(c.start=H(c.start.line- -f,c.start.ch)),c.end=H(c.end.line-f,c.end.ch)}else e.push({type:"full",name:b.name,text:F(a,b)}),c.file=b.name,b.changed=null;else c.file=b.name;for(var i in a.docs){var j=a.docs[i];j.changed&&j!=b&&(e.push({type:"full",name:j.name,text:F(a,j)}),j.changed=null)}return{query:c,files:e}}function v(b,c,d){for(var e,f=b.doc,g=null,h=null,i=4,j=c.line-1,k=Math.max(0,j-50);j>=k;--j){var l=f.getLine(j),m=l.search(/\bfunction\b/);if(!(m<0)){var n=a.countColumn(l,null,i);null!=g&&g<=n||(g=n,h=j)}}null==h&&(h=k);var o=Math.min(f.lastLine(),d.line+20);if(null==g||g==a.countColumn(f.getLine(c.line),null,i))e=o;else for(e=d.line+1;e<o;++e){var n=a.countColumn(f.getLine(e),null,i);if(n<=g)break}var p=H(h,0);return{type:"part",name:b.name,offsetLines:p.line,text:f.getRange(p,H(e,0))}}function w(a,b){var c=document.createElement(a);b&&(c.className=b);for(var d=2;d<arguments.length;++d){var e=arguments[d];"string"==typeof e&&(e=document.createTextNode(e)),c.appendChild(e)}return c}function x(a,b,c){a.openDialog?a.openDialog(b+": <input type=text>",c):c(prompt(b,""))}function y(b,c,d){function e(){j=!0,i||f()}function f(){b.state.ternTooltip=null,h.parentNode&&C(h),k()}b.state.ternTooltip&&B(b.state.ternTooltip);var g=b.cursorCoords(),h=b.state.ternTooltip=A(g.right+1,g.bottom,c),i=!1,j=!1;a.on(h,"mousemove",function(){i=!0}),a.on(h,"mouseout",function(b){a.contains(h,b.relatedTarget||b.toElement)||(j?f():i=!1)}),setTimeout(e,d.options.hintDelay?d.options.hintDelay:1700);var k=z(b,f)}function z(a,b){return a.on("cursorActivity",b),a.on("blur",b),a.on("scroll",b),a.on("setDoc",b),function(){a.off("cursorActivity",b),a.off("blur",b),a.off("scroll",b),a.off("setDoc",b)}}function A(a,b,c){var d=w("div",I+"tooltip",c);return d.style.left=a+"px",d.style.top=b+"px",document.body.appendChild(d),d}function B(a){var b=a&&a.parentNode;b&&b.removeChild(a)}function C(a){a.style.opacity="0",setTimeout(function(){B(a)},1100)}function D(a,b,c){a.options.showError?a.options.showError(b,c):y(b,String(c),a)}function E(a){a.activeArgHints&&(a.activeArgHints.clear&&a.activeArgHints.clear(),B(a.activeArgHints),a.activeArgHints=null)}function F(a,b){var c=b.doc.getValue();return a.options.fileFilter&&(c=a.options.fileFilter(c,b.name,b.doc)),c}function G(a){function c(a,b){b&&(a.id=++e,f[e]=b),d.postMessage(a)}var d=a.worker=new Worker(a.options.workerScript);d.postMessage({type:"init",defs:a.options.defs,plugins:a.options.plugins,scripts:a.options.workerDeps});var e=0,f={};d.onmessage=function(d){var e=d.data;"getFile"==e.type?b(a,e.name,function(a,b){c({type:"getFile",err:String(a),text:b,id:e.id})}):"debug"==e.type?window.console.log(e.message):e.id&&f[e.id]&&(f[e.id](e.err,e.body),delete f[e.id])},d.onerror=function(a){for(var b in f)f[b](a);f={}},this.addFile=function(a,b){c({type:"add",name:a,text:b})},this.delFile=function(a){c({type:"del",name:a})},this.request=function(a,b){c({type:"req",body:a},b)}}a.TernServer=function(a){var c=this;this.options=a||{};var d=this.options.plugins||(this.options.plugins={});d.doc_comment||(d.doc_comment=!0),this.docs=Object.create(null),this.options.useWorker?this.server=new G(this):this.server=new tern.Server({getFile:function(a,d){return b(c,a,d)},async:!0,defs:this.options.defs||[],plugins:d}),this.trackChange=function(a,b){e(c,a,b)},this.cachedArgHints=null,this.activeArgHints=null,this.jumpStack=[],this.getHint=function(a,b){return g(c,a,b)},this.getHint.async=!0},a.TernServer.prototype={addDoc:function(b,c){var d={doc:c,name:b,changed:null};return this.server.addFile(b,F(this,d)),a.on(c,"change",this.trackChange),this.docs[b]=d},delDoc:function(b){var c=d(this,b);c&&(a.off(c.doc,"change",this.trackChange),delete this.docs[c.name],this.server.delFile(c.name))},hideDoc:function(a){E(this);var b=d(this,a);b&&b.changed&&f(this,b)},complete:function(a){a.showHint({hint:this.getHint})},showType:function(a,b,c){i(this,a,b,"type",c)},showDocs:function(a,b,c){i(this,a,b,"documentation",c)},updateArgHints:function(a){j(this,a)},jumpToDef:function(a){m(this,a)},jumpBack:function(a){n(this,a)},rename:function(a){r(this,a)},selectName:function(a){s(this,a)},request:function(a,b,d,e){var f=this,g=c(this,a.getDoc()),h=u(this,g,b,e),i=h.query&&this.options.queryOptions&&this.options.queryOptions[h.query.type];if(i)for(var j in i)h.query[j]=i[j];this.server.request(h,function(a,c){!a&&f.options.responseFilter&&(c=f.options.responseFilter(g,b,h,a,c)),d(a,c)})},destroy:function(){E(this),this.worker&&(this.worker.terminate(),this.worker=null)}};var H=a.Pos,I="CodeMirror-Tern-",J=250,K=0,L=a.cmpPos})},{"../../lib/codemirror":59}],54:[function(a,b,c){function d(a,b){postMessage({type:"getFile",name:a,id:++g}),h[g]=b}function e(a,b,c){c&&importScripts.apply(null,c),f=new tern.Server({getFile:d,async:!0,defs:a,plugins:b})}var f;this.onmessage=function(a){var b=a.data;switch(b.type){case"init":return e(b.defs,b.plugins,b.scripts);case"add":return f.addFile(b.name,b.text);case"del":return f.delFile(b.name);case"req":return f.request(b.body,function(a,c){postMessage({id:b.id,body:c,err:a&&String(a)})});case"getFile":var c=h[b.id];return delete h[b.id],c(b.err,b.text);default:throw new Error("Unknown message type: "+b.type)}};var g=0,h={};this.console={log:function(a){postMessage({type:"debug",message:a})}}},{}],55:[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,c){for(var d=c.paragraphStart||a.getHelper(b,"paragraphStart"),e=b.line,f=a.firstLine();e>f;--e){var g=a.getLine(e);if(d&&d.test(g))break;if(!/\S/.test(g)){++e;break}}for(var h=c.paragraphEnd||a.getHelper(b,"paragraphEnd"),i=b.line+1,j=a.lastLine();i<=j;++i){var g=a.getLine(i);if(h&&h.test(g)){++i;break}if(!/\S/.test(g))break}return{from:e,to:i}}function c(a,b,c,d){for(var e=b;e<a.length&&" "==a.charAt(e);)e++;for(;e>0&&!c.test(a.slice(e-1,e+1));--e);for(var f=!0;;f=!1){var g=e;if(d)for(;" "==a.charAt(g-1);)--g;if(0!=g||!f)return{from:g,to:e};e=b}}function d(b,d,f,g){d=b.clipPos(d),f=b.clipPos(f);var h=g.column||80,i=g.wrapOn||/\s\S|-[^\.\d]/,j=g.killTrailingSpace!==!1,k=[],l="",m=d.line,n=b.getRange(d,f,!1);if(!n.length)return null;for(var o=n[0].match(/^[ \t]*/)[0],p=0;p<n.length;++p){var q=n[p],r=l.length,s=0;l&&q&&!i.test(l.charAt(l.length-1)+q.charAt(0))&&(l+=" ",s=1);var t="";if(p&&(t=q.match(/^\s*/)[0],q=q.slice(t.length)),l+=q,p){var u=l.length>h&&o==t&&c(l,h,i,j);u&&u.from==r&&u.to==r+s?(l=o+q,++m):k.push({text:[s?" ":""],from:e(m,r),to:e(m+1,t.length)})}for(;l.length>h;){var v=c(l,h,i,j);k.push({text:["",o],from:e(m,v.from),to:e(m,v.to)}),l=o+l.slice(v.to),++m}}return k.length&&b.operation(function(){for(var c=0;c<k.length;++c){var d=k[c];(d.text||a.cmpPos(d.from,d.to))&&b.replaceRange(d.text,d.from,d.to)}}),k.length?{from:k[0].from,to:a.changeEnd(k[k.length-1])}:null}var e=a.Pos;a.defineExtension("wrapParagraph",function(a,c){c=c||{},a||(a=this.getCursor());var f=b(this,a,c);return d(this,e(f.from,0),e(f.to-1),c)}),a.commands.wrapLines=function(a){a.operation(function(){for(var c=a.listSelections(),f=a.lastLine()+1,g=c.length-1;g>=0;g--){var h,i=c[g];if(i.empty()){var j=b(a,i.head,{});h={from:e(j.from,0),to:e(j.to-1)}}else h={from:i.from(),to:i.to()};h.to.line>=f||(f=h.from.line,d(a,h.from,h.to,{}))}})},a.defineExtension("wrapRange",function(a,b,c){return d(this,a,b,c||{})}),a.defineExtension("wrapParagraphsInRange",function(a,c,f){f=f||{};for(var g=this,h=[],i=a.line;i<=c.line;){var j=b(g,e(i,0),f);h.push(j),i=j.to}var k=!1;return h.length&&g.operation(function(){for(var a=h.length-1;a>=0;--a)k=k||d(g,e(h[a].from,0),e(h[a].to-1),f)}),k})})},{"../../lib/codemirror":59}],56:[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){return a.line==b.line&&a.ch==b.ch}function c(a){I.push(a),I.length>50&&I.shift()}function d(a){return I.length?void(I[I.length-1]+=a):c(a)}function e(a){return I[I.length-(a?Math.min(a,1):1)]||""}function f(){return I.length>1&&I.pop(),e()}function g(a,e,f,g,h){null==h&&(h=a.getRange(e,f)),g&&J&&J.cm==a&&b(e,J.pos)&&a.isClean(J.gen)?d(h):c(h),a.replaceRange("",e,f,"+delete"),J=g?{cm:a,pos:e,gen:a.changeGeneration()}:null}function h(a,b,c){return a.findPosH(b,c,"char",!0)}function i(a,b,c){return a.findPosH(b,c,"word",!0)}function j(a,b,c){return a.findPosV(b,c,"line",a.doc.sel.goalColumn)}function k(a,b,c){return a.findPosV(b,c,"page",a.doc.sel.goalColumn)}function l(a,b,c){for(var d=b.line,e=a.getLine(d),f=/\S/.test(c<0?e.slice(0,b.ch):e.slice(b.ch)),g=a.firstLine(),h=a.lastLine();;){if(d+=c,d<g||d>h)return a.clipPos(H(d-c,c<0?0:null));e=a.getLine(d);var i=/\S/.test(e);if(i)f=!0;else if(f)return H(d,0)}}function m(a,b,c){for(var d=b.line,e=b.ch,f=a.getLine(b.line),g=!1;;){var h=f.charAt(e+(c<0?-1:0));if(h){if(g&&/[!?.]/.test(h))return H(d,e+(c>0?1:0));g||(g=/\w/.test(h)),e+=c}else{if(d==(c<0?a.firstLine():a.lastLine()))return H(d,e);if(f=a.getLine(d+c),!/\S/.test(f))return H(d,e);d+=c,e=c<0?f.length:0}}}function n(a,c,d){var e;if(a.findMatchingBracket&&(e=a.findMatchingBracket(c,{strict:!0}))&&e.match&&(e.forward?1:-1)==d)return d>0?H(e.to.line,e.to.ch+1):e.to;for(var f=!0;;f=!1){var g=a.getTokenAt(c),h=H(c.line,d<0?g.start:g.end);if(!(f&&d>0&&g.end==c.ch)&&/\w/.test(g.string))return h;var i=a.findPosH(h,d,"char");if(b(h,i))return c;c=i}}function o(a,b){var c=a.state.emacsPrefix;return c?(w(a),"-"==c?-1:Number(c)):b?null:1}function p(a){var b="string"==typeof a?function(b){b.execCommand(a)}:a;return function(a){var c=o(a);b(a);for(var d=1;d<c;++d)b(a)}}function q(a,c,d,e){var f=o(a);f<0&&(e=-e,f=-f);for(var g=0;g<f;++g){var h=d(a,c,e);if(b(h,c))break;c=h}return c}function r(a,b){var c=function(c){c.extendSelection(q(c,c.getCursor(),a,b))};return c.motion=!0,c}function s(a,b,c){for(var d,e=a.listSelections(),f=e.length;f--;)d=e[f].head,g(a,d,q(a,d,b,c),!0)}function t(a){if(a.somethingSelected()){for(var b,c=a.listSelections(),d=c.length;d--;)b=c[d],g(a,b.anchor,b.head);return!0}}function u(a,b){return a.state.emacsPrefix?void("-"!=b&&(a.state.emacsPrefix+=b)):(a.state.emacsPrefix=b,a.on("keyHandled",v),void a.on("inputRead",x))}function v(a,b){a.state.emacsPrefixMap||K.hasOwnProperty(b)||w(a)}function w(a){a.state.emacsPrefix=null,a.off("keyHandled",v),a.off("inputRead",x)}function x(a,b){var c=o(a);if(c>1&&"+input"==b.origin){for(var d=b.text.join("\n"),e="",f=1;f<c;++f)e+=d;a.replaceSelection(e)}}function y(a){a.state.emacsPrefixMap=!0,a.addKeyMap(M),a.on("keyHandled",z),a.on("inputRead",z)}function z(a,b){("string"!=typeof b||!/^\d$/.test(b)&&"Ctrl-U"!=b)&&(a.removeKeyMap(M),a.state.emacsPrefixMap=!1,a.off("keyHandled",z),a.off("inputRead",z))}function A(a){a.setCursor(a.getCursor()),a.setExtending(!a.getExtending()),a.on("change",function(){a.setExtending(!1)})}function B(a){a.setExtending(!1),a.setCursor(a.getCursor())}function C(a,b,c){a.openDialog?a.openDialog(b+': <input type="text" style="width: 10em"/>',c,{bottom:!0}):c(prompt(b,""))}function D(a,b){var c=a.getCursor(),d=a.findPosH(c,1,"word");a.replaceRange(b(a.getRange(c,d)),c,d),a.setCursor(d)}function E(a){for(var b=a.getCursor(),c=b.line,d=b.ch,e=[];c>=a.firstLine();){for(var f=a.getLine(c),g=null==d?f.length:d;g>0;){var d=f.charAt(--g);if(")"==d)e.push("(");else if("]"==d)e.push("[");else if("}"==d)e.push("{");else if(/[\(\{\[]/.test(d)&&(!e.length||e.pop()!=d))return a.extendSelection(H(c,g))}--c,d=null}}function F(a){a.execCommand("clearSearch"),B(a)}function G(a){M[a]=function(b){u(b,a)},L["Ctrl-"+a]=function(b){u(b,a)},K["Ctrl-"+a]=!0}var H=a.Pos,I=[],J=null,K={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0};a.emacs={kill:g,killRegion:t,repeated:p};for(var L=a.keyMap.emacs=a.normalizeKeyMap({"Ctrl-W":function(a){g(a,a.getCursor("start"),a.getCursor("end"))},"Ctrl-K":p(function(a){var b=a.getCursor(),c=a.clipPos(H(b.line)),d=a.getRange(b,c);/\S/.test(d)||(d+="\n",c=H(b.line+1,0)),g(a,b,c,!0,d)}),"Alt-W":function(a){c(a.getSelection()),B(a)},"Ctrl-Y":function(a){var b=a.getCursor();a.replaceRange(e(o(a)),b,b,"paste"),a.setSelection(b,a.getCursor())},"Alt-Y":function(a){a.replaceSelection(f(),"around","paste")},"Ctrl-Space":A,"Ctrl-Shift-2":A,"Ctrl-F":r(h,1),"Ctrl-B":r(h,-1),Right:r(h,1),Left:r(h,-1),"Ctrl-D":function(a){s(a,h,1)},Delete:function(a){t(a)||s(a,h,1)},"Ctrl-H":function(a){s(a,h,-1)},Backspace:function(a){t(a)||s(a,h,-1)},"Alt-F":r(i,1),"Alt-B":r(i,-1),"Alt-D":function(a){s(a,i,1)},"Alt-Backspace":function(a){s(a,i,-1)},"Ctrl-N":r(j,1),"Ctrl-P":r(j,-1),Down:r(j,1),Up:r(j,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":r(k,-1),"Ctrl-V":r(k,1),PageUp:r(k,-1),PageDown:r(k,1),"Ctrl-Up":r(l,-1),"Ctrl-Down":r(l,1),"Alt-A":r(m,-1),"Alt-E":r(m,1),"Alt-K":function(a){s(a,m,1)},"Ctrl-Alt-K":function(a){s(a,n,1)},"Ctrl-Alt-Backspace":function(a){s(a,n,-1)},"Ctrl-Alt-F":r(n,1),"Ctrl-Alt-B":r(n,-1),"Shift-Ctrl-Alt-2":function(a){var b=a.getCursor();a.setSelection(q(a,b,n,1),b)},"Ctrl-Alt-T":function(a){var b=n(a,a.getCursor(),-1),c=n(a,b,1),d=n(a,c,1),e=n(a,d,-1);a.replaceRange(a.getRange(e,d)+a.getRange(c,e)+a.getRange(b,c),b,d)},"Ctrl-Alt-U":p(E),"Alt-Space":function(a){for(var b=a.getCursor(),c=b.ch,d=b.ch,e=a.getLine(b.line);c&&/\s/.test(e.charAt(c-1));)--c;for(;d<e.length&&/\s/.test(e.charAt(d));)++d;a.replaceRange(" ",H(b.line,c),H(b.line,d))},"Ctrl-O":p(function(a){a.replaceSelection("\n","start")}),"Ctrl-T":p(function(a){a.execCommand("transposeChars")}),"Alt-C":p(function(a){D(a,function(a){var b=a.search(/\w/);return b==-1?a:a.slice(0,b)+a.charAt(b).toUpperCase()+a.slice(b+1).toLowerCase()})}),"Alt-U":p(function(a){D(a,function(a){return a.toUpperCase()})}),"Alt-L":p(function(a){D(a,function(a){return a.toLowerCase()})}),"Alt-;":"toggleComment","Ctrl-/":p("undo"),"Shift-Ctrl--":p("undo"),"Ctrl-Z":p("undo"),"Cmd-Z":p("undo"),"Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findPersistentNext","Ctrl-R":"findPersistentPrev","Ctrl-G":F,"Shift-Alt-5":"replace","Alt-/":"autocomplete",Enter:"newlineAndIndent","Ctrl-J":p(function(a){a.replaceSelection("\n","end")}),Tab:"indentAuto","Alt-G G":function(a){var b=o(a,!0);return null!=b&&b>0?a.setCursor(b-1):void C(a,"Goto line",function(b){var c;b&&!isNaN(c=Number(b))&&c==(0|c)&&c>0&&a.setCursor(c-1)})},"Ctrl-X Tab":function(a){a.indentSelection(o(a,!0)||a.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(a){a.setSelection(a.getCursor("head"),a.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":p("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(a){g(a,a.getCursor(),m(a,a.getCursor(),1),!0)},"Ctrl-X H":"selectAll","Ctrl-Q Tab":p("insertTab"),"Ctrl-U":y}),M={"Ctrl-G":w},N=0;N<10;++N)G(String(N));G("-")})},{"../lib/codemirror":59}],57:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../lib/codemirror"),a("../addon/search/searchcursor"),a("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],d):d(CodeMirror)}(function(a){"use strict";function b(b,c,d){if(d<0&&0==c.ch)return b.clipPos(o(c.line-1));var e=b.getLine(c.line);if(d>0&&c.ch>=e.length)return b.clipPos(o(c.line+1,0));for(var f,g="start",h=c.ch,i=d<0?0:e.length,j=0;h!=i;h+=d,j++){var k=e.charAt(d<0?h-1:h),l="_"!=k&&a.isWordChar(k)?"w":"o";if("w"==l&&k.toUpperCase()==k&&(l="W"),"start"==g)"o"!=l&&(g="in",f=l);else if("in"==g&&f!=l){if("w"==f&&"W"==l&&d<0&&h--,"W"==f&&"w"==l&&d>0){f="w";continue}break}}return o(c.line,h)}function c(a,c){a.extendSelectionsBy(function(d){return a.display.shift||a.doc.extend||d.empty()?b(a.doc,d.head,c):c<0?d.from():d.to()})}function d(b,c){return b.isReadOnly()?a.Pass:(b.operation(function(){for(var a=b.listSelections().length,d=[],e=-1,f=0;f<a;f++){var g=b.listSelections()[f].head;if(!(g.line<=e)){var h=o(g.line+(c?0:1),0);b.replaceRange("\n",h,null,"+insertLine"),b.indentLine(h.line,null,!0),