// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.sidebar.clients');
goog.require('cljs.core');
goog.require('crate.binding');
goog.require('lt.util.dom');
goog.require('lt.objs.sidebar');
goog.require('lt.objs.context');
goog.require('lt.objs.popup');
goog.require('lt.objs.popup');
goog.require('lt.objs.context');
goog.require('lt.util.dom');
goog.require('lt.objs.sidebar');
goog.require('lt.objs.editor.pool');
goog.require('lt.objs.clients.ws');
goog.require('lt.objs.command');
goog.require('lt.objs.clients.tcp');
goog.require('lt.objs.clients');
goog.require('lt.objs.clients.tcp');
goog.require('crate.binding');
goog.require('lt.object');
goog.require('lt.object');
goog.require('lt.objs.clients.ws');
goog.require('lt.objs.clients');
goog.require('lt.objs.editor.pool');
goog.require('lt.objs.command');
lt.objs.sidebar.clients.close_button = (function close_button(i){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.button","span.button",4282180040),"disconnect"], null));var seq__9823_9829 = 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.objs.clients.close_BANG_.call(null,i);
})], null)));var chunk__9824_9830 = null;var count__9825_9831 = 0;var i__9826_9832 = 0;while(true){
if((i__9826_9832 < count__9825_9831))
{var vec__9827_9833 = cljs.core._nth.call(null,chunk__9824_9830,i__9826_9832);var ev__3326__auto___9834 = cljs.core.nth.call(null,vec__9827_9833,0,null);var func__3327__auto___9835 = cljs.core.nth.call(null,vec__9827_9833,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___9834,func__3327__auto___9835);
{
var G__9836 = seq__9823_9829;
var G__9837 = chunk__9824_9830;
var G__9838 = count__9825_9831;
var G__9839 = (i__9826_9832 + 1);
seq__9823_9829 = G__9836;
chunk__9824_9830 = G__9837;
count__9825_9831 = G__9838;
i__9826_9832 = G__9839;
continue;
}
} else
{var temp__4092__auto___9840 = cljs.core.seq.call(null,seq__9823_9829);if(temp__4092__auto___9840)
{var seq__9823_9841__$1 = temp__4092__auto___9840;if(cljs.core.chunked_seq_QMARK_.call(null,seq__9823_9841__$1))
{var c__4262__auto___9842 = cljs.core.chunk_first.call(null,seq__9823_9841__$1);{
var G__9843 = cljs.core.chunk_rest.call(null,seq__9823_9841__$1);
var G__9844 = c__4262__auto___9842;
var G__9845 = cljs.core.count.call(null,c__4262__auto___9842);
var G__9846 = 0;
seq__9823_9829 = G__9843;
chunk__9824_9830 = G__9844;
count__9825_9831 = G__9845;
i__9826_9832 = G__9846;
continue;
}
} else
{var vec__9828_9847 = cljs.core.first.call(null,seq__9823_9841__$1);var ev__3326__auto___9848 = cljs.core.nth.call(null,vec__9828_9847,0,null);var func__3327__auto___9849 = cljs.core.nth.call(null,vec__9828_9847,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___9848,func__3327__auto___9849);
{
var G__9850 = cljs.core.next.call(null,seq__9823_9841__$1);
var G__9851 = null;
var G__9852 = 0;
var G__9853 = 0;
seq__9823_9829 = G__9850;
chunk__9824_9830 = G__9851;
count__9825_9831 = G__9852;
i__9826_9832 = G__9853;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.clients.unset_button = (function unset_button(i){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.button.unset","span.button.unset",4681740547),"unset"], null));var seq__9860_9866 = 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,lt.objs.sidebar.clients.clients,new cljs.core.Keyword(null,"unset!","unset!",4468628874),i);
})], null)));var chunk__9861_9867 = null;var count__9862_9868 = 0;var i__9863_9869 = 0;while(true){
if((i__9863_9869 < count__9862_9868))
{var vec__9864_9870 = cljs.core._nth.call(null,chunk__9861_9867,i__9863_9869);var ev__3326__auto___9871 = cljs.core.nth.call(null,vec__9864_9870,0,null);var func__3327__auto___9872 = cljs.core.nth.call(null,vec__9864_9870,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___9871,func__3327__auto___9872);
{
var G__9873 = seq__9860_9866;
var G__9874 = chunk__9861_9867;
var G__9875 = count__9862_9868;
var G__9876 = (i__9863_9869 + 1);
seq__9860_9866 = G__9873;
chunk__9861_9867 = G__9874;
count__9862_9868 = G__9875;
i__9863_9869 = G__9876;
continue;
}
} else
{var temp__4092__auto___9877 = cljs.core.seq.call(null,seq__9860_9866);if(temp__4092__auto___9877)
{var seq__9860_9878__$1 = temp__4092__auto___9877;if(cljs.core.chunked_seq_QMARK_.call(null,seq__9860_9878__$1))
{var c__4262__auto___9879 = cljs.core.chunk_first.call(null,seq__9860_9878__$1);{
var G__9880 = cljs.core.chunk_rest.call(null,seq__9860_9878__$1);
var G__9881 = c__4262__auto___9879;
var G__9882 = cljs.core.count.call(null,c__4262__auto___9879);
var G__9883 = 0;
seq__9860_9866 = G__9880;
chunk__9861_9867 = G__9881;
count__9862_9868 = G__9882;
i__9863_9869 = G__9883;
continue;
}
} else
{var vec__9865_9884 = cljs.core.first.call(null,seq__9860_9878__$1);var ev__3326__auto___9885 = cljs.core.nth.call(null,vec__9865_9884,0,null);var func__3327__auto___9886 = cljs.core.nth.call(null,vec__9865_9884,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___9885,func__3327__auto___9886);
{
var G__9887 = cljs.core.next.call(null,seq__9860_9878__$1);
var G__9888 = null;
var G__9889 = 0;
var G__9890 = 0;
seq__9860_9866 = G__9887;
chunk__9861_9867 = G__9888;
count__9862_9868 = G__9889;
i__9863_9869 = G__9890;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.clients.add_button = (function add_button(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h2.toggle.add.button","h2.toggle.add.button",3718387527),"Add Connection"], null));var seq__9897_9903 = 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,"selecting!","selecting!",3653545709));
})], null)));var chunk__9898_9904 = null;var count__9899_9905 = 0;var i__9900_9906 = 0;while(true){
if((i__9900_9906 < count__9899_9905))
{var vec__9901_9907 = cljs.core._nth.call(null,chunk__9898_9904,i__9900_9906);var ev__3326__auto___9908 = cljs.core.nth.call(null,vec__9901_9907,0,null);var func__3327__auto___9909 = cljs.core.nth.call(null,vec__9901_9907,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___9908,func__3327__auto___9909);
{
var G__9910 = seq__9897_9903;
var G__9911 = chunk__9898_9904;
var G__9912 = count__9899_9905;
var G__9913 = (i__9900_9906 + 1);
seq__9897_9903 = G__9910;
chunk__9898_9904 = G__9911;
count__9899_9905 = G__9912;
i__9900_9906 = G__9913;
continue;
}
} else
{var temp__4092__auto___9914 = cljs.core.seq.call(null,seq__9897_9903);if(temp__4092__auto___9914)
{var seq__9897_9915__$1 = temp__4092__auto___9914;if(cljs.core.chunked_seq_QMARK_.call(null,seq__9897_9915__$1))
{var c__4262__auto___9916 = cljs.core.chunk_first.call(null,seq__9897_9915__$1);{
var G__9917 = cljs.core.chunk_rest.call(null,seq__9897_9915__$1);
var G__9918 = c__4262__auto___9916;
var G__9919 = cljs.core.count.call(null,c__4262__auto___9916);
var G__9920 = 0;
seq__9897_9903 = G__9917;
chunk__9898_9904 = G__9918;
count__9899_9905 = G__9919;
i__9900_9906 = G__9920;
continue;
}
} else
{var vec__9902_9921 = cljs.core.first.call(null,seq__9897_9915__$1);var ev__3326__auto___9922 = cljs.core.nth.call(null,vec__9902_9921,0,null);var func__3327__auto___9923 = cljs.core.nth.call(null,vec__9902_9921,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___9922,func__3327__auto___9923);
{
var G__9924 = cljs.core.next.call(null,seq__9897_9915__$1);
var G__9925 = null;
var G__9926 = 0;
var G__9927 = 0;
seq__9897_9903 = G__9924;
chunk__9898_9904 = G__9925;
count__9899_9905 = G__9926;
i__9900_9906 = G__9927;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.clients.choose_cancel = (function choose_cancel(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h2.toggle.button","h2.toggle.button",1431469146),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1017440956),"Choose a client type"], null)], null));var seq__9934_9940 = 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,"cancel","cancel",3941147116));
})], null)));var chunk__9935_9941 = null;var count__9936_9942 = 0;var i__9937_9943 = 0;while(true){
if((i__9937_9943 < count__9936_9942))
{var vec__9938_9944 = cljs.core._nth.call(null,chunk__9935_9941,i__9937_9943);var ev__3326__auto___9945 = cljs.core.nth.call(null,vec__9938_9944,0,null);var func__3327__auto___9946 = cljs.core.nth.call(null,vec__9938_9944,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___9945,func__3327__auto___9946);
{
var G__9947 = seq__9934_9940;
var G__9948 = chunk__9935_9941;
var G__9949 = count__9936_9942;
var G__9950 = (i__9937_9943 + 1);
seq__9934_9940 = G__9947;
chunk__9935_9941 = G__9948;
count__9936_9942 = G__9949;
i__9937_9943 = G__9950;
continue;
}
} else
{var temp__4092__auto___9951 = cljs.core.seq.call(null,seq__9934_9940);if(temp__4092__auto___9951)
{var seq__9934_9952__$1 = temp__4092__auto___9951;if(cljs.core.chunked_seq_QMARK_.call(null,seq__9934_9952__$1))
{var c__4262__auto___9953 = cljs.core.chunk_first.call(null,seq__9934_9952__$1);{
var G__9954 = cljs.core.chunk_rest.call(null,seq__9934_9952__$1);
var G__9955 = c__4262__auto___9953;
var G__9956 = cljs.core.count.call(null,c__4262__auto___9953);
var G__9957 = 0;
seq__9934_9940 = G__9954;
chunk__9935_9941 = G__9955;
count__9936_9942 = G__9956;
i__9937_9943 = G__9957;
continue;
}
} else
{var vec__9939_9958 = cljs.core.first.call(null,seq__9934_9952__$1);var ev__3326__auto___9959 = cljs.core.nth.call(null,vec__9939_9958,0,null);var func__3327__auto___9960 = cljs.core.nth.call(null,vec__9939_9958,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___9959,func__3327__auto___9960);
{
var G__9961 = cljs.core.next.call(null,seq__9934_9952__$1);
var G__9962 = null;
var G__9963 = 0;
var G__9964 = 0;
seq__9934_9940 = G__9961;
chunk__9935_9941 = G__9962;
count__9936_9942 = G__9963;
i__9937_9943 = G__9964;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.clients.__GT_active_QMARK_ = (function __GT_active_QMARK_(cur,clients){var actives = new cljs.core.Keyword(null,"active","active",3885920888).cljs$core$IFn$_invoke$arity$1(clients);var found_QMARK_ = cljs.core.first.call(null,cljs.core.filter.call(null,((function (actives){
return (function (p1__9965_SHARP_){return cljs.core._EQ_.call(null,cur,cljs.core.val.call(null,p1__9965_SHARP_));
});})(actives))
,actives));var connected_QMARK_ = new cljs.core.Keyword(null,"connected","connected",4729661051).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,cur));if(cljs.core.truth_((function (){var and__3508__auto__ = found_QMARK_;if(cljs.core.truth_(and__3508__auto__))
{return connected_QMARK_;
} else
{return and__3508__auto__;
}
})()))
{return [cljs.core.str("active client-"),cljs.core.str(cljs.core.name.call(null,cljs.core.first.call(null,found_QMARK_)))].join('');
} else
{return "";
}
});
lt.objs.sidebar.clients.client_item_STAR_ = (function client_item_STAR_(i){if(cljs.core.truth_(new cljs.core.Keyword(null,"connected","connected",4729661051).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,i))))
{return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h2","h2",1013907516),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,i))], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.details","div.details",4139669847),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"table","table",1124020032),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tr","tr",1013907952),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"td","td",1013907938),"Type"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"td","td",1013907938),new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,i))], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tr","tr",1013907952),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"td","td",1013907938),"Commands"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"td","td",1013907938),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul","ul",1013907977),(function (){var iter__4231__auto__ = (function iter__9970(s__9971){return (new cljs.core.LazySeq(null,(function (){var s__9971__$1 = s__9971;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__9971__$1);if(temp__4092__auto__)
{var s__9971__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__9971__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__9971__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__9973 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__9972 = 0;while(true){
if((i__9972 < size__4230__auto__))
{var c = cljs.core._nth.call(null,c__4229__auto__,i__9972);cljs.core.chunk_append.call(null,b__9973,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),c], null));
{
var G__9974 = (i__9972 + 1);
i__9972 = G__9974;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__9973),iter__9970.call(null,cljs.core.chunk_rest.call(null,s__9971__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__9973),null);
}
} else
{var c = cljs.core.first.call(null,s__9971__$2);return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),c], null),iter__9970.call(null,cljs.core.rest.call(null,s__9971__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,new cljs.core.Keyword(null,"commands","commands",4706336250).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,i)));
})()], null)], null)], null)], null),lt.objs.sidebar.clients.close_button.call(null,i),lt.objs.sidebar.clients.unset_button.call(null,i)], null)], null);
} else
{return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.connecting","div.connecting",1770928039),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.load-wrapper","div.load-wrapper",4672926811),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.img","div.img",2686470232)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p","p",1013904354),"Connecting.."], null)], null);
}
});
lt.objs.sidebar.clients.connector_QMARK_ = (function connector_QMARK_(clients){return [cljs.core.str("clients "),cljs.core.str((cljs.core.truth_(new cljs.core.Keyword(null,"selecting?","selecting?",3653545739).cljs$core$IFn$_invoke$arity$1(clients))?"selecting":"")),cljs.core.str((cljs.core.truth_(lt.util.dom.has_class_QMARK_.call(null,new cljs.core.Keyword(null,"content","content",1965434859).cljs$core$IFn$_invoke$arity$1(clients),new cljs.core.Keyword(null,"active","active",3885920888)))?" active":null))].join('');
});
lt.objs.sidebar.clients.client_item = (function client_item(clients,i){var e__3325__auto__ = crate.core.html.call(null,(function (){var i__$1 = cljs.core.deref.call(null,i);return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",1108647146),crate.binding.bound.call(null,clients,((function (i__$1){
return (function (p1__9975_SHARP_){return lt.objs.sidebar.clients.__GT_active_QMARK_.call(null,i__$1,p1__9975_SHARP_);
});})(i__$1))
)], null),crate.binding.bound.call(null,i__$1,((function (i__$1){
return (function (){return lt.objs.sidebar.clients.client_item_STAR_.call(null,i__$1);
});})(i__$1))
)], null);
})());var seq__9982_9988 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__9983_9989 = null;var count__9984_9990 = 0;var i__9985_9991 = 0;while(true){
if((i__9985_9991 < count__9984_9990))
{var vec__9986_9992 = cljs.core._nth.call(null,chunk__9983_9989,i__9985_9991);var ev__3326__auto___9993 = cljs.core.nth.call(null,vec__9986_9992,0,null);var func__3327__auto___9994 = cljs.core.nth.call(null,vec__9986_9992,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___9993,func__3327__auto___9994);
{
var G__9995 = seq__9982_9988;
var G__9996 = chunk__9983_9989;
var G__9997 = count__9984_9990;
var G__9998 = (i__9985_9991 + 1);
seq__9982_9988 = G__9995;
chunk__9983_9989 = G__9996;
count__9984_9990 = G__9997;
i__9985_9991 = G__9998;
continue;
}
} else
{var temp__4092__auto___9999 = cljs.core.seq.call(null,seq__9982_9988);if(temp__4092__auto___9999)
{var seq__9982_10000__$1 = temp__4092__auto___9999;if(cljs.core.chunked_seq_QMARK_.call(null,seq__9982_10000__$1))
{var c__4262__auto___10001 = cljs.core.chunk_first.call(null,seq__9982_10000__$1);{
var G__10002 = cljs.core.chunk_rest.call(null,seq__9982_10000__$1);
var G__10003 = c__4262__auto___10001;
var G__10004 = cljs.core.count.call(null,c__4262__auto___10001);
var G__10005 = 0;
seq__9982_9988 = G__10002;
chunk__9983_9989 = G__10003;
count__9984_9990 = G__10004;
i__9985_9991 = G__10005;
continue;
}
} else
{var vec__9987_10006 = cljs.core.first.call(null,seq__9982_10000__$1);var ev__3326__auto___10007 = cljs.core.nth.call(null,vec__9987_10006,0,null);var func__3327__auto___10008 = cljs.core.nth.call(null,vec__9987_10006,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10007,func__3327__auto___10008);
{
var G__10009 = cljs.core.next.call(null,seq__9982_10000__$1);
var G__10010 = null;
var G__10011 = 0;
var G__10012 = 0;
seq__9982_9988 = G__10009;
chunk__9983_9989 = G__10010;
count__9984_9990 = G__10011;
i__9985_9991 = G__10012;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.clients.connection_type = (function connection_type(this$,i){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h2","h2",1013907516),i.call(null,new cljs.core.Keyword(null,"name","name",1017277949))], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p","p",1013904354),i.call(null,new cljs.core.Keyword(null,"desc","desc",1016984067))], null)], null));var seq__10019_10025 = 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 (){lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"selected","selected",2205476365));
return new cljs.core.Keyword(null,"connect","connect",1965255772).cljs$core$IFn$_invoke$arity$1(i).call(null);
})], null)));var chunk__10020_10026 = null;var count__10021_10027 = 0;var i__10022_10028 = 0;while(true){
if((i__10022_10028 < count__10021_10027))
{var vec__10023_10029 = cljs.core._nth.call(null,chunk__10020_10026,i__10022_10028);var ev__3326__auto___10030 = cljs.core.nth.call(null,vec__10023_10029,0,null);var func__3327__auto___10031 = cljs.core.nth.call(null,vec__10023_10029,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10030,func__3327__auto___10031);
{
var G__10032 = seq__10019_10025;
var G__10033 = chunk__10020_10026;
var G__10034 = count__10021_10027;
var G__10035 = (i__10022_10028 + 1);
seq__10019_10025 = G__10032;
chunk__10020_10026 = G__10033;
count__10021_10027 = G__10034;
i__10022_10028 = G__10035;
continue;
}
} else
{var temp__4092__auto___10036 = cljs.core.seq.call(null,seq__10019_10025);if(temp__4092__auto___10036)
{var seq__10019_10037__$1 = temp__4092__auto___10036;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10019_10037__$1))
{var c__4262__auto___10038 = cljs.core.chunk_first.call(null,seq__10019_10037__$1);{
var G__10039 = cljs.core.chunk_rest.call(null,seq__10019_10037__$1);
var G__10040 = c__4262__auto___10038;
var G__10041 = cljs.core.count.call(null,c__4262__auto___10038);
var G__10042 = 0;
seq__10019_10025 = G__10039;
chunk__10020_10026 = G__10040;
count__10021_10027 = G__10041;
i__10022_10028 = G__10042;
continue;
}
} else
{var vec__10024_10043 = cljs.core.first.call(null,seq__10019_10037__$1);var ev__3326__auto___10044 = cljs.core.nth.call(null,vec__10024_10043,0,null);var func__3327__auto___10045 = cljs.core.nth.call(null,vec__10024_10043,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10044,func__3327__auto___10045);
{
var G__10046 = cljs.core.next.call(null,seq__10019_10037__$1);
var G__10047 = null;
var G__10048 = 0;
var G__10049 = 0;
seq__10019_10025 = G__10046;
chunk__10020_10026 = G__10047;
count__10021_10027 = G__10048;
i__10022_10028 = G__10049;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.clients.connectors = (function connectors(this$,connectors__$1){var iter__4231__auto__ = (function iter__10058(s__10059){return (new cljs.core.LazySeq(null,(function (){var s__10059__$1 = s__10059;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10059__$1);if(temp__4092__auto__)
{var s__10059__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10059__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10059__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10061 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10060 = 0;while(true){
if((i__10060 < size__4230__auto__))
{var vec__10064 = cljs.core._nth.call(null,c__4229__auto__,i__10060);var k = cljs.core.nth.call(null,vec__10064,0,null);var c = cljs.core.nth.call(null,vec__10064,1,null);cljs.core.chunk_append.call(null,b__10061,lt.objs.sidebar.clients.connection_type.call(null,this$,c));
{
var G__10066 = (i__10060 + 1);
i__10060 = G__10066;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10061),iter__10058.call(null,cljs.core.chunk_rest.call(null,s__10059__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10061),null);
}
} else
{var vec__10065 = cljs.core.first.call(null,s__10059__$2);var k = cljs.core.nth.call(null,vec__10065,0,null);var c = cljs.core.nth.call(null,vec__10065,1,null);return cljs.core.cons.call(null,lt.objs.sidebar.clients.connection_type.call(null,this$,c),iter__10058.call(null,cljs.core.rest.call(null,s__10059__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,connectors__$1);
});
lt.objs.sidebar.clients.connect_ui = (function connect_ui(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"class","class",1108647146),crate.binding.bound.call(null,this$,lt.objs.sidebar.clients.connector_QMARK_),new cljs.core.Keyword(null,"tabindex","tabindex",4410954191),-1], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.list","div.list",1323928397),lt.objs.sidebar.clients.add_button.call(null,this$),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul","ul",1013907977),crate.binding.map_bound.call(null,cljs.core.partial.call(null,lt.objs.sidebar.clients.client_item,this$),lt.objs.clients.cs)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.connector","div.connector",4086365858),lt.objs.sidebar.clients.choose_cancel.call(null,this$),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul","ul",1013907977),crate.binding.bound.call(null,crate.binding.subatom.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"connectors","connectors",4533225784)], null)),cljs.core.partial.call(null,lt.objs.sidebar.clients.connectors,this$))], null)], null)], null));var seq__10073_10079 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"focus","focus",1111509066),(function (){return lt.objs.context.in_BANG_.call(null,new cljs.core.Keyword(null,"sidebar.clients","sidebar.clients",3856103656),this$);
}),new cljs.core.Keyword(null,"blur","blur",1016931289),(function (){return lt.objs.context.out_BANG_.call(null,new cljs.core.Keyword(null,"sidebar.clients","sidebar.clients",3856103656),this$);
})], null)));var chunk__10074_10080 = null;var count__10075_10081 = 0;var i__10076_10082 = 0;while(true){
if((i__10076_10082 < count__10075_10081))
{var vec__10077_10083 = cljs.core._nth.call(null,chunk__10074_10080,i__10076_10082);var ev__3326__auto___10084 = cljs.core.nth.call(null,vec__10077_10083,0,null);var func__3327__auto___10085 = cljs.core.nth.call(null,vec__10077_10083,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10084,func__3327__auto___10085);
{
var G__10086 = seq__10073_10079;
var G__10087 = chunk__10074_10080;
var G__10088 = count__10075_10081;
var G__10089 = (i__10076_10082 + 1);
seq__10073_10079 = G__10086;
chunk__10074_10080 = G__10087;
count__10075_10081 = G__10088;
i__10076_10082 = G__10089;
continue;
}
} else
{var temp__4092__auto___10090 = cljs.core.seq.call(null,seq__10073_10079);if(temp__4092__auto___10090)
{var seq__10073_10091__$1 = temp__4092__auto___10090;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10073_10091__$1))
{var c__4262__auto___10092 = cljs.core.chunk_first.call(null,seq__10073_10091__$1);{
var G__10093 = cljs.core.chunk_rest.call(null,seq__10073_10091__$1);
var G__10094 = c__4262__auto___10092;
var G__10095 = cljs.core.count.call(null,c__4262__auto___10092);
var G__10096 = 0;
seq__10073_10079 = G__10093;
chunk__10074_10080 = G__10094;
count__10075_10081 = G__10095;
i__10076_10082 = G__10096;
continue;
}
} else
{var vec__10078_10097 = cljs.core.first.call(null,seq__10073_10091__$1);var ev__3326__auto___10098 = cljs.core.nth.call(null,vec__10078_10097,0,null);var func__3327__auto___10099 = cljs.core.nth.call(null,vec__10078_10097,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10098,func__3327__auto___10099);
{
var G__10100 = cljs.core.next.call(null,seq__10073_10091__$1);
var G__10101 = null;
var G__10102 = 0;
var G__10103 = 0;
seq__10073_10079 = G__10100;
chunk__10074_10080 = G__10101;
count__10075_10081 = G__10102;
i__10076_10082 = G__10103;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.clients.__BEH__track_active_client = (function __BEH__track_active_client(ed){return lt.object.merge_BANG_.call(null,lt.objs.sidebar.clients.clients,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"active","active",3885920888),new cljs.core.Keyword(null,"client","client",3951159101).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ed))], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.clients","track-active-client","lt.objs.sidebar.clients/track-active-client",667432058),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.clients.__BEH__track_active_client,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"set-client","set-client",2248164104),null,new cljs.core.Keyword(null,"active","active",3885920888),null], null), null));
lt.objs.sidebar.clients.__BEH__unset_client = (function __BEH__unset_client(this$,cur){var ed = lt.objs.editor.pool.last_active.call(null);var actives = new cljs.core.Keyword(null,"client","client",3951159101).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ed));var found_QMARK_ = cljs.core.first.call(null,cljs.core.filter.call(null,((function (ed,actives){
return (function (p1__10104_SHARP_){return cljs.core._EQ_.call(null,cur,cljs.core.val.call(null,p1__10104_SHARP_));
});})(ed,actives))
,actives));if(cljs.core.truth_(found_QMARK_))
{lt.object.update_BANG_.call(null,ed,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"client","client",3951159101)], null),cljs.core.dissoc,cljs.core.first.call(null,found_QMARK_));
} else
{}
return lt.objs.editor.pool.focus_last.call(null);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.clients","unset-client","lt.objs.sidebar.clients/unset-client",3530183417),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.clients.__BEH__unset_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,"unset!","unset!",4468628874),null], null), null));
lt.objs.sidebar.clients.__BEH__selecting_BANG_ = (function __BEH__selecting_BANG_(this$){return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"selecting?","selecting?",3653545739),true], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.clients","selecting!","lt.objs.sidebar.clients/selecting!",2845524117),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.clients.__BEH__selecting_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,"selecting!","selecting!",3653545709),null], null), null));
lt.objs.sidebar.clients.__BEH__done_selecting = (function __BEH__done_selecting(this$){return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"selecting?","selecting?",3653545739),false], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.clients","done-selecting","lt.objs.sidebar.clients/done-selecting",1238663413),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.clients.__BEH__done_selecting,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cancel","cancel",3941147116),null,new cljs.core.Keyword(null,"selected","selected",2205476365),null], null), null));
lt.objs.sidebar.clients.__BEH__hide_on_select = (function __BEH__hide_on_select(this$){return lt.object.raise.call(null,lt.objs.sidebar.rightbar,new cljs.core.Keyword(null,"close!","close!",3951350939));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.clients","hide-on-select","lt.objs.sidebar.clients/hide-on-select",1437883881),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.clients.__BEH__hide_on_select,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.sidebar.clients.__BEH__focus_BANG_ = (function __BEH__focus_BANG_(this$){return lt.util.dom.focus.call(null,lt.object.__GT_content.call(null,this$));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.clients","focus!","lt.objs.sidebar.clients/focus!",3198076775),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.sidebar.clients.__BEH__focus_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,"focus!","focus!",4039653819),null], null), null));
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.sidebar.clients","sidebar.clients","lt.objs.sidebar.clients/sidebar.clients",3045557908),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"sidebar.clients","sidebar.clients",3856103656),null], null), null),new cljs.core.Keyword(null,"label","label",1116631654),"connect",new cljs.core.Keyword(null,"connectors","connectors",4533225784),cljs.core.sorted_map.call(null),new cljs.core.Keyword(null,"order","order",1119910592),2,new cljs.core.Keyword(null,"init","init",1017141378),(function (this$){return lt.objs.sidebar.clients.connect_ui.call(null,this$);
}));
lt.objs.sidebar.clients.clients = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.sidebar.clients","sidebar.clients","lt.objs.sidebar.clients/sidebar.clients",3045557908));
lt.objs.sidebar.add_item.call(null,lt.objs.sidebar.rightbar,lt.objs.sidebar.clients.clients);
lt.objs.sidebar.clients.add_connector = (function add_connector(c){return lt.object.update_BANG_.call(null,lt.objs.sidebar.clients.clients,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"connectors","connectors",4533225784)], null),cljs.core.assoc,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(c),c);
});
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,"show-connect","show-connect",2165693836),new cljs.core.Keyword(null,"desc","desc",1016984067),"Connect: Toggle connect bar",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){lt.object.raise.call(null,lt.objs.sidebar.rightbar,new cljs.core.Keyword(null,"toggle","toggle",4440567494),lt.objs.sidebar.clients.clients);
return lt.object.raise.call(null,lt.objs.sidebar.clients.clients,new cljs.core.Keyword(null,"focus!","focus!",4039653819));
})], 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,"show-add-connection","show-add-connection",3671605196),new cljs.core.Keyword(null,"desc","desc",1016984067),"Connect: Add Connection",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){lt.object.raise.call(null,lt.objs.sidebar.rightbar,new cljs.core.Keyword(null,"toggle","toggle",4440567494),lt.objs.sidebar.clients.clients,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"force?","force?",4040082982),true,new cljs.core.Keyword(null,"transient?","transient?",3584270951),false], null));
return lt.object.raise.call(null,lt.objs.sidebar.clients.clients,new cljs.core.Keyword(null,"selecting!","selecting!",3653545709));
})], null));
lt.objs.sidebar.clients.add_connector.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"name","name",1017277949),"Ports",new cljs.core.Keyword(null,"desc","desc",1016984067),"Get the ports for the local TCP and Websocket servers",new cljs.core.Keyword(null,"connect","connect",1965255772),(function (){return lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"header","header",4087600639),"Ports",new cljs.core.Keyword(null,"body","body",1016933652),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"dl#ports","dl#ports",1671270345),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"dt","dt",1013907458),"TCP: "], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"dd","dd",1013907442),[cljs.core.str(lt.objs.clients.tcp.port)].join('')], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"dt","dt",1013907458),"WebSocket: "], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"dd","dd",1013907442),[cljs.core.str(lt.objs.clients.ws.port)].join('')], null)], null),new cljs.core.Keyword(null,"buttons","buttons",1255256819),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1116631654),"ok"], null)], null)], null));
})], null));
