// 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___7664 = 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___7664))
{var cb_7665 = temp__4092__auto___7664;cb_7665.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__7672_7678 = 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__7673_7679 = null;var count__7674_7680 = 0;var i__7675_7681 = 0;while(true){
if((i__7675_7681 < count__7674_7680))
{var vec__7676_7682 = cljs.core._nth.call(null,chunk__7673_7679,i__7675_7681);var ev__3326__auto___7683 = cljs.core.nth.call(null,vec__7676_7682,0,null);var func__3327__auto___7684 = cljs.core.nth.call(null,vec__7676_7682,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___7683,func__3327__auto___7684);
{
var G__7685 = seq__7672_7678;
var G__7686 = chunk__7673_7679;
var G__7687 = count__7674_7680;
var G__7688 = (i__7675_7681 + 1);
seq__7672_7678 = G__7685;
chunk__7673_7679 = G__7686;
count__7674_7680 = G__7687;
i__7675_7681 = G__7688;
continue;
}
} else
{var temp__4092__auto___7689 = cljs.core.seq.call(null,seq__7672_7678);if(temp__4092__auto___7689)
{var seq__7672_7690__$1 = temp__4092__auto___7689;if(cljs.core.chunked_seq_QMARK_.call(null,seq__7672_7690__$1))
{var c__4262__auto___7691 = cljs.core.chunk_first.call(null,seq__7672_7690__$1);{
var G__7692 = cljs.core.chunk_rest.call(null,seq__7672_7690__$1);
var G__7693 = c__4262__auto___7691;
var G__7694 = cljs.core.count.call(null,c__4262__auto___7691);
var G__7695 = 0;
seq__7672_7678 = G__7692;
chunk__7673_7679 = G__7693;
count__7674_7680 = G__7694;
i__7675_7681 = G__7695;
continue;
}
} else
{var vec__7677_7696 = cljs.core.first.call(null,seq__7672_7690__$1);var ev__3326__auto___7697 = cljs.core.nth.call(null,vec__7677_7696,0,null);var func__3327__auto___7698 = cljs.core.nth.call(null,vec__7677_7696,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___7697,func__3327__auto___7698);
{
var G__7699 = cljs.core.next.call(null,seq__7672_7690__$1);
var G__7700 = null;
var G__7701 = 0;
var G__7702 = 0;
seq__7672_7678 = G__7699;
chunk__7673_7679 = G__7700;
count__7674_7680 = G__7701;
i__7675_7681 = G__7702;
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));
