// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.tabs');
goog.require('cljs.core');
goog.require('lt.util.js');
goog.require('lt.util.style');
goog.require('lt.util.dom');
goog.require('crate.binding');
goog.require('lt.object');
goog.require('lt.objs.menu');
goog.require('lt.util.js');
goog.require('lt.util.dom');
goog.require('lt.objs.context');
goog.require('crate.core');
goog.require('lt.objs.context');
goog.require('lt.util.dom');
goog.require('lt.objs.animations');
goog.require('lt.objs.canvas');
goog.require('lt.objs.command');
goog.require('lt.objs.menu');
goog.require('lt.util.load');
goog.require('lt.objs.animations');
goog.require('crate.binding');
goog.require('lt.objs.editor');
goog.require('lt.objs.canvas');
goog.require('lt.object');
goog.require('lt.object');
goog.require('lt.util.load');
goog.require('lt.util.style');
goog.require('lt.objs.editor');
goog.require('crate.core');
goog.require('lt.objs.command');
lt.util.load.js.call(null,"core/node_modules/lighttable/ui/dragdrop.js",new cljs.core.Keyword(null,"sync","sync",1017449997));
lt.objs.tabs.multi_def = lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","multi-editor2","lt.objs.tabs/multi-editor2",1325787623),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tabs","tabs",1017456368),null], null), null),new cljs.core.Keyword(null,"tabsets","tabsets",3756175576),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"left","left",1017222009),0,new cljs.core.Keyword(null,"right","right",1122416014),0,new cljs.core.Keyword(null,"bottom","bottom",3925642653),0,new cljs.core.Keyword(null,"init","init",1017141378),(function (this$){var tabsets = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.tabsets","div.tabsets",1029252219),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",1123684643),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"bottom","bottom",3925642653),crate.binding.bound.call(null,crate.binding.subatom.call(null,this$,new cljs.core.Keyword(null,"tabset-bottom","tabset-bottom",2176185021)),lt.util.style.__GT_px)], null)], null)], null));lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tabsets-elem","tabsets-elem",4253111048),tabsets], null));
lt.objs.context.in_BANG_.call(null,new cljs.core.Keyword(null,"tabs","tabs",1017456368),this$);
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div#multi","div#multi",1721072185),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",1123684643),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"left","left",1017222009),crate.binding.bound.call(null,crate.binding.subatom.call(null,this$,new cljs.core.Keyword(null,"left","left",1017222009)),lt.util.style.__GT_px),new cljs.core.Keyword(null,"right","right",1122416014),crate.binding.bound.call(null,crate.binding.subatom.call(null,this$,new cljs.core.Keyword(null,"right","right",1122416014)),lt.util.style.__GT_px),new cljs.core.Keyword(null,"bottom","bottom",3925642653),crate.binding.bound.call(null,crate.binding.subatom.call(null,this$,new cljs.core.Keyword(null,"bottom","bottom",3925642653)),lt.util.style.__GT_px)], null)], null),tabsets], null);
}));
lt.objs.tabs.multi = lt.object.create.call(null,lt.objs.tabs.multi_def);
lt.objs.tabs.ensure_visible = (function ensure_visible(idx,tabset){var temp__4092__auto__ = (lt.util.dom.$$.call(null,".list li",lt.object.__GT_content.call(null,tabset))[idx]);if(cljs.core.truth_(temp__4092__auto__))
{var cur = temp__4092__auto__;var left = cur.offsetLeft;var width = cur.clientWidth;var right = (left + width);var gp = lt.util.dom.parent.call(null,lt.util.dom.parent.call(null,cur));var pwidth = gp.clientWidth;var pleft = gp.scrollLeft;var pright = (pleft + pwidth);var inside = ((left >= pleft)) && ((right <= pright));if(inside)
{return null;
} else
{if((pleft > left))
{return gp.scrollLeft = (left - 50);
} else
{return gp.scrollLeft = ((right - pwidth) + 50);
}
}
} else
{return null;
}
});
lt.objs.tabs.__GT_index = (function __GT_index(obj){if(cljs.core.truth_((function (){var and__3508__auto__ = obj;if(cljs.core.truth_(and__3508__auto__))
{var and__3508__auto____$1 = cljs.core.deref.call(null,obj);if(cljs.core.truth_(and__3508__auto____$1))
{return new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,obj));
} else
{return and__3508__auto____$1;
}
} else
{return and__3508__auto__;
}
})()))
{return cljs.core.first.call(null,cljs.core.first.call(null,cljs.core.filter.call(null,(function (p1__7872_SHARP_){return cljs.core._EQ_.call(null,obj,cljs.core.second.call(null,p1__7872_SHARP_));
}),cljs.core.map_indexed.call(null,cljs.core.vector,new cljs.core.Keyword(null,"objs","objs",1017308622).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,obj))))))));
} else
{return null;
}
});
lt.objs.tabs.active_BANG_ = (function active_BANG_(obj){if(cljs.core.truth_((function (){var and__3508__auto__ = obj;if(cljs.core.truth_(and__3508__auto__))
{return new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,obj));
} else
{return and__3508__auto__;
}
})()))
{lt.object.merge_BANG_.call(null,new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,obj)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"active-obj","active-obj",3056705826),obj], null));
lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"show","show",1017433711));
return lt.objs.tabs.ensure_visible.call(null,lt.objs.tabs.__GT_index.call(null,obj),new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,obj)));
} else
{return null;
}
});
lt.objs.tabs.update_tab_order = (function update_tab_order(multi,children){var ser = ((cljs.core.vector_QMARK_.call(null,children))?children:cljs.core.map.call(null,(function (p1__7873_SHARP_){return lt.util.dom.attr.call(null,p1__7873_SHARP_,new cljs.core.Keyword(null,"pos","pos",1014015430));
}),children));var prev_active = new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,multi));lt.object.merge_BANG_.call(null,multi,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"objs","objs",1017308622),cljs.core.mapv.call(null,new cljs.core.Keyword(null,"objs","objs",1017308622).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,multi)),ser),new cljs.core.Keyword(null,"active-obj","active-obj",3056705826),null], null));
return lt.objs.tabs.active_BANG_.call(null,prev_active);
});
lt.objs.tabs.__GT_name = (function __GT_name(e){var or__3520__auto__ = cljs.core.get_in.call(null,cljs.core.deref.call(null,e),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"info","info",1017141280),new cljs.core.Keyword(null,"name","name",1017277949)], null));if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{var or__3520__auto____$1 = new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,e));if(cljs.core.truth_(or__3520__auto____$1))
{return or__3520__auto____$1;
} else
{return "unknown";
}
}
});
lt.objs.tabs.__GT_path = (function __GT_path(e){var or__3520__auto__ = cljs.core.get_in.call(null,cljs.core.deref.call(null,e),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"info","info",1017141280),new cljs.core.Keyword(null,"path","path",1017337751)], null));if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{var or__3520__auto____$1 = new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,e));if(cljs.core.truth_(or__3520__auto____$1))
{return or__3520__auto____$1;
} else
{return "";
}
}
});
lt.objs.tabs.active_QMARK_ = (function active_QMARK_(c,e,multi){return [cljs.core.str(c),cljs.core.str(((cljs.core._EQ_.call(null,cljs.core.deref.call(null,multi).call(null,new cljs.core.Keyword(null,"active-obj","active-obj",3056705826)),e))?" active":null))].join('');
});
lt.objs.tabs.dirty_QMARK_ = (function dirty_QMARK_(c,e){return [cljs.core.str(c),cljs.core.str((cljs.core.truth_(new cljs.core.Keyword(null,"dirty","dirty",1109497668).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,e)))?" dirty":null))].join('');
});
lt.objs.tabs.close_tab = (function close_tab(obj){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,"span.tab-close","span.tab-close",4094760846),"x"], null));var seq__7880_7886 = 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,obj,new cljs.core.Keyword(null,"close","close",1108660586));
})], null)));var chunk__7881_7887 = null;var count__7882_7888 = 0;var i__7883_7889 = 0;while(true){
if((i__7883_7889 < count__7882_7888))
{var vec__7884_7890 = cljs.core._nth.call(null,chunk__7881_7887,i__7883_7889);var ev__3326__auto___7891 = cljs.core.nth.call(null,vec__7884_7890,0,null);var func__3327__auto___7892 = cljs.core.nth.call(null,vec__7884_7890,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___7891,func__3327__auto___7892);
{
var G__7893 = seq__7880_7886;
var G__7894 = chunk__7881_7887;
var G__7895 = count__7882_7888;
var G__7896 = (i__7883_7889 + 1);
seq__7880_7886 = G__7893;
chunk__7881_7887 = G__7894;
count__7882_7888 = G__7895;
i__7883_7889 = G__7896;
continue;
}
} else
{var temp__4092__auto___7897 = cljs.core.seq.call(null,seq__7880_7886);if(temp__4092__auto___7897)
{var seq__7880_7898__$1 = temp__4092__auto___7897;if(cljs.core.chunked_seq_QMARK_.call(null,seq__7880_7898__$1))
{var c__4262__auto___7899 = cljs.core.chunk_first.call(null,seq__7880_7898__$1);{
var G__7900 = cljs.core.chunk_rest.call(null,seq__7880_7898__$1);
var G__7901 = c__4262__auto___7899;
var G__7902 = cljs.core.count.call(null,c__4262__auto___7899);
var G__7903 = 0;
seq__7880_7886 = G__7900;
chunk__7881_7887 = G__7901;
count__7882_7888 = G__7902;
i__7883_7889 = G__7903;
continue;
}
} else
{var vec__7885_7904 = cljs.core.first.call(null,seq__7880_7898__$1);var ev__3326__auto___7905 = cljs.core.nth.call(null,vec__7885_7904,0,null);var func__3327__auto___7906 = cljs.core.nth.call(null,vec__7885_7904,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___7905,func__3327__auto___7906);
{
var G__7907 = cljs.core.next.call(null,seq__7880_7898__$1);
var G__7908 = null;
var G__7909 = 0;
var G__7910 = 0;
seq__7880_7886 = G__7907;
chunk__7881_7887 = G__7908;
count__7882_7888 = G__7909;
i__7883_7889 = G__7910;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.tabs.item = (function item(label,multi,e,pos){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,"li","li",1013907695),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"class","class",1108647146),lt.objs.tabs.dirty_QMARK_.call(null,lt.objs.tabs.active_QMARK_.call(null," ",e,multi),e),new cljs.core.Keyword(null,"draggable","draggable",709423359),"true",new cljs.core.Keyword(null,"title","title",1124275658),lt.objs.tabs.__GT_path.call(null,e),new cljs.core.Keyword(null,"obj-id","obj-id",4285449507),lt.object.__GT_id.call(null,e),new cljs.core.Keyword(null,"pos","pos",1014015430),pos], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.file-name","span.file-name",2230443530),lt.objs.tabs.__GT_name.call(null,e)], null),(cljs.core.truth_(lt.object.raise_reduce.call(null,e,new cljs.core.Keyword(null,"close-button+","close-button+",3559586774),false))?lt.objs.tabs.close_tab.call(null,label):null)], null));var seq__7917_7923 = 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,"mouseup","mouseup",2256972146),(function (ev){if(cljs.core.truth_((function (){var or__3520__auto__ = cljs.core._EQ_.call(null,1,ev.button);if(or__3520__auto__)
{return or__3520__auto__;
} else
{return ev.metaKey;
}
})()))
{return lt.util.dom.prevent.call(null,ev);
} else
{return null;
}
}),new cljs.core.Keyword(null,"click","click",1108654330),(function (ev){if(cljs.core.truth_((function (){var or__3520__auto__ = cljs.core._EQ_.call(null,1,ev.button);if(or__3520__auto__)
{return or__3520__auto__;
} else
{return ev.metaKey;
}
})()))
{return lt.object.raise.call(null,label,new cljs.core.Keyword(null,"close","close",1108660586));
} else
{return lt.objs.tabs.active_BANG_.call(null,e);
}
}),new cljs.core.Keyword(null,"contextmenu","contextmenu",911789824),(function (ev){return lt.object.raise.call(null,label,new cljs.core.Keyword(null,"menu!","menu!",1117686292),ev);
})], null)));var chunk__7918_7924 = null;var count__7919_7925 = 0;var i__7920_7926 = 0;while(true){
if((i__7920_7926 < count__7919_7925))
{var vec__7921_7927 = cljs.core._nth.call(null,chunk__7918_7924,i__7920_7926);var ev__3326__auto___7928 = cljs.core.nth.call(null,vec__7921_7927,0,null);var func__3327__auto___7929 = cljs.core.nth.call(null,vec__7921_7927,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___7928,func__3327__auto___7929);
{
var G__7930 = seq__7917_7923;
var G__7931 = chunk__7918_7924;
var G__7932 = count__7919_7925;
var G__7933 = (i__7920_7926 + 1);
seq__7917_7923 = G__7930;
chunk__7918_7924 = G__7931;
count__7919_7925 = G__7932;
i__7920_7926 = G__7933;
continue;
}
} else
{var temp__4092__auto___7934 = cljs.core.seq.call(null,seq__7917_7923);if(temp__4092__auto___7934)
{var seq__7917_7935__$1 = temp__4092__auto___7934;if(cljs.core.chunked_seq_QMARK_.call(null,seq__7917_7935__$1))
{var c__4262__auto___7936 = cljs.core.chunk_first.call(null,seq__7917_7935__$1);{
var G__7937 = cljs.core.chunk_rest.call(null,seq__7917_7935__$1);
var G__7938 = c__4262__auto___7936;
var G__7939 = cljs.core.count.call(null,c__4262__auto___7936);
var G__7940 = 0;
seq__7917_7923 = G__7937;
chunk__7918_7924 = G__7938;
count__7919_7925 = G__7939;
i__7920_7926 = G__7940;
continue;
}
} else
{var vec__7922_7941 = cljs.core.first.call(null,seq__7917_7935__$1);var ev__3326__auto___7942 = cljs.core.nth.call(null,vec__7922_7941,0,null);var func__3327__auto___7943 = cljs.core.nth.call(null,vec__7922_7941,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___7942,func__3327__auto___7943);
{
var G__7944 = cljs.core.next.call(null,seq__7917_7935__$1);
var G__7945 = null;
var G__7946 = 0;
var G__7947 = 0;
seq__7917_7923 = G__7944;
chunk__7918_7924 = G__7945;
count__7919_7925 = G__7946;
i__7920_7926 = G__7947;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","tab-label","lt.objs.tabs/tab-label",914538750),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tab-label","tab-label",1523548718),null], null), null),new cljs.core.Keyword(null,"init","init",1017141378),(function (this$,multi,e,pos){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword("lt.objs.tabs","tab-object","lt.objs.tabs/tab-object",3521887033),e,new cljs.core.Keyword(null,"tabset","tabset",4427500575),multi], null));
return lt.objs.tabs.item.call(null,this$,multi,e,pos);
}));
lt.objs.tabs.objs_list = (function objs_list(multi,objs){var prev_tabs = cljs.core.filter.call(null,(function (p1__7948_SHARP_){return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,p1__7948_SHARP_)),multi);
}),lt.object.by_tag.call(null,new cljs.core.Keyword(null,"tab-label","tab-label",1523548718)));var item = crate.core.html.call(null,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 (prev_tabs){
return (function iter__7963(s__7964){return (new cljs.core.LazySeq(null,((function (prev_tabs){
return (function (){var s__7964__$1 = s__7964;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__7964__$1);if(temp__4092__auto__)
{var s__7964__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__7964__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__7964__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__7966 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__7965 = 0;while(true){
if((i__7965 < size__4230__auto__))
{var vec__7969 = cljs.core._nth.call(null,c__4229__auto__,i__7965);var idx = cljs.core.nth.call(null,vec__7969,0,null);var o = cljs.core.nth.call(null,vec__7969,1,null);if(cljs.core.truth_(cljs.core.deref.call(null,o)))
{cljs.core.chunk_append.call(null,b__7966,lt.object.__GT_content.call(null,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.tabs","tab-label","lt.objs.tabs/tab-label",914538750),multi,o,idx)));
{
var G__7977 = (i__7965 + 1);
i__7965 = G__7977;
continue;
}
} else
{{
var G__7978 = (i__7965 + 1);
i__7965 = G__7978;
continue;
}
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__7966),iter__7963.call(null,cljs.core.chunk_rest.call(null,s__7964__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__7966),null);
}
} else
{var vec__7970 = cljs.core.first.call(null,s__7964__$2);var idx = cljs.core.nth.call(null,vec__7970,0,null);var o = cljs.core.nth.call(null,vec__7970,1,null);if(cljs.core.truth_(cljs.core.deref.call(null,o)))
{return cljs.core.cons.call(null,lt.object.__GT_content.call(null,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.tabs","tab-label","lt.objs.tabs/tab-label",914538750),multi,o,idx)),iter__7963.call(null,cljs.core.rest.call(null,s__7964__$2)));
} else
{{
var G__7979 = cljs.core.rest.call(null,s__7964__$2);
s__7964__$1 = G__7979;
continue;
}
}
}
} else
{return null;
}
break;
}
});})(prev_tabs))
,null,null));
});})(prev_tabs))
;return iter__4231__auto__.call(null,cljs.core.map.call(null,cljs.core.vector,cljs.core.range.call(null),objs));
})()], null));var seq__7971_7980 = cljs.core.seq.call(null,prev_tabs);var chunk__7972_7981 = null;var count__7973_7982 = 0;var i__7974_7983 = 0;while(true){
if((i__7974_7983 < count__7973_7982))
{var tab_7984 = cljs.core._nth.call(null,chunk__7972_7981,i__7974_7983);lt.object.destroy_BANG_.call(null,tab_7984);
{
var G__7985 = seq__7971_7980;
var G__7986 = chunk__7972_7981;
var G__7987 = count__7973_7982;
var G__7988 = (i__7974_7983 + 1);
seq__7971_7980 = G__7985;
chunk__7972_7981 = G__7986;
count__7973_7982 = G__7987;
i__7974_7983 = G__7988;
continue;
}
} else
{var temp__4092__auto___7989 = cljs.core.seq.call(null,seq__7971_7980);if(temp__4092__auto___7989)
{var seq__7971_7990__$1 = temp__4092__auto___7989;if(cljs.core.chunked_seq_QMARK_.call(null,seq__7971_7990__$1))
{var c__4262__auto___7991 = cljs.core.chunk_first.call(null,seq__7971_7990__$1);{
var G__7992 = cljs.core.chunk_rest.call(null,seq__7971_7990__$1);
var G__7993 = c__4262__auto___7991;
var G__7994 = cljs.core.count.call(null,c__4262__auto___7991);
var G__7995 = 0;
seq__7971_7980 = G__7992;
chunk__7972_7981 = G__7993;
count__7973_7982 = G__7994;
i__7974_7983 = G__7995;
continue;
}
} else
{var tab_7996 = cljs.core.first.call(null,seq__7971_7990__$1);lt.object.destroy_BANG_.call(null,tab_7996);
{
var G__7997 = cljs.core.next.call(null,seq__7971_7990__$1);
var G__7998 = null;
var G__7999 = 0;
var G__8000 = 0;
seq__7971_7980 = G__7997;
chunk__7972_7981 = G__7998;
count__7973_7982 = G__7999;
i__7974_7983 = G__8000;
continue;
}
}
} else
{}
}
break;
}
sortable(item,(function (){var obj7976 = {"axis":"x","distance":10,"scroll":false,"opacity":0.9,"connectWith":".list"};return obj7976;
})());
lt.util.dom.on.call(null,item,"contextmenu",(function (e){return lt.object.raise.call(null,multi,new cljs.core.Keyword(null,"menu!","menu!",1117686292),e);
}));
lt.util.dom.on.call(null,item,"moved",(function (e){return lt.objs.tabs.move_tab.call(null,multi,e.opts);
}));
lt.util.dom.on.call(null,item,"sortupdate",(function (e){return lt.objs.tabs.update_tab_order.call(null,multi,e.opts);
}));
return item;
});
lt.objs.tabs.tabbed_item = (function tabbed_item(active,item){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.content","div.content",3533478798),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",1123684643),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"visibility","visibility",2955236996),crate.binding.bound.call(null,active,(function (p1__8001_SHARP_){if(cljs.core._EQ_.call(null,p1__8001_SHARP_,cljs.core.deref.call(null,item)))
{return "visible";
} else
{return "hidden";
}
}))], null)], null),crate.binding.bound.call(null,item,(function (p1__8002_SHARP_){if(cljs.core.truth_(p1__8002_SHARP_))
{return lt.object.__GT_content.call(null,p1__8002_SHARP_);
} else
{return null;
}
}))], null));var seq__8009_8015 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__8010_8016 = null;var count__8011_8017 = 0;var i__8012_8018 = 0;while(true){
if((i__8012_8018 < count__8011_8017))
{var vec__8013_8019 = cljs.core._nth.call(null,chunk__8010_8016,i__8012_8018);var ev__3326__auto___8020 = cljs.core.nth.call(null,vec__8013_8019,0,null);var func__3327__auto___8021 = cljs.core.nth.call(null,vec__8013_8019,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___8020,func__3327__auto___8021);
{
var G__8022 = seq__8009_8015;
var G__8023 = chunk__8010_8016;
var G__8024 = count__8011_8017;
var G__8025 = (i__8012_8018 + 1);
seq__8009_8015 = G__8022;
chunk__8010_8016 = G__8023;
count__8011_8017 = G__8024;
i__8012_8018 = G__8025;
continue;
}
} else
{var temp__4092__auto___8026 = cljs.core.seq.call(null,seq__8009_8015);if(temp__4092__auto___8026)
{var seq__8009_8027__$1 = temp__4092__auto___8026;if(cljs.core.chunked_seq_QMARK_.call(null,seq__8009_8027__$1))
{var c__4262__auto___8028 = cljs.core.chunk_first.call(null,seq__8009_8027__$1);{
var G__8029 = cljs.core.chunk_rest.call(null,seq__8009_8027__$1);
var G__8030 = c__4262__auto___8028;
var G__8031 = cljs.core.count.call(null,c__4262__auto___8028);
var G__8032 = 0;
seq__8009_8015 = G__8029;
chunk__8010_8016 = G__8030;
count__8011_8017 = G__8031;
i__8012_8018 = G__8032;
continue;
}
} else
{var vec__8014_8033 = cljs.core.first.call(null,seq__8009_8027__$1);var ev__3326__auto___8034 = cljs.core.nth.call(null,vec__8014_8033,0,null);var func__3327__auto___8035 = cljs.core.nth.call(null,vec__8014_8033,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___8034,func__3327__auto___8035);
{
var G__8036 = cljs.core.next.call(null,seq__8009_8027__$1);
var G__8037 = null;
var G__8038 = 0;
var G__8039 = 0;
seq__8009_8015 = G__8036;
chunk__8010_8016 = G__8037;
count__8011_8017 = G__8038;
i__8012_8018 = G__8039;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.tabs.vertical_grip = (function vertical_grip(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,"div.vertical-grip","div.vertical-grip",4287455262),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"draggable","draggable",709423359),"true"], null)], null));var seq__8046_8052 = 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,"dragstart","dragstart",721070880),(function (e){e.dataTransfer.dropEffect = "move";
e.dataTransfer.setData("text/plain",null);
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"start-drag","start-drag",3689081649),e);
}),new cljs.core.Keyword(null,"dragend","dragend",2926432921),(function (e){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"end-drag","end-drag",2692811352),e);
}),new cljs.core.Keyword(null,"drag","drag",1016996006),(function (e){e.dataTransfer.dropEffect = "move";
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"width!","width!",4520836749),e);
})], null)));var chunk__8047_8053 = null;var count__8048_8054 = 0;var i__8049_8055 = 0;while(true){
if((i__8049_8055 < count__8048_8054))
{var vec__8050_8056 = cljs.core._nth.call(null,chunk__8047_8053,i__8049_8055);var ev__3326__auto___8057 = cljs.core.nth.call(null,vec__8050_8056,0,null);var func__3327__auto___8058 = cljs.core.nth.call(null,vec__8050_8056,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___8057,func__3327__auto___8058);
{
var G__8059 = seq__8046_8052;
var G__8060 = chunk__8047_8053;
var G__8061 = count__8048_8054;
var G__8062 = (i__8049_8055 + 1);
seq__8046_8052 = G__8059;
chunk__8047_8053 = G__8060;
count__8048_8054 = G__8061;
i__8049_8055 = G__8062;
continue;
}
} else
{var temp__4092__auto___8063 = cljs.core.seq.call(null,seq__8046_8052);if(temp__4092__auto___8063)
{var seq__8046_8064__$1 = temp__4092__auto___8063;if(cljs.core.chunked_seq_QMARK_.call(null,seq__8046_8064__$1))
{var c__4262__auto___8065 = cljs.core.chunk_first.call(null,seq__8046_8064__$1);{
var G__8066 = cljs.core.chunk_rest.call(null,seq__8046_8064__$1);
var G__8067 = c__4262__auto___8065;
var G__8068 = cljs.core.count.call(null,c__4262__auto___8065);
var G__8069 = 0;
seq__8046_8052 = G__8066;
chunk__8047_8053 = G__8067;
count__8048_8054 = G__8068;
i__8049_8055 = G__8069;
continue;
}
} else
{var vec__8051_8070 = cljs.core.first.call(null,seq__8046_8064__$1);var ev__3326__auto___8071 = cljs.core.nth.call(null,vec__8051_8070,0,null);var func__3327__auto___8072 = cljs.core.nth.call(null,vec__8051_8070,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___8071,func__3327__auto___8072);
{
var G__8073 = cljs.core.next.call(null,seq__8046_8064__$1);
var G__8074 = null;
var G__8075 = 0;
var G__8076 = 0;
seq__8046_8052 = G__8073;
chunk__8047_8053 = G__8074;
count__8048_8054 = G__8075;
i__8049_8055 = G__8076;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.tabs.__GT_perc = (function __GT_perc(x){if(cljs.core.truth_(x))
{return [cljs.core.str(x),cljs.core.str("%")].join('');
} else
{return "0";
}
});
lt.objs.tabs.floored = (function floored(x){if((x < 0))
{return 0;
} else
{if((x > 100))
{return 100;
} else
{if(new cljs.core.Keyword(null,"else","else",1017020587))
{return x;
} else
{return null;
}
}
}
});
lt.objs.tabs.to_perc = (function to_perc(width,x){return ((x / width) * 100);
});
lt.objs.tabs.next_tabset = (function next_tabset(t){var ts = cljs.core.deref.call(null,lt.objs.tabs.multi).call(null,new cljs.core.Keyword(null,"tabsets","tabsets",3756175576));return cljs.core.second.call(null,cljs.core.drop_while.call(null,(function (p1__8077_SHARP_){return cljs.core.not_EQ_.call(null,t,p1__8077_SHARP_);
}),ts));
});
lt.objs.tabs.prev_tabset = (function prev_tabset(t){var ts = cljs.core.deref.call(null,lt.objs.tabs.multi).call(null,new cljs.core.Keyword(null,"tabsets","tabsets",3756175576));return cljs.core.last.call(null,cljs.core.take_while.call(null,(function (p1__8078_SHARP_){return cljs.core.not_EQ_.call(null,t,p1__8078_SHARP_);
}),ts));
});
lt.objs.tabs.previous_tabset_width = (function previous_tabset_width(cur){var ts = cljs.core.deref.call(null,lt.objs.tabs.multi).call(null,new cljs.core.Keyword(null,"tabsets","tabsets",3756175576));return cljs.core.reduce.call(null,cljs.core._PLUS_,0,cljs.core.map.call(null,cljs.core.comp.call(null,new cljs.core.Keyword(null,"width","width",1127031096),cljs.core.deref),cljs.core.take_while.call(null,(function (p1__8079_SHARP_){return cljs.core.not_EQ_.call(null,cur,p1__8079_SHARP_);
}),ts)));
});
lt.objs.tabs.add_tabset = (function add_tabset(ts){lt.object.update_BANG_.call(null,lt.objs.tabs.multi,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tabsets","tabsets",3756175576)], null),cljs.core.conj,ts);
return lt.util.dom.append.call(null,new cljs.core.Keyword(null,"tabsets-elem","tabsets-elem",4253111048).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.tabs.multi)),lt.object.__GT_content.call(null,ts));
});
lt.objs.tabs.spawn_tabset = (function spawn_tabset(){var ts = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779));var width = (100 - cljs.core.reduce.call(null,cljs.core._PLUS_,cljs.core.map.call(null,cljs.core.comp.call(null,new cljs.core.Keyword(null,"width","width",1127031096),cljs.core.deref),cljs.core.deref.call(null,lt.objs.tabs.multi).call(null,new cljs.core.Keyword(null,"tabsets","tabsets",3756175576)))));lt.object.merge_BANG_.call(null,ts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),width], null));
lt.objs.tabs.add_tabset.call(null,ts);
return ts;
});
lt.objs.tabs.equalize_tabset_widths = (function equalize_tabset_widths(){var tss = new cljs.core.Keyword(null,"tabsets","tabsets",3756175576).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.tabs.multi));var width = (100.0 / cljs.core.count.call(null,tss));var seq__8084 = cljs.core.seq.call(null,tss);var chunk__8085 = null;var count__8086 = 0;var i__8087 = 0;while(true){
if((i__8087 < count__8086))
{var ts = cljs.core._nth.call(null,chunk__8085,i__8087);lt.object.merge_BANG_.call(null,ts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),width], null));
{
var G__8088 = seq__8084;
var G__8089 = chunk__8085;
var G__8090 = count__8086;
var G__8091 = (i__8087 + 1);
seq__8084 = G__8088;
chunk__8085 = G__8089;
count__8086 = G__8090;
i__8087 = G__8091;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__8084);if(temp__4092__auto__)
{var seq__8084__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__8084__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__8084__$1);{
var G__8092 = cljs.core.chunk_rest.call(null,seq__8084__$1);
var G__8093 = c__4262__auto__;
var G__8094 = cljs.core.count.call(null,c__4262__auto__);
var G__8095 = 0;
seq__8084 = G__8092;
chunk__8085 = G__8093;
count__8086 = G__8094;
i__8087 = G__8095;
continue;
}
} else
{var ts = cljs.core.first.call(null,seq__8084__$1);lt.object.merge_BANG_.call(null,ts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),width], null));
{
var G__8096 = cljs.core.next.call(null,seq__8084__$1);
var G__8097 = null;
var G__8098 = 0;
var G__8099 = 0;
seq__8084 = G__8096;
chunk__8085 = G__8097;
count__8086 = G__8098;
i__8087 = G__8099;
continue;
}
}
} else
{return null;
}
}
break;
}
});
lt.objs.tabs.temp_width = (function temp_width(ts,w){return lt.util.dom.css.call(null,lt.object.__GT_content.call(null,ts),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",1127031096),lt.objs.tabs.__GT_perc.call(null,w),new cljs.core.Keyword(null,"border-width","border-width",1324275799),((cljs.core._EQ_.call(null,0,w))?0:"")], null));
});
lt.objs.tabs.activate_tabset = (function activate_tabset(ts){if(cljs.core._EQ_.call(null,lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575)),ts))
{return null;
} else
{var temp__4092__auto___8100 = lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575));if(cljs.core.truth_(temp__4092__auto___8100))
{var old_8101 = temp__4092__auto___8100;lt.util.dom.remove_class.call(null,lt.object.__GT_content.call(null,old_8101),new cljs.core.Keyword(null,"active","active",3885920888));
} else
{}
lt.objs.context.in_BANG_.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575),ts);
lt.util.dom.add_class.call(null,lt.object.__GT_content.call(null,ts),new cljs.core.Keyword(null,"active","active",3885920888));
return true;
}
});
lt.objs.tabs.tabset_ui = (function tabset_ui(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.tabset","div.tabset",2815514652),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",1123684643),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),crate.binding.bound.call(null,crate.binding.subatom.call(null,this$,new cljs.core.Keyword(null,"width","width",1127031096)),lt.objs.tabs.__GT_perc)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.list","div.list",1323928397),crate.binding.bound.call(null,this$,(function (p1__8102_SHARP_){return lt.objs.tabs.objs_list.call(null,this$,new cljs.core.Keyword(null,"objs","objs",1017308622).cljs$core$IFn$_invoke$arity$1(p1__8102_SHARP_));
}))], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.items","div.items",2032262037),crate.binding.map_bound.call(null,cljs.core.partial.call(null,lt.objs.tabs.tabbed_item,crate.binding.subatom.call(null,this$,new cljs.core.Keyword(null,"active-obj","active-obj",3056705826))),this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"path","path",1017337751),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"objs","objs",1017308622)], null)], null))], null),lt.objs.tabs.vertical_grip.call(null,this$)], null));var seq__8109_8115 = 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,"active","active",3885920888));
})], null)));var chunk__8110_8116 = null;var count__8111_8117 = 0;var i__8112_8118 = 0;while(true){
if((i__8112_8118 < count__8111_8117))
{var vec__8113_8119 = cljs.core._nth.call(null,chunk__8110_8116,i__8112_8118);var ev__3326__auto___8120 = cljs.core.nth.call(null,vec__8113_8119,0,null);var func__3327__auto___8121 = cljs.core.nth.call(null,vec__8113_8119,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___8120,func__3327__auto___8121);
{
var G__8122 = seq__8109_8115;
var G__8123 = chunk__8110_8116;
var G__8124 = count__8111_8117;
var G__8125 = (i__8112_8118 + 1);
seq__8109_8115 = G__8122;
chunk__8110_8116 = G__8123;
count__8111_8117 = G__8124;
i__8112_8118 = G__8125;
continue;
}
} else
{var temp__4092__auto___8126 = cljs.core.seq.call(null,seq__8109_8115);if(temp__4092__auto___8126)
{var seq__8109_8127__$1 = temp__4092__auto___8126;if(cljs.core.chunked_seq_QMARK_.call(null,seq__8109_8127__$1))
{var c__4262__auto___8128 = cljs.core.chunk_first.call(null,seq__8109_8127__$1);{
var G__8129 = cljs.core.chunk_rest.call(null,seq__8109_8127__$1);
var G__8130 = c__4262__auto___8128;
var G__8131 = cljs.core.count.call(null,c__4262__auto___8128);
var G__8132 = 0;
seq__8109_8115 = G__8129;
chunk__8110_8116 = G__8130;
count__8111_8117 = G__8131;
i__8112_8118 = G__8132;
continue;
}
} else
{var vec__8114_8133 = cljs.core.first.call(null,seq__8109_8127__$1);var ev__3326__auto___8134 = cljs.core.nth.call(null,vec__8114_8133,0,null);var func__3327__auto___8135 = cljs.core.nth.call(null,vec__8114_8133,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___8134,func__3327__auto___8135);
{
var G__8136 = cljs.core.next.call(null,seq__8109_8127__$1);
var G__8137 = null;
var G__8138 = 0;
var G__8139 = 0;
seq__8109_8115 = G__8136;
chunk__8110_8116 = G__8137;
count__8111_8117 = G__8138;
i__8112_8118 = G__8139;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779),new cljs.core.Keyword(null,"objs","objs",1017308622),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"active-obj","active-obj",3056705826),null,new cljs.core.Keyword(null,"count","count",1108755585),0,new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tabset","tabset",4427500575),null], null), null),new cljs.core.Keyword(null,"width","width",1127031096),100,new cljs.core.Keyword(null,"init","init",1017141378),(function (this$){return lt.objs.tabs.tabset_ui.call(null,this$);
}));
lt.objs.tabs.__GT_tabsets = (function __GT_tabsets(tabs){var iter__4231__auto__ = (function iter__8144(s__8145){return (new cljs.core.LazySeq(null,(function (){var s__8145__$1 = s__8145;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__8145__$1);if(temp__4092__auto__)
{var s__8145__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__8145__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__8145__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__8147 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__8146 = 0;while(true){
if((i__8146 < size__4230__auto__))
{var k = cljs.core._nth.call(null,c__4229__auto__,i__8146);cljs.core.chunk_append.call(null,b__8147,lt.object.__GT_content.call(null,k));
{
var G__8148 = (i__8146 + 1);
i__8146 = G__8148;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__8147),iter__8144.call(null,cljs.core.chunk_rest.call(null,s__8145__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__8147),null);
}
} else
{var k = cljs.core.first.call(null,s__8145__$2);return cljs.core.cons.call(null,lt.object.__GT_content.call(null,k),iter__8144.call(null,cljs.core.rest.call(null,s__8145__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,tabs);
});
lt.objs.tabs.tabset = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779));
lt.objs.tabs.add_BANG_ = (function() {
var add_BANG_ = null;
var add_BANG___1 = (function (obj){return add_BANG_.call(null,obj,null);
});
var add_BANG___2 = (function (obj,ts){var temp__4092__auto__ = (function (){var or__3520__auto__ = ts;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575));
}
})();if(cljs.core.truth_(temp__4092__auto__))
{var cur_tabset = temp__4092__auto__;lt.object.add_tags.call(null,obj,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tabset.tab","tabset.tab",1444337222)], null));
lt.object.update_BANG_.call(null,cur_tabset,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"objs","objs",1017308622)], null),cljs.core.conj,obj);
lt.object.merge_BANG_.call(null,obj,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779),cur_tabset], null));
cljs.core.add_watch.call(null,crate.binding.subatom.call(null,obj,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"dirty","dirty",1109497668)], null)),new cljs.core.Keyword(null,"tabs","tabs",1017456368),(function (_,___$1,___$2,cur){return lt.object.raise.call(null,cur_tabset,new cljs.core.Keyword(null,"tab.updated","tab.updated",2727558868));
}));
return obj;
} else
{return null;
}
});
add_BANG_ = function(obj,ts){
switch(arguments.length){
case 1:
return add_BANG___1.call(this,obj);
case 2:
return add_BANG___2.call(this,obj,ts);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
add_BANG_.cljs$core$IFn$_invoke$arity$1 = add_BANG___1;
add_BANG_.cljs$core$IFn$_invoke$arity$2 = add_BANG___2;
return add_BANG_;
})()
;
lt.objs.tabs.rem_tabset = (function() {
var rem_tabset = null;
var rem_tabset__1 = (function (ts){return rem_tabset.call(null,ts,false);
});
var rem_tabset__2 = (function (ts,prev_QMARK_){var to_ts = (cljs.core.truth_(prev_QMARK_)?(function (){var or__3520__auto__ = lt.objs.tabs.prev_tabset.call(null,ts);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.tabs.next_tabset.call(null,ts);
}
})():(function (){var or__3520__auto__ = lt.objs.tabs.next_tabset.call(null,ts);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.tabs.prev_tabset.call(null,ts);
}
})());if(cljs.core.truth_(to_ts))
{lt.object.merge_BANG_.call(null,to_ts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),lt.objs.tabs.floored.call(null,(new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,to_ts)) + new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts))))], null));
lt.util.dom.remove.call(null,lt.object.__GT_content.call(null,ts));
var seq__8154_8158 = cljs.core.seq.call(null,new cljs.core.Keyword(null,"objs","objs",1017308622).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts)));var chunk__8155_8159 = null;var count__8156_8160 = 0;var i__8157_8161 = 0;while(true){
if((i__8157_8161 < count__8156_8160))
{var t_8162 = cljs.core._nth.call(null,chunk__8155_8159,i__8157_8161);lt.objs.tabs.add_BANG_.call(null,t_8162,to_ts);
{
var G__8163 = seq__8154_8158;
var G__8164 = chunk__8155_8159;
var G__8165 = count__8156_8160;
var G__8166 = (i__8157_8161 + 1);
seq__8154_8158 = G__8163;
chunk__8155_8159 = G__8164;
count__8156_8160 = G__8165;
i__8157_8161 = G__8166;
continue;
}
} else
{var temp__4092__auto___8167 = cljs.core.seq.call(null,seq__8154_8158);if(temp__4092__auto___8167)
{var seq__8154_8168__$1 = temp__4092__auto___8167;if(cljs.core.chunked_seq_QMARK_.call(null,seq__8154_8168__$1))
{var c__4262__auto___8169 = cljs.core.chunk_first.call(null,seq__8154_8168__$1);{
var G__8170 = cljs.core.chunk_rest.call(null,seq__8154_8168__$1);
var G__8171 = c__4262__auto___8169;
var G__8172 = cljs.core.count.call(null,c__4262__auto___8169);
var G__8173 = 0;
seq__8154_8158 = G__8170;
chunk__8155_8159 = G__8171;
count__8156_8160 = G__8172;
i__8157_8161 = G__8173;
continue;
}
} else
{var t_8174 = cljs.core.first.call(null,seq__8154_8168__$1);lt.objs.tabs.add_BANG_.call(null,t_8174,to_ts);
{
var G__8175 = cljs.core.next.call(null,seq__8154_8168__$1);
var G__8176 = null;
var G__8177 = 0;
var G__8178 = 0;
seq__8154_8158 = G__8175;
chunk__8155_8159 = G__8176;
count__8156_8160 = G__8177;
i__8157_8161 = G__8178;
continue;
}
}
} else
{}
}
break;
}
lt.object.update_BANG_.call(null,lt.objs.tabs.multi,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tabsets","tabsets",3756175576)], null),(function (p1__8149_SHARP_){return cljs.core.vec.call(null,cljs.core.remove.call(null,cljs.core.PersistentHashSet.fromArray([ts], true),p1__8149_SHARP_));
}));
lt.object.destroy_BANG_.call(null,ts);
lt.objs.tabs.equalize_tabset_widths.call(null);
return lt.object.raise.call(null,to_ts,new cljs.core.Keyword(null,"active","active",3885920888));
} else
{return null;
}
});
rem_tabset = function(ts,prev_QMARK_){
switch(arguments.length){
case 1:
return rem_tabset__1.call(this,ts);
case 2:
return rem_tabset__2.call(this,ts,prev_QMARK_);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
rem_tabset.cljs$core$IFn$_invoke$arity$1 = rem_tabset__1;
rem_tabset.cljs$core$IFn$_invoke$arity$2 = rem_tabset__2;
return rem_tabset;
})()
;
lt.objs.tabs.rem_BANG_ = (function rem_BANG_(obj){if(cljs.core.truth_((function (){var and__3508__auto__ = obj;if(cljs.core.truth_(and__3508__auto__))
{var and__3508__auto____$1 = cljs.core.deref.call(null,obj);if(cljs.core.truth_(and__3508__auto____$1))
{return new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,obj));
} else
{return and__3508__auto____$1;
}
} else
{return and__3508__auto__;
}
})()))
{var cur_tabset = new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,obj));var idx = lt.objs.tabs.__GT_index.call(null,obj);var active = new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,cur_tabset));var aidx = lt.objs.tabs.__GT_index.call(null,active);cljs.core.remove_watch.call(null,obj,new cljs.core.Keyword(null,"tabs","tabs",1017456368));
lt.object.merge_BANG_.call(null,obj,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779),null], null));
lt.object.merge_BANG_.call(null,cur_tabset,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"objs","objs",1017308622),cljs.core.vec.call(null,cljs.core.remove.call(null,(function (p1__8179_SHARP_){return cljs.core._EQ_.call(null,obj,p1__8179_SHARP_);
}),cljs.core.deref.call(null,cur_tabset).call(null,new cljs.core.Keyword(null,"objs","objs",1017308622))))], null));
if(cljs.core._EQ_.call(null,obj,active))
{return lt.object.raise.call(null,cur_tabset,new cljs.core.Keyword(null,"tab","tab",1014018823),idx);
} else
{if(cljs.core.not_EQ_.call(null,aidx,lt.objs.tabs.__GT_index.call(null,active)))
{lt.object.merge_BANG_.call(null,cur_tabset,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"active-obj","active-obj",3056705826),null], null));
return lt.objs.tabs.active_BANG_.call(null,active);
} else
{return null;
}
}
} else
{return null;
}
});
lt.objs.tabs.refresh_BANG_ = (function refresh_BANG_(obj){var temp__4092__auto__ = new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,obj));if(cljs.core.truth_(temp__4092__auto__))
{var ts = temp__4092__auto__;return lt.object.raise.call(null,ts,new cljs.core.Keyword(null,"tab.updated","tab.updated",2727558868));
} else
{return null;
}
});
lt.objs.tabs.in_tab_QMARK_ = (function in_tab_QMARK_(obj){return cljs.core.deref.call(null,obj).call(null,new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779));
});
lt.objs.tabs.add_or_focus_BANG_ = (function add_or_focus_BANG_(obj){if(cljs.core.truth_(lt.objs.tabs.in_tab_QMARK_.call(null,obj)))
{return lt.objs.tabs.active_BANG_.call(null,obj);
} else
{lt.objs.tabs.add_BANG_.call(null,obj);
return lt.objs.tabs.active_BANG_.call(null,obj);
}
});
lt.objs.tabs.num_tabs = (function num_tabs(){return cljs.core.reduce.call(null,(function (res,cur){return (res + cljs.core.count.call(null,new cljs.core.Keyword(null,"objs","objs",1017308622).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,cur))));
}),0,new cljs.core.Keyword(null,"tabsets","tabsets",3756175576).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.tabs.multi)));
});
lt.objs.tabs.active_tab = (function active_tab(){var temp__4092__auto__ = lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575));if(cljs.core.truth_(temp__4092__auto__))
{var cur_tabset = temp__4092__auto__;return new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,cur_tabset));
} else
{return null;
}
});
lt.objs.tabs.move_tab_to_tabset = (function move_tab_to_tabset(obj,ts){lt.objs.tabs.rem_BANG_.call(null,obj);
lt.objs.tabs.add_BANG_.call(null,obj,ts);
lt.objs.tabs.active_BANG_.call(null,obj);
return lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"move","move",1017261891));
});
lt.objs.tabs.move_tab = (function move_tab(multi,elem){var id = lt.util.dom.attr.call(null,elem,new cljs.core.Keyword(null,"obj-id","obj-id",4285449507));var idx = lt.util.dom.index.call(null,elem);var obj = lt.object.by_id.call(null,parseInt(id));var cnt = cljs.core.count.call(null,new cljs.core.Keyword(null,"objs","objs",1017308622).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,multi)));lt.objs.tabs.rem_BANG_.call(null,obj);
lt.objs.tabs.add_BANG_.call(null,obj,multi);
if((cnt > 0))
{lt.objs.tabs.update_tab_order.call(null,multi,cljs.core.vec.call(null,cljs.core.concat.call(null,cljs.core.range.call(null,idx),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cnt], null),cljs.core.range.call(null,idx,cnt))));
} else
{}
lt.objs.tabs.active_BANG_.call(null,obj);
return lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"move","move",1017261891));
});
lt.objs.tabs.__BEH__on_destroy_remove = (function __BEH__on_destroy_remove(this$){return lt.objs.tabs.rem_BANG_.call(null,this$);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","on-destroy-remove","lt.objs.tabs/on-destroy-remove",1369860715),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__on_destroy_remove,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"destroy","destroy",2571277164),null,new cljs.core.Keyword(null,"closed","closed",3951351006),null], null), null));
lt.objs.tabs.__BEH__active_tab_num = (function __BEH__active_tab_num(this$,num){var objs = cljs.core.deref.call(null,this$).call(null,new cljs.core.Keyword(null,"objs","objs",1017308622));if((num < cljs.core.count.call(null,objs)))
{return lt.objs.tabs.active_BANG_.call(null,cljs.core.get.call(null,objs,num));
} else
{return lt.objs.tabs.active_BANG_.call(null,cljs.core.get.call(null,objs,(cljs.core.count.call(null,objs) - 1)));
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","active-tab-num","lt.objs.tabs/active-tab-num",3859758153),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__active_tab_num,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tab","tab",1014018823),null], null), null));
lt.objs.tabs.__BEH__prev_tab = (function __BEH__prev_tab(this$){var objs = cljs.core.deref.call(null,this$).call(null,new cljs.core.Keyword(null,"objs","objs",1017308622));var idx = lt.objs.tabs.__GT_index.call(null,new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));if((idx > 0))
{return lt.objs.tabs.active_BANG_.call(null,cljs.core.get.call(null,objs,(idx - 1)));
} else
{return lt.objs.tabs.active_BANG_.call(null,cljs.core.get.call(null,objs,(cljs.core.count.call(null,objs) - 1)));
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","prev-tab","lt.objs.tabs/prev-tab",3503997629),new cljs.core.Keyword(null,"throttle","throttle",2497347228),100,new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__prev_tab,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tab.prev","tab.prev",4356539486),null], null), null));
lt.objs.tabs.__BEH__next_tab = (function __BEH__next_tab(this$){var objs = cljs.core.deref.call(null,this$).call(null,new cljs.core.Keyword(null,"objs","objs",1017308622));var idx = (lt.objs.tabs.__GT_index.call(null,new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))) + 1);if((idx < cljs.core.count.call(null,objs)))
{return lt.objs.tabs.active_BANG_.call(null,cljs.core.get.call(null,objs,idx));
} else
{return lt.objs.tabs.active_BANG_.call(null,cljs.core.get.call(null,objs,0));
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","next-tab","lt.objs.tabs/next-tab",4026023933),new cljs.core.Keyword(null,"throttle","throttle",2497347228),100,new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__next_tab,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tab.next","tab.next",4356467998),null], null), null));
lt.objs.tabs.__BEH__tab_close = (function __BEH__tab_close(this$){try{var orig = new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));return lt.object.raise.call(null,orig,new cljs.core.Keyword(null,"close","close",1108660586));
}catch (e8181){var e = e8181;return lt.objs.console.error(e);
}});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","tab-close","lt.objs.tabs/tab-close",921329682),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__tab_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,"tab.close","tab.close",1544206801),null], null), null));
lt.objs.tabs.__BEH__on_destroy_objs = (function __BEH__on_destroy_objs(this$){var seq__8186 = cljs.core.seq.call(null,new cljs.core.Keyword(null,"objs","objs",1017308622).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));var chunk__8187 = null;var count__8188 = 0;var i__8189 = 0;while(true){
if((i__8189 < count__8188))
{var e = cljs.core._nth.call(null,chunk__8187,i__8189);lt.object.destroy_BANG_.call(null,e);
{
var G__8190 = seq__8186;
var G__8191 = chunk__8187;
var G__8192 = count__8188;
var G__8193 = (i__8189 + 1);
seq__8186 = G__8190;
chunk__8187 = G__8191;
count__8188 = G__8192;
i__8189 = G__8193;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__8186);if(temp__4092__auto__)
{var seq__8186__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__8186__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__8186__$1);{
var G__8194 = cljs.core.chunk_rest.call(null,seq__8186__$1);
var G__8195 = c__4262__auto__;
var G__8196 = cljs.core.count.call(null,c__4262__auto__);
var G__8197 = 0;
seq__8186 = G__8194;
chunk__8187 = G__8195;
count__8188 = G__8196;
i__8189 = G__8197;
continue;
}
} else
{var e = cljs.core.first.call(null,seq__8186__$1);lt.object.destroy_BANG_.call(null,e);
{
var G__8198 = cljs.core.next.call(null,seq__8186__$1);
var G__8199 = null;
var G__8200 = 0;
var G__8201 = 0;
seq__8186 = G__8198;
chunk__8187 = G__8199;
count__8188 = G__8200;
i__8189 = G__8201;
continue;
}
}
} else
{return null;
}
}
break;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","on-destroy-objs","lt.objs.tabs/on-destroy-objs",2776869971),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__on_destroy_objs,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"destroy","destroy",2571277164),null], null), null));
lt.objs.tabs.__BEH__repaint_tab_updated = (function __BEH__repaint_tab_updated(this$){return lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"count","count",1108755585)], null),cljs.core.inc);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","repaint-tab-updated","lt.objs.tabs/repaint-tab-updated",1521843223),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__repaint_tab_updated,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tab.updated","tab.updated",2727558868),null], null), null));
lt.objs.tabs.__BEH__no_anim_on_drag = (function __BEH__no_anim_on_drag(this$){return lt.objs.animations.off.call(null);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","no-anim-on-drag","lt.objs.tabs/no-anim-on-drag",2746913928),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__no_anim_on_drag,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-drag","start-drag",3689081649),null], null), null));
lt.objs.tabs.__BEH__reanim_on_drop = (function __BEH__reanim_on_drop(this$){return lt.objs.animations.on.call(null);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","reanim-on-drop","lt.objs.tabs/reanim-on-drop",2109600678),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__reanim_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,"end-drag","end-drag",2692811352),null], null), null));
lt.objs.tabs.__BEH__set_dragging = (function __BEH__set_dragging(this$){return lt.util.dom.add_class.call(null,lt.util.dom.$.call(null,new cljs.core.Keyword(null,"body","body",1016933652)),new cljs.core.Keyword(null,"dragging","dragging",4467773633));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","set-dragging","lt.objs.tabs/set-dragging",3265197408),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__set_dragging,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-drag","start-drag",3689081649),null], null), null));
lt.objs.tabs.__BEH__unset_dragging = (function __BEH__unset_dragging(this$){return lt.util.dom.remove_class.call(null,lt.util.dom.$.call(null,new cljs.core.Keyword(null,"body","body",1016933652)),new cljs.core.Keyword(null,"dragging","dragging",4467773633));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","unset-dragging","lt.objs.tabs/unset-dragging",4764787269),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__unset_dragging,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"end-drag","end-drag",2692811352),null], null), null));
lt.objs.tabs.__BEH__set_width_final_BANG_ = (function __BEH__set_width_final_BANG_(this$,e){var temp__4092__auto__ = lt.objs.tabs.next_tabset.call(null,this$);if(cljs.core.truth_(temp__4092__auto__))
{var ts = temp__4092__auto__;var width = lt.util.dom.width.call(null,lt.object.__GT_content.call(null,lt.objs.tabs.multi));var left = new cljs.core.Keyword(null,"left","left",1017222009).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.tabs.multi));var cx = e.clientX;var new_loc = ((width + left) - cx);var new_perc = lt.objs.tabs.floored.call(null,(((100 - lt.objs.tabs.previous_tabset_width.call(null,this$)) - lt.objs.tabs.to_perc.call(null,width,new_loc)) | 0));var prev_width = new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));var new_perc__$1 = (((new_perc >= (new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts)) + prev_width)))?(new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts)) + prev_width):new_perc);var next_width = lt.objs.tabs.floored.call(null,((cljs.core.not.call(null,ts))?1:(new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts)) + (prev_width - new_perc__$1))));if(cljs.core._EQ_.call(null,new_perc__$1,0))
{return lt.objs.tabs.rem_tabset.call(null,this$);
} else
{if(cljs.core._EQ_.call(null,next_width,0))
{return lt.objs.tabs.rem_tabset.call(null,ts,new cljs.core.Keyword(null,"prev","prev",1017353637));
} else
{if(new cljs.core.Keyword(null,"else","else",1017020587))
{if(cljs.core._EQ_.call(null,cx,0))
{return null;
} else
{if((new_perc__$1 < 0))
{return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),100], null));
} else
{if(cljs.core.truth_((function (){var and__3508__auto__ = cljs.core.not_EQ_.call(null,cx,0);if(and__3508__auto__)
{var and__3508__auto____$1 = ts;if(cljs.core.truth_(and__3508__auto____$1))
{return ((new_perc__$1 >= 0)) && ((next_width >= 0));
} else
{return and__3508__auto____$1;
}
} else
{return and__3508__auto__;
}
})()))
{lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),new_perc__$1], null));
if(cljs.core.truth_(ts))
{return lt.object.merge_BANG_.call(null,ts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",1127031096),next_width], null));
} else
{return lt.objs.tabs.spawn_tabset.call(null);
}
} else
{return null;
}
}
}
} else
{return null;
}
}
}
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","set-width-final!","lt.objs.tabs/set-width-final!",4331804915),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__set_width_final_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,"end-drag","end-drag",2692811352),null], null), null));
lt.objs.tabs.__BEH__width_BANG_ = (function __BEH__width_BANG_(this$,e){var width = lt.util.dom.width.call(null,lt.object.__GT_content.call(null,lt.objs.tabs.multi));var left = new cljs.core.Keyword(null,"left","left",1017222009).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.tabs.multi));var cx = e.clientX;var new_loc = ((width + left) - cx);var new_perc = lt.objs.tabs.floored.call(null,(((100 - lt.objs.tabs.previous_tabset_width.call(null,this$)) - lt.objs.tabs.to_perc.call(null,width,new_loc)) | 0));var prev_width = new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));var ts = lt.objs.tabs.next_tabset.call(null,this$);var new_perc__$1 = (cljs.core.truth_((function (){var and__3508__auto__ = ts;if(cljs.core.truth_(and__3508__auto__))
{return (new_perc >= (new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts)) + prev_width));
} else
{return and__3508__auto__;
}
})())?(new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts)) + prev_width):new_perc);var next_width = lt.objs.tabs.floored.call(null,((cljs.core.not.call(null,ts))?1:(new cljs.core.Keyword(null,"width","width",1127031096).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts)) + (prev_width - new_perc__$1))));if(cljs.core._EQ_.call(null,cx,0))
{return null;
} else
{if((new_perc__$1 < 0))
{return lt.objs.tabs.temp_width.call(null,this$,100);
} else
{if(cljs.core.truth_((function (){var and__3508__auto__ = cljs.core.not_EQ_.call(null,cx,0);if(and__3508__auto__)
{var and__3508__auto____$1 = ts;if(cljs.core.truth_(and__3508__auto____$1))
{return ((new_perc__$1 >= 0)) && ((next_width >= 0));
} else
{return and__3508__auto____$1;
}
} else
{return and__3508__auto__;
}
})()))
{lt.objs.tabs.temp_width.call(null,this$,new_perc__$1);
if(cljs.core.truth_(ts))
{return lt.objs.tabs.temp_width.call(null,ts,next_width);
} else
{return lt.objs.tabs.spawn_tabset.call(null);
}
} else
{return null;
}
}
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","width!","lt.objs.tabs/width!",1942600349),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__width_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,"width!","width!",4520836749),null], null), null));
lt.objs.tabs.__BEH__tab_active = (function __BEH__tab_active(this$){return lt.objs.tabs.activate_tabset.call(null,new cljs.core.Keyword("lt.objs.tabs","tabset","lt.objs.tabs/tabset",3378091779).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","tab-active","lt.objs.tabs/tab-active",3117606804),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__tab_active,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"active","active",3885920888),null], null), null));
lt.objs.tabs.__BEH__tab_label_menu_PLUS_ = (function __BEH__tab_label_menu_PLUS_(this$,items){return cljs.core.conj.call(null,items,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Move tab to new tabset",new cljs.core.Keyword(null,"order","order",1119910592),1,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"tabs.move-new-tabset","tabs.move-new-tabset",1394582008),new cljs.core.Keyword("lt.objs.tabs","tab-object","lt.objs.tabs/tab-object",3521887033).cljs$core$IFn$_invoke$arity$1(this$));
})], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Close tab",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,"close","close",1108660586));
})], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","tab-label-menu+","lt.objs.tabs/tab-label-menu+",3717573469),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__tab_label_menu_PLUS_,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+",1117686302),null], null), null));
lt.objs.tabs.__BEH__on_close_tab_label = (function __BEH__on_close_tab_label(this$){var temp__4092__auto___8202 = new cljs.core.Keyword("lt.objs.tabs","tab-object","lt.objs.tabs/tab-object",3521887033).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));if(cljs.core.truth_(temp__4092__auto___8202))
{var e_8203 = temp__4092__auto___8202;lt.object.raise.call(null,e_8203,new cljs.core.Keyword(null,"close","close",1108660586));
} else
{}
return lt.object.destroy_BANG_.call(null,this$);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","on-close-tab-label","lt.objs.tabs/on-close-tab-label",1131551871),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__on_close_tab_label,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",1108660586),null], null), null));
lt.objs.tabs.__BEH__tabset_active = (function __BEH__tabset_active(this$){if(cljs.core.truth_(lt.objs.tabs.activate_tabset.call(null,this$)))
{var temp__4092__auto__ = new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));if(cljs.core.truth_(temp__4092__auto__))
{var active = temp__4092__auto__;return lt.object.raise.call(null,active,new cljs.core.Keyword(null,"focus!","focus!",4039653819));
} else
{return null;
}
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","tabset-active","lt.objs.tabs/tabset-active",1106535340),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__tabset_active,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"active","active",3885920888),null], null), null));
lt.objs.tabs.__BEH__tabset_menu_PLUS_ = (function __BEH__tabset_menu_PLUS_(this$,items){return cljs.core.conj.call(null,items,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"New tabset",new cljs.core.Keyword(null,"order","order",1119910592),1,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"tabset.new","tabset.new",1444331601));
})], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Close tabset",new cljs.core.Keyword(null,"order","order",1119910592),2,new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.objs.tabs.rem_tabset.call(null,this$);
})], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","tabset-menu+","lt.objs.tabs/tabset-menu+",1202208846),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__tabset_menu_PLUS_,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+",1117686302),null], null), null));
lt.objs.tabs.__BEH__left_BANG_ = (function __BEH__left_BANG_(this$,v){return lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"left","left",1017222009)], null),cljs.core._PLUS_,v);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","left!","lt.objs.tabs/left!",2125172416),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__left_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,"left!","left!",1116755052),null], null), null));
lt.objs.tabs.__BEH__right_BANG_ = (function __BEH__right_BANG_(this$,v){return lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"right","right",1122416014)], null),cljs.core._PLUS_,v);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","right!","lt.objs.tabs/right!",3429024843),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__right_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,"right!","right!",4377769207),null], null), null));
lt.objs.tabs.__BEH__bottom_BANG_ = (function __BEH__bottom_BANG_(this$,v){return lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"bottom","bottom",3925642653)], null),cljs.core._PLUS_,v);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","bottom!","lt.objs.tabs/bottom!",2158565980),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__bottom_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,"bottom!","bottom!",1083481800),null], null), null));
lt.objs.tabs.__BEH__tabset_bottom_BANG_ = (function __BEH__tabset_bottom_BANG_(this$,v){return lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tabset-bottom","tabset-bottom",2176185021)], null),cljs.core._PLUS_,v);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","tabset-bottom!","lt.objs.tabs/tabset-bottom!",3779353980),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__tabset_bottom_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,"tabset-bottom!","tabset-bottom!",2684870056),null], null), null));
lt.objs.tabs.__BEH__init_sortable = (function __BEH__init_sortable(app){return initSortable(window);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","init-sortable","lt.objs.tabs/init-sortable",4237069211),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__init_sortable,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));
lt.objs.tabs.__BEH__init = (function __BEH__init(this$){lt.objs.tabs.add_tabset.call(null,lt.objs.tabs.tabset);
return lt.object.raise.call(null,lt.objs.tabs.tabset,new cljs.core.Keyword(null,"active","active",3885920888));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","init","lt.objs.tabs/init",2224810146),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__init,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));
lt.objs.tabs.__BEH__show_close_button = (function __BEH__show_close_button(this$){return true;
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.tabs","show-close-button","lt.objs.tabs/show-close-button",2366934073),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.tabs.__BEH__show_close_button,new cljs.core.Keyword(null,"desc","desc",1016984067),"Tab: Show close button on tabs",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-button+","close-button+",3559586774),null], null), null),new cljs.core.Keyword(null,"type","type",1017479852),new cljs.core.Keyword(null,"user","user",1017503549));
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,"tabs.move-new-tabset","tabs.move-new-tabset",1394582008),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tab: Move tab to new tabset",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (tab){var temp__4092__auto__ = lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575));if(cljs.core.truth_(temp__4092__auto__))
{var ts = temp__4092__auto__;var temp__4092__auto____$1 = (function (){var or__3520__auto__ = tab;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.deref.call(null,ts).call(null,new cljs.core.Keyword(null,"active-obj","active-obj",3056705826));
}
})();if(cljs.core.truth_(temp__4092__auto____$1))
{var cur = temp__4092__auto____$1;var new$ = lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"tabset.new","tabset.new",1444331601));return lt.objs.tabs.move_tab_to_tabset.call(null,cur,new$);
} else
{return null;
}
} 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,"tabs.move-next-tabset","tabs.move-next-tabset",3557293229),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tab: Move tab to next tabset",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,"tabset","tabset",4427500575));if(cljs.core.truth_(temp__4092__auto__))
{var ts = temp__4092__auto__;var cur = cljs.core.deref.call(null,ts).call(null,new cljs.core.Keyword(null,"active-obj","active-obj",3056705826));var next = (function (){var or__3520__auto__ = lt.objs.tabs.next_tabset.call(null,ts);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.tabs.prev_tabset.call(null,ts);
}
})();if(cljs.core.truth_((function (){var and__3508__auto__ = cur;if(cljs.core.truth_(and__3508__auto__))
{var and__3508__auto____$1 = next;if(cljs.core.truth_(and__3508__auto____$1))
{return cljs.core.not_EQ_.call(null,next,ts);
} else
{return and__3508__auto____$1;
}
} else
{return and__3508__auto__;
}
})()))
{return lt.objs.tabs.move_tab_to_tabset.call(null,cur,next);
} else
{return null;
}
} 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,"tabs.move-prev-tabset","tabs.move-prev-tabset",876232045),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tab: Move tab to previous tabset",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,"tabset","tabset",4427500575));if(cljs.core.truth_(temp__4092__auto__))
{var ts = temp__4092__auto__;var cur = cljs.core.deref.call(null,ts).call(null,new cljs.core.Keyword(null,"active-obj","active-obj",3056705826));var next = (function (){var or__3520__auto__ = lt.objs.tabs.prev_tabset.call(null,ts);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.tabs.next_tabset.call(null,ts);
}
})();if(cljs.core.truth_((function (){var and__3508__auto__ = cur;if(cljs.core.truth_(and__3508__auto__))
{var and__3508__auto____$1 = next;if(cljs.core.truth_(and__3508__auto____$1))
{return cljs.core.not_EQ_.call(null,next,ts);
} else
{return and__3508__auto____$1;
}
} else
{return and__3508__auto__;
}
})()))
{return lt.objs.tabs.move_tab_to_tabset.call(null,cur,next);
} else
{return null;
}
} 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,"tabs.next","tabs.next",3470721749),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tab: Next tab",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){return lt.object.raise.call(null,lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575)),new cljs.core.Keyword(null,"tab.next","tab.next",4356467998));
})], 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,"tabs.prev","tabs.prev",3470793237),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tab: Previous tab",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){return lt.object.raise.call(null,lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575)),new cljs.core.Keyword(null,"tab.prev","tab.prev",4356539486));
})], 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,"tabs.close","tabs.close",4150844154),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tab: Close current tab",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){if(cljs.core._EQ_.call(null,0,lt.objs.tabs.num_tabs.call(null)))
{lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"window.close","window.close",3118917100));
} else
{}
var temp__4092__auto__ = lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575));if(cljs.core.truth_(temp__4092__auto__))
{var ts = temp__4092__auto__;if(cljs.core.truth_((function (){var and__3508__auto__ = new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts));if(cljs.core.truth_(and__3508__auto__))
{return cljs.core.deref.call(null,new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts)));
} else
{return and__3508__auto__;
}
})()))
{return lt.object.raise.call(null,ts,new cljs.core.Keyword(null,"tab.close","tab.close",1544206801));
} else
{return null;
}
} 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,"tabs.close-all","tabs.close-all",2444215630),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tabs: Close all tabs",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var objs = lt.object.by_tag.call(null,new cljs.core.Keyword(null,"tabset.tab","tabset.tab",1444337222));var seq__8204 = cljs.core.seq.call(null,objs);var chunk__8205 = null;var count__8206 = 0;var i__8207 = 0;while(true){
if((i__8207 < count__8206))
{var obj = cljs.core._nth.call(null,chunk__8205,i__8207);lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"close","close",1108660586));
{
var G__8208 = seq__8204;
var G__8209 = chunk__8205;
var G__8210 = count__8206;
var G__8211 = (i__8207 + 1);
seq__8204 = G__8208;
chunk__8205 = G__8209;
count__8206 = G__8210;
i__8207 = G__8211;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__8204);if(temp__4092__auto__)
{var seq__8204__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__8204__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__8204__$1);{
var G__8212 = cljs.core.chunk_rest.call(null,seq__8204__$1);
var G__8213 = c__4262__auto__;
var G__8214 = cljs.core.count.call(null,c__4262__auto__);
var G__8215 = 0;
seq__8204 = G__8212;
chunk__8205 = G__8213;
count__8206 = G__8214;
i__8207 = G__8215;
continue;
}
} else
{var obj = cljs.core.first.call(null,seq__8204__$1);lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"close","close",1108660586));
{
var G__8216 = cljs.core.next.call(null,seq__8204__$1);
var G__8217 = null;
var G__8218 = 0;
var G__8219 = 0;
seq__8204 = G__8216;
chunk__8205 = G__8217;
count__8206 = G__8218;
i__8207 = G__8219;
continue;
}
}
} else
{return null;
}
}
break;
}
})], 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,"tabs.close-others","tabs.close-others",1458098362),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tabs: Close tabs except current tab",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var cur = lt.objs.tabs.active_tab.call(null);var objs = lt.object.by_tag.call(null,new cljs.core.Keyword(null,"tabset.tab","tabset.tab",1444337222));var seq__8220 = cljs.core.seq.call(null,objs);var chunk__8221 = null;var count__8222 = 0;var i__8223 = 0;while(true){
if((i__8223 < count__8222))
{var obj = cljs.core._nth.call(null,chunk__8221,i__8223);if(!((cur === obj)))
{lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"close","close",1108660586));
} else
{}
{
var G__8224 = seq__8220;
var G__8225 = chunk__8221;
var G__8226 = count__8222;
var G__8227 = (i__8223 + 1);
seq__8220 = G__8224;
chunk__8221 = G__8225;
count__8222 = G__8226;
i__8223 = G__8227;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__8220);if(temp__4092__auto__)
{var seq__8220__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__8220__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__8220__$1);{
var G__8228 = cljs.core.chunk_rest.call(null,seq__8220__$1);
var G__8229 = c__4262__auto__;
var G__8230 = cljs.core.count.call(null,c__4262__auto__);
var G__8231 = 0;
seq__8220 = G__8228;
chunk__8221 = G__8229;
count__8222 = G__8230;
i__8223 = G__8231;
continue;
}
} else
{var obj = cljs.core.first.call(null,seq__8220__$1);if(!((cur === obj)))
{lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"close","close",1108660586));
} else
{}
{
var G__8232 = cljs.core.next.call(null,seq__8220__$1);
var G__8233 = null;
var G__8234 = 0;
var G__8235 = 0;
seq__8220 = G__8232;
chunk__8221 = G__8233;
count__8222 = G__8234;
i__8223 = G__8235;
continue;
}
}
} else
{return null;
}
}
break;
}
})], 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,"tabs.goto","tabs.goto",3470522693),new cljs.core.Keyword(null,"hidden","hidden",4091384092),true,new cljs.core.Keyword(null,"desc","desc",1016984067),"Tab: Goto tab # or :last",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (x){var ts = lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575));var tab_count = cljs.core.count.call(null,new cljs.core.Keyword(null,"objs","objs",1017308622).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ts)));var idx = (tab_count - 1);return lt.object.raise.call(null,lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575)),new cljs.core.Keyword(null,"tab","tab",1014018823),((cljs.core._EQ_.call(null,x,new cljs.core.Keyword(null,"last","last",1017218568)))?idx:x));
})], 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,"tabset.next","tabset.next",1472250630),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tabset: Next tabset",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var temp__4090__auto__ = lt.objs.tabs.next_tabset.call(null,lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575)));if(cljs.core.truth_(temp__4090__auto__))
{var n = temp__4090__auto__;return lt.object.raise.call(null,n,new cljs.core.Keyword(null,"active","active",3885920888));
} else
{var temp__4090__auto____$1 = cljs.core.get.call(null,new cljs.core.Keyword(null,"tabsets","tabsets",3756175576).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.tabs.multi)),0);if(cljs.core.truth_(temp__4090__auto____$1))
{var n = temp__4090__auto____$1;return lt.object.raise.call(null,n,new cljs.core.Keyword(null,"active","active",3885920888));
} 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,"tabset.prev","tabset.prev",1472322118),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tabset: Previous tabset",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var temp__4090__auto__ = lt.objs.tabs.prev_tabset.call(null,lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575)));if(cljs.core.truth_(temp__4090__auto__))
{var n = temp__4090__auto__;return lt.object.raise.call(null,n,new cljs.core.Keyword(null,"active","active",3885920888));
} else
{var temp__4090__auto____$1 = cljs.core.last.call(null,new cljs.core.Keyword(null,"tabsets","tabsets",3756175576).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.tabs.multi)));if(cljs.core.truth_(temp__4090__auto____$1))
{var n = temp__4090__auto____$1;return lt.object.raise.call(null,n,new cljs.core.Keyword(null,"active","active",3885920888));
} 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,"tabset.close","tabset.close",2327781609),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tabset: Remove active tabset",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (ts){return lt.objs.tabs.rem_tabset.call(null,lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575)));
})], 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,"tabset.new","tabset.new",1444331601),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tabset: Add a tabset",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var ts = lt.objs.tabs.spawn_tabset.call(null);lt.objs.tabs.equalize_tabset_widths.call(null);
return ts;
})], 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,"tabs.focus-active","tabs.focus-active",2001074557),new cljs.core.Keyword(null,"desc","desc",1016984067),"Tab: focus active",new cljs.core.Keyword(null,"hidden","hidden",4091384092),true,new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var temp__4092__auto__ = new cljs.core.Keyword(null,"active-obj","active-obj",3056705826).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575))));if(cljs.core.truth_(temp__4092__auto__))
{var active = temp__4092__auto__;return lt.object.raise.call(null,active,new cljs.core.Keyword(null,"focus!","focus!",4039653819));
} else
{return null;
}
})], null));
lt.util.dom.append.call(null,lt.object.__GT_content.call(null,lt.objs.canvas.canvas),new cljs.core.Keyword(null,"content","content",1965434859).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.tabs.multi)));
