//>>built
require({cache:{"dojo/node":function(){define(["./has"],function(a){var d;if(require.nodeRequire)d=require.nodeRequire("path");else throw Error("node plugin failed to load because it cannot find the original Node.js require");return{load:function(d,a,c){if(!a.nodeRequire)throw Error("Cannot find native require function");a=a.nodeRequire;var b=define,f;define=void 0;try{f=a(d)}finally{define=b}c(f)},normalize:function(a,g){if("."===a.charAt(0)){var c=require.toUrl(g(".")).replace("/",d.sep),b=a.split("/");
b.unshift(c);a=d.join.apply(d,b)}return a}}})},"main/remoteCaller":function(){define(["dojo/_base/declare","dojo/Deferred","dojo/json"],function(a,d,e){return new (a([],{classes:{},call:function(a,c){for(var b={declaredClass:a,fName:c,args:[]},f=2;f<arguments.length;)b.args.push(arguments[f]),++f;var h=new d;require(["dojo/request/xhr"],function(c){c("/apicall",{data:e.stringify(b),method:"PUT",handleAs:"json",headers:{"Content-Type":"application/json"}}).then(function(b){h.resolve(b.result)},function(b){h.reject(b)})});
return h},add:function(a){this.classes[a.declaredClass]=a},serverCall:function(a){var c=[];a.args&&(c=a.args);var b=this.classes[a.declaredClass];return b[a.fName].apply(b,c)}}))({})})},"main/treeItems":function(){define("dojo/_base/declare main/_RemoteCall dojo/Deferred main/config!node-mirror dojo/_base/array sol/fileName sol/promise dojo/_base/lang main/nameTranslator main/serverOnly!server/files".split(" "),function(a,d,e,g,c,b,f,h,k,l){var m;return m=new (a("treeItems",[d],{remoteFunctions:{getRootDef:!0,
getChildrenDef:!0,getItemDef:!0},getRootDef:function(){return m.getItemDef("")},getItemDef:function(c){var a=new e,f={id:c,name:""===c?b.single(g.dir):b.single(c)};l.dirsDef(k.fileName(c)).then(function(b){f.hasChildren=!!b;a.resolve(f)});return a},getChildrenDef:function(b){var a=new e;l.dirsDef(g.dir+b).then(function(b){if(b){var t=[];f.allDone(c.map(b,function(b){return m.getItemDef(k.reduceName(b)).then(h.hitch(t,"push"))})).then(function(){a.resolve(t)},function(){})}else a.resolve()});return a}}))})},
"main/_RemoteCall":function(){define(["dojo/_base/declare","dojo/has","main/remoteCaller","dojo/_base/lang"],function(a,d,e,g){return a("_RemoteCall",[],{constructor:function(c){e.add(this)},remoteFunctions:{}})})},"main/config":function(){define("dojo/_base/declare dojo/_base/config dojo/_base/lang dojo/has ./config/load!node-mirror main/_RemoteCall dojo/Deferred".split(" "),function(a,d,e,g,c,b,f){var h;return h=new (a("Config",[b],{remoteFunctions:{loadClientConfig:!0,clientSetConfig:!0},clientConfig:{theme:!0,
terminal:!0,debug:!0,restart:!0,seeunicorns:!0},saveable:{theme:!0},constructor:function(){e.mixin(this,c);this.config=c},set:function(b,a){try{this.config[b]=a,this.saveable[b]&&c.set(b,a),c[b]=a}catch(f){}},set2:function(b,a){try{this.config[b]=a,this.saveable[b]&&c.set(b,a),c[b]=a}catch(f){}},clientSetConfig:function(b,c){var a=new f;this.clientConfig[b]&&this.set2(b,c);a.resolve();return a},get:function(b){var c=new f;c.resolve(this.config[b]);return c},load:function(b,c,a){a(h)},loadClientConfig:function(){var b=
new f,a={},d;for(d in this.clientConfig)a[d]=c[d];b.resolve(a);return b}}))})},"main/config/load":function(){define(["dojo/_base/declare","dojo/_base/config","dojo/_base/lang","dojo/has"],function(a,d,e,g){return{load:function(c,b,a){var h=d.nodeMirrorNodeModule,k=h.getConfig();k.dir||(k.dir=h.getProcessDir());b(["dojo/node!runtime-configuration"],function(b){var d=b(c,{port:3E3,theme:"monokai"},function(b,c){b||(e.mixin(k,c),k.set=function(b,c){d.set(b,c);d.save("ini")},"win32"==process.platform&&
(k.restart=!1),a(k))})})}}})},"sol/fileName":function(){define(["dojo/_base/declare","dojo/_base/array","dojo/_base/lang"],function(a,d,e,g){return new (a("File",[],{single:function(c){c=c.split("/");return c[c.length-1]},dir:function(c){c=c.split("/");for(var b="",a=0,a=0;a<c.length-1;++a)b+=c[a],b+="/";return b}}))})},"sol/promise":function(){define(["dojo/_base/declare","dojo/Deferred","dojo/_base/array","dojo/promise/all","dojo/_base/lang"],function(a,d,e,g,c){return new (a("SolPromise",[],{_isPromise:function(b){return b&&
"function"===typeof b.then},_parseParameter:function(b){var c,a;b instanceof Array?a=b:b&&"object"===typeof b&&(c=b);if(c){a=[];for(var d in c)Object.hasOwnProperty.call(c,d)&&this._isPromise(c[d])&&a.push(c[d])}if(a)return a},allDone:function(b){ar=this._parseParameter(b);if(!ar||!ar.length)return(new d).resolve(b);var c=new d,a=ar.length,k=function(){0===--a&&c.resolve(b)};e.forEach(ar,function(b,c){b.then(k,k)});return c.promise}}))})},"dojo/promise/all":function(){define(["../_base/array","../Deferred",
"../when"],function(a,d,e){var g=a.some;return function(c){var b,a;c instanceof Array?a=c:c&&"object"===typeof c&&(b=c);var h,k=[];if(b){a=[];for(var l in b)Object.hasOwnProperty.call(b,l)&&(k.push(l),a.push(b[l]));h={}}else a&&(h=[]);if(!a||!a.length)return(new d).resolve(h);var m=new d;m.promise.always(function(){h=k=null});var q=a.length;g(a,function(c,a){b||k.push(a);e(c,function(b){m.isFulfilled()||(h[k[a]]=b,0===--q&&m.resolve(h))},m.reject);return m.isFulfilled()});return m.promise}})},"main/nameTranslator":function(){define(["dojo/_base/declare",
"main/config","dojo/has"],function(a,d,e){var g=0,c,g=d.dir.length;if("win32"==process.platform||"win64"==process.platform)c=!0;return new (a("NameTranslator",[],{reduceName:function(b){return c?b.substr(g).replace("\\","/"):b.substr(g)},fileName:function(b){return c?d.dir+b.replace("/","\\"):d.dir+b}}))})},"main/serverOnly":function(){define(["dojo/has"],function(a){return{load:function(a,e,g){e([a],g)}}})},"server/files":function(){define("dojo/_base/declare dojo/Deferred dojo/node!fs dojo/_base/array dojo/promise/all dojo/_base/lang sol/promise dojo/node!mime-magic dojo/node!mime sol/string".split(" "),
function(a,d,e,g,c,b,f,h,k,l){var m={".pl":"application/promiseLand",".pegjs":"application/peg.js",".less":"text/x-less"},q={".pl":"application/promiseLand",".pegjs":"application/peg.js",".less":"text/x-less"},n;return n=new (a("File",[],{remoteFunctions:{},dirsDef:function(b){var c=new d;e.stat(b,function(a,d){a||!d.isDirectory()?c.resolve():e.readdir(b,function(a,d){if(a)c.resolve();else{var e=[];f.allDone(g.map(d,function(c){filename=b+"/"+c;return n.isDirDef(filename).then(function(b){e.push(b)})})).then(function(){c.resolve(e)})}})});
return c.promise},childrenDef:function(b){var c=new d;n.isDirDef(b).then(function(){e.readdir(b,function(a,d){a?c.resolve():c.resolve(g.map(d,function(c){return b+"/"+c}))})},function(){c.resolve()});return c.promise},isDirDef:function(b){var c=new d;e.stat(b,function(a,d){a||d.isDirectory()&&c.resolve(b);c.reject(b)});return c.promise},contentTypeDef:function(b){var c=new d;h(b,function(a,d){a?c.reject(a):e.stat(b,function(a,f){try{if(a)c.reject(a);else{var e=!1;!f.isDirectory()&&0===f.size&&(e=
!0);"inode/x-empty"==d&&(e=!0);var h;if("text/plain"==d||e){for(h in m)if(b.substr(b.length-h.length)==h){d=m[h];c.resolve(d);return}d=k.lookup(b)}else if(l.startsWith(d,"text/"))for(h in q)if(l.endsWith(b,h)){d=m[h];c.resolve(d);return}c.resolve(d)}}catch(p){}})});return c.promise},readTextDef:function(b){var c=new d;e.readFile(b,{encoding:"utf8"},function(b,a){"object"==typeof a?c.resolve(a.toString()):"string"==typeof a?c.resolve(a):c.resolve("file could not be read")});return c.promise},createFileDef:function(b){var c=
new d;e.open(b,"a",void 0,function(b,a){b?c.reject(b):a?e.close(a,function(){c.resolve()}):c.resolve()});return c.promise},createDirDef:function(b){var c=new d;e.mkdir(b,void 0,function(a){a?c.reject(a):c.resolve(b)});return c.promise},writeTextDef:function(b,c){var a=new d;e.writeFile(b,c,{encoding:"utf8"},function(b,c){a.resolve()});return a.promise}}))})},"sol/string":function(){define([],function(){return{endsWith:function(a,d){return a.substr(a.length-d.length)==d?!0:!1},startsWith:function(a,
d){return a.substr(0,d.length)==d?!0:!1},cutEnd:function(a,d){return a.substr(0,a.length-d)},cutStart:function(a,d){return a.substr(d)}}})},"main/contentIO":function(){define("dojo/_base/declare main/_RemoteCall dojo/Deferred dojo/_base/array sol/fileName sol/promise dojo/_base/lang main/nameTranslator main/modules main/serverOnly!server/files main/moduleLoader!server".split(" "),function(a,d,e,g,c,b,f,h,k,l,m){return new (a("ContentIO",[d],{remoteFunctions:{getContentDef:!0},getContentDef:function(b){var c=
new e,a=f.hitch(c,"reject"),d=h.fileName(b.id);l.contentTypeDef(d).then(function(d){b.contentType=d;m.findModulePs(b).then(function(d){try{d.getContentPs(b).then(function(a){c.resolve({content:a,par:b,moduleId:d.getModuleId()})},a)}catch(f){a()}},a)});return c}}))})},"main/modules":function(){define([],function(){return"modules/SideBar modules/ContentTabs modules/Files modules/Binary modules/Directory modules/Text modules/Html modules/JavaScript modules/Less modules/Peg modules/Terminal modules/Control".split(" ")})},
"main/moduleLoader":function(){define("main/modules dojo/_base/array dojo/Deferred dojo/_base/declare main/_RemoteCall dojo/_base/lang".split(" "),function(a,d,e,g,c,b){moduleLoader=new (g([],{modules:[],namedModules:{},register:function(b,c){this.modules.push(b);this.namedModules[c]=b},getModule:function(b){return this.namedModules[b]},getModules:function(){return d.map(this.modules,function(b){return b})},findModulePs:function(c){var a=new e,d=this.modules.length;if(c.force)try{var f=this.getModule(c.force);
if(f)return a.resolve(f),a}catch(g){}var n;n=b.hitch(this,function(){if(d){--d;var b;try{b=this.modules[d],b.isCompetentPs?b.isCompetentPs(c).then(function(){a.resolve(b)},n):n()}catch(f){n()}}else a.reject()});n();return a}}));var f;return{load:function(b,k,l){f||(f=new e,k(a,function(){d.forEach(arguments,function(b,d){var f=a[d],e=new (g(f,[c,b],{buildRendering:function(){this.keepBuildRendering&&this.inherited(arguments)}}));e.ModuleClass=b;e.moduleId=f;moduleLoader.register(e,f)});f.resolve()}));
f.then(function(){l(moduleLoader)})}}})},"main/nodeControl":function(){define("dojo/_base/declare main/_RemoteCall dojo/Deferred main/config!node-mirror dojo/_base/array sol/promise dojo/_base/lang dojo/has".split(" "),function(a,d,e,g,c,b,f,h){return new (a("NodeControl",[d],{remoteFunctions:{restartDef:!0},restartDef:function(){var b=new e;setTimeout(function(){g.restartableObj&&g.restartableObj.isRestartable&&g.restartableObj.restart()},10);b.resolve({});return b.promise}}))})},"sol/node/npm":function(){define(["dojo/node!npm",
"dojo/_base/declare","dojo/Deferred","dojo/_base/lang"],function(a,d,e,g){var c=new e;a.load(function(b){b?c.reject(b):c.resolve(a)});return{load:function(b){var a=new e;b.onLoad&&a.then(b.onLoad);b.onError&&a.then(void 0,b.onError);try{require(["dojo/node!"+b.name],function(b){a.resolve(b)})}catch(d){c.then(function(c){if(b.onInstall)try{b.onInstall(b)}catch(d){}c.commands.install([b.name],function(b,c){if(b)a.reject(b);else try{var d=process.cwd()+"/"+c[0][1];require(["dojo/node!"+d],function(b){a.resolve(b)})}catch(e){a.reject(e)}})})}return a}}})},
"sol/node/debug/Protocol":function(){define(["dojo/_base/declare","dojo/json","dojo/Deferred","dojo/_base/lang"],function(a,d,e,g){return a([],{constructor:function(){this.bufStr="";this._events={};this.seq=0;this._responseHandler={}},write:function(c){this.bufStr="STRING"==typeof c?this.bufStr+c:this.bufStr+c.toString();for(c=!0;c;)c=this.expectBody?this.parseBody():this.parseHead()},parseBody:function(){if(this.bufStr.length>=this.contentLength)return this._newMsg({head:this.head,body:this.bufStr.substr(0,
this.contentLength)}),this.bufStr=this.bufStr.substr(this.contentLength),this.expectBody=!1,!0},parseHead:function(){var c=this.bufStr.indexOf("\r\n\r\n");return-1<c?(this.headStr=this.bufStr.substr(0,c),this.bufStr=this.bufStr.substr(c+4),this._parseHead(),this.head["Content-Length"]&&((this.contentLength=parseInt(this.head["Content-Length"],10))?this.expectBody=!0:this._newMsg({head:this.head,body:void 0})),!0):!1},_parseHead:function(){this.head={};var c=this.headStr.split("\r\n"),b,a;for(b=0;b<
c.length;++b)if(a=c[b].indexOf(":"),-1<a){var d=c[b].substr(0,a);a=c[b].substr(a+(" "==c[b][a+1]?2:1));this.head[d]=a}},_newMsg:function(c){if(this._events._message)for(var b=0;b<this._events._message.length;++b)try{this._events._message[b](c)}catch(a){}void 0!==c.body&&(c=d.parse(c.body),"event"==c.type?this._handleEvent(c):"response"==c.type&&this._handleResponse(c))},_handleEvent:function(c){if(this._events[c.event])for(var b=0;b<this._events[c.event].length;++b)try{this._events[c.event][b](c.body)}catch(a){}},
on:function(c,b){this._events[c]||(this._events[c]=[]);this._events[c].push(b)},_data:function(c){if(this._events.data)for(var b=0;b<this._events.data.length;++b)try{this._events.data[b](c)}catch(a){}},_handleResponse:function(a){if(this._responseHandler[a.command])this._responseHandler[a.command](a)},_expectResponse:function(a){var b=new e;this._responseHandler[a.command]=g.hitch(this,function(d){delete this._responseHandler[a.command];b.resolve(d.body)});return b.promise},getSource:function(a){var b=
new e,f="";a={seq:this.seq++,type:"request",command:"scripts",arguments:{ids:[a.id],includeSource:!0}};f="Content-Length: ";a=d.stringify(a);f+=a.length;f=f+"\r\n\r\n"+a;this._data(f);this._expectResponse({command:"scripts"}).then(function(a){b.resolve({id:a[0].id,name:a[0].name,source:a[0].source})});return b},_commmand:function(a,b){var f=new e,h="",g={seq:this.seq++,type:"request",command:a};b&&(g.arguments=b);h="Content-Length: ";g=d.stringify(g);h+=g.length;h=h+"\r\n\r\n"+g;this._data(h);this._expectResponse({command:a}).then(function(b){f.resolve(b)});
return f},cont:function(a){var b=new e;this._commmand("continue",a.step?{stepaction:a.step}:void 0).then(function(a){b.resolve(a)});return b}})})},"term/server":function(){define(["dojo/Deferred","main/config","sol/node/npm","dojo/node!../../../lib/terminal.js"],function(a,d,e,g){var c;return{connections:[],newConnection:function(b){this.connections.push(b);b.on("openterminal",function(f,h){if(!1===d.terminal)h({});else{var k=new a;c||"win32"==process.platform?k.resolve(c):e.load({name:"pty.js",onInstall:function(){b.emit("terminal_meta",
{event:"install"})},onError:function(a){b.emit("terminal_meta",{event:"installerror"});k.reject()},onLoad:function(b){g.setPty(b);c=b;k.resolve(b)}});k.then(function(){g.newTerminal(function(a){var c="term"+a.id;h({termid:c});a.onData=function(a){b.emit(c,a)};b.on(c,function(b){a.write(b)});b.on(c+"_resize",function(b){try{a.resize(b.x,b.y)}catch(c){}});b.emit(c+"_meta",{event:"ready"})})})}})}}})},"main/connection":function(){define(["dojo/_base/declare","dojo/_base/array"],function(a,d){var e={};
return{newConnection:function(a,c){e.connect&&d.forEach(e.connect,function(b){try{b(a,c)}catch(d){}})},on:function(a,c){e[a]||(e[a]=[]);e[a].push(c)}}})},"main/codemirror/subtypes":function(){define(["./meta","dojo/_base/array"],function(a,d){var e={};d.forEach(a,function(a){e[a.mime.split("/")[1]]=!0});return e})},"main/codemirror/meta":function(){(function(a,d){if("function"==typeof define)define(a,d);else{for(var e=[],g=0,g=0;g<a.length;++g)e.push(require(a[g]));module.exports=d.apply(void 0,e)}})(["main/codemirror/fake"],
function(a){a.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl"},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk"},{name:"C",mime:"text/x-csrc",mode:"clike"},{name:"C++",mime:"text/x-c++src",mode:"clike"},{name:"Cobol",mime:"text/x-cobol",mode:"cobol"},{name:"Java",mime:"text/x-java",mode:"clike"},{name:"C#",mime:"text/x-csharp",mode:"clike"},{name:"Scala",mime:"text/x-scala",mode:"clike"},{name:"Clojure",mime:"text/x-clojure",mode:"clojure"},{name:"CoffeeScript",mime:"text/x-coffeescript",
mode:"coffeescript"},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp"},{name:"CSS",mime:"text/css",mode:"css"},{name:"D",mime:"text/x-d",mode:"d"},{name:"diff",mime:"text/x-diff",mode:"diff"},{name:"ECL",mime:"text/x-ecl",mode:"ecl"},{name:"Erlang",mime:"text/x-erlang",mode:"erlang"},{name:"Gas",mime:"text/x-gas",mode:"gas"},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm"},{name:"GO",mime:"text/x-go",mode:"go"},{name:"Groovy",mime:"text/x-groovy",mode:"groovy"},{name:"Haskell",
mime:"text/x-haskell",mode:"haskell"},{name:"Haxe",mime:"text/x-haxe",mode:"haxe"},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded"},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded"},{name:"JavaServer Pages",mime:"application/x-jsp",mode:"htmlembedded"},{name:"HTML",mime:"text/html",mode:"htmlmixed"},{name:"HTTP",mime:"message/http",mode:"http"},{name:"Jade",mime:"text/x-jade",mode:"jade"},{name:"JavaScript",mime:"text/javascript",mode:"javascript"},{name:"JSON",
mime:"application/x-json",mode:"javascript"},{name:"JSON",mime:"application/json",mode:"javascript"},{name:"TypeScript",mime:"application/typescript",mode:"javascript"},{name:"Jinja2",mime:"jinja2",mode:"jinja2"},{name:"LESS",mime:"text/x-less",mode:"less"},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript"},{name:"Lua",mime:"text/x-lua",mode:"lua"},{name:"Markdown (GitHub-flavour)",mime:"text/x-markdown",mode:"markdown"},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"Nginx",mime:"text/x-nginx-conf",
mode:"nginx"},{name:"NTriples",mime:"text/n-triples",mode:"ntriples"},{name:"OCaml",mime:"text/x-ocaml",mode:"ocaml"},{name:"Pascal",mime:"text/x-pascal",mode:"pascal"},{name:"Perl",mime:"text/x-perl",mode:"perl"},{name:"PHP",mime:"text/x-php",mode:"php"},{name:"PHP(HTML)",mime:"application/x-httpd-php",mode:"php"},{name:"Pig",mime:"text/x-pig",mode:"pig"},{name:"Plain Text",mime:"text/plain",mode:"null"},{name:"Properties files",mime:"text/x-properties",mode:"clike"},{name:"Python",mime:"text/x-python",
mode:"python"},{name:"Cython",mime:"text/x-cython",mode:"python"},{name:"R",mime:"text/x-rsrc",mode:"r"},{name:"reStructuredText",mime:"text/x-rst",mode:"rst"},{name:"Ruby",mime:"text/x-ruby",mode:"ruby"},{name:"Rust",mime:"text/x-rustsrc",mode:"rust"},{name:"Sass",mime:"text/x-sass",mode:"sass"},{name:"Scheme",mime:"text/x-scheme",mode:"scheme"},{name:"SCSS",mime:"text/x-scss",mode:"css"},{name:"Shell",mime:"text/x-sh",mode:"shell"},{name:"Sieve",mime:"application/sieve",mode:"sieve"},{name:"Smalltalk",
mime:"text/x-stsrc",mode:"smalltalk"},{name:"Smarty",mime:"text/x-smarty",mode:"smarty"},{name:"SmartyMixed",mime:"text/x-smarty",mode:"smartymixed"},{name:"SPARQL",mime:"application/x-sparql-query",mode:"sparql"},{name:"SQL",mime:"text/x-sql",mode:"sql"},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex"},{name:"Tcl",mime:"text/x-tcl",mode:"tcl"},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},
{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"VB.NET",mime:"text/x-vb",mode:"vb"},{name:"VBScript",mime:"text/vbscript",mode:"vbscript"},{name:"Velocity",mime:"text/velocity",mode:"velocity"},{name:"Verilog",mime:"text/x-verilog",mode:"verilog"},{name:"XML",mime:"application/xml",mode:"xml"},{name:"HTML",mime:"text/html",mode:"xml"},{name:"XQuery",mime:"application/xquery",mode:"xquery"},{name:"YAML",mime:"text/x-yaml",mode:"yaml"},{name:"Z80",mime:"text/x-z80",mode:"z80"}];return a.modeInfo})},
"modules/Files":function(){define("dojo/_base/declare dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/config main/clientOnly!./files/Wgt".split(" "),function(a,d,e,g,c,b,f,h,k){return a([],{constructor:function(){},provideSideBarWidgetPs:function(){var b=new d,a=this;a.wgt?b.resolve(a.wgt):require(["main/clientOnly!modules/files/Wgt"],function(c){a.wgt=new c({});b.resolve(a.wgt)});return b}})})},"main/clientOnly":function(){define(["dojo/has"],function(a){return{load:function(a,
e,g){g(void 0)}}})},"modules/SideBar":function(){define("dojo/_base/declare dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/config".split(" "),function(a,d,e,g,c,b,f,h){return a([],{constructor:function(){},provideMainWidgetPs:function(){var a=new d,b=this;b.wgt?a.resolve(b.wgt):require(["main/clientOnly!modules/sideBar/Wgt"],function(c){b.wgt=new c({});a.resolve(b.wgt)});return a}})})},"modules/ContentTabs":function(){define("dojo/_base/declare dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/config".split(" "),
function(a,d,e,g,c,b,f,h){return a([],{constructor:function(){},provideMainWidgetPs:function(){var b=new d,a=this;a.wgt?b.resolve(a.wgt):require(["main/clientOnly!modules/contentTabs/Wgt"],function(c){a.wgt=new c({});b.resolve(a.wgt)});return b},addChild:function(){var a=arguments;this.provideMainWidgetPs().then(function(b){b.addChild.apply(b,a)})},removeChild:function(){this.wgt.removeChild.apply(this.wgt,arguments)},selectChild:function(){var b=arguments;this.provideMainWidgetPs().then(function(a){a.selectChild.apply(a,
b)})}})})},"modules/Terminal":function(){define("dojo/_base/declare dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/config main/serverOnly!sol/node/npm main/serverOnly!dojo/node!../../../lib/terminal.js main/connection".split(" "),function(a,d,e,g,c,b,f,h,k,l,m){var q,n,r=a([],{constructor:function(a){var b=this;this.socket=a.socket;this.termid=a.termid;this.eventid="terminal"+a.termid;this._on={resize:[],data:[]};this.socket.on(this.eventid,function(a){c.forEach(b._on[a.event],
function(b){try{b(a.data)}catch(c){}})})},on:function(a,b){this._on[a].push(b)},write:function(a){this.socket.emit(this.eventid,{event:"data",data:a})},resize:function(a){this.socket.emit(this.eventid,{event:"resize",data:a})}});a=a([],{constructor:function(){var a=this;this.socketDef=new d;m.on("connect",function(b,c){a.handleConnection(b,c)});a.handleConnection=n},provideSideBarWidgetPs:function(){var a=new d,b=this;h.get("terminal").then(function(c){!1===c?a.reject():b.wgt?a.resolve(b.wgt):require(["main/clientOnly!modules/terminal/Wgt"],
function(c){b.wgt=new c({module:b});a.resolve(b.wgt)})});return a},openTerminal:function(a){var b=new d,c=this;this.socket.emit("openterminal",{mode:"terminal",id:a},function(a){void 0===a.termid?b.reject():b.resolve(new r({termid:a.termid,socket:c.socket}))});return b},getList:function(){var a=new d;this.socketDef.then(function(b){b.emit("terminal/getList",function(b){a.resolve(b)})});return a}});n=function(a,c){a.on("terminal/getList",function(a){l.getList(a)});a.on("openterminal",function(c,e){if(!1===
h.terminal)e({});else{var f=new d;q||"win32"==process.platform?f.resolve(q):k.load({name:"pty.js",onInstall:function(){a.emit("terminal_meta",{event:"install"})},onError:function(b){a.emit("terminal_meta",{event:"installerror"});f.reject()},onLoad:function(a){l.setPty(a);q=a;f.resolve(a)}});f.then(function(){var d=b.hitch(l,"newTerminal");void 0!==c.id&&(d=b.hitch(l,"getTerminal",c.id));d(function(b){var c=b.id,d="terminal"+c;e({termid:c});b.on("data",function(b){a.emit(d,{event:"data",data:b})});
b.on("resize",function(b){a.emit(d,{event:"resize",data:b})});a.on(d,function(a){try{"data"==a.event&&b.write(a.data),"resize"==a.event&&b.resize(a.data.x,a.data.y)}catch(c){}});a.emit(d,{event:"ready"})})})}})};return a})},"modules/Control":function(){define("dojo/_base/declare dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/config main/connection main/nodeControl".split(" "),function(a,d,e,g,c,b,f,h,k,l){return a([],{constructor:function(){},provideSideBarWidgetPs:function(){var a=
new d,b=this;b.wgt?a.resolve(b.wgt):require(["main/clientOnly!modules/control/Wgt"],function(c){b.wgt=new c({module:b});a.resolve(b.wgt)});return a},restartServer:function(){l.restartDef()}})})},"modules/Text":function(){define("dojo/_base/declare modules/base/BorderContainer dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang main/serverOnly!server/files main/codemirror/subtypes sol/string main/clientOnly!sol/wgt/CodeMirror main/clientOnly!codemirror/theme/all main/clientOnly!dijit/form/Select main/config main/clientOnly!codemirror/mode/allModes main/clientOnly!codemirror/addon/dialog/dialog main/clientOnly!codemirror/addon/search/search main/clientOnly!codemirror/addon/search/searchcursor main/clientOnly!codemirror/addon/edit/matchbrackets".split(" "),
function(a,d,e,g,c,b,f,h,k,l,m,q,n,r){var t={"peg.js":!0,"x-empty":!0},p={"inode/x-empty":!0};return a([d],{"class":"content text",saveButton:!0,reloadButton:!0,downloadButton:!0,binaryModeButton:!0,isCompetentPs:function(a){var b=this.def(),c=!1;l.startsWith(a.contentType,"text/")&&(c=!0);if(!c&&l.startsWith(a.contentType,"application/")){var d=a.contentType.split("/")[1];if(k[d]||t[d])c=!0}c||p[a.contentType]&&(c=!0);c?b.resolve():b.reject();return b},getContentPs:function(a){var b=new e,d={},g=
this.def(),r=this.def();h.readTextDef(this.getFileName(a.id)).then(function(a){d.text=a;g.resolve(d)});h.contentTypeDef(this.getFileName(a.id)).then(function(a){d.contentType=a;r.resolve(d)});c.allDone([g,r]).then(f.hitch(b,"resolve",d));return b},saveContentPs:function(a,b){return h.writeTextDef(this.getFileName(a.id),b.text)},buildRendering:function(){var a=this.inherited(arguments);this.themeSelect=this.ownObj(new n({options:b.map(q,function(a){return{label:a,value:a}}),onChange:f.hitch(this,"changeTheme")}));
this.menu.addChild(this.themeSelect);this.mirror=this.ownObj(new m({region:"center",value:this.content.text,mode:this.par.contentType,lineNumbers:!0,theme:"twilight",matchBrackets:!0}));this.addChild(this.mirror);this.mirror.on("change",f.hitch(this,function(){this._started&&this.set("dirty",!0)}));r.get("theme").then(f.hitch(this,function(a){this.mirror.set("theme",a);this.themeSelect.set("value",a)}));return a},changeTheme:function(){this.mirror.set("theme",this.themeSelect.get("value"));r.set("theme",
this.themeSelect.get("value"))},_setContentAttr:function(a){this._set("content",a);this.mirror&&(this.mirror.set("value",this.content.text),this.mirror.set("mode",this.content.contentType))},_getContentAttr:function(){this.mirror&&(this.content.text=this.mirror.get("value"));return this.content}})})},"modules/base/BorderContainer":function(){define(["dojo/_base/declare","dojo/_base/lang","main/clientOrStub!dijit/layout/BorderContainer","main/clientOrStub!./WidgetMixin","modules/base/Base"],function(a,
d,e,g,c){return a([c,e,g],{"class":"content",gutters:!1,showMenu:!0,buildRendering:function(){return this.inherited(arguments)}})})},"main/clientOrStub":function(){define(["dojo/has","dojo/_base/declare"],function(a,d){var e=d([],{});return{load:function(a,c,b){b(e)}}})},"modules/base/Base":function(){define(["dojo/_base/declare","dojo/Deferred","main/_RemoteCall","main/nameTranslator","dojo/_base/lang"],function(a,d,e,g,c){e={getContentPs:!0,saveContentPs:!0};a=a([],{WidgetClass:void 0,remoteFunctions:e,
def:function(){return new d},isCompetentPs:function(a){a=this.def();a.reject();return a},getContentPs:function(a){a=this.def();a.reject();return a},saveContentPs:function(a,c){var d=this.def();d.reject();return d},getWidgetClassPs:function(a){a=this.def();a.resolve(this.WidgetClass||this.ModuleClass);return a},createWidgetPs:function(a){var d=this.def();this.getWidgetClassPs(a).then(c.hitch(this,function(e){if(e){var g={createWidgetPs:c.hitch(this,"createWidgetPs"),isCompetentPs:c.hitch(this,"isCompetentPs"),
getContentPs:c.hitch(this,"getContentPs"),saveContentPs:c.hitch(this,"saveContentPs"),moduleId:this.getModuleId()},l;for(l in this.remoteFunctions)g[l]=c.hitch(this,l);d.resolve(new e(c.mixin(g,a)))}else d.reject()}));return d},getFileName:function(a){return g.fileName(a)},getModuleId:function(){return this.moduleId}});a.remoteFunctions=e;return a})},"modules/Directory":function(){define("dojo/_base/declare modules/base/Base modules/base/BorderContainer dojo/Deferred dojo/has sol/promise dojo/_base/array main/nameTranslator main/serverOnly!server/files main/clientOnly!./directory/Grid main/clientOnly!./directory/NewDlg main/clientOnly!dijit/form/Button dojo/_base/lang".split(" "),
function(a,d,e,g,c,b,f,h,k,l,m,q,n){return a([e],{remoteFunctions:n.mixin({},d.remoteFunctions,{createFilePs:!0}),reloadButton:!0,downloadButton:!0,isCompetentPs:function(a){var b=this.def();"inode/directory"==a.contentType?b.resolve():b.reject();return b},getContentPs:function(a){var c=this.def();a=this.getFileName(a.id);k.childrenDef(a).then(function(a){var d={children:[]};b.allDone(f.map(a,function(a){var b={type:"file",id:h.reduceName(a)};d.children.push(b);return k.contentTypeDef(a).then(function(a){b.contentType=
a})})).then(function(){c.resolve(d)})});return c},createFilePs:function(a,b,c){var d=this.def(),e=function(a){d.reject()},f=a.id+"/"+b;if(!b||!b.length)d.reject();else return a=h.fileName(f),b=n.hitch(this,function(){try{require(["main/contentIO"],function(a){try{a.getContentDef({type:"file",id:f}).then(function(a){d.resolve(a)},function(a){})}catch(b){d.reject()}})}catch(a){d.reject()}}),c?k.createDirDef(a).then(b,e):k.createFileDef(a).then(b,e),d.promise},downloadbutton:!0,reloadbutton:!0,buildRendering:function(){var a=
this.inherited(arguments);this.newDirButton=this.ownObj(new q({label:"new Directory",showLabel:!0,onClick:n.hitch(this,"createNew",!0),region:"left"}));this.menu.addChild(this.newDirButton);this.newButton=this.ownObj(new q({label:"new File",showLabel:!0,onClick:n.hitch(this,"createNew",!1),region:"left"}));this.menu.addChild(this.newButton);this.grid=this.ownObj(new l({content:this.content,mainWgt:this}));this.addChild(this.grid);return a},_setContentAttr:function(a){this._set("content",a);this.grid.set("content",
a);this.grid.doRender()},createNew:function(a){a=new m({newDir:a,parent:this});a.startup();a.show()}})})},"modules/Binary":function(){define("dojo/_base/declare dojo/Deferred dojo/_base/lang sol/promise dojo/_base/array main/serverOnly!server/files sol/string modules/base/Base modules/base/BorderContainer main/serverOnly!dojo/node!fs main/clientOnly!./binary/HexGrid".split(" "),function(a,d,e,g,c,b,f,h,k,l,m){return a([k],{remoteFunctions:e.mixin({},h.remoteFunctions,{readLinesPs:!0}),"class":"content binary",
saveButton:!0,reloadButton:!0,downloadButton:!0,textModeButton:!0,buildRendering:function(){var a=this.inherited(arguments);this.hexGrid=this.ownObj(new m({fileId:this.par.id,region:"center",parent:this}));this.addChild(this.hexGrid);return a},isCompetentPs:function(a){var b=this.def();"inode/directory"==a.contentType?b.reject():b.resolve();return b},getContentPs:function(a){a=this.def();a.resolve({isBin:!0});return a},_getContentAttr:function(){return this.hexGrid.getSaveData()},savePs:function(){var a=
this.inherited(arguments);a.then(e.hitch(this.hexGrid,"resetEdited"));return a},saveContentPs:function(a,b){var c=new d,e=this.getFileName(a.id);l.open(e,"r+",function(a,d){if(a)c.reject();else{var e=0,f=0,g=[],h,k=function(){var b=g.length,k=16*f;e=f=0;if(!b)return h();var m=new Buffer(g);l.write(d,m,0,b,k,function(){a?c.reject():(g=[],h())})};h=function(){if(b.length){for(;b.length;){var a=b[0];if(a.lineNr!=e){if(g.length)return k();f=a.lineNr}b.shift();e=a.lineNr+1;g=g.concat(a.data);if(16!=a.data.length)return k()}k()}else l.close(d,
function(){c.resolve()})};h()}});return c},readLinesPs:function(a,b){var c=new d,e=this.getFileName(a);l.open(e,"r",function(a,d){if(a)c.reject();else{var e=b.count||1,f=16*e,g=b.start||0,g=16*g,h=new Buffer(f);l.read(d,h,0,f,g,function(a,f,g){if(a)c.reject();else{var h=[];for(a=0;a<e;++a){for(var k=16*a,m={lineNr:b.start+a,data:[]},p=0;16>p;++p)f&&(--f,m.data[p]=g[k+p]);h.push(m)}l.close(d,function(){c.resolve(h)})}})}});return c}})})},"modules/Less":function(){define("dojo/_base/declare modules/base/Base modules/Text dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/clientOnly!./less/Tester main/clientOnly!dijit/form/Button main/serverOnly!dojo/node!less sol/fileName main/serverOnly!server/files main/clientOnly!sol/wgt/Iframe main/clientOnly!dojo/dom-style main/clientOnly!dojo/dom-construct main/clientOnly!dojo/dom-geometry".split(" "),
function(a,d,e,g,c,b,f,h,k,l,m,q,n,r,t,p,u,s){var v={less:!0,"x-less":!0},w={};return a([e],{remoteFunctions:h.mixin({},d.remoteFunctions,{testPs:!0}),"class":"content text less",isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];v[d]&&(c=!0);c||w[a.contentType]&&(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.testBtn=this.ownObj(new m({onClick:h.hitch(this,"test"),label:"test"}));this.menu.addChild(this.testBtn);
this.referenceBtn=this.ownObj(new m({onClick:h.hitch(this,"reference"),label:"Reference"}));this.menu.addChild(this.referenceBtn);return a},reference:function(){this.referenceFrame&&this.showingReference?(this.showingReference=!1,this._frameBox=s.getMarginBox(this.referenceFrame.domNode),this._frameBox2=s.getMarginBox(this.referenceFrame._splitterWidget.domNode),p.set(this.referenceFrame.domNode,"height","0px"),p.set(this.referenceFrame.domNode,"border","0px"),p.set(this.referenceFrame._splitterWidget.domNode,
"height","0px"),this.resize()):(this.showingReference=!0,this.referenceFrame?(s.setMarginBox(this.referenceFrame.domNode,{h:this._frameBox.h}),s.setMarginBox(this.referenceFrame._splitterWidget.domNode,{h:this._frameBox2.h}),this.resize()):(this.referenceFrame=this.ownObj(new t({"class":"referenceFrame",src:"http://lesscss.org/#reference",region:"top",splitter:!0})),this.addChild(this.referenceFrame)))},test:function(){this.tester||(this.tester=this.ownObj(new l({parent:this})),this.addChild(this.tester));
this.testPs(this.par,this.mirror.get("value")).then(h.hitch(this,function(a){this.tester.set("value",a)}))},testPs:function(a,b){var c=this.def();(new q.Parser({paths:[this.getFileName(n.dir(a.id))],filename:n.single(a.id)})).parse(b,function(a,b){a?c.resolve("error"):c.resolve(b.toCSS())});return c},saveContentPs:function(a,c){var d=this.inherited(arguments),e=this.def();try{var f=this.getFileName(a.id);k.endsWith(f,".less")&&(f=f.substr(0,f.length-5));f+=".css";this.testPs(a,c.text).then(function(a){r.writeTextDef(f,
a).then(function(){e.resolve()})})}catch(g){}return b.allDone([d,e])}})})},"modules/Html":function(){define("dojo/_base/declare modules/Text dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/clientOnly!./html/Tester main/clientOnly!dijit/form/Button".split(" "),function(a,d,e,g,c,b,f,h,k,l){var m={html:!0},q={};return a([d],{"class":"content text html",isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];m[d]&&(c=!0);c||q[a.contentType]&&
(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.testBtn=this.ownObj(new l({onClick:f.hitch(this,"test"),label:"test"}));this.menu.addChild(this.testBtn);return a},test:function(){this.tester||(this.tester=this.ownObj(new k({parent:this})),this.addChild(this.tester),this.mirror.on("change",f.hitch(this,function(){this.tester.codeChanged()})));this.tester.test()}})})},"modules/Peg":function(){define("dojo/_base/declare modules/Text dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/clientOnly!./peg.js/Parser main/clientOnly!dijit/form/Button main/clientOnly!dojo/dom-class".split(" "),
function(a,d,e,g,c,b,f,h,k,l,m){var q={"peg.js":!0,pegjs:!0},n={};return a([d],{"class":"content text pegjs",isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];q[d]&&(c=!0);c||n[a.contentType]&&(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.parseBtn=this.ownObj(new l({onClick:f.hitch(this,"openparser"),label:"try Parser"}));this.menu.addChild(this.parseBtn);this.closeParseBtn=this.ownObj(new l({onClick:f.hitch(this,
"closeparser"),label:"close Try Bar"}));m.add(this.closeParseBtn.domNode,"invisible");this.menu.addChild(this.closeParseBtn);this.reinitParserBtn=this.ownObj(new l({onClick:f.hitch(this,"reinitParser"),label:"reapply Peg Code"}));m.add(this.reinitParserBtn.domNode,"invisible");this.menu.addChild(this.reinitParserBtn);return a},openparser:function(){m.add(this.parseBtn.domNode,"invisible");m.remove(this.closeParseBtn.domNode,"invisible");m.remove(this.reinitParserBtn.domNode,"invisible");this.parser||
(this.parser=this.ownObj(new k({parent:this})),this.mirror.on("change",f.hitch(this,function(){this.parser.parserCodeChanged()})));this.addChild(this.parser);this.parser.parse()},closeparser:function(){m.remove(this.parseBtn.domNode,"invisible");m.add(this.closeParseBtn.domNode,"invisible");m.add(this.reinitParserBtn.domNode,"invisible");this.removeChild(this.parser)},reinitParser:function(){}})})},"modules/JavaScript":function(){define("dojo/_base/declare modules/Text dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/clientOnly!dijit/form/Button main/clientOnly!dijit/form/ToggleButton".split(" "),
function(a,d,e,g,c,b,f,h,k,l){var m={javascript:!0,javaScript:!0,JavaScript:!0,Javascript:!0},q={},n=!0;return a([d],{"class":"content text javascript",isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];m[d]&&(c=!0);c||q[a.contentType]&&(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.jshintBtn=this.ownObj(new l({onChange:f.hitch(this,function(){n=this.jshintBtn.get("checked");this.mirror.set("jshint",n)}),label:"syntax check",
checked:n}));this.menu.addChild(this.jshintBtn);this.mirror.set("jshint",n);return a}})})},"main/codemirror/fake":function(){define([],function(){return{}})}}});
define("server/server","dojo/node!express dojo/node!mime-magic dojo/node!socket.io dojo/node!http dojo/has dojo/node!fs dojo/node!session.socket.io dojo/node!connect dojo/Deferred".split(" "),function(a,d,e,g,c,b,f,h,k){require("main/remoteCaller main/treeItems server/files main/nameTranslator sol/fileName main/contentIO main/nodeControl dojo/node!easy-zip main/config sol/node/npm dojo/node!net sol/node/debug/Protocol dojo/node!../../lib/terminal.js term/server main/connection".split(" "),function(c,
d,k,n,r,t,p,u,s,v,w,y,z,A,x){EasyZip=u.EasyZip;p=a();u=g.createServer(p);s.username&&p.use(a.basicAuth(s.username,s.password));d=a.cookieParser("my session secret");t=new h.middleware.session.MemoryStore;p.use(d);p.use(a.session({store:t,cookie:{path:"/",httpOnly:!0,maxAge:null}}));p.use(a.bodyParser());p.put("/apicall",function(a,b){try{c.serverCall(a.body).then(function(a){b.send({result:a})})}catch(d){b.close()}});p.put("/reconnect",function(a,b){b.setHeader("Content-Type","application/json");
b.send({reconnected:!0})});p.get("/download",function(a,c){var d=n.fileName(a.query.id);k.contentTypeDef(d).then(function(a){if("inode/directory"==a){var e=new EasyZip;e.zipFolder(d,function(){c.setHeader("Content-Disposition",'attachment; filename\x3d"'+r.single(d)+'.zip"');e.writeToResponse(c,r.single(d)+".zip");c.end()})}else c.setHeader("Content-Type",a),b.readFile(d,function(a,b){a?c.end():(c.setHeader("Content-Length",b.length),c.setHeader("Content-Disposition",'attachment; filename\x3d"'+r.single(d)+
'"'),c.end(b))})})});p.use(a["static"](s["static"]));p.get("/",function(a,c){c.setHeader("Content-Type","text/html");b.readFile(s["static"]+"/index.html",function(a,b){a?c.end(a):c.end(b)})});u.listen(s.port);p=e.listen(u);p.set("log level",0);sessionSockets=new f(p,t,d);sessionSockets.on("connection",function(a,b,c){a?b&&b.emit("tryagain"):x.newConnection(b,c)})})});
//@ sourceMappingURL=server.js.map