// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.sidebar.workspace');
goog.require('cljs.core');
goog.require('lt.util.cljs');
goog.require('crate.binding');
goog.require('lt.objs.menu');
goog.require('lt.objs.files');
goog.require('lt.objs.opener');
goog.require('lt.util.dom');
goog.require('lt.objs.sidebar');
goog.require('lt.objs.context');
goog.require('lt.objs.popup');
goog.require('lt.objs.dialogs');
goog.require('lt.objs.popup');
goog.require('lt.objs.workspace');
goog.require('lt.objs.context');
goog.require('lt.objs.workspace');
goog.require('lt.util.dom');
goog.require('lt.objs.sidebar');
goog.require('clojure.string');
goog.require('lt.util.cljs');
goog.require('lt.objs.command');
goog.require('lt.objs.menu');
goog.require('lt.objs.files');
goog.require('lt.objs.opener');
goog.require('clojure.string');
goog.require('crate.binding');
goog.require('lt.object');
goog.require('lt.object');
goog.require('lt.objs.dialogs');
goog.require('lt.objs.command');
lt.objs.sidebar.workspace.files_and_folders = (function files_and_folders(path){var fs = lt.objs.workspace.files_and_folders.call(null,path);return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"files","files",1111338473),cljs.core.mapv.call(null,(function (p1__10105_SHARP_){return lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.file","lt.objs.sidebar.workspace/workspace.file",4597702653),p1__10105_SHARP_);
}),new cljs.core.Keyword(null,"files","files",1111338473).cljs$core$IFn$_invoke$arity$1(fs)),new cljs.core.Keyword(null,"folders","folders",4625622327),cljs.core.mapv.call(null,(function (p1__10106_SHARP_){return lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.folder","lt.objs.sidebar.workspace/workspace.folder",1951235275),p1__10106_SHARP_);
}),new cljs.core.Keyword(null,"folders","folders",4625622327).cljs$core$IFn$_invoke$arity$1(fs))], null);
});
lt.objs.sidebar.workspace.root_folder = (function root_folder(path){return lt.object.add_tags.call(null,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.folder","lt.objs.sidebar.workspace/workspace.folder",1951235275),path),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"workspace.folder.root","workspace.folder.root",4665807355)], null));
});
lt.objs.sidebar.workspace.root_file = (function root_file(path){return lt.object.add_tags.call(null,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.file","lt.objs.sidebar.workspace/workspace.file",4597702653),path),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"workspace.file.root","workspace.file.root",532025197)], null));
});
lt.objs.sidebar.workspace.remove_child = (function remove_child(p,child){if(cljs.core.truth_(lt.object.has_tag_QMARK_.call(null,child,new cljs.core.Keyword(null,"workspace.file","workspace.file",1768213159))))
{return lt.object.update_BANG_.call(null,p,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"files","files",1111338473)], null),(function (cur){return cljs.core.vec.call(null,cljs.core.remove.call(null,cljs.core.PersistentHashSet.fromArray([child], true),cur));
}));
} else
{return lt.object.update_BANG_.call(null,p,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"folders","folders",4625622327)], null),(function (cur){return cljs.core.vec.call(null,cljs.core.remove.call(null,cljs.core.PersistentHashSet.fromArray([child], true),cur));
}));
}
});
lt.objs.sidebar.workspace.find_by_path = (function find_by_path(path){return cljs.core.first.call(null,cljs.core.filter.call(null,(function (p1__10107_SHARP_){return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,p1__10107_SHARP_)),path);
}),lt.object.by_tag.call(null,new cljs.core.Keyword(null,"tree-item","tree-item",999403348))));
});
lt.objs.sidebar.workspace.__BEH__add_ws_folder = (function __BEH__add_ws_folder(this$,path){return lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"add.folder!","add.folder!",2151595160),path);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","add-ws-folder","lt.objs.sidebar.workspace/add-ws-folder",3077183263),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__add_ws_folder,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"workspace.add.folder!","workspace.add.folder!",1443047615),null], null), null));
lt.objs.sidebar.workspace.__BEH__add_ws_file = (function __BEH__add_ws_file(this$,path){lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"add.file!","add.file!",4237252106),path);
return lt.object.raise.call(null,cljs.core.first.call(null,lt.object.by_tag.call(null,new cljs.core.Keyword(null,"opener","opener",4298292201))),new cljs.core.Keyword(null,"open!","open!",1119852169),path);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","add-ws-file","lt.objs.sidebar.workspace/add-ws-file",3890882145),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__add_ws_file,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"workspace.add.file!","workspace.add.file!",821993457),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_open_ls = (function __BEH__on_open_ls(this$){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"open?","open?",1119852199),true], null));
if(cljs.core.truth_(new cljs.core.Keyword(null,"realized?","realized?",4433874243).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{return null;
} else
{lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"realized?","realized?",4433874243),true], null));
lt.object.merge_BANG_.call(null,this$,lt.objs.sidebar.workspace.files_and_folders.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))));
var folder = lt.util.dom.$.call(null,new cljs.core.Keyword(null,"ul","ul",1013907977),lt.object.__GT_content.call(null,this$));var width = lt.util.dom.scroll_width.call(null,folder);var seq__10112 = cljs.core.seq.call(null,lt.util.dom.children.call(null,folder));var chunk__10113 = null;var count__10114 = 0;var i__10115 = 0;while(true){
if((i__10115 < count__10114))
{var child = cljs.core._nth.call(null,chunk__10113,i__10115);lt.util.dom.css.call(null,child,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),width], null));
{
var G__10116 = seq__10112;
var G__10117 = chunk__10113;
var G__10118 = count__10114;
var G__10119 = (i__10115 + 1);
seq__10112 = G__10116;
chunk__10113 = G__10117;
count__10114 = G__10118;
i__10115 = G__10119;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__10112);if(temp__4092__auto__)
{var seq__10112__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10112__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__10112__$1);{
var G__10120 = cljs.core.chunk_rest.call(null,seq__10112__$1);
var G__10121 = c__4262__auto__;
var G__10122 = cljs.core.count.call(null,c__4262__auto__);
var G__10123 = 0;
seq__10112 = G__10120;
chunk__10113 = G__10121;
count__10114 = G__10122;
i__10115 = G__10123;
continue;
}
} else
{var child = cljs.core.first.call(null,seq__10112__$1);lt.util.dom.css.call(null,child,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),width], null));
{
var G__10124 = cljs.core.next.call(null,seq__10112__$1);
var G__10125 = null;
var G__10126 = 0;
var G__10127 = 0;
seq__10112 = G__10124;
chunk__10113 = G__10125;
count__10114 = G__10126;
i__10115 = G__10127;
continue;
}
}
} else
{return null;
}
}
break;
}
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-open-ls","lt.objs.sidebar.workspace/on-open-ls",636886726),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_open_ls,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"open!","open!",1119852169),null], null), null));
lt.objs.sidebar.workspace.__BEH__refresh = (function __BEH__refresh(this$){var seq__10132_10136 = cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.Keyword(null,"files","files",1111338473).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.Keyword(null,"folders","folders",4625622327).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))));var chunk__10133_10137 = null;var count__10134_10138 = 0;var i__10135_10139 = 0;while(true){
if((i__10135_10139 < count__10134_10138))
{var f_10140 = cljs.core._nth.call(null,chunk__10133_10137,i__10135_10139);lt.object.destroy_BANG_.call(null,f_10140);
{
var G__10141 = seq__10132_10136;
var G__10142 = chunk__10133_10137;
var G__10143 = count__10134_10138;
var G__10144 = (i__10135_10139 + 1);
seq__10132_10136 = G__10141;
chunk__10133_10137 = G__10142;
count__10134_10138 = G__10143;
i__10135_10139 = G__10144;
continue;
}
} else
{var temp__4092__auto___10145 = cljs.core.seq.call(null,seq__10132_10136);if(temp__4092__auto___10145)
{var seq__10132_10146__$1 = temp__4092__auto___10145;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10132_10146__$1))
{var c__4262__auto___10147 = cljs.core.chunk_first.call(null,seq__10132_10146__$1);{
var G__10148 = cljs.core.chunk_rest.call(null,seq__10132_10146__$1);
var G__10149 = c__4262__auto___10147;
var G__10150 = cljs.core.count.call(null,c__4262__auto___10147);
var G__10151 = 0;
seq__10132_10136 = G__10148;
chunk__10133_10137 = G__10149;
count__10134_10138 = G__10150;
i__10135_10139 = G__10151;
continue;
}
} else
{var f_10152 = cljs.core.first.call(null,seq__10132_10146__$1);lt.object.destroy_BANG_.call(null,f_10152);
{
var G__10153 = cljs.core.next.call(null,seq__10132_10146__$1);
var G__10154 = null;
var G__10155 = 0;
var G__10156 = 0;
seq__10132_10136 = G__10153;
chunk__10133_10137 = G__10154;
count__10134_10138 = G__10155;
i__10135_10139 = G__10156;
continue;
}
}
} else
{}
}
break;
}
lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"refresh","refresh",2099349069),new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
return lt.object.merge_BANG_.call(null,this$,lt.objs.sidebar.workspace.files_and_folders.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","refresh","lt.objs.sidebar.workspace/refresh",4526611623),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__refresh,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"refresh!","refresh!",4597922840),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_close = (function __BEH__on_close(this$){return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"open?","open?",1119852199),false], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-close","lt.objs.sidebar.workspace/on-close",2768332408),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_close,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"close!","close!",3951350939),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_open_file = (function __BEH__on_open_file(this$){return lt.object.raise.call(null,lt.objs.opener.opener,new cljs.core.Keyword(null,"open!","open!",1119852169),new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-open-file","lt.objs.sidebar.workspace/on-open-file",535182993),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_open_file,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"open!","open!",1119852169),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_remove = (function __BEH__on_remove(this$,item){if(cljs.core.truth_(lt.object.has_tag_QMARK_.call(null,item,new cljs.core.Keyword(null,"workspace.folder","workspace.folder",4355811161))))
{return lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"remove.folder!","remove.folder!",1531423099),new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,item)));
} else
{return lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"remove.file!","remove.file!",3382976429),new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,item)));
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-remove","lt.objs.sidebar.workspace/on-remove",3327022336),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_remove,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"remove!","remove!",2105740175),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_clear = (function __BEH__on_clear(this$){return lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"clear!","clear!",3951036134));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-clear","lt.objs.sidebar.workspace/on-clear",2768322211),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_clear,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"clear!","clear!",3951036134),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_ws_add = (function __BEH__on_ws_add(ws,f){if(cljs.core.truth_(lt.objs.files.file_QMARK_.call(null,f)))
{return lt.object.update_BANG_.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"files","files",1111338473)], null),cljs.core.conj,lt.objs.sidebar.workspace.root_file.call(null,f));
} else
{return lt.object.update_BANG_.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"folders","folders",4625622327)], null),cljs.core.conj,lt.objs.sidebar.workspace.root_folder.call(null,f));
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-ws-add","lt.objs.sidebar.workspace/on-ws-add",2946370468),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_ws_add,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"add","add",1014000659),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_ws_remove = (function __BEH__on_ws_remove(ws,f){var item = lt.objs.sidebar.workspace.find_by_path.call(null,f);if(cljs.core.truth_(lt.objs.files.file_QMARK_.call(null,f)))
{lt.object.update_BANG_.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"files","files",1111338473)], null),(function (cur){return cljs.core.vec.call(null,cljs.core.remove.call(null,cljs.core.PersistentHashSet.fromArray([item], true),cur));
}));
} else
{lt.object.update_BANG_.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"folders","folders",4625622327)], null),(function (cur){return cljs.core.vec.call(null,cljs.core.remove.call(null,cljs.core.PersistentHashSet.fromArray([item], true),cur));
}));
}
return lt.object.destroy_BANG_.call(null,item);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-ws-remove","lt.objs.sidebar.workspace/on-ws-remove",3507655435),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_ws_remove,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"remove","remove",4374260726),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_ws_set = (function __BEH__on_ws_set(ws){var map__10158 = cljs.core.deref.call(null,ws);var map__10158__$1 = ((cljs.core.seq_QMARK_.call(null,map__10158))?cljs.core.apply.call(null,cljs.core.hash_map,map__10158):map__10158);var files = cljs.core.get.call(null,map__10158__$1,new cljs.core.Keyword(null,"files","files",1111338473));var folders = cljs.core.get.call(null,map__10158__$1,new cljs.core.Keyword(null,"folders","folders",4625622327));return lt.object.merge_BANG_.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"files","files",1111338473),cljs.core.mapv.call(null,lt.objs.sidebar.workspace.root_file,files),new cljs.core.Keyword(null,"folders","folders",4625622327),cljs.core.mapv.call(null,lt.objs.sidebar.workspace.root_folder,folders),new cljs.core.Keyword(null,"open-dirs","open-dirs",2513590939),cljs.core.PersistentHashSet.EMPTY], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-ws-set","lt.objs.sidebar.workspace/on-ws-set",2946355043),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_ws_set,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"set","set",1014018004),null], null), null));
lt.objs.sidebar.workspace.__BEH__track_and_watch_open_dirs = (function __BEH__track_and_watch_open_dirs(this$){lt.objs.workspace.watch_BANG_.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
return lt.object.update_BANG_.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"open-dirs","open-dirs",2513590939)], null),cljs.core.conj,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","track-and-watch-open-dirs","lt.objs.sidebar.workspace/track-and-watch-open-dirs",3304823039),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__track_and_watch_open_dirs,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"open!","open!",1119852169),null], null), null));
lt.objs.sidebar.workspace.__BEH__untrack_closed_dirs = (function __BEH__untrack_closed_dirs(this$){return lt.object.update_BANG_.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"open-dirs","open-dirs",2513590939)], null),cljs.core.disj,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","untrack-closed-dirs","lt.objs.sidebar.workspace/untrack-closed-dirs",3049036598),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__untrack_closed_dirs,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"close!","close!",3951350939),null], null), null));
lt.objs.sidebar.workspace.__BEH__watch_open_dirs_paths = (function __BEH__watch_open_dirs_paths(this$,cur){return cljs.core.concat.call(null,cur,new cljs.core.Keyword(null,"open-dirs","open-dirs",2513590939).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.sidebar.workspace.tree)));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","watch-open-dirs-paths","lt.objs.sidebar.workspace/watch-open-dirs-paths",4677839158),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__watch_open_dirs_paths,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watch-paths+","watch-paths+",2265407277),null], null), null));
lt.objs.sidebar.workspace.__BEH__watched__DOT__delete = (function __BEH__watched__DOT__delete(ws,path){var temp__4092__auto__ = lt.objs.sidebar.workspace.find_by_path.call(null,path);if(cljs.core.truth_(temp__4092__auto__))
{var child = temp__4092__auto__;var temp__4092__auto___10159__$1 = lt.objs.sidebar.workspace.find_by_path.call(null,lt.objs.files.parent.call(null,path));if(cljs.core.truth_(temp__4092__auto___10159__$1))
{var p_10160 = temp__4092__auto___10159__$1;lt.objs.sidebar.workspace.remove_child.call(null,p_10160,child);
} else
{}
return lt.object.destroy_BANG_.call(null,child);
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","watched.delete","lt.objs.sidebar.workspace/watched.delete",3594533591),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__watched__DOT__delete,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watched.delete","watched.delete",766354781),null], null), null));
lt.objs.sidebar.workspace.__BEH__watched__DOT__create = (function __BEH__watched__DOT__create(ws,path){if(cljs.core.truth_((function (){var and__3508__auto__ = lt.objs.sidebar.workspace.find_by_path.call(null,path);if(cljs.core.truth_(and__3508__auto__))
{return cljs.core.not.call(null,cljs.core.re_seq.call(null,lt.objs.files.ignore_pattern,lt.objs.files.basename.call(null,path)));
} else
{return and__3508__auto__;
}
})()))
{return null;
} else
{var temp__4092__auto__ = lt.objs.sidebar.workspace.find_by_path.call(null,lt.objs.files.parent.call(null,path));if(cljs.core.truth_(temp__4092__auto__))
{var parent = temp__4092__auto__;if(cljs.core.truth_(new cljs.core.Keyword(null,"realized?","realized?",4433874243).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,parent))))
{if(cljs.core.truth_(lt.objs.files.dir_QMARK_.call(null,path)))
{return lt.object.update_BANG_.call(null,parent,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"folders","folders",4625622327)], null),cljs.core.conj,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.folder","lt.objs.sidebar.workspace/workspace.folder",1951235275),path));
} else
{return lt.object.update_BANG_.call(null,parent,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"files","files",1111338473)], null),cljs.core.conj,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.file","lt.objs.sidebar.workspace/workspace.file",4597702653),path));
}
} else
{return null;
}
} else
{return null;
}
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","watched.create","lt.objs.sidebar.workspace/watched.create",3712177670),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__watched__DOT__create,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"watched.create","watched.create",749519022),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_drop = (function __BEH__on_drop(this$,e){var size = e.dataTransfer.files.length;var i = 0;while(true){
if((i < size))
{var path_10161 = (e.dataTransfer.files[i]).path;if(cljs.core.truth_(lt.objs.files.dir_QMARK_.call(null,path_10161)))
{lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"add.folder!","add.folder!",2151595160),path_10161);
} else
{lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"add.file!","add.file!",4237252106),path_10161);
}
{
var G__10162 = (i + 1);
i = G__10162;
continue;
}
} else
{return null;
}
break;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-drop","lt.objs.sidebar.workspace/on-drop",2605653733),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_drop,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"drop","drop",1016996449),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_menu = (function __BEH__on_menu(this$,e){var items = cljs.core.sort_by.call(null,new cljs.core.Keyword(null,"order","order",1119910592),lt.object.raise_reduce.call(null,this$,new cljs.core.Keyword(null,"menu-items","menu-items",3782623556),cljs.core.PersistentVector.EMPTY));return lt.objs.menu.show_menu.call(null,lt.objs.menu.menu.call(null,items));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-menu","lt.objs.sidebar.workspace/on-menu",2605385333),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"menu!","menu!",1117686292),null], null), null));
lt.objs.sidebar.workspace.__BEH__on_root_menu = (function __BEH__on_root_menu(this$,items){return cljs.core.conj.call(null,items,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"type","type",1017479852),"separator",new cljs.core.Keyword(null,"order","order",1119910592),9], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Remove from workspace",new cljs.core.Keyword(null,"order","order",1119910592),10,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.Keyword(null,"remove!","remove!",2105740175),this$);
})], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","on-root-menu","lt.objs.sidebar.workspace/on-root-menu",2948325830),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__on_root_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"menu-items","menu-items",3782623556),null], null), null));
lt.objs.sidebar.workspace.__BEH__subfile_menu = (function __BEH__subfile_menu(this$,items){return cljs.core.conj.call(null,items,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Duplicate",new cljs.core.Keyword(null,"order","order",1119910592),1,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"duplicate!","duplicate!",3906488296));
})], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Rename",new cljs.core.Keyword(null,"order","order",1119910592),2,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"start-rename!","start-rename!",3285764522));
})], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Delete",new cljs.core.Keyword(null,"order","order",1119910592),3,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"delete!","delete!",2564367176));
})], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","subfile-menu","lt.objs.sidebar.workspace/subfile-menu",2571608754),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__subfile_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"menu-items","menu-items",3782623556),null], null), null));
lt.objs.sidebar.workspace.__BEH__subfolder_menu = (function __BEH__subfolder_menu(this$,items){return cljs.core.conj.call(null,items,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"New file",new cljs.core.Keyword(null,"order","order",1119910592),0,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"new-file!","new-file!",3612062506));
})], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Rename",new cljs.core.Keyword(null,"order","order",1119910592),2,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"start-rename!","start-rename!",3285764522));
})], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"type","type",1017479852),"separator",new cljs.core.Keyword(null,"order","order",1119910592),3], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"New folder",new cljs.core.Keyword(null,"order","order",1119910592),4,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"new-folder!","new-folder!",2639811000));
})], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Delete folder",new cljs.core.Keyword(null,"order","order",1119910592),5,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"delete!","delete!",2564367176));
})], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Refresh folder",new cljs.core.Keyword(null,"order","order",1119910592),6,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"refresh!","refresh!",4597922840));
})], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","subfolder-menu","lt.objs.sidebar.workspace/subfolder-menu",1537446372),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__subfolder_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"menu-items","menu-items",3782623556),null], null), null));
lt.objs.sidebar.workspace.__BEH__force_delete_file = (function __BEH__force_delete_file(this$){lt.objs.files.delete_BANG_.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
lt.util.dom.remove.call(null,lt.object.__GT_content.call(null,this$));
lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"watched.delete","watched.delete",766354781),new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
return lt.object.destroy_BANG_.call(null,this$);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","force-delete-file","lt.objs.sidebar.workspace/force-delete-file",1104151110),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__force_delete_file,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"force-delete!","force-delete!",2129098342),null], null), null));
lt.objs.sidebar.workspace.__BEH__delete_file = (function __BEH__delete_file(this$){return lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"header","header",4087600639),"Delete this file?",new cljs.core.Keyword(null,"body","body",1016933652),[cljs.core.str("This will delete "),cljs.core.str(new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))),cljs.core.str(" from disk and cannot be undone.")].join(''),new cljs.core.Keyword(null,"buttons","buttons",1255256819),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Delete file",new cljs.core.Keyword(null,"action","action",3885920680),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"force-delete!","force-delete!",2129098342));
})], null),lt.objs.popup.cancel_button], null)], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","delete-file","lt.objs.sidebar.workspace/delete-file",2141449508),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__delete_file,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"delete!","delete!",2564367176),null], null), null));
lt.objs.sidebar.workspace.__BEH__force_delete_folder = (function __BEH__force_delete_folder(this$){lt.objs.files.delete_BANG_.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
lt.util.dom.remove.call(null,lt.object.__GT_content.call(null,this$));
lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"watched.delete","watched.delete",766354781),new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
return lt.object.destroy_BANG_.call(null,this$);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","force-delete-folder","lt.objs.sidebar.workspace/force-delete-folder",3126323540),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__force_delete_folder,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"force-delete!","force-delete!",2129098342),null], null), null));
lt.objs.sidebar.workspace.__BEH__delete_folder = (function __BEH__delete_folder(this$){return lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"header","header",4087600639),"Delete this folder?",new cljs.core.Keyword(null,"body","body",1016933652),[cljs.core.str("This will delete "),cljs.core.str(new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))),cljs.core.str(" from disk and cannot be undone.")].join(''),new cljs.core.Keyword(null,"buttons","buttons",1255256819),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Delete folder",new cljs.core.Keyword(null,"action","action",3885920680),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"force-delete!","force-delete!",2129098342));
})], null),lt.objs.popup.cancel_button], null)], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","delete-folder","lt.objs.sidebar.workspace/delete-folder",915989682),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__delete_folder,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"delete!","delete!",2564367176),null], null), null));
lt.objs.sidebar.workspace.__BEH__new_file_BANG_ = (function __BEH__new_file_BANG_(this$){var ext = (function (){var temp__4090__auto__ = cljs.core.first.call(null,new cljs.core.Keyword(null,"files","files",1111338473).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));if(cljs.core.truth_(temp__4090__auto__))
{var ffile = temp__4090__auto__;var temp__4092__auto__ = new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ffile));if(cljs.core.truth_(temp__4092__auto__))
{var path = temp__4092__auto__;return lt.objs.files.ext.call(null,path);
} else
{return null;
}
} else
{return "txt";
}
})();var path = lt.objs.files.join.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),[cljs.core.str("untitled."),cljs.core.str(ext)].join(''));var final_path = lt.objs.files.next_available_name.call(null,path);var folder = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.file","lt.objs.sidebar.workspace/workspace.file",4597702653),final_path);lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"files","files",1111338473)], null),cljs.core.conj,folder);
lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"open?","open?",1119852199),true], null));
lt.objs.files.save.call(null,final_path,"");
lt.object.raise.call(null,lt.objs.opener.opener,new cljs.core.Keyword(null,"open!","open!",1119852169),final_path);
return lt.object.raise.call(null,folder,new cljs.core.Keyword(null,"start-rename!","start-rename!",3285764522));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","new-file!","lt.objs.sidebar.workspace/new-file!",539117946),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__new_file_BANG_,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"new-file!","new-file!",3612062506),null], null), null));
lt.objs.sidebar.workspace.__BEH__new_folder_BANG_ = (function __BEH__new_folder_BANG_(this$){var path = lt.objs.files.join.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),"NewFolder");var final_path = lt.objs.files.next_available_name.call(null,path);var folder = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.folder","lt.objs.sidebar.workspace/workspace.folder",1951235275),final_path);lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"folders","folders",4625622327)], null),cljs.core.conj,folder);
lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"open?","open?",1119852199),true], null));
lt.objs.files.mkdir.call(null,final_path);
return lt.object.raise.call(null,folder,new cljs.core.Keyword(null,"start-rename!","start-rename!",3285764522));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","new-folder!","lt.objs.sidebar.workspace/new-folder!",3994412844),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__new_folder_BANG_,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"new-folder!","new-folder!",2639811000),null], null), null));
lt.objs.sidebar.workspace.__BEH__rename_folder = (function __BEH__rename_folder(this$,n){var path = new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));var neue = lt.objs.files.join.call(null,lt.objs.files.parent.call(null,path),n);if(cljs.core._EQ_.call(null,path,neue))
{return null;
} else
{if(cljs.core.truth_((function (){var and__3508__auto__ = cljs.core.not_EQ_.call(null,clojure.string.lower_case.call(null,path),clojure.string.lower_case.call(null,neue));if(and__3508__auto__)
{return lt.objs.files.exists_QMARK_.call(null,neue);
} else
{return and__3508__auto__;
}
})()))
{return lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"header","header",4087600639),"Folder already exists.",new cljs.core.Keyword(null,"body","body",1016933652),[cljs.core.str("The folder "),cljs.core.str(neue),cljs.core.str(" already exists, you'll have to pick a different name.")].join(''),new cljs.core.Keyword(null,"buttons","buttons",1255256819),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"ok",new cljs.core.Keyword(null,"post-action","post-action",4039331701),(function (){lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"rename.cancel","rename.cancel",1388940956));
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"start-rename!","start-rename!",3285764522));
})], null)], null)], null));
} else
{var root_QMARK_ = lt.object.has_tag_QMARK_.call(null,this$,new cljs.core.Keyword(null,"workspace.folder.root","workspace.folder.root",4665807355));lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"path","path",1017337751),neue,new cljs.core.Keyword(null,"realized?","realized?",4433874243),false], null));
lt.objs.files.move_BANG_.call(null,path,neue);
lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"refresh!","refresh!",4597922840));
if(cljs.core.truth_(root_QMARK_))
{return lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"rename!","rename!",2106237973),path,neue);
} else
{return lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"watched.rename","watched.rename",1167218416),path,neue);
}
}
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","rename-folder","lt.objs.sidebar.workspace/rename-folder",3567769509),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__rename_folder,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"rename","rename",4374276784),null], null), null));
lt.objs.sidebar.workspace.__BEH__rename_file = (function __BEH__rename_file(this$,n){var path = new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));var neue = lt.objs.files.join.call(null,lt.objs.files.parent.call(null,path),n);if(cljs.core._EQ_.call(null,path,neue))
{return null;
} else
{if(cljs.core.truth_((function (){var and__3508__auto__ = cljs.core.not_EQ_.call(null,clojure.string.lower_case.call(null,path),clojure.string.lower_case.call(null,neue));if(and__3508__auto__)
{return lt.objs.files.exists_QMARK_.call(null,neue);
} else
{return and__3508__auto__;
}
})()))
{return lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"header","header",4087600639),"File already exists.",new cljs.core.Keyword(null,"body","body",1016933652),[cljs.core.str("The file"),cljs.core.str(neue),cljs.core.str(" already exists, you'll have to pick a different name.")].join(''),new cljs.core.Keyword(null,"buttons","buttons",1255256819),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"ok",new cljs.core.Keyword(null,"post-action","post-action",4039331701),(function (){lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"rename.cancel","rename.cancel",1388940956));
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"start-rename!","start-rename!",3285764522));
})], null)], null)], null));
} else
{if(cljs.core.truth_((function (){var or__3520__auto__ = lt.object.has_tag_QMARK_.call(null,this$,new cljs.core.Keyword(null,"workspace.folder.root","workspace.folder.root",4665807355));if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.object.has_tag_QMARK_.call(null,this$,new cljs.core.Keyword(null,"workspace.file.root","workspace.file.root",532025197));
}
})()))
{lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"rename!","rename!",2106237973),path,neue);
} else
{lt.object.raise.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"watched.rename","watched.rename",1167218416),path,neue);
}
lt.objs.files.move_BANG_.call(null,path,neue);
return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"path","path",1017337751),neue], null));
}
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","rename-file","lt.objs.sidebar.workspace/rename-file",3270197399),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__rename_file,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"rename","rename",4374276784),null], null), null));
lt.objs.sidebar.workspace.__BEH__start_rename = (function __BEH__start_rename(this$){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"renaming?","renaming?",2774795926),true], null));
var input = lt.util.dom.$.call(null,new cljs.core.Keyword(null,"input","input",1114262332),lt.object.__GT_content.call(null,this$));var len = cljs.core.count.call(null,lt.objs.files.without_ext.call(null,lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)))));var width = lt.util.dom.scroll_width.call(null,lt.util.dom.parent.call(null,input));lt.util.dom.css.call(null,input,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),width], null));
lt.util.dom.focus.call(null,input);
return lt.util.dom.selection.call(null,input,0,len,"forward");
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","start-rename","lt.objs.sidebar.workspace/start-rename",2390201321),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__start_rename,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"start-rename!","start-rename!",3285764522),null], null), null));
lt.objs.sidebar.workspace.__BEH__rename_focus = (function __BEH__rename_focus(this$){return lt.objs.context.in_BANG_.call(null,new cljs.core.Keyword(null,"tree.rename","tree.rename",1095020288),this$);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","rename-focus","lt.objs.sidebar.workspace/rename-focus",2321367913),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__rename_focus,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"rename.focus","rename.focus",4215768474),null], null), null));
lt.objs.sidebar.workspace.__BEH__rename_submit = (function __BEH__rename_submit(this$){var val = lt.util.dom.val.call(null,lt.util.dom.$.call(null,new cljs.core.Keyword(null,"input","input",1114262332),lt.object.__GT_content.call(null,this$)));lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"renaming?","renaming?",2774795926),false], null));
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"rename","rename",4374276784),val);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","rename-submit","lt.objs.sidebar.workspace/rename-submit",3408558955),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__rename_submit,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"rename.submit!","rename.submit!",1632100299),null], null), null));
lt.objs.sidebar.workspace.__BEH__rename_blur = (function __BEH__rename_blur(this$){lt.objs.context.out_BANG_.call(null,new cljs.core.Keyword(null,"tree.rename","tree.rename",1095020288));
if(cljs.core.truth_(new cljs.core.Keyword(null,"renaming?","renaming?",2774795926).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"rename.submit!","rename.submit!",1632100299));
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","rename-blur","lt.objs.sidebar.workspace/rename-blur",3270310748),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__rename_blur,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"rename.blur","rename.blur",839974025),null], null), null));
lt.objs.sidebar.workspace.__BEH__rename_cancel = (function __BEH__rename_cancel(this$){return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"renaming?","renaming?",2774795926),false], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","rename-cancel","lt.objs.sidebar.workspace/rename-cancel",1720510665),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__rename_cancel,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"rename.cancel!","rename.cancel!",4050107817),null], null), null));
lt.objs.sidebar.workspace.__BEH__duplicate = (function __BEH__duplicate(this$){var base_name = lt.objs.files.without_ext.call(null,lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))));var new_name = [cljs.core.str(base_name),cljs.core.str(" copy."),cljs.core.str(lt.objs.files.ext.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))].join('');var new_path = lt.objs.files.join.call(null,lt.objs.files.parent.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))),new_name);return lt.objs.files.copy.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new_path);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","duplicate","lt.objs.sidebar.workspace/duplicate",4108375543),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__duplicate,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"duplicate!","duplicate!",3906488296),null], null), null));
lt.objs.sidebar.workspace.__BEH__destroy_sub_tree = (function __BEH__destroy_sub_tree(this$){var seq__10167 = cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.Keyword(null,"files","files",1111338473).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.Keyword(null,"folders","folders",4625622327).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))));var chunk__10168 = null;var count__10169 = 0;var i__10170 = 0;while(true){
if((i__10170 < count__10169))
{var f = cljs.core._nth.call(null,chunk__10168,i__10170);lt.object.destroy_BANG_.call(null,f);
{
var G__10171 = seq__10167;
var G__10172 = chunk__10168;
var G__10173 = count__10169;
var G__10174 = (i__10170 + 1);
seq__10167 = G__10171;
chunk__10168 = G__10172;
count__10169 = G__10173;
i__10170 = G__10174;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__10167);if(temp__4092__auto__)
{var seq__10167__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10167__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__10167__$1);{
var G__10175 = cljs.core.chunk_rest.call(null,seq__10167__$1);
var G__10176 = c__4262__auto__;
var G__10177 = cljs.core.count.call(null,c__4262__auto__);
var G__10178 = 0;
seq__10167 = G__10175;
chunk__10168 = G__10176;
count__10169 = G__10177;
i__10170 = G__10178;
continue;
}
} else
{var f = cljs.core.first.call(null,seq__10167__$1);lt.object.destroy_BANG_.call(null,f);
{
var G__10179 = cljs.core.next.call(null,seq__10167__$1);
var G__10180 = null;
var G__10181 = 0;
var G__10182 = 0;
seq__10167 = G__10179;
chunk__10168 = G__10180;
count__10169 = G__10181;
i__10170 = G__10182;
continue;
}
}
} else
{return null;
}
}
break;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","destroy-sub-tree","lt.objs.sidebar.workspace/destroy-sub-tree",2888041796),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__destroy_sub_tree,new cljs.core.Keyword(null,"trigger","trigger",4248979754),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"destroy","destroy",2571277164),null], null), null));
lt.objs.sidebar.workspace.file_toggle = (function file_toggle(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p","p",1013904354),crate.binding.bound.call(null,this$,(function (){return lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
}))], null));var seq__10189_10195 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"contextmenu","contextmenu",911789824),(function (e){lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"menu!","menu!",1117686292),e);
lt.util.dom.prevent.call(null,e);
return lt.util.dom.stop_propagation.call(null,e);
}),new cljs.core.Keyword(null,"dblclick","dblclick",3463991820),(function (e){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"dblopen!","dblopen!",3475189659));
}),new cljs.core.Keyword(null,"click","click",1108654330),(function (e){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"open!","open!",1119852169));
})], null)));var chunk__10190_10196 = null;var count__10191_10197 = 0;var i__10192_10198 = 0;while(true){
if((i__10192_10198 < count__10191_10197))
{var vec__10193_10199 = cljs.core._nth.call(null,chunk__10190_10196,i__10192_10198);var ev__3326__auto___10200 = cljs.core.nth.call(null,vec__10193_10199,0,null);var func__3327__auto___10201 = cljs.core.nth.call(null,vec__10193_10199,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10200,func__3327__auto___10201);
{
var G__10202 = seq__10189_10195;
var G__10203 = chunk__10190_10196;
var G__10204 = count__10191_10197;
var G__10205 = (i__10192_10198 + 1);
seq__10189_10195 = G__10202;
chunk__10190_10196 = G__10203;
count__10191_10197 = G__10204;
i__10192_10198 = G__10205;
continue;
}
} else
{var temp__4092__auto___10206 = cljs.core.seq.call(null,seq__10189_10195);if(temp__4092__auto___10206)
{var seq__10189_10207__$1 = temp__4092__auto___10206;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10189_10207__$1))
{var c__4262__auto___10208 = cljs.core.chunk_first.call(null,seq__10189_10207__$1);{
var G__10209 = cljs.core.chunk_rest.call(null,seq__10189_10207__$1);
var G__10210 = c__4262__auto___10208;
var G__10211 = cljs.core.count.call(null,c__4262__auto___10208);
var G__10212 = 0;
seq__10189_10195 = G__10209;
chunk__10190_10196 = G__10210;
count__10191_10197 = G__10211;
i__10192_10198 = G__10212;
continue;
}
} else
{var vec__10194_10213 = cljs.core.first.call(null,seq__10189_10207__$1);var ev__3326__auto___10214 = cljs.core.nth.call(null,vec__10194_10213,0,null);var func__3327__auto___10215 = cljs.core.nth.call(null,vec__10194_10213,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10214,func__3327__auto___10215);
{
var G__10216 = cljs.core.next.call(null,seq__10189_10207__$1);
var G__10217 = null;
var G__10218 = 0;
var G__10219 = 0;
seq__10189_10195 = G__10216;
chunk__10190_10196 = G__10217;
count__10191_10197 = G__10218;
i__10192_10198 = G__10219;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.workspace.folder_toggle = (function folder_toggle(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p.folder","p.folder",3836630814),crate.binding.bound.call(null,this$,(function (){return [cljs.core.str(lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)))),cljs.core.str(lt.objs.files.separator)].join('');
}))], null));var seq__10226_10232 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"contextmenu","contextmenu",911789824),(function (e){lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"menu!","menu!",1117686292),e);
lt.util.dom.prevent.call(null,e);
return lt.util.dom.stop_propagation.call(null,e);
}),new cljs.core.Keyword(null,"click","click",1108654330),(function (){if(cljs.core.not.call(null,new cljs.core.Keyword(null,"open?","open?",1119852199).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"open!","open!",1119852169));
} else
{return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"close!","close!",3951350939));
}
})], null)));var chunk__10227_10233 = null;var count__10228_10234 = 0;var i__10229_10235 = 0;while(true){
if((i__10229_10235 < count__10228_10234))
{var vec__10230_10236 = cljs.core._nth.call(null,chunk__10227_10233,i__10229_10235);var ev__3326__auto___10237 = cljs.core.nth.call(null,vec__10230_10236,0,null);var func__3327__auto___10238 = cljs.core.nth.call(null,vec__10230_10236,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10237,func__3327__auto___10238);
{
var G__10239 = seq__10226_10232;
var G__10240 = chunk__10227_10233;
var G__10241 = count__10228_10234;
var G__10242 = (i__10229_10235 + 1);
seq__10226_10232 = G__10239;
chunk__10227_10233 = G__10240;
count__10228_10234 = G__10241;
i__10229_10235 = G__10242;
continue;
}
} else
{var temp__4092__auto___10243 = cljs.core.seq.call(null,seq__10226_10232);if(temp__4092__auto___10243)
{var seq__10226_10244__$1 = temp__4092__auto___10243;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10226_10244__$1))
{var c__4262__auto___10245 = cljs.core.chunk_first.call(null,seq__10226_10244__$1);{
var G__10246 = cljs.core.chunk_rest.call(null,seq__10226_10244__$1);
var G__10247 = c__4262__auto___10245;
var G__10248 = cljs.core.count.call(null,c__4262__auto___10245);
var G__10249 = 0;
seq__10226_10232 = G__10246;
chunk__10227_10233 = G__10247;
count__10228_10234 = G__10248;
i__10229_10235 = G__10249;
continue;
}
} else
{var vec__10231_10250 = cljs.core.first.call(null,seq__10226_10244__$1);var ev__3326__auto___10251 = cljs.core.nth.call(null,vec__10231_10250,0,null);var func__3327__auto___10252 = cljs.core.nth.call(null,vec__10231_10250,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10251,func__3327__auto___10252);
{
var G__10253 = cljs.core.next.call(null,seq__10226_10244__$1);
var G__10254 = null;
var G__10255 = 0;
var G__10256 = 0;
seq__10226_10232 = G__10253;
chunk__10227_10233 = G__10254;
count__10228_10234 = G__10255;
i__10229_10235 = G__10256;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.workspace.sub_folders = (function sub_folders(p__10259){var map__10275 = p__10259;var map__10275__$1 = ((cljs.core.seq_QMARK_.call(null,map__10275))?cljs.core.apply.call(null,cljs.core.hash_map,map__10275):map__10275);var root_QMARK_ = cljs.core.get.call(null,map__10275__$1,new cljs.core.Keyword(null,"root?","root?",1122602767));var path = cljs.core.get.call(null,map__10275__$1,new cljs.core.Keyword(null,"path","path",1017337751));var open_QMARK_ = cljs.core.get.call(null,map__10275__$1,new cljs.core.Keyword(null,"open?","open?",1119852199));var files = cljs.core.get.call(null,map__10275__$1,new cljs.core.Keyword(null,"files","files",1111338473));var folders = cljs.core.get.call(null,map__10275__$1,new cljs.core.Keyword(null,"folders","folders",4625622327));var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul","ul",1013907977),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",1108647146),[cljs.core.str((cljs.core.truth_(root_QMARK_)?null:"sub ")),cljs.core.str((cljs.core.truth_(open_QMARK_)?"opened":null))].join('')], null),(function (){var iter__4231__auto__ = (function iter__10276(s__10277){return (new cljs.core.LazySeq(null,(function (){var s__10277__$1 = s__10277;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10277__$1);if(temp__4092__auto__)
{var s__10277__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10277__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10277__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10279 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10278 = 0;while(true){
if((i__10278 < size__4230__auto__))
{var f = cljs.core._nth.call(null,c__4229__auto__,i__10278);cljs.core.chunk_append.call(null,b__10279,lt.object.__GT_content.call(null,f));
{
var G__10290 = (i__10278 + 1);
i__10278 = G__10290;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10279),iter__10276.call(null,cljs.core.chunk_rest.call(null,s__10277__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10279),null);
}
} else
{var f = cljs.core.first.call(null,s__10277__$2);return cljs.core.cons.call(null,lt.object.__GT_content.call(null,f),iter__10276.call(null,cljs.core.rest.call(null,s__10277__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,cljs.core.sort_by.call(null,((function (iter__4231__auto__){
return (function (p1__10257_SHARP_){return clojure.string.lower_case.call(null,lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,p1__10257_SHARP_))));
});})(iter__4231__auto__))
,folders));
})(),(function (){var iter__4231__auto__ = (function iter__10280(s__10281){return (new cljs.core.LazySeq(null,(function (){var s__10281__$1 = s__10281;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10281__$1);if(temp__4092__auto__)
{var s__10281__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10281__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10281__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10283 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10282 = 0;while(true){
if((i__10282 < size__4230__auto__))
{var f = cljs.core._nth.call(null,c__4229__auto__,i__10282);cljs.core.chunk_append.call(null,b__10283,lt.object.__GT_content.call(null,f));
{
var G__10291 = (i__10282 + 1);
i__10282 = G__10291;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10283),iter__10280.call(null,cljs.core.chunk_rest.call(null,s__10281__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10283),null);
}
} else
{var f = cljs.core.first.call(null,s__10281__$2);return cljs.core.cons.call(null,lt.object.__GT_content.call(null,f),iter__10280.call(null,cljs.core.rest.call(null,s__10281__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,cljs.core.sort_by.call(null,((function (iter__4231__auto__){
return (function (p1__10258_SHARP_){return clojure.string.lower_case.call(null,lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,p1__10258_SHARP_))));
});})(iter__4231__auto__))
,files));
})()], null));var seq__10284_10292 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__10285_10293 = null;var count__10286_10294 = 0;var i__10287_10295 = 0;while(true){
if((i__10287_10295 < count__10286_10294))
{var vec__10288_10296 = cljs.core._nth.call(null,chunk__10285_10293,i__10287_10295);var ev__3326__auto___10297 = cljs.core.nth.call(null,vec__10288_10296,0,null);var func__3327__auto___10298 = cljs.core.nth.call(null,vec__10288_10296,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10297,func__3327__auto___10298);
{
var G__10299 = seq__10284_10292;
var G__10300 = chunk__10285_10293;
var G__10301 = count__10286_10294;
var G__10302 = (i__10287_10295 + 1);
seq__10284_10292 = G__10299;
chunk__10285_10293 = G__10300;
count__10286_10294 = G__10301;
i__10287_10295 = G__10302;
continue;
}
} else
{var temp__4092__auto___10303 = cljs.core.seq.call(null,seq__10284_10292);if(temp__4092__auto___10303)
{var seq__10284_10304__$1 = temp__4092__auto___10303;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10284_10304__$1))
{var c__4262__auto___10305 = cljs.core.chunk_first.call(null,seq__10284_10304__$1);{
var G__10306 = cljs.core.chunk_rest.call(null,seq__10284_10304__$1);
var G__10307 = c__4262__auto___10305;
var G__10308 = cljs.core.count.call(null,c__4262__auto___10305);
var G__10309 = 0;
seq__10284_10292 = G__10306;
chunk__10285_10293 = G__10307;
count__10286_10294 = G__10308;
i__10287_10295 = G__10309;
continue;
}
} else
{var vec__10289_10310 = cljs.core.first.call(null,seq__10284_10304__$1);var ev__3326__auto___10311 = cljs.core.nth.call(null,vec__10289_10310,0,null);var func__3327__auto___10312 = cljs.core.nth.call(null,vec__10289_10310,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10311,func__3327__auto___10312);
{
var G__10313 = cljs.core.next.call(null,seq__10284_10304__$1);
var G__10314 = null;
var G__10315 = 0;
var G__10316 = 0;
seq__10284_10292 = G__10313;
chunk__10285_10293 = G__10314;
count__10286_10294 = G__10315;
i__10287_10295 = G__10316;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.workspace.rename_input = (function rename_input(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input.rename","input.rename",1571488084),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"type","type",1017479852),"text",new cljs.core.Keyword(null,"value","value",1125876963),lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)))], null)], null));var seq__10323_10329 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"focus","focus",1111509066),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"rename.focus","rename.focus",4215768474));
}),new cljs.core.Keyword(null,"blur","blur",1016931289),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"rename.blur","rename.blur",839974025));
})], null)));var chunk__10324_10330 = null;var count__10325_10331 = 0;var i__10326_10332 = 0;while(true){
if((i__10326_10332 < count__10325_10331))
{var vec__10327_10333 = cljs.core._nth.call(null,chunk__10324_10330,i__10326_10332);var ev__3326__auto___10334 = cljs.core.nth.call(null,vec__10327_10333,0,null);var func__3327__auto___10335 = cljs.core.nth.call(null,vec__10327_10333,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10334,func__3327__auto___10335);
{
var G__10336 = seq__10323_10329;
var G__10337 = chunk__10324_10330;
var G__10338 = count__10325_10331;
var G__10339 = (i__10326_10332 + 1);
seq__10323_10329 = G__10336;
chunk__10324_10330 = G__10337;
count__10325_10331 = G__10338;
i__10326_10332 = G__10339;
continue;
}
} else
{var temp__4092__auto___10340 = cljs.core.seq.call(null,seq__10323_10329);if(temp__4092__auto___10340)
{var seq__10323_10341__$1 = temp__4092__auto___10340;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10323_10341__$1))
{var c__4262__auto___10342 = cljs.core.chunk_first.call(null,seq__10323_10341__$1);{
var G__10343 = cljs.core.chunk_rest.call(null,seq__10323_10341__$1);
var G__10344 = c__4262__auto___10342;
var G__10345 = cljs.core.count.call(null,c__4262__auto___10342);
var G__10346 = 0;
seq__10323_10329 = G__10343;
chunk__10324_10330 = G__10344;
count__10325_10331 = G__10345;
i__10326_10332 = G__10346;
continue;
}
} else
{var vec__10328_10347 = cljs.core.first.call(null,seq__10323_10341__$1);var ev__3326__auto___10348 = cljs.core.nth.call(null,vec__10328_10347,0,null);var func__3327__auto___10349 = cljs.core.nth.call(null,vec__10328_10347,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10348,func__3327__auto___10349);
{
var G__10350 = cljs.core.next.call(null,seq__10323_10341__$1);
var G__10351 = null;
var G__10352 = 0;
var G__10353 = 0;
seq__10323_10329 = G__10350;
chunk__10324_10330 = G__10351;
count__10325_10331 = G__10352;
i__10326_10332 = G__10353;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.workspace.renameable = (function renameable(this$,cur,content){if(cljs.core.truth_(cur))
{return lt.objs.sidebar.workspace.rename_input.call(null,this$);
} else
{return content;
}
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.file","lt.objs.sidebar.workspace/workspace.file",4597702653),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"tree-item","tree-item",999403348),null,new cljs.core.Keyword(null,"workspace.file","workspace.file",1768213159),null], null), null),new cljs.core.Keyword(null,"path","path",1017337751),"",new cljs.core.Keyword(null,"init","init",1017141378),(function (this$,path){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"path","path",1017337751),path], null));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",1108647146),crate.binding.bound.call(null,this$,(function (p1__10354_SHARP_){if(cljs.core.truth_(new cljs.core.Keyword(null,"renaming?","renaming?",2774795926).cljs$core$IFn$_invoke$arity$1(p1__10354_SHARP_)))
{return "renaming";
} else
{return "";
}
}))], null),lt.objs.sidebar.workspace.rename_input.call(null,this$),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.tree-item","div.tree-item",4651075127),lt.objs.sidebar.workspace.file_toggle.call(null,this$)], null)], null);
}));
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.folder","lt.objs.sidebar.workspace/workspace.folder",1951235275),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"tree-item","tree-item",999403348),null,new cljs.core.Keyword(null,"workspace.folder","workspace.folder",4355811161),null], null), null),new cljs.core.Keyword(null,"path","path",1017337751),"",new cljs.core.Keyword(null,"open?","open?",1119852199),false,new cljs.core.Keyword(null,"realized?","realized?",4433874243),false,new cljs.core.Keyword(null,"folders","folders",4625622327),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"files","files",1111338473),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"init","init",1017141378),(function (this$,path){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"path","path",1017337751),path], null));
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",1108647146),crate.binding.bound.call(null,this$,(function (p1__10355_SHARP_){if(cljs.core.truth_(new cljs.core.Keyword(null,"renaming?","renaming?",2774795926).cljs$core$IFn$_invoke$arity$1(p1__10355_SHARP_)))
{return "renaming";
} else
{return "";
}
}))], null),lt.objs.sidebar.workspace.rename_input.call(null,this$),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.tree-item","div.tree-item",4651075127),(cljs.core.truth_(path)?lt.objs.sidebar.workspace.folder_toggle.call(null,this$):null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),crate.binding.bound.call(null,this$,lt.objs.sidebar.workspace.sub_folders)], null)], null)], null);
}));
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.root","lt.objs.sidebar.workspace/workspace.root",4597214311),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"workspace.root","workspace.root",1768576525),null], null), null),new cljs.core.Keyword(null,"root?","root?",1122602767),true,new cljs.core.Keyword(null,"open-dirs","open-dirs",2513590939),cljs.core.PersistentHashSet.EMPTY,new cljs.core.Keyword(null,"files","files",1111338473),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"folders","folders",4625622327),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"open?","open?",1119852199),true,new cljs.core.Keyword(null,"init","init",1017141378),(function (this$){return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.tree-root","div.tree-root",4651338758),crate.binding.bound.call(null,this$,lt.objs.sidebar.workspace.sub_folders)], null);
}));
lt.objs.sidebar.workspace.tree = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.root","lt.objs.sidebar.workspace/workspace.root",4597214311));
lt.objs.sidebar.workspace.input = (function input(type,event){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input","input",1114262332),new cljs.core.PersistentArrayMap.fromArray([new cljs.core.Keyword(null,"type","type",1017479852),"file",type,true,new cljs.core.Keyword(null,"style","style",1123684643),"display:none;"], true, false)], null));var seq__10362_10368 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"change","change",3947235106),(function (){var me = this;if(cljs.core.empty_QMARK_.call(null,lt.util.dom.val.call(null,me)))
{return null;
} else
{return lt.object.raise.call(null,lt.objs.sidebar.workspace.tree,event,lt.util.dom.val.call(null,me));
}
})], null)));var chunk__10363_10369 = null;var count__10364_10370 = 0;var i__10365_10371 = 0;while(true){
if((i__10365_10371 < count__10364_10370))
{var vec__10366_10372 = cljs.core._nth.call(null,chunk__10363_10369,i__10365_10371);var ev__3326__auto___10373 = cljs.core.nth.call(null,vec__10366_10372,0,null);var func__3327__auto___10374 = cljs.core.nth.call(null,vec__10366_10372,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10373,func__3327__auto___10374);
{
var G__10375 = seq__10362_10368;
var G__10376 = chunk__10363_10369;
var G__10377 = count__10364_10370;
var G__10378 = (i__10365_10371 + 1);
seq__10362_10368 = G__10375;
chunk__10363_10369 = G__10376;
count__10364_10370 = G__10377;
i__10365_10371 = G__10378;
continue;
}
} else
{var temp__4092__auto___10379 = cljs.core.seq.call(null,seq__10362_10368);if(temp__4092__auto___10379)
{var seq__10362_10380__$1 = temp__4092__auto___10379;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10362_10380__$1))
{var c__4262__auto___10381 = cljs.core.chunk_first.call(null,seq__10362_10380__$1);{
var G__10382 = cljs.core.chunk_rest.call(null,seq__10362_10380__$1);
var G__10383 = c__4262__auto___10381;
var G__10384 = cljs.core.count.call(null,c__4262__auto___10381);
var G__10385 = 0;
seq__10362_10368 = G__10382;
chunk__10363_10369 = G__10383;
count__10364_10370 = G__10384;
i__10365_10371 = G__10385;
continue;
}
} else
{var vec__10367_10386 = cljs.core.first.call(null,seq__10362_10380__$1);var ev__3326__auto___10387 = cljs.core.nth.call(null,vec__10367_10386,0,null);var func__3327__auto___10388 = cljs.core.nth.call(null,vec__10367_10386,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10387,func__3327__auto___10388);
{
var G__10389 = cljs.core.next.call(null,seq__10362_10380__$1);
var G__10390 = null;
var G__10391 = 0;
var G__10392 = 0;
seq__10362_10368 = G__10389;
chunk__10363_10369 = G__10390;
count__10364_10370 = G__10391;
i__10365_10371 = G__10392;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.workspace.open_folder = (function open_folder(){return lt.objs.dialogs.dir.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.Keyword(null,"workspace.add.folder!","workspace.add.folder!",1443047615));
});
lt.objs.sidebar.workspace.open_file = (function open_file(){return lt.objs.dialogs.file.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.Keyword(null,"workspace.add.file!","workspace.add.file!",821993457));
});
lt.objs.sidebar.workspace.button = (function button(name,action){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),name], null));var seq__10399_10405 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"click","click",1108654330),action], null)));var chunk__10400_10406 = null;var count__10401_10407 = 0;var i__10402_10408 = 0;while(true){
if((i__10402_10408 < count__10401_10407))
{var vec__10403_10409 = cljs.core._nth.call(null,chunk__10400_10406,i__10402_10408);var ev__3326__auto___10410 = cljs.core.nth.call(null,vec__10403_10409,0,null);var func__3327__auto___10411 = cljs.core.nth.call(null,vec__10403_10409,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10410,func__3327__auto___10411);
{
var G__10412 = seq__10399_10405;
var G__10413 = chunk__10400_10406;
var G__10414 = count__10401_10407;
var G__10415 = (i__10402_10408 + 1);
seq__10399_10405 = G__10412;
chunk__10400_10406 = G__10413;
count__10401_10407 = G__10414;
i__10402_10408 = G__10415;
continue;
}
} else
{var temp__4092__auto___10416 = cljs.core.seq.call(null,seq__10399_10405);if(temp__4092__auto___10416)
{var seq__10399_10417__$1 = temp__4092__auto___10416;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10399_10417__$1))
{var c__4262__auto___10418 = cljs.core.chunk_first.call(null,seq__10399_10417__$1);{
var G__10419 = cljs.core.chunk_rest.call(null,seq__10399_10417__$1);
var G__10420 = c__4262__auto___10418;
var G__10421 = cljs.core.count.call(null,c__4262__auto___10418);
var G__10422 = 0;
seq__10399_10405 = G__10419;
chunk__10400_10406 = G__10420;
count__10401_10407 = G__10421;
i__10402_10408 = G__10422;
continue;
}
} else
{var vec__10404_10423 = cljs.core.first.call(null,seq__10399_10417__$1);var ev__3326__auto___10424 = cljs.core.nth.call(null,vec__10404_10423,0,null);var func__3327__auto___10425 = cljs.core.nth.call(null,vec__10404_10423,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10424,func__3327__auto___10425);
{
var G__10426 = cljs.core.next.call(null,seq__10399_10417__$1);
var G__10427 = null;
var G__10428 = 0;
var G__10429 = 0;
seq__10399_10405 = G__10426;
chunk__10400_10406 = G__10427;
count__10401_10407 = G__10428;
i__10402_10408 = G__10429;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.workspace.recent = (function recent(this$){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"recent!","recent!",2096199832));
});
lt.objs.sidebar.workspace.recents_item = (function recents_item(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul.folders","ul.folders",4036689120),(function (){var iter__4231__auto__ = (function iter__10444(s__10445){return (new cljs.core.LazySeq(null,(function (){var s__10445__$1 = s__10445;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10445__$1);if(temp__4092__auto__)
{var s__10445__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10445__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10445__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10447 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10446 = 0;while(true){
if((i__10446 < size__4230__auto__))
{var f = cljs.core._nth.call(null,c__4229__auto__,i__10446);cljs.core.chunk_append.call(null,b__10447,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),lt.objs.files.basename.call(null,f),lt.objs.files.separator], null));
{
var G__10458 = (i__10446 + 1);
i__10446 = G__10458;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10447),iter__10444.call(null,cljs.core.chunk_rest.call(null,s__10445__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10447),null);
}
} else
{var f = cljs.core.first.call(null,s__10445__$2);return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),lt.objs.files.basename.call(null,f),lt.objs.files.separator], null),iter__10444.call(null,cljs.core.rest.call(null,s__10445__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,new cljs.core.Keyword(null,"folders","folders",4625622327).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
})()], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul.files","ul.files",1539775442),(function (){var iter__4231__auto__ = (function iter__10448(s__10449){return (new cljs.core.LazySeq(null,(function (){var s__10449__$1 = s__10449;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10449__$1);if(temp__4092__auto__)
{var s__10449__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10449__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10449__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10451 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10450 = 0;while(true){
if((i__10450 < size__4230__auto__))
{var f = cljs.core._nth.call(null,c__4229__auto__,i__10450);cljs.core.chunk_append.call(null,b__10451,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),lt.objs.files.basename.call(null,f)], null));
{
var G__10459 = (i__10450 + 1);
i__10450 = G__10459;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10451),iter__10448.call(null,cljs.core.chunk_rest.call(null,s__10449__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10451),null);
}
} else
{var f = cljs.core.first.call(null,s__10449__$2);return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),lt.objs.files.basename.call(null,f)], null),iter__10448.call(null,cljs.core.rest.call(null,s__10449__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,new cljs.core.Keyword(null,"files","files",1111338473).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
})()], null)], null));var seq__10452_10460 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"contextmenu","contextmenu",911789824),(function (e){lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"menu!","menu!",1117686292),e);
lt.util.dom.prevent.call(null,e);
return lt.util.dom.stop_propagation.call(null,e);
}),new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"select!","select!",2992004631));
})], null)));var chunk__10453_10461 = null;var count__10454_10462 = 0;var i__10455_10463 = 0;while(true){
if((i__10455_10463 < count__10454_10462))
{var vec__10456_10464 = cljs.core._nth.call(null,chunk__10453_10461,i__10455_10463);var ev__3326__auto___10465 = cljs.core.nth.call(null,vec__10456_10464,0,null);var func__3327__auto___10466 = cljs.core.nth.call(null,vec__10456_10464,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10465,func__3327__auto___10466);
{
var G__10467 = seq__10452_10460;
var G__10468 = chunk__10453_10461;
var G__10469 = count__10454_10462;
var G__10470 = (i__10455_10463 + 1);
seq__10452_10460 = G__10467;
chunk__10453_10461 = G__10468;
count__10454_10462 = G__10469;
i__10455_10463 = G__10470;
continue;
}
} else
{var temp__4092__auto___10471 = cljs.core.seq.call(null,seq__10452_10460);if(temp__4092__auto___10471)
{var seq__10452_10472__$1 = temp__4092__auto___10471;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10452_10472__$1))
{var c__4262__auto___10473 = cljs.core.chunk_first.call(null,seq__10452_10472__$1);{
var G__10474 = cljs.core.chunk_rest.call(null,seq__10452_10472__$1);
var G__10475 = c__4262__auto___10473;
var G__10476 = cljs.core.count.call(null,c__4262__auto___10473);
var G__10477 = 0;
seq__10452_10460 = G__10474;
chunk__10453_10461 = G__10475;
count__10454_10462 = G__10476;
i__10455_10463 = G__10477;
continue;
}
} else
{var vec__10457_10478 = cljs.core.first.call(null,seq__10452_10472__$1);var ev__3326__auto___10479 = cljs.core.nth.call(null,vec__10457_10478,0,null);var func__3327__auto___10480 = cljs.core.nth.call(null,vec__10457_10478,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10479,func__3327__auto___10480);
{
var G__10481 = cljs.core.next.call(null,seq__10452_10472__$1);
var G__10482 = null;
var G__10483 = 0;
var G__10484 = 0;
seq__10452_10460 = G__10481;
chunk__10453_10461 = G__10482;
count__10454_10462 = G__10483;
i__10455_10463 = G__10484;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.workspace.back_button = (function back_button(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h2","h2",1013907516),"Select a workspace"], null));var seq__10491_10497 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"tree!","tree!",1124529077));
})], null)));var chunk__10492_10498 = null;var count__10493_10499 = 0;var i__10494_10500 = 0;while(true){
if((i__10494_10500 < count__10493_10499))
{var vec__10495_10501 = cljs.core._nth.call(null,chunk__10492_10498,i__10494_10500);var ev__3326__auto___10502 = cljs.core.nth.call(null,vec__10495_10501,0,null);var func__3327__auto___10503 = cljs.core.nth.call(null,vec__10495_10501,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10502,func__3327__auto___10503);
{
var G__10504 = seq__10491_10497;
var G__10505 = chunk__10492_10498;
var G__10506 = count__10493_10499;
var G__10507 = (i__10494_10500 + 1);
seq__10491_10497 = G__10504;
chunk__10492_10498 = G__10505;
count__10493_10499 = G__10506;
i__10494_10500 = G__10507;
continue;
}
} else
{var temp__4092__auto___10508 = cljs.core.seq.call(null,seq__10491_10497);if(temp__4092__auto___10508)
{var seq__10491_10509__$1 = temp__4092__auto___10508;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10491_10509__$1))
{var c__4262__auto___10510 = cljs.core.chunk_first.call(null,seq__10491_10509__$1);{
var G__10511 = cljs.core.chunk_rest.call(null,seq__10491_10509__$1);
var G__10512 = c__4262__auto___10510;
var G__10513 = cljs.core.count.call(null,c__4262__auto___10510);
var G__10514 = 0;
seq__10491_10497 = G__10511;
chunk__10492_10498 = G__10512;
count__10493_10499 = G__10513;
i__10494_10500 = G__10514;
continue;
}
} else
{var vec__10496_10515 = cljs.core.first.call(null,seq__10491_10509__$1);var ev__3326__auto___10516 = cljs.core.nth.call(null,vec__10496_10515,0,null);var func__3327__auto___10517 = cljs.core.nth.call(null,vec__10496_10515,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10516,func__3327__auto___10517);
{
var G__10518 = cljs.core.next.call(null,seq__10491_10509__$1);
var G__10519 = null;
var G__10520 = 0;
var G__10521 = 0;
seq__10491_10497 = G__10518;
chunk__10492_10498 = G__10519;
count__10493_10499 = G__10520;
i__10494_10500 = G__10521;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.workspace.recents = (function recents(this$,rs){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),lt.objs.sidebar.workspace.back_button.call(null,this$),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul","ul",1013907977),(function (){var iter__4231__auto__ = (function iter__10532(s__10533){return (new cljs.core.LazySeq(null,(function (){var s__10533__$1 = s__10533;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10533__$1);if(temp__4092__auto__)
{var s__10533__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10533__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10533__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10535 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10534 = 0;while(true){
if((i__10534 < size__4230__auto__))
{var r = cljs.core._nth.call(null,c__4229__auto__,i__10534);cljs.core.chunk_append.call(null,b__10535,lt.object.__GT_content.call(null,r));
{
var G__10542 = (i__10534 + 1);
i__10534 = G__10542;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10535),iter__10532.call(null,cljs.core.chunk_rest.call(null,s__10533__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10535),null);
}
} else
{var r = cljs.core.first.call(null,s__10533__$2);return cljs.core.cons.call(null,lt.object.__GT_content.call(null,r),iter__10532.call(null,cljs.core.rest.call(null,s__10533__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,rs);
})()], null)], null));var seq__10536_10543 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__10537_10544 = null;var count__10538_10545 = 0;var i__10539_10546 = 0;while(true){
if((i__10539_10546 < count__10538_10545))
{var vec__10540_10547 = cljs.core._nth.call(null,chunk__10537_10544,i__10539_10546);var ev__3326__auto___10548 = cljs.core.nth.call(null,vec__10540_10547,0,null);var func__3327__auto___10549 = cljs.core.nth.call(null,vec__10540_10547,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10548,func__3327__auto___10549);
{
var G__10550 = seq__10536_10543;
var G__10551 = chunk__10537_10544;
var G__10552 = count__10538_10545;
var G__10553 = (i__10539_10546 + 1);
seq__10536_10543 = G__10550;
chunk__10537_10544 = G__10551;
count__10538_10545 = G__10552;
i__10539_10546 = G__10553;
continue;
}
} else
{var temp__4092__auto___10554 = cljs.core.seq.call(null,seq__10536_10543);if(temp__4092__auto___10554)
{var seq__10536_10555__$1 = temp__4092__auto___10554;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10536_10555__$1))
{var c__4262__auto___10556 = cljs.core.chunk_first.call(null,seq__10536_10555__$1);{
var G__10557 = cljs.core.chunk_rest.call(null,seq__10536_10555__$1);
var G__10558 = c__4262__auto___10556;
var G__10559 = cljs.core.count.call(null,c__4262__auto___10556);
var G__10560 = 0;
seq__10536_10543 = G__10557;
chunk__10537_10544 = G__10558;
count__10538_10545 = G__10559;
i__10539_10546 = G__10560;
continue;
}
} else
{var vec__10541_10561 = cljs.core.first.call(null,seq__10536_10555__$1);var ev__3326__auto___10562 = cljs.core.nth.call(null,vec__10541_10561,0,null);var func__3327__auto___10563 = cljs.core.nth.call(null,vec__10541_10561,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10562,func__3327__auto___10563);
{
var G__10564 = cljs.core.next.call(null,seq__10536_10555__$1);
var G__10565 = null;
var G__10566 = 0;
var G__10567 = 0;
seq__10536_10543 = G__10564;
chunk__10537_10544 = G__10565;
count__10538_10545 = G__10566;
i__10539_10546 = G__10567;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.workspace.__BEH__recent_BANG_ = (function __BEH__recent_BANG_(this$){var seq__10573_10577 = cljs.core.seq.call(null,new cljs.core.Keyword(null,"recents","recents",2096199914).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));var chunk__10574_10578 = null;var count__10575_10579 = 0;var i__10576_10580 = 0;while(true){
if((i__10576_10580 < count__10575_10579))
{var r_10581 = cljs.core._nth.call(null,chunk__10574_10578,i__10576_10580);lt.object.destroy_BANG_.call(null,r_10581);
{
var G__10582 = seq__10573_10577;
var G__10583 = chunk__10574_10578;
var G__10584 = count__10575_10579;
var G__10585 = (i__10576_10580 + 1);
seq__10573_10577 = G__10582;
chunk__10574_10578 = G__10583;
count__10575_10579 = G__10584;
i__10576_10580 = G__10585;
continue;
}
} else
{var temp__4092__auto___10586 = cljs.core.seq.call(null,seq__10573_10577);if(temp__4092__auto___10586)
{var seq__10573_10587__$1 = temp__4092__auto___10586;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10573_10587__$1))
{var c__4262__auto___10588 = cljs.core.chunk_first.call(null,seq__10573_10587__$1);{
var G__10589 = cljs.core.chunk_rest.call(null,seq__10573_10587__$1);
var G__10590 = c__4262__auto___10588;
var G__10591 = cljs.core.count.call(null,c__4262__auto___10588);
var G__10592 = 0;
seq__10573_10577 = G__10589;
chunk__10574_10578 = G__10590;
count__10575_10579 = G__10591;
i__10576_10580 = G__10592;
continue;
}
} else
{var r_10593 = cljs.core.first.call(null,seq__10573_10587__$1);lt.object.destroy_BANG_.call(null,r_10593);
{
var G__10594 = cljs.core.next.call(null,seq__10573_10587__$1);
var G__10595 = null;
var G__10596 = 0;
var G__10597 = 0;
seq__10573_10577 = G__10594;
chunk__10574_10578 = G__10595;
count__10575_10579 = G__10596;
i__10576_10580 = G__10597;
continue;
}
}
} else
{}
}
break;
}
return lt.object.merge_BANG_.call(null,this$,cljs.core.PersistentHashMap.fromArrays.call(null,[new cljs.core.Keyword(null,"recents","recents",2096199914)],[cljs.core.map.call(null,(function (p1__10568_SHARP_){return lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","recent-workspace","lt.objs.sidebar.workspace/recent-workspace",4144769423),p1__10568_SHARP_);
}),lt.objs.workspace.all.call(null))]));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","recent!","lt.objs.sidebar.workspace/recent!",4521365004),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__recent_BANG_,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"recent!","recent!",2096199832),null], null), null));
lt.objs.sidebar.workspace.__BEH__tree_BANG_ = (function __BEH__tree_BANG_(this$){var seq__10602_10606 = cljs.core.seq.call(null,new cljs.core.Keyword(null,"recents","recents",2096199914).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));var chunk__10603_10607 = null;var count__10604_10608 = 0;var i__10605_10609 = 0;while(true){
if((i__10605_10609 < count__10604_10608))
{var r_10610 = cljs.core._nth.call(null,chunk__10603_10607,i__10605_10609);lt.object.destroy_BANG_.call(null,r_10610);
{
var G__10611 = seq__10602_10606;
var G__10612 = chunk__10603_10607;
var G__10613 = count__10604_10608;
var G__10614 = (i__10605_10609 + 1);
seq__10602_10606 = G__10611;
chunk__10603_10607 = G__10612;
count__10604_10608 = G__10613;
i__10605_10609 = G__10614;
continue;
}
} else
{var temp__4092__auto___10615 = cljs.core.seq.call(null,seq__10602_10606);if(temp__4092__auto___10615)
{var seq__10602_10616__$1 = temp__4092__auto___10615;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10602_10616__$1))
{var c__4262__auto___10617 = cljs.core.chunk_first.call(null,seq__10602_10616__$1);{
var G__10618 = cljs.core.chunk_rest.call(null,seq__10602_10616__$1);
var G__10619 = c__4262__auto___10617;
var G__10620 = cljs.core.count.call(null,c__4262__auto___10617);
var G__10621 = 0;
seq__10602_10606 = G__10618;
chunk__10603_10607 = G__10619;
count__10604_10608 = G__10620;
i__10605_10609 = G__10621;
continue;
}
} else
{var r_10622 = cljs.core.first.call(null,seq__10602_10616__$1);lt.object.destroy_BANG_.call(null,r_10622);
{
var G__10623 = cljs.core.next.call(null,seq__10602_10616__$1);
var G__10624 = null;
var G__10625 = 0;
var G__10626 = 0;
seq__10602_10606 = G__10623;
chunk__10603_10607 = G__10624;
count__10604_10608 = G__10625;
i__10605_10609 = G__10626;
continue;
}
}
} else
{}
}
break;
}
return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"recents","recents",2096199914),null], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","tree!","lt.objs.sidebar.workspace/tree!",3018393903),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__tree_BANG_,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tree!","tree!",1124529077),null], null), null));
lt.objs.sidebar.workspace.__BEH__recent__DOT__select_BANG_ = (function __BEH__recent__DOT__select_BANG_(this$){lt.objs.workspace.open.call(null,lt.objs.workspace.current_ws,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
return lt.object.raise.call(null,lt.objs.sidebar.workspace.sidebar_workspace,new cljs.core.Keyword(null,"tree!","tree!",1124529077));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","recent.select!","lt.objs.sidebar.workspace/recent.select!",2595077856),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__recent__DOT__select_BANG_,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"select!","select!",2992004631),null], null), null));
lt.objs.sidebar.workspace.__BEH__recent__DOT__delete_BANG_ = (function __BEH__recent__DOT__delete_BANG_(this$){if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"file","file",1017047278).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.workspace.current_ws)),lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)))))
{lt.object.raise.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.Keyword(null,"clear!","clear!",3951036134));
} else
{}
lt.objs.files.delete_BANG_.call(null,new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
return lt.object.raise.call(null,lt.objs.sidebar.workspace.sidebar_workspace,new cljs.core.Keyword(null,"recent!","recent!",2096199832));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","recent.delete!","lt.objs.sidebar.workspace/recent.delete!",959251503),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__recent__DOT__delete_BANG_,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"delete!","delete!",2564367176),null], null), null));
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","recent-workspace","lt.objs.sidebar.workspace/recent-workspace",4144769423),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"recent-workspace","recent-workspace",2388792085),null], null), null),new cljs.core.Keyword(null,"init","init",1017141378),(function (this$,r){lt.object.merge_BANG_.call(null,this$,r);
return lt.objs.sidebar.workspace.recents_item.call(null,this$);
}));
lt.objs.sidebar.workspace.ws_class = (function ws_class(ws){return [cljs.core.str("workspace"),cljs.core.str((cljs.core.truth_(new cljs.core.Keyword(null,"recents","recents",2096199914).cljs$core$IFn$_invoke$arity$1(ws))?" recents":null))].join('');
});
lt.objs.sidebar.workspace.workspace_ui = (function workspace_ui(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",1108647146),crate.binding.bound.call(null,this$,lt.objs.sidebar.workspace.ws_class)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.wstree","div.wstree",2918560745),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul.buttons","ul.buttons",666323612),lt.objs.sidebar.workspace.button.call(null,"folder",lt.objs.sidebar.workspace.open_folder),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li.sep","li.sep",4204306399),"|"], null),lt.objs.sidebar.workspace.button.call(null,"file",lt.objs.sidebar.workspace.open_file),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li.sep","li.sep",4204306399),"|"], null),lt.objs.sidebar.workspace.button.call(null,"recent",(function (){return lt.objs.sidebar.workspace.recent.call(null,this$);
}))], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul.root","ul.root",615589195),lt.object.__GT_content.call(null,lt.objs.sidebar.workspace.tree)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.recent","div.recent",2761967050),crate.binding.bound.call(null,this$,(function (sw){return lt.objs.sidebar.workspace.recents.call(null,this$,new cljs.core.Keyword(null,"recents","recents",2096199914).cljs$core$IFn$_invoke$arity$1(sw));
}))], null)], null));var seq__10633_10639 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"dragover","dragover",4468024186),(function (e){e.dataTransfer.dropEffect = "move";
lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"dragover","dragover",4468024186),e);
lt.util.dom.prevent.call(null,e);
return false;
}),new cljs.core.Keyword(null,"drop","drop",1016996449),(function (e){lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"drop","drop",1016996449),e);
lt.util.dom.stop_propagation.call(null,e);
return lt.util.dom.prevent.call(null,e);
}),new cljs.core.Keyword(null,"contextmenu","contextmenu",911789824),(function (e){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"menu!","menu!",1117686292),e);
})], null)));var chunk__10634_10640 = null;var count__10635_10641 = 0;var i__10636_10642 = 0;while(true){
if((i__10636_10642 < count__10635_10641))
{var vec__10637_10643 = cljs.core._nth.call(null,chunk__10634_10640,i__10636_10642);var ev__3326__auto___10644 = cljs.core.nth.call(null,vec__10637_10643,0,null);var func__3327__auto___10645 = cljs.core.nth.call(null,vec__10637_10643,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10644,func__3327__auto___10645);
{
var G__10646 = seq__10633_10639;
var G__10647 = chunk__10634_10640;
var G__10648 = count__10635_10641;
var G__10649 = (i__10636_10642 + 1);
seq__10633_10639 = G__10646;
chunk__10634_10640 = G__10647;
count__10635_10641 = G__10648;
i__10636_10642 = G__10649;
continue;
}
} else
{var temp__4092__auto___10650 = cljs.core.seq.call(null,seq__10633_10639);if(temp__4092__auto___10650)
{var seq__10633_10651__$1 = temp__4092__auto___10650;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10633_10651__$1))
{var c__4262__auto___10652 = cljs.core.chunk_first.call(null,seq__10633_10651__$1);{
var G__10653 = cljs.core.chunk_rest.call(null,seq__10633_10651__$1);
var G__10654 = c__4262__auto___10652;
var G__10655 = cljs.core.count.call(null,c__4262__auto___10652);
var G__10656 = 0;
seq__10633_10639 = G__10653;
chunk__10634_10640 = G__10654;
count__10635_10641 = G__10655;
i__10636_10642 = G__10656;
continue;
}
} else
{var vec__10638_10657 = cljs.core.first.call(null,seq__10633_10651__$1);var ev__3326__auto___10658 = cljs.core.nth.call(null,vec__10638_10657,0,null);var func__3327__auto___10659 = cljs.core.nth.call(null,vec__10638_10657,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10658,func__3327__auto___10659);
{
var G__10660 = cljs.core.next.call(null,seq__10633_10651__$1);
var G__10661 = null;
var G__10662 = 0;
var G__10663 = 0;
seq__10633_10639 = G__10660;
chunk__10634_10640 = G__10661;
count__10635_10641 = G__10662;
i__10636_10642 = G__10663;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","sidebar.workspace","lt.objs.sidebar.workspace/sidebar.workspace",705450607),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"sidebar.workspace","sidebar.workspace",3781278709),null], null), null),new cljs.core.Keyword(null,"label","label",1116631654),"workspace",new cljs.core.Keyword(null,"order","order",1119910592),-7,new cljs.core.Keyword(null,"init","init",1017141378),(function (this$){return lt.objs.sidebar.workspace.workspace_ui.call(null,this$);
}));
lt.objs.sidebar.workspace.__BEH__sidebar_menu = (function __BEH__sidebar_menu(this$,items){return cljs.core.conj.call(null,items,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Add folder",new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"workspace.add-folder","workspace.add-folder",2772643205));
})], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Add file",new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"workspace.add-file","workspace.add-file",2669358035));
})], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Open recent workspace",new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"workspace.show-recents","workspace.show-recents",1806500563));
})], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Clear workspace",new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,lt.objs.sidebar.workspace.tree,new cljs.core.Keyword(null,"clear!","clear!",3951036134));
})], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","sidebar-menu","lt.objs.sidebar.workspace/sidebar-menu",3021041170),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__sidebar_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"menu-items","menu-items",3782623556),null], null), null));
lt.objs.sidebar.workspace.__BEH__recent_menu = (function __BEH__recent_menu(this$,items){return cljs.core.conj.call(null,items,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Delete Workspace",new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"delete!","delete!",2564367176));
})], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","recent-menu","lt.objs.sidebar.workspace/recent-menu",1238711153),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__recent_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"menu-items","menu-items",3782623556),null], null), null));
lt.objs.sidebar.workspace.__BEH__workspace__DOT__open_on_start = (function __BEH__workspace__DOT__open_on_start(this$){return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"workspace.show","workspace.show",1768599592));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","workspace.open-on-start","lt.objs.sidebar.workspace/workspace.open-on-start",2867305284),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.workspace.__BEH__workspace__DOT__open_on_start,new cljs.core.Keyword(null,"desc","desc",1016984067),"Workspace: Show workspace on start",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"init","init",1017141378),null], null), null),new cljs.core.Keyword(null,"type","type",1017479852),new cljs.core.Keyword(null,"user","user",1017503549));
lt.objs.sidebar.workspace.sidebar_workspace = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.workspace","sidebar.workspace","lt.objs.sidebar.workspace/sidebar.workspace",705450607));
lt.objs.sidebar.add_item.call(null,lt.objs.sidebar.sidebar,lt.objs.sidebar.workspace.sidebar_workspace);
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"workspace.add-folder","workspace.add-folder",2772643205),new cljs.core.Keyword(null,"desc","desc",1016984067),"Workspace: add folder",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){return lt.objs.sidebar.workspace.open_folder.call(null);
})], null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"workspace.add-file","workspace.add-file",2669358035),new cljs.core.Keyword(null,"desc","desc",1016984067),"Workspace: add file",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){return lt.objs.sidebar.workspace.open_file.call(null);
})], null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"workspace.show","workspace.show",1768599592),new cljs.core.Keyword(null,"desc","desc",1016984067),"Workspace: Toggle workspace tree",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (force_QMARK_){return lt.object.raise.call(null,lt.objs.sidebar.sidebar,new cljs.core.Keyword(null,"toggle","toggle",4440567494),lt.objs.sidebar.workspace.sidebar_workspace,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"transient?","transient?",3584270951),false,new cljs.core.Keyword(null,"force?","force?",4040082982),force_QMARK_], null));
})], null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"workspace.rename.cancel!","workspace.rename.cancel!",1179487266),new cljs.core.Keyword(null,"desc","desc",1016984067),"Workspace: Cancel rename",new cljs.core.Keyword(null,"hidden","hidden",4091384092),true,new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var temp__4092__auto__ = lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tree.rename","tree.rename",1095020288));if(cljs.core.truth_(temp__4092__auto__))
{var c = temp__4092__auto__;return lt.object.raise.call(null,c,new cljs.core.Keyword(null,"rename.cancel!","rename.cancel!",4050107817));
} else
{return null;
}
})], null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"workspace.rename.submit!","workspace.rename.submit!",3056447044),new cljs.core.Keyword(null,"desc","desc",1016984067),"Workspace: Submit rename",new cljs.core.Keyword(null,"hidden","hidden",4091384092),true,new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var temp__4092__auto__ = lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tree.rename","tree.rename",1095020288));if(cljs.core.truth_(temp__4092__auto__))
{var c = temp__4092__auto__;return lt.object.raise.call(null,c,new cljs.core.Keyword(null,"rename.submit!","rename.submit!",1632100299));
} else
{return null;
}
})], null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"workspace.show-recents","workspace.show-recents",1806500563),new cljs.core.Keyword(null,"desc","desc",1016984067),"Workspace: Open recent workspace",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"workspace.show","workspace.show",1768599592),new cljs.core.Keyword(null,"force","force",1111522909));
return lt.objs.sidebar.workspace.recent.call(null,lt.objs.sidebar.workspace.sidebar_workspace);
})], null));
