// 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__13561_SHARP_){return cljs.core._EQ_.call(null,obj,cljs.core.second.call(null,p1__13561_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__13562_SHARP_){return lt.util.dom.attr.call(null,p1__13562_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__13569_13575 = 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__13570_13576 = null;var count__13571_13577 = 0;var i__13572_13578 = 0;while(true){
if((i__13572_13578 < count__13571_13577))
{var vec__13573_13579 = cljs.core._nth.call(null,chunk__13570_13576,i__13572_13578);var ev__3326__auto___13580 = cljs.core.nth.call(null,vec__13573_13579,0,null);var func__3327__auto___13581 = cljs.core.nth.call(null,vec__13573_13579,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13580,func__3327__auto___13581);
{
var G__13582 = seq__13569_13575;
var G__13583 = chunk__13570_13576;
var G__13584 = count__13571_13577;
var G__13585 = (i__13572_13578 + 1);
seq__13569_13575 = G__13582;
chunk__13570_13576 = G__13583;
count__13571_13577 = G__13584;
i__13572_13578 = G__13585;
continue;
}
} else
{var temp__4092__auto___13586 = cljs.core.seq.call(null,seq__13569_13575);if(temp__4092__auto___13586)
{var seq__13569_13587__$1 = temp__4092__auto___13586;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13569_13587__$1))
{var c__4262__auto___13588 = cljs.core.chunk_first.call(null,seq__13569_13587__$1);{
var G__13589 = cljs.core.chunk_rest.call(null,seq__13569_13587__$1);
var G__13590 = c__4262__auto___13588;
var G__13591 = cljs.core.count.call(null,c__4262__auto___13588);
var G__13592 = 0;
seq__13569_13575 = G__13589;
chunk__13570_13576 = G__13590;
count__13571_13577 = G__13591;
i__13572_13578 = G__13592;
continue;
}
} else
{var vec__13574_13593 = cljs.core.first.call(null,seq__13569_13587__$1);var ev__3326__auto___13594 = cljs.core.nth.call(null,vec__13574_13593,0,null);var func__3327__auto___13595 = cljs.core.nth.call(null,vec__13574_13593,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13594,func__3327__auto___13595);
{
var G__13596 = cljs.core.next.call(null,seq__13569_13587__$1);
var G__13597 = null;
var G__13598 = 0;
var G__13599 = 0;
seq__13569_13575 = G__13596;
chunk__13570_13576 = G__13597;
count__13571_13577 = G__13598;
i__13572_13578 = G__13599;
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__13606_13612 = 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__13607_13613 = null;var count__13608_13614 = 0;var i__13609_13615 = 0;while(true){
if((i__13609_13615 < count__13608_13614))
{var vec__13610_13616 = cljs.core._nth.call(null,chunk__13607_13613,i__13609_13615);var ev__3326__auto___13617 = cljs.core.nth.call(null,vec__13610_13616,0,null);var func__3327__auto___13618 = cljs.core.nth.call(null,vec__13610_13616,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13617,func__3327__auto___13618);
{
var G__13619 = seq__13606_13612;
var G__13620 = chunk__13607_13613;
var G__13621 = count__13608_13614;
var G__13622 = (i__13609_13615 + 1);
seq__13606_13612 = G__13619;
chunk__13607_13613 = G__13620;
count__13608_13614 = G__13621;
i__13609_13615 = G__13622;
continue;
}
} else
{var temp__4092__auto___13623 = cljs.core.seq.call(null,seq__13606_13612);if(temp__4092__auto___13623)
{var seq__13606_13624__$1 = temp__4092__auto___13623;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13606_13624__$1))
{var c__4262__auto___13625 = cljs.core.chunk_first.call(null,seq__13606_13624__$1);{
var G__13626 = cljs.core.chunk_rest.call(null,seq__13606_13624__$1);
var G__13627 = c__4262__auto___13625;
var G__13628 = cljs.core.count.call(null,c__4262__auto___13625);
var G__13629 = 0;
seq__13606_13612 = G__13626;
chunk__13607_13613 = G__13627;
count__13608_13614 = G__13628;
i__13609_13615 = G__13629;
continue;
}
} else
{var vec__13611_13630 = cljs.core.first.call(null,seq__13606_13624__$1);var ev__3326__auto___13631 = cljs.core.nth.call(null,vec__13611_13630,0,null);var func__3327__auto___13632 = cljs.core.nth.call(null,vec__13611_13630,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13631,func__3327__auto___13632);
{
var G__13633 = cljs.core.next.call(null,seq__13606_13624__$1);
var G__13634 = null;
var G__13635 = 0;
var G__13636 = 0;
seq__13606_13612 = G__13633;
chunk__13607_13613 = G__13634;
count__13608_13614 = G__13635;
i__13609_13615 = G__13636;
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__13637_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__13637_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__13652(s__13653){return (new cljs.core.LazySeq(null,((function (prev_tabs){
return (function (){var s__13653__$1 = s__13653;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__13653__$1);if(temp__4092__auto__)
{var s__13653__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__13653__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__13653__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__13655 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__13654 = 0;while(true){
if((i__13654 < size__4230__auto__))
{var vec__13658 = cljs.core._nth.call(null,c__4229__auto__,i__13654);var idx = cljs.core.nth.call(null,vec__13658,0,null);var o = cljs.core.nth.call(null,vec__13658,1,null);if(cljs.core.truth_(cljs.core.deref.call(null,o)))
{cljs.core.chunk_append.call(null,b__13655,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__13666 = (i__13654 + 1);
i__13654 = G__13666;
continue;
}
} else
{{
var G__13667 = (i__13654 + 1);
i__13654 = G__13667;
continue;
}
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__13655),iter__13652.call(null,cljs.core.chunk_rest.call(null,s__13653__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__13655),null);
}
} else
{var vec__13659 = cljs.core.first.call(null,s__13653__$2);var idx = cljs.core.nth.call(null,vec__13659,0,null);var o = cljs.core.nth.call(null,vec__13659,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__13652.call(null,cljs.core.rest.call(null,s__13653__$2)));
} else
{{
var G__13668 = cljs.core.rest.call(null,s__13653__$2);
s__13653__$1 = G__13668;
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__13660_13669 = cljs.core.seq.call(null,prev_tabs);var chunk__13661_13670 = null;var count__13662_13671 = 0;var i__13663_13672 = 0;while(true){
if((i__13663_13672 < count__13662_13671))
{var tab_13673 = cljs.core._nth.call(null,chunk__13661_13670,i__13663_13672);lt.object.destroy_BANG_.call(null,tab_13673);
{
var G__13674 = seq__13660_13669;
var G__13675 = chunk__13661_13670;
var G__13676 = count__13662_13671;
var G__13677 = (i__13663_13672 + 1);
seq__13660_13669 = G__13674;
chunk__13661_13670 = G__13675;
count__13662_13671 = G__13676;
i__13663_13672 = G__13677;
continue;
}
} else
{var temp__4092__auto___13678 = cljs.core.seq.call(null,seq__13660_13669);if(temp__4092__auto___13678)
{var seq__13660_13679__$1 = temp__4092__auto___13678;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13660_13679__$1))
{var c__4262__auto___13680 = cljs.core.chunk_first.call(null,seq__13660_13679__$1);{
var G__13681 = cljs.core.chunk_rest.call(null,seq__13660_13679__$1);
var G__13682 = c__4262__auto___13680;
var G__13683 = cljs.core.count.call(null,c__4262__auto___13680);
var G__13684 = 0;
seq__13660_13669 = G__13681;
chunk__13661_13670 = G__13682;
count__13662_13671 = G__13683;
i__13663_13672 = G__13684;
continue;
}
} else
{var tab_13685 = cljs.core.first.call(null,seq__13660_13679__$1);lt.object.destroy_BANG_.call(null,tab_13685);
{
var G__13686 = cljs.core.next.call(null,seq__13660_13679__$1);
var G__13687 = null;
var G__13688 = 0;
var G__13689 = 0;
seq__13660_13669 = G__13686;
chunk__13661_13670 = G__13687;
count__13662_13671 = G__13688;
i__13663_13672 = G__13689;
continue;
}
}
} else
{}
}
break;
}
sortable(item,(function (){var obj13665 = {"axis":"x","distance":10,"scroll":false,"opacity":0.9,"connectWith":".list"};return obj13665;
})());
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__13690_SHARP_){if(cljs.core._EQ_.call(null,p1__13690_SHARP_,cljs.core.deref.call(null,item)))
{return "visible";
} else
{return "hidden";
}
}))], null)], null),crate.binding.bound.call(null,item,(function (p1__13691_SHARP_){if(cljs.core.truth_(p1__13691_SHARP_))
{return lt.object.__GT_content.call(null,p1__13691_SHARP_);
} else
{return null;
}
}))], null));var seq__13698_13704 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__13699_13705 = null;var count__13700_13706 = 0;var i__13701_13707 = 0;while(true){
if((i__13701_13707 < count__13700_13706))
{var vec__13702_13708 = cljs.core._nth.call(null,chunk__13699_13705,i__13701_13707);var ev__3326__auto___13709 = cljs.core.nth.call(null,vec__13702_13708,0,null);var func__3327__auto___13710 = cljs.core.nth.call(null,vec__13702_13708,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13709,func__3327__auto___13710);
{
var G__13711 = seq__13698_13704;
var G__13712 = chunk__13699_13705;
var G__13713 = count__13700_13706;
var G__13714 = (i__13701_13707 + 1);
seq__13698_13704 = G__13711;
chunk__13699_13705 = G__13712;
count__13700_13706 = G__13713;
i__13701_13707 = G__13714;
continue;
}
} else
{var temp__4092__auto___13715 = cljs.core.seq.call(null,seq__13698_13704);if(temp__4092__auto___13715)
{var seq__13698_13716__$1 = temp__4092__auto___13715;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13698_13716__$1))
{var c__4262__auto___13717 = cljs.core.chunk_first.call(null,seq__13698_13716__$1);{
var G__13718 = cljs.core.chunk_rest.call(null,seq__13698_13716__$1);
var G__13719 = c__4262__auto___13717;
var G__13720 = cljs.core.count.call(null,c__4262__auto___13717);
var G__13721 = 0;
seq__13698_13704 = G__13718;
chunk__13699_13705 = G__13719;
count__13700_13706 = G__13720;
i__13701_13707 = G__13721;
continue;
}
} else
{var vec__13703_13722 = cljs.core.first.call(null,seq__13698_13716__$1);var ev__3326__auto___13723 = cljs.core.nth.call(null,vec__13703_13722,0,null);var func__3327__auto___13724 = cljs.core.nth.call(null,vec__13703_13722,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13723,func__3327__auto___13724);
{
var G__13725 = cljs.core.next.call(null,seq__13698_13716__$1);
var G__13726 = null;
var G__13727 = 0;
var G__13728 = 0;
seq__13698_13704 = G__13725;
chunk__13699_13705 = G__13726;
count__13700_13706 = G__13727;
i__13701_13707 = G__13728;
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__13735_13741 = 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__13736_13742 = null;var count__13737_13743 = 0;var i__13738_13744 = 0;while(true){
if((i__13738_13744 < count__13737_13743))
{var vec__13739_13745 = cljs.core._nth.call(null,chunk__13736_13742,i__13738_13744);var ev__3326__auto___13746 = cljs.core.nth.call(null,vec__13739_13745,0,null);var func__3327__auto___13747 = cljs.core.nth.call(null,vec__13739_13745,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13746,func__3327__auto___13747);
{
var G__13748 = seq__13735_13741;
var G__13749 = chunk__13736_13742;
var G__13750 = count__13737_13743;
var G__13751 = (i__13738_13744 + 1);
seq__13735_13741 = G__13748;
chunk__13736_13742 = G__13749;
count__13737_13743 = G__13750;
i__13738_13744 = G__13751;
continue;
}
} else
{var temp__4092__auto___13752 = cljs.core.seq.call(null,seq__13735_13741);if(temp__4092__auto___13752)
{var seq__13735_13753__$1 = temp__4092__auto___13752;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13735_13753__$1))
{var c__4262__auto___13754 = cljs.core.chunk_first.call(null,seq__13735_13753__$1);{
var G__13755 = cljs.core.chunk_rest.call(null,seq__13735_13753__$1);
var G__13756 = c__4262__auto___13754;
var G__13757 = cljs.core.count.call(null,c__4262__auto___13754);
var G__13758 = 0;
seq__13735_13741 = G__13755;
chunk__13736_13742 = G__13756;
count__13737_13743 = G__13757;
i__13738_13744 = G__13758;
continue;
}
} else
{var vec__13740_13759 = cljs.core.first.call(null,seq__13735_13753__$1);var ev__3326__auto___13760 = cljs.core.nth.call(null,vec__13740_13759,0,null);var func__3327__auto___13761 = cljs.core.nth.call(null,vec__13740_13759,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13760,func__3327__auto___13761);
{
var G__13762 = cljs.core.next.call(null,seq__13735_13753__$1);
var G__13763 = null;
var G__13764 = 0;
var G__13765 = 0;
seq__13735_13741 = G__13762;
chunk__13736_13742 = G__13763;
count__13737_13743 = G__13764;
i__13738_13744 = G__13765;
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__13766_SHARP_){return cljs.core.not_EQ_.call(null,t,p1__13766_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__13767_SHARP_){return cljs.core.not_EQ_.call(null,t,p1__13767_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__13768_SHARP_){return cljs.core.not_EQ_.call(null,cur,p1__13768_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__13773 = cljs.core.seq.call(null,tss);var chunk__13774 = null;var count__13775 = 0;var i__13776 = 0;while(true){
if((i__13776 < count__13775))
{var ts = cljs.core._nth.call(null,chunk__13774,i__13776);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__13777 = seq__13773;
var G__13778 = chunk__13774;
var G__13779 = count__13775;
var G__13780 = (i__13776 + 1);
seq__13773 = G__13777;
chunk__13774 = G__13778;
count__13775 = G__13779;
i__13776 = G__13780;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__13773);if(temp__4092__auto__)
{var seq__13773__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13773__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__13773__$1);{
var G__13781 = cljs.core.chunk_rest.call(null,seq__13773__$1);
var G__13782 = c__4262__auto__;
var G__13783 = cljs.core.count.call(null,c__4262__auto__);
var G__13784 = 0;
seq__13773 = G__13781;
chunk__13774 = G__13782;
count__13775 = G__13783;
i__13776 = G__13784;
continue;
}
} else
{var ts = cljs.core.first.call(null,seq__13773__$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__13785 = cljs.core.next.call(null,seq__13773__$1);
var G__13786 = null;
var G__13787 = 0;
var G__13788 = 0;
seq__13773 = G__13785;
chunk__13774 = G__13786;
count__13775 = G__13787;
i__13776 = G__13788;
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___13789 = lt.objs.context.__GT_obj.call(null,new cljs.core.Keyword(null,"tabset","tabset",4427500575));if(cljs.core.truth_(temp__4092__auto___13789))
{var old_13790 = temp__4092__auto___13789;lt.util.dom.remove_class.call(null,lt.object.__GT_content.call(null,old_13790),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__13791_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__13791_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__13798_13804 = 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__13799_13805 = null;var count__13800_13806 = 0;var i__13801_13807 = 0;while(true){
if((i__13801_13807 < count__13800_13806))
{var vec__13802_13808 = cljs.core._nth.call(null,chunk__13799_13805,i__13801_13807);var ev__3326__auto___13809 = cljs.core.nth.call(null,vec__13802_13808,0,null);var func__3327__auto___13810 = cljs.core.nth.call(null,vec__13802_13808,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13809,func__3327__auto___13810);
{
var G__13811 = seq__13798_13804;
var G__13812 = chunk__13799_13805;
var G__13813 = count__13800_13806;
var G__13814 = (i__13801_13807 + 1);
seq__13798_13804 = G__13811;
chunk__13799_13805 = G__13812;
count__13800_13806 = G__13813;
i__13801_13807 = G__13814;
continue;
}
} else
{var temp__4092__auto___13815 = cljs.core.seq.call(null,seq__13798_13804);if(temp__4092__auto___13815)
{var seq__13798_13816__$1 = temp__4092__auto___13815;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13798_13816__$1))
{var c__4262__auto___13817 = cljs.core.chunk_first.call(null,seq__13798_13816__$1);{
var G__13818 = cljs.core.chunk_rest.call(null,seq__13798_13816__$1);
var G__13819 = c__4262__auto___13817;
var G__13820 = cljs.core.count.call(null,c__4262__auto___13817);
var G__13821 = 0;
seq__13798_13804 = G__13818;
chunk__13799_13805 = G__13819;
count__13800_13806 = G__13820;
i__13801_13807 = G__13821;
continue;
}
} else
{var vec__13803_13822 = cljs.core.first.call(null,seq__13798_13816__$1);var ev__3326__auto___13823 = cljs.core.nth.call(null,vec__13803_13822,0,null);var func__3327__auto___13824 = cljs.core.nth.call(null,vec__13803_13822,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___13823,func__3327__auto___13824);
{
var G__13825 = cljs.core.next.call(null,seq__13798_13816__$1);
var G__13826 = null;
var G__13827 = 0;
var G__13828 = 0;
seq__13798_13804 = G__13825;
chunk__13799_13805 = G__13826;
count__13800_13806 = G__13827;
i__13801_13807 = G__13828;
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__13833(s__13834){return (new cljs.core.LazySeq(null,(function (){var s__13834__$1 = s__13834;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__13834__$1);if(temp__4092__auto__)
{var s__13834__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__13834__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__13834__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__13836 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__13835 = 0;while(true){
if((i__13835 < size__4230__auto__))
{var k = cljs.core._nth.call(null,c__4229__auto__,i__13835);cljs.core.chunk_append.call(null,b__13836,lt.object.__GT_content.call(null,k));
{
var G__13837 = (i__13835 + 1);
i__13835 = G__13837;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__13836),iter__13833.call(null,cljs.core.chunk_rest.call(null,s__13834__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__13836),null);
}
} else
{var k = cljs.core.first.call(null,s__13834__$2);return cljs.core.cons.call(null,lt.object.__GT_content.call(null,k),iter__13833.call(null,cljs.core.rest.call(null,s__13834__$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__13843_13847 = 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__13844_13848 = null;var count__13845_13849 = 0;var i__13846_13850 = 0;while(true){
if((i__13846_13850 < count__13845_13849))
{var t_13851 = cljs.core._nth.call(null,chunk__13844_13848,i__13846_13850);lt.objs.tabs.add_BANG_.call(null,t_13851,to_ts);
{
var G__13852 = seq__13843_13847;
var G__13853 = chunk__13844_13848;
var G__13854 = count__13845_13849;
var G__13855 = (i__13846_13850 + 1);
seq__13843_13847 = G__13852;
chunk__13844_13848 = G__13853;
count__13845_13849 = G__13854;
i__13846_13850 = G__13855;
continue;
}
} else
{var temp__4092__auto___13856 = cljs.core.seq.call(null,seq__13843_13847);if(temp__4092__auto___13856)
{var seq__13843_13857__$1 = temp__4092__auto___13856;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13843_13857__$1))
{var c__4262__auto___13858 = cljs.core.chunk_first.call(null,seq__13843_13857__$1);{
var G__13859 = cljs.core.chunk_rest.call(null,seq__13843_13857__$1);
var G__13860 = c__4262__auto___13858;
var G__13861 = cljs.core.count.call(null,c__4262__auto___13858);
var G__13862 = 0;
seq__13843_13847 = G__13859;
chunk__13844_13848 = G__13860;
count__13845_13849 = G__13861;
i__13846_13850 = G__13862;
continue;
}
} else
{var t_13863 = cljs.core.first.call(null,seq__13843_13857__$1);lt.objs.tabs.add_BANG_.call(null,t_13863,to_ts);
{
var G__13864 = cljs.core.next.call(null,seq__13843_13857__$1);
var G__13865 = null;
var G__13866 = 0;
var G__13867 = 0;
seq__13843_13847 = G__13864;
chunk__13844_13848 = G__13865;
count__13845_13849 = G__13866;
i__13846_13850 = G__13867;
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__13838_SHARP_){return cljs.core.vec.call(null,cljs.core.remove.call(null,cljs.core.PersistentHashSet.fromArray([ts], true),p1__13838_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__13868_SHARP_){return cljs.core._EQ_.call(null,obj,p1__13868_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 (e13870){var e = e13870;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__13875 = 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__13876 = null;var count__13877 = 0;var i__13878 = 0;while(true){
if((i__13878 < count__13877))
{var e = cljs.core._nth.call(null,chunk__13876,i__13878);lt.object.destroy_BANG_.call(null,e);
{
var G__13879 = seq__13875;
var G__13880 = chunk__13876;
var G__13881 = count__13877;
var G__13882 = (i__13878 + 1);
seq__13875 = G__13879;
chunk__13876 = G__13880;
count__13877 = G__13881;
i__13878 = G__13882;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__13875);if(temp__4092__auto__)
{var seq__13875__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13875__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__13875__$1);{
var G__13883 = cljs.core.chunk_rest.call(null,seq__13875__$1);
var G__13884 = c__4262__auto__;
var G__13885 = cljs.core.count.call(null,c__4262__auto__);
var G__13886 = 0;
seq__13875 = G__13883;
chunk__13876 = G__13884;
count__13877 = G__13885;
i__13878 = G__13886;
continue;
}
} else
{var e = cljs.core.first.call(null,seq__13875__$1);lt.object.destroy_BANG_.call(null,e);
{
var G__13887 = cljs.core.next.call(null,seq__13875__$1);
var G__13888 = null;
var G__13889 = 0;
var G__13890 = 0;
seq__13875 = G__13887;
chunk__13876 = G__13888;
count__13877 = G__13889;
i__13878 = G__13890;
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___13891 = 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___13891))
{var e_13892 = temp__4092__auto___13891;lt.object.raise.call(null,e_13892,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__13893 = cljs.core.seq.call(null,objs);var chunk__13894 = null;var count__13895 = 0;var i__13896 = 0;while(true){
if((i__13896 < count__13895))
{var obj = cljs.core._nth.call(null,chunk__13894,i__13896);lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"close","close",1108660586));
{
var G__13897 = seq__13893;
var G__13898 = chunk__13894;
var G__13899 = count__13895;
var G__13900 = (i__13896 + 1);
seq__13893 = G__13897;
chunk__13894 = G__13898;
count__13895 = G__13899;
i__13896 = G__13900;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__13893);if(temp__4092__auto__)
{var seq__13893__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13893__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__13893__$1);{
var G__13901 = cljs.core.chunk_rest.call(null,seq__13893__$1);
var G__13902 = c__4262__auto__;
var G__13903 = cljs.core.count.call(null,c__4262__auto__);
var G__13904 = 0;
seq__13893 = G__13901;
chunk__13894 = G__13902;
count__13895 = G__13903;
i__13896 = G__13904;
continue;
}
} else
{var obj = cljs.core.first.call(null,seq__13893__$1);lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"close","close",1108660586));
{
var G__13905 = cljs.core.next.call(null,seq__13893__$1);
var G__13906 = null;
var G__13907 = 0;
var G__13908 = 0;
seq__13893 = G__13905;
chunk__13894 = G__13906;
count__13895 = G__13907;
i__13896 = G__13908;
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__13909 = cljs.core.seq.call(null,objs);var chunk__13910 = null;var count__13911 = 0;var i__13912 = 0;while(true){
if((i__13912 < count__13911))
{var obj = cljs.core._nth.call(null,chunk__13910,i__13912);if(!((cur === obj)))
{lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"close","close",1108660586));
} else
{}
{
var G__13913 = seq__13909;
var G__13914 = chunk__13910;
var G__13915 = count__13911;
var G__13916 = (i__13912 + 1);
seq__13909 = G__13913;
chunk__13910 = G__13914;
count__13911 = G__13915;
i__13912 = G__13916;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__13909);if(temp__4092__auto__)
{var seq__13909__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__13909__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__13909__$1);{
var G__13917 = cljs.core.chunk_rest.call(null,seq__13909__$1);
var G__13918 = c__4262__auto__;
var G__13919 = cljs.core.count.call(null,c__4262__auto__);
var G__13920 = 0;
seq__13909 = G__13917;
chunk__13910 = G__13918;
count__13911 = G__13919;
i__13912 = G__13920;
continue;
}
} else
{var obj = cljs.core.first.call(null,seq__13909__$1);if(!((cur === obj)))
{lt.object.raise.call(null,obj,new cljs.core.Keyword(null,"close","close",1108660586));
} else
{}
{
var G__13921 = cljs.core.next.call(null,seq__13909__$1);
var G__13922 = null;
var G__13923 = 0;
var G__13924 = 0;
seq__13909 = G__13921;
chunk__13910 = G__13922;
count__13911 = G__13923;
i__13912 = G__13924;
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)));
