//>>built
require({cache:{"dojo/node":function(){define(["./has"],function(b){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,b,c){if(!b.nodeRequire)throw Error("Cannot find native require function");b=b.nodeRequire;var a=define,f;define=void 0;try{f=b(d)}finally{define=a}c(f)},normalize:function(b,g){if("."===b.charAt(0)){var c=require.toUrl(g(".")).replace("/",d.sep),a=b.split("/");
a.unshift(c);b=d.join.apply(d,a)}return b}}})},"main/remoteCaller":function(){define(["dojo/_base/declare","dojo/Deferred","dojo/json"],function(b,d,e){return new (b([],{classes:{},call:function(b,c){for(var a={declaredClass:b,fName:c,args:[]},f=2;f<arguments.length;)a.args.push(arguments[f]),++f;var h=new d;require(["dojo/request/xhr"],function(c){c("/apicall",{data:e.stringify(a),method:"PUT",handleAs:"json",headers:{"Content-Type":"application/json"}}).then(function(a){h.resolve(a.result)},function(a){h.reject(a)})});
return h},add:function(b){this.classes[b.declaredClass]=b},serverCall:function(b){var c=[];b.args&&(c=b.args);var a=this.classes[b.declaredClass];return a[b.fName].apply(a,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(b,d,e,g,c,a,f,h,k,m){var l;return l=new (b("treeItems",[d],{remoteFunctions:{getRootDef:!0,
getChildrenDef:!0,getItemDef:!0},getRootDef:function(){return l.getItemDef("")},getItemDef:function(c){var f=new e,b={id:c,name:""===c?a.single(g.dir):a.single(c)};m.dirsDef(k.fileName(c)).then(function(a){b.hasChildren=!!a;f.resolve(b)});return f},getChildrenDef:function(a){var b=new e;m.dirsDef(g.dir+a).then(function(a){if(a){var t=[];f.allDone(c.map(a,function(a){return l.getItemDef(k.reduceName(a)).then(h.hitch(t,"push"))})).then(function(){b.resolve(t)},function(){})}else b.resolve()});return b}}))})},
"main/_RemoteCall":function(){define(["dojo/_base/declare","dojo/has","main/remoteCaller","dojo/_base/lang"],function(b,d,e,g){return b("_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(b,d,e,g,c,a,f){var h;return h=new (b("Config",[a],{remoteFunctions:{loadClientConfig:!0,clientSetConfig:!0},clientConfig:{theme:!0,
terminal:!0,debug:!0,restart:!0},saveable:{theme:!0},constructor:function(){e.mixin(this,c);this.config=c},set:function(a,f){try{this.config[a]=f,this.saveable[a]&&c.set(a,f),c[a]=f}catch(b){}},set2:function(a,f){try{this.config[a]=f,this.saveable[a]&&c.set(a,f),c[a]=f}catch(b){}},clientSetConfig:function(a,c){var b=new f;this.clientConfig[a]&&this.set2(a,c);b.resolve();return b},get:function(a){var c=new f;c.resolve(this.config[a]);return c},load:function(a,c,f){f(h)},loadClientConfig:function(){var a=
new f,b={},d;for(d in this.clientConfig)b[d]=c[d];a.resolve(b);return a}}))})},"main/config/load":function(){define(["dojo/_base/declare","dojo/_base/config","dojo/_base/lang","dojo/has"],function(b,d,e,g){return{load:function(c,a,f){var b=d.nodeMirrorNodeModule,k=b.getConfig();k.dir||(k.dir=b.getProcessDir());a(["dojo/node!runtime-configuration"],function(a){var b=a(c,{port:3E3,theme:"monokai"},function(a,c){a||(e.mixin(k,c),k.set=function(a,c){b.set(a,c);b.save("ini")},"win32"==process.platform&&
(k.restart=!1),f(k))})})}}})},"sol/fileName":function(){define(["dojo/_base/declare","dojo/_base/array","dojo/_base/lang"],function(b,d,e,g){return new (b("File",[],{single:function(c){c=c.split("/");return c[c.length-1]},dir:function(c){c=c.split("/");for(var a="",b=0,b=0;b<c.length-1;++b)a+=c[b],a+="/";return a}}))})},"sol/promise":function(){define(["dojo/_base/declare","dojo/Deferred","dojo/_base/array","dojo/promise/all","dojo/_base/lang"],function(b,d,e,g,c){return new (b("SolPromise",[],{_isPromise:function(a){return a&&
"function"===typeof a.then},_parseParameter:function(a){var c,b;a instanceof Array?b=a:a&&"object"===typeof a&&(c=a);if(c){b=[];for(var d in c)Object.hasOwnProperty.call(c,d)&&this._isPromise(c[d])&&b.push(c[d])}if(b)return b},allDone:function(a){ar=this._parseParameter(a);if(!ar||!ar.length)return(new d).resolve(a);var c=new d,b=ar.length,k=function(){0===--b&&c.resolve(a)};e.forEach(ar,function(a,c){a.then(k,k)});return c.promise}}))})},"dojo/promise/all":function(){define(["../_base/array","../Deferred",
"../when"],function(b,d,e){var g=b.some;return function(c){var a,b;c instanceof Array?b=c:c&&"object"===typeof c&&(a=c);var h,k=[];if(a){b=[];for(var m in a)Object.hasOwnProperty.call(a,m)&&(k.push(m),b.push(a[m]));h={}}else b&&(h=[]);if(!b||!b.length)return(new d).resolve(h);var l=new d;l.promise.always(function(){h=k=null});var p=b.length;g(b,function(c,b){a||k.push(b);e(c,function(a){l.isFulfilled()||(h[k[b]]=a,0===--p&&l.resolve(h))},l.reject);return l.isFulfilled()});return l.promise}})},"main/nameTranslator":function(){define(["dojo/_base/declare",
"main/config","dojo/has"],function(b,d,e){var g=0,c,g=d.dir.length;if("win32"==process.platform||"win64"==process.platform)c=!0;return new (b("NameTranslator",[],{reduceName:function(a){return c?a.substr(g).replace("\\","/"):a.substr(g)},fileName:function(a){return c?d.dir+a.replace("/","\\"):d.dir+a}}))})},"main/serverOnly":function(){define(["dojo/has"],function(b){return{load:function(b,e,g){e([b],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(b,d,e,g,c,a,f,h,k,m){var l={".pl":"application/promiseLand",".pegjs":"application/peg.js",".less":"text/x-less"},p={".pl":"application/promiseLand",".pegjs":"application/peg.js",".less":"text/x-less"},q;return q=new (b("File",[],{remoteFunctions:{},dirsDef:function(a){var c=new d;e.stat(a,function(b,d){b||!d.isDirectory()?c.resolve():e.readdir(a,function(b,d){if(b)c.resolve();else{var e=[];f.allDone(g.map(d,function(c){filename=a+"/"+c;return q.isDirDef(filename).then(function(a){e.push(a)})})).then(function(){c.resolve(e)})}})});
return c.promise},childrenDef:function(a){var c=new d;q.isDirDef(a).then(function(){e.readdir(a,function(b,f){b?c.resolve():c.resolve(g.map(f,function(c){return a+"/"+c}))})},function(){c.resolve()});return c.promise},isDirDef:function(a){var c=new d;e.stat(a,function(b,f){b||f.isDirectory()&&c.resolve(a);c.reject(a)});return c.promise},contentTypeDef:function(a){var c=new d;h(a,function(b,f){b?c.reject(b):e.stat(a,function(b,d){try{if(b)c.reject(b);else{var e=!1;!d.isDirectory()&&0===d.size&&(e=
!0);"inode/x-empty"==f&&(e=!0);var h;if("text/plain"==f||e){for(h in l)if(a.substr(a.length-h.length)==h){f=l[h];c.resolve(f);return}f=k.lookup(a)}else if(m.startsWith(f,"text/"))for(h in p)if(m.endsWith(a,h)){f=l[h];c.resolve(f);return}c.resolve(f)}}catch(q){}})});return c.promise},readTextDef:function(a){var c=new d;e.readFile(a,{encoding:"utf8"},function(a,b){"object"==typeof b?c.resolve(b.toString()):"string"==typeof b?c.resolve(b):c.resolve("file could not be read")});return c.promise},createFileDef:function(a){var c=
new d;e.open(a,"a",void 0,function(a,b){a?c.reject(a):b?e.close(b,function(){c.resolve()}):c.resolve()});return c.promise},createDirDef:function(a){var c=new d;e.mkdir(a,void 0,function(b){b?c.reject(b):c.resolve(a)});return c.promise},writeTextDef:function(a,c){var b=new d;e.writeFile(a,c,{encoding:"utf8"},function(a,c){b.resolve()});return b.promise}}))})},"sol/string":function(){define([],function(){return{endsWith:function(b,d){return b.substr(b.length-d.length)==d?!0:!1},startsWith:function(b,
d){return b.substr(0,d.length)==d?!0:!1},cutEnd:function(b,d){return b.substr(0,b.length-d)},cutStart:function(b,d){return b.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(b,d,e,g,c,a,f,h,k,m,l){return new (b("ContentIO",[d],{remoteFunctions:{getContentDef:!0},getContentDef:function(a){var c=
new e,b=f.hitch(c,"reject"),d=h.fileName(a.id);m.contentTypeDef(d).then(function(f){a.contentType=f;l.findModulePs(a).then(function(f){try{f.getContentPs(a).then(function(b){c.resolve({content:b,par:a,moduleId:f.getModuleId()})},b)}catch(d){b()}},b)});return c}}))})},"main/modules":function(){define([],function(){return"modules/Binary modules/Directory modules/Text modules/Html modules/JavaScript modules/Less".split(" ")})},"main/moduleLoader":function(){define("main/modules dojo/_base/array dojo/Deferred dojo/_base/declare main/_RemoteCall dojo/_base/lang".split(" "),
function(b,d,e,g,c,a){moduleLoader=new (g([],{modules:[],namedModules:{},register:function(a,c){this.modules.push(a);this.namedModules[c]=a},getModule:function(a){return this.namedModules[a]},findModulePs:function(c){var b=new e,d=this.modules.length;if(c.force)try{var g=this.getModule(c.force);if(g)return b.resolve(g),b}catch(l){}var p;p=a.hitch(this,function(){if(d){--d;var a;try{a=this.modules[d],a.isCompetentPs(c).then(function(){b.resolve(a)},p)}catch(e){p()}}else b.reject()});p();return b}}));
return{load:function(a,e,k){e(b,function(){d.forEach(arguments,function(a,f){var d=b[f],e=new (g(d,[c,a],{buildRendering:function(){}}));e.ModuleClass=a;e.moduleId=d;moduleLoader.register(e,d)});k(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(b,d,e,g,c,a,f,h){return new (b("NodeControl",[d],{remoteFunctions:{restartDef:!0},restartDef:function(){var a=
new e;setTimeout(function(){g.restartableObj&&g.restartableObj.isRestartable&&g.restartableObj.restart()},10);a.resolve({});return a.promise}}))})},"sol/node/npm":function(){define(["dojo/node!npm","dojo/_base/declare","dojo/Deferred","dojo/_base/lang"],function(b,d,e,g){var c=new e;b.load(function(a){a?c.reject(a):c.resolve(b)});return{load:function(a){var b=new e;a.onLoad&&b.then(a.onLoad);a.onError&&b.then(void 0,a.onError);try{require(["dojo/node!"+a.name],function(a){b.resolve(a)})}catch(d){c.then(function(c){if(a.onInstall)try{a.onInstall(a)}catch(d){}c.commands.install([a.name],
function(a,c){if(a)b.reject(a);else try{var d=process.cwd()+"/"+c[0][1];require(["dojo/node!"+d],function(a){b.resolve(a)})}catch(e){b.reject(e)}})})}return b}}})},"sol/node/debug/Protocol":function(){define(["dojo/_base/declare","dojo/json","dojo/Deferred","dojo/_base/lang"],function(b,d,e,g){return b([],{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"),a,b;for(a=0;a<c.length;++a)if(b=c[a].indexOf(":"),-1<b){var d=c[a].substr(0,b);b=c[a].substr(b+(" "==c[a][b+1]?2:1));this.head[d]=b}},_newMsg:function(c){if(this._events._message)for(var a=0;a<this._events._message.length;++a)try{this._events._message[a](c)}catch(b){}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 a=0;a<this._events[c.event].length;++a)try{this._events[c.event][a](c.body)}catch(b){}},on:function(c,a){this._events[c]||(this._events[c]=[]);this._events[c].push(a)},_data:function(c){if(this._events.data)for(var a=0;a<this._events.data.length;++a)try{this._events.data[a](c)}catch(b){}},_handleResponse:function(c){if(this._responseHandler[c.command])this._responseHandler[c.command](c)},_expectResponse:function(c){var a=
new e;this._responseHandler[c.command]=g.hitch(this,function(b){delete this._responseHandler[c.command];a.resolve(b.body)});return a.promise},getSource:function(c){var a=new e,b="";c={seq:this.seq++,type:"request",command:"scripts",arguments:{ids:[c.id],includeSource:!0}};b="Content-Length: ";c=d.stringify(c);b+=c.length;b=b+"\r\n\r\n"+c;this._data(b);this._expectResponse({command:"scripts"}).then(function(b){a.resolve({id:b[0].id,name:b[0].name,source:b[0].source})});return a},_commmand:function(b,
a){var f=new e,h="",g={seq:this.seq++,type:"request",command:b};a&&(g.arguments=a);h="Content-Length: ";g=d.stringify(g);h+=g.length;h=h+"\r\n\r\n"+g;this._data(h);this._expectResponse({command:b}).then(function(a){f.resolve(a)});return f},cont:function(b){var a=new e;this._commmand("continue",b.step?{stepaction:b.step}:void 0).then(function(b){a.resolve(b)});return a}})})},"term/server":function(){define(["dojo/Deferred","main/config","sol/node/npm","dojo/node!../../../lib/terminal.js"],function(b,
d,e,g){var c;return{connections:[],newConnection:function(a){this.connections.push(a);a.on("openterminal",function(f,h){if(!1===d.terminal)h({});else{var k=new b;c||"win32"==process.platform?k.resolve(c):e.load({name:"pty.js",onInstall:function(){a.emit("terminal_meta",{event:"install"})},onError:function(b){a.emit("terminal_meta",{event:"installerror"});k.reject()},onLoad:function(a){g.setPty(a);c=a;k.resolve(a)}});k.then(function(){g.newTerminal(function(b){var c="term"+b.id;h({termid:c});b.onData=
function(b){a.emit(c,b)};a.on(c,function(a){b.write(a)});a.on(c+"_resize",function(a){try{b.resize(a.x,a.y)}catch(c){}});a.emit(c+"_meta",{event:"ready"})})})}})}}})},"main/codemirror/subtypes":function(){define(["./meta","dojo/_base/array"],function(b,d){var e={};d.forEach(b,function(b){e[b.mime.split("/")[1]]=!0});return e})},"main/codemirror/meta":function(){(function(b,d){if("function"==typeof define)define(b,d);else{for(var e=[],g=0,g=0;g<b.length;++g)e.push(require(b[g]));module.exports=d.apply(void 0,
e)}})(["main/codemirror/fake"],function(b){b.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 b.modeInfo})},"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(b,d,e,g,c,a,f,h,k,m,l,p,q,r){var t={"peg.js":!0,"x-empty":!0},n={"inode/x-empty":!0};return b([d],{"class":"content text",saveButton:!0,reloadButton:!0,downloadButton:!0,binaryModeButton:!0,isCompetentPs:function(a){var b=this.def(),c=!1;m.startsWith(a.contentType,"text/")&&(c=!0);if(!c&&m.startsWith(a.contentType,"application/")){var d=a.contentType.split("/")[1];if(k[d]||t[d])c=!0}c||n[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 b=this.inherited(arguments);this.themeSelect=this.ownObj(new q({options:a.map(p,function(a){return{label:a,value:a}}),onChange:f.hitch(this,"changeTheme")}));
this.menu.addChild(this.themeSelect);this.mirror=this.ownObj(new l({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 b},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(b,
d,e,g,c){return b([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(b,d){var e=d([],{});return{load:function(b,c,a){a(e)}}})},"modules/base/Base":function(){define(["dojo/_base/declare","dojo/Deferred","main/_RemoteCall","main/nameTranslator","dojo/_base/lang"],function(b,d,e,g,c){e={getContentPs:!0,saveContentPs:!0};b=b([],{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,b){var c=this.def();c.reject();return c},getWidgetClassPs:function(a){a=this.def();a.resolve(this.WidgetClass||this.ModuleClass);return a},createWidgetPs:function(a){var b=this.def();this.getWidgetClassPs(a).then(c.hitch(this,function(d){if(d){var e={createWidgetPs:c.hitch(this,"createWidgetPs"),isCompetentPs:c.hitch(this,"isCompetentPs"),
getContentPs:c.hitch(this,"getContentPs"),saveContentPs:c.hitch(this,"saveContentPs"),moduleId:this.getModuleId()},g;for(g in this.remoteFunctions)e[g]=c.hitch(this,g);b.resolve(new d(c.mixin(e,a)))}else b.reject()}));return b},getFileName:function(a){return g.fileName(a)},getModuleId:function(){return this.moduleId}});b.remoteFunctions=e;return b})},"main/clientOnly":function(){define(["dojo/has"],function(b){return{load:function(b,e,g){g(void 0)}}})},"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(b,d,e,g,c,a,f,h,k,m,l,p,q){return b([e],{remoteFunctions:q.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(b){var c=this.def();b=this.getFileName(b.id);k.childrenDef(b).then(function(b){var d={children:[]};a.allDone(f.map(b,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=q.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 p({label:"new Directory",showLabel:!0,onClick:q.hitch(this,"createNew",!0),region:"left"}));this.menu.addChild(this.newDirButton);this.newButton=this.ownObj(new p({label:"new File",showLabel:!0,onClick:q.hitch(this,"createNew",!1),region:"left"}));this.menu.addChild(this.newButton);this.grid=this.ownObj(new m({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 l({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(b,d,e,g,c,a,f,h,k,m,l){return b([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 l({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);m.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 y=new Buffer(g);m.write(d,y,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 m.close(d,
function(){c.resolve()})};h()}});return c},readLinesPs:function(a,b){var c=new d,e=this.getFileName(a);m.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);m.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,l={lineNr:b.start+a,data:[]},n=0;16>n;++n)f&&(--f,l.data[n]=g[k+n]);h.push(l)}m.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(b,d,e,g,c,a,f,h,k,m,l,p,q,r,t,n,u,s){var v={less:!0,"x-less":!0},w={};return b([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 l({onClick:h.hitch(this,"test"),label:"test"}));this.menu.addChild(this.testBtn);
this.referenceBtn=this.ownObj(new l({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),n.set(this.referenceFrame.domNode,"height","0px"),n.set(this.referenceFrame.domNode,"border","0px"),n.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 m({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 p.Parser({paths:[this.getFileName(q.dir(a.id))],filename:q.single(a.id)})).parse(b,function(a,b){a?c.resolve("error"):c.resolve(b.toCSS())});return c},saveContentPs:function(b,c){var d=this.inherited(arguments),e=this.def();try{var f=this.getFileName(b.id);k.endsWith(f,".less")&&(f=f.substr(0,f.length-5));f+=".css";this.testPs(b,c.text).then(function(a){r.writeTextDef(f,
a).then(function(){e.resolve()})})}catch(g){}return a.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(b,d,e,g,c,a,f,h,k,m){var l={html:!0},p={};return b([d],{"class":"content text html",isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];l[d]&&(c=!0);c||p[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: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".split(" "),
function(b,d,e,g,c,a,f,h,k,m){var l={"peg.js":!0,pegjs:!0},p={};return b([d],{"class":"content text pegjs",isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];l[d]&&(c=!0);c||p[a.contentType]&&(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.parseBtn=this.ownObj(new m({onClick:f.hitch(this,"parse"),label:"parse"}));this.menu.addChild(this.parseBtn);return a},parse:function(){this.parser||(this.parser=this.ownObj(new k({parent:this})),
this.addChild(this.parser),this.mirror.on("change",f.hitch(this,function(){this.parser.parserCodeChanged()})));this.parser.parse()}})})},"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(b,d,e,g,c,a,f,h,k,m){var l={javascript:!0,javaScript:!0,JavaScript:!0,Javascript:!0},p={},q=!0;return b([d],{"class":"content text javascript",
isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];l[d]&&(c=!0);c||p[a.contentType]&&(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.jshintBtn=this.ownObj(new m({onChange:f.hitch(this,function(){q=this.jshintBtn.get("checked");this.mirror.set("jshint",q)}),label:"syntax check",checked:q}));this.menu.addChild(this.jshintBtn);this.mirror.set("jshint",q);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(b,d,e,g,c,a,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".split(" "),function(c,d,k,q,r,t,n,
u,s,v,w,z,A,x){EasyZip=u.EasyZip;n=b();u=g.createServer(n);s.username&&n.use(b.basicAuth(s.username,s.password));d=b.cookieParser("my session secret");t=new h.middleware.session.MemoryStore;n.use(d);n.use(b.session({store:t,cookie:{path:"/",httpOnly:!0,maxAge:null}}));n.use(b.bodyParser());n.put("/apicall",function(a,b){try{c.serverCall(a.body).then(function(a){b.send({result:a})})}catch(d){b.close()}});n.put("/reconnect",function(a,b){b.setHeader("Content-Type","application/json");b.send({reconnected:!0})});
n.get("/download",function(b,c){var d=q.fileName(b.query.id);k.contentTypeDef(d).then(function(b){if("inode/directory"==b){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",b),a.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))})})});
n.use(b["static"](s["static"]));n.get("/",function(b,c){c.setHeader("Content-Type","text/html");a.readFile(s["static"]+"/index.html",function(a,b){a?c.end(a):c.end(b)})});u.listen(s.port);n=e.listen(u);n.set("log level",0);sessionSockets=new f(n,t,d);sessionSockets.on("connection",function(a,b,c){a?b&&b.emit("tryagain"):x.newConnection(b)})})});
//@ sourceMappingURL=server.js.map