// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.connector');
goog.require('cljs.core');
goog.require('lt.objs.eval');
goog.require('lt.objs.eval');
goog.require('lt.objs.popup');
goog.require('lt.objs.popup');
goog.require('lt.objs.canvas');
goog.require('lt.objs.canvas');
goog.require('lt.object');
goog.require('lt.object');
lt.objs.connector.__BEH__on_selected = (function __BEH__on_selected(this$,client){var temp__4092__auto___12390 = new cljs.core.Keyword(null,"cb","cb",1013907409).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));if(cljs.core.truth_(temp__4092__auto___12390))
{var cb_12391 = temp__4092__auto___12390;cb_12391.call(null,client);
} else
{}
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"close!","close!",3951350939));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.connector","on-selected","lt.objs.connector/on-selected",554282612),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.connector.__BEH__on_selected,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"selected","selected",2205476365),null], null), null));
lt.objs.connector.__BEH__on_close_BANG_ = (function __BEH__on_close_BANG_(this$){lt.object.raise.call(null,new cljs.core.Keyword(null,"popup","popup",1120756766).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.Keyword(null,"close!","close!",3951350939));
return lt.object.destroy_BANG_.call(null,this$);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.connector","on-close!","lt.objs.connector/on-close!",4610609218),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.connector.__BEH__on_close_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,"close!","close!",3951350939),null], null), null));
lt.objs.connector.client_button = (function client_button(obj,client){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li.button","li.button",2481585205),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,client))], null));var seq__12398_12404 = 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,"selected","selected",2205476365),client);
})], null)));var chunk__12399_12405 = null;var count__12400_12406 = 0;var i__12401_12407 = 0;while(true){
if((i__12401_12407 < count__12400_12406))
{var vec__12402_12408 = cljs.core._nth.call(null,chunk__12399_12405,i__12401_12407);var ev__3326__auto___12409 = cljs.core.nth.call(null,vec__12402_12408,0,null);var func__3327__auto___12410 = cljs.core.nth.call(null,vec__12402_12408,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12409,func__3327__auto___12410);
{
var G__12411 = seq__12398_12404;
var G__12412 = chunk__12399_12405;
var G__12413 = count__12400_12406;
var G__12414 = (i__12401_12407 + 1);
seq__12398_12404 = G__12411;
chunk__12399_12405 = G__12412;
count__12400_12406 = G__12413;
i__12401_12407 = G__12414;
continue;
}
} else
{var temp__4092__auto___12415 = cljs.core.seq.call(null,seq__12398_12404);if(temp__4092__auto___12415)
{var seq__12398_12416__$1 = temp__4092__auto___12415;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12398_12416__$1))
{var c__4262__auto___12417 = cljs.core.chunk_first.call(null,seq__12398_12416__$1);{
var G__12418 = cljs.core.chunk_rest.call(null,seq__12398_12416__$1);
var G__12419 = c__4262__auto___12417;
var G__12420 = cljs.core.count.call(null,c__4262__auto___12417);
var G__12421 = 0;
seq__12398_12404 = G__12418;
chunk__12399_12405 = G__12419;
count__12400_12406 = G__12420;
i__12401_12407 = G__12421;
continue;
}
} else
{var vec__12403_12422 = cljs.core.first.call(null,seq__12398_12416__$1);var ev__3326__auto___12423 = cljs.core.nth.call(null,vec__12403_12422,0,null);var func__3327__auto___12424 = cljs.core.nth.call(null,vec__12403_12422,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12423,func__3327__auto___12424);
{
var G__12425 = cljs.core.next.call(null,seq__12398_12416__$1);
var G__12426 = null;
var G__12427 = 0;
var G__12428 = 0;
seq__12398_12404 = G__12425;
chunk__12399_12405 = G__12426;
count__12400_12406 = G__12427;
i__12401_12407 = G__12428;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.connector","client-selector","lt.objs.connector/client-selector",4663980940),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"client.selector","client.selector",3112958484),null], null), null),new cljs.core.Keyword(null,"init","init",1017141378),(function (this$,clients,cb){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cb","cb",1013907409),cb,new cljs.core.Keyword(null,"popup","popup",1120756766),lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"header","header",4087600639),"Which client?",new cljs.core.Keyword(null,"body","body",1016933652),cljs.core._conj.call(null,cljs.core._conj.call(null,cljs.core.List.EMPTY,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul","ul",1013907977),cljs.core.map.call(null,cljs.core.partial.call(null,lt.objs.connector.client_button,this$),clients)], null)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p","p",1013904354),"There are multiple clients that could potentially handle this.\n                                                            Which one do you want us to use for this file?"], null))], null))], null));
return null;
}));
lt.objs.connector.__BEH__select_client = (function __BEH__select_client(obj,potentials,cb){return lt.object.create.call(null,new cljs.core.Keyword("lt.objs.connector","client-selector","lt.objs.connector/client-selector",4663980940),potentials,cb);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.connector","select-client","lt.objs.connector/select-client",1181118821),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.connector.__BEH__select_client,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"select-client","select-client",4292921646),null], null), null));
lt.object.add_behavior_BANG_.call(null,lt.objs.eval.evaler,new cljs.core.Keyword("lt.objs.connector","select-client","lt.objs.connector/select-client",1181118821));
