// 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__12169_12175 = 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__12170_12176 = null;var count__12171_12177 = 0;var i__12172_12178 = 0;while(true){
if((i__12172_12178 < count__12171_12177))
{var vec__12173_12179 = cljs.core._nth.call(null,chunk__12170_12176,i__12172_12178);var ev__3326__auto___12180 = cljs.core.nth.call(null,vec__12173_12179,0,null);var func__3327__auto___12181 = cljs.core.nth.call(null,vec__12173_12179,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12180,func__3327__auto___12181);
{
var G__12182 = seq__12169_12175;
var G__12183 = chunk__12170_12176;
var G__12184 = count__12171_12177;
var G__12185 = (i__12172_12178 + 1);
seq__12169_12175 = G__12182;
chunk__12170_12176 = G__12183;
count__12171_12177 = G__12184;
i__12172_12178 = G__12185;
continue;
}
} else
{var temp__4092__auto___12186 = cljs.core.seq.call(null,seq__12169_12175);if(temp__4092__auto___12186)
{var seq__12169_12187__$1 = temp__4092__auto___12186;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12169_12187__$1))
{var c__4262__auto___12188 = cljs.core.chunk_first.call(null,seq__12169_12187__$1);{
var G__12189 = cljs.core.chunk_rest.call(null,seq__12169_12187__$1);
var G__12190 = c__4262__auto___12188;
var G__12191 = cljs.core.count.call(null,c__4262__auto___12188);
var G__12192 = 0;
seq__12169_12175 = G__12189;
chunk__12170_12176 = G__12190;
count__12171_12177 = G__12191;
i__12172_12178 = G__12192;
continue;
}
} else
{var vec__12174_12193 = cljs.core.first.call(null,seq__12169_12187__$1);var ev__3326__auto___12194 = cljs.core.nth.call(null,vec__12174_12193,0,null);var func__3327__auto___12195 = cljs.core.nth.call(null,vec__12174_12193,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12194,func__3327__auto___12195);
{
var G__12196 = cljs.core.next.call(null,seq__12169_12187__$1);
var G__12197 = null;
var G__12198 = 0;
var G__12199 = 0;
seq__12169_12175 = G__12196;
chunk__12170_12176 = G__12197;
count__12171_12177 = G__12198;
i__12172_12178 = G__12199;
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__12206_12212 = 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__12207_12213 = null;var count__12208_12214 = 0;var i__12209_12215 = 0;while(true){
if((i__12209_12215 < count__12208_12214))
{var vec__12210_12216 = cljs.core._nth.call(null,chunk__12207_12213,i__12209_12215);var ev__3326__auto___12217 = cljs.core.nth.call(null,vec__12210_12216,0,null);var func__3327__auto___12218 = cljs.core.nth.call(null,vec__12210_12216,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12217,func__3327__auto___12218);
{
var G__12219 = seq__12206_12212;
var G__12220 = chunk__12207_12213;
var G__12221 = count__12208_12214;
var G__12222 = (i__12209_12215 + 1);
seq__12206_12212 = G__12219;
chunk__12207_12213 = G__12220;
count__12208_12214 = G__12221;
i__12209_12215 = G__12222;
continue;
}
} else
{var temp__4092__auto___12223 = cljs.core.seq.call(null,seq__12206_12212);if(temp__4092__auto___12223)
{var seq__12206_12224__$1 = temp__4092__auto___12223;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12206_12224__$1))
{var c__4262__auto___12225 = cljs.core.chunk_first.call(null,seq__12206_12224__$1);{
var G__12226 = cljs.core.chunk_rest.call(null,seq__12206_12224__$1);
var G__12227 = c__4262__auto___12225;
var G__12228 = cljs.core.count.call(null,c__4262__auto___12225);
var G__12229 = 0;
seq__12206_12212 = G__12226;
chunk__12207_12213 = G__12227;
count__12208_12214 = G__12228;
i__12209_12215 = G__12229;
continue;
}
} else
{var vec__12211_12230 = cljs.core.first.call(null,seq__12206_12224__$1);var ev__3326__auto___12231 = cljs.core.nth.call(null,vec__12211_12230,0,null);var func__3327__auto___12232 = cljs.core.nth.call(null,vec__12211_12230,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12231,func__3327__auto___12232);
{
var G__12233 = cljs.core.next.call(null,seq__12206_12224__$1);
var G__12234 = null;
var G__12235 = 0;
var G__12236 = 0;
seq__12206_12212 = G__12233;
chunk__12207_12213 = G__12234;
count__12208_12214 = G__12235;
i__12209_12215 = G__12236;
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__12243_12249 = 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__12244_12250 = null;var count__12245_12251 = 0;var i__12246_12252 = 0;while(true){
if((i__12246_12252 < count__12245_12251))
{var vec__12247_12253 = cljs.core._nth.call(null,chunk__12244_12250,i__12246_12252);var ev__3326__auto___12254 = cljs.core.nth.call(null,vec__12247_12253,0,null);var func__3327__auto___12255 = cljs.core.nth.call(null,vec__12247_12253,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12254,func__3327__auto___12255);
{
var G__12256 = seq__12243_12249;
var G__12257 = chunk__12244_12250;
var G__12258 = count__12245_12251;
var G__12259 = (i__12246_12252 + 1);
seq__12243_12249 = G__12256;
chunk__12244_12250 = G__12257;
count__12245_12251 = G__12258;
i__12246_12252 = G__12259;
continue;
}
} else
{var temp__4092__auto___12260 = cljs.core.seq.call(null,seq__12243_12249);if(temp__4092__auto___12260)
{var seq__12243_12261__$1 = temp__4092__auto___12260;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12243_12261__$1))
{var c__4262__auto___12262 = cljs.core.chunk_first.call(null,seq__12243_12261__$1);{
var G__12263 = cljs.core.chunk_rest.call(null,seq__12243_12261__$1);
var G__12264 = c__4262__auto___12262;
var G__12265 = cljs.core.count.call(null,c__4262__auto___12262);
var G__12266 = 0;
seq__12243_12249 = G__12263;
chunk__12244_12250 = G__12264;
count__12245_12251 = G__12265;
i__12246_12252 = G__12266;
continue;
}
} else
{var vec__12248_12267 = cljs.core.first.call(null,seq__12243_12261__$1);var ev__3326__auto___12268 = cljs.core.nth.call(null,vec__12248_12267,0,null);var func__3327__auto___12269 = cljs.core.nth.call(null,vec__12248_12267,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12268,func__3327__auto___12269);
{
var G__12270 = cljs.core.next.call(null,seq__12243_12261__$1);
var G__12271 = null;
var G__12272 = 0;
var G__12273 = 0;
seq__12243_12249 = G__12270;
chunk__12244_12250 = G__12271;
count__12245_12251 = G__12272;
i__12246_12252 = G__12273;
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__12280_12286 = 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__12281_12287 = null;var count__12282_12288 = 0;var i__12283_12289 = 0;while(true){
if((i__12283_12289 < count__12282_12288))
{var vec__12284_12290 = cljs.core._nth.call(null,chunk__12281_12287,i__12283_12289);var ev__3326__auto___12291 = cljs.core.nth.call(null,vec__12284_12290,0,null);var func__3327__auto___12292 = cljs.core.nth.call(null,vec__12284_12290,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12291,func__3327__auto___12292);
{
var G__12293 = seq__12280_12286;
var G__12294 = chunk__12281_12287;
var G__12295 = count__12282_12288;
var G__12296 = (i__12283_12289 + 1);
seq__12280_12286 = G__12293;
chunk__12281_12287 = G__12294;
count__12282_12288 = G__12295;
i__12283_12289 = G__12296;
continue;
}
} else
{var temp__4092__auto___12297 = cljs.core.seq.call(null,seq__12280_12286);if(temp__4092__auto___12297)
{var seq__12280_12298__$1 = temp__4092__auto___12297;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12280_12298__$1))
{var c__4262__auto___12299 = cljs.core.chunk_first.call(null,seq__12280_12298__$1);{
var G__12300 = cljs.core.chunk_rest.call(null,seq__12280_12298__$1);
var G__12301 = c__4262__auto___12299;
var G__12302 = cljs.core.count.call(null,c__4262__auto___12299);
var G__12303 = 0;
seq__12280_12286 = G__12300;
chunk__12281_12287 = G__12301;
count__12282_12288 = G__12302;
i__12283_12289 = G__12303;
continue;
}
} else
{var vec__12285_12304 = cljs.core.first.call(null,seq__12280_12298__$1);var ev__3326__auto___12305 = cljs.core.nth.call(null,vec__12285_12304,0,null);var func__3327__auto___12306 = cljs.core.nth.call(null,vec__12285_12304,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12305,func__3327__auto___12306);
{
var G__12307 = cljs.core.next.call(null,seq__12280_12298__$1);
var G__12308 = null;
var G__12309 = 0;
var G__12310 = 0;
seq__12280_12286 = G__12307;
chunk__12281_12287 = G__12308;
count__12282_12288 = G__12309;
i__12283_12289 = G__12310;
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__12311_SHARP_){return cljs.core._EQ_.call(null,cur,cljs.core.val.call(null,p1__12311_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__12316(s__12317){return (new cljs.core.LazySeq(null,(function (){var s__12317__$1 = s__12317;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__12317__$1);if(temp__4092__auto__)
{var s__12317__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__12317__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__12317__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__12319 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__12318 = 0;while(true){
if((i__12318 < size__4230__auto__))
{var c = cljs.core._nth.call(null,c__4229__auto__,i__12318);cljs.core.chunk_append.call(null,b__12319,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),c], null));
{
var G__12320 = (i__12318 + 1);
i__12318 = G__12320;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12319),iter__12316.call(null,cljs.core.chunk_rest.call(null,s__12317__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12319),null);
}
} else
{var c = cljs.core.first.call(null,s__12317__$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__12316.call(null,cljs.core.rest.call(null,s__12317__$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__12321_SHARP_){return lt.objs.sidebar.clients.__GT_active_QMARK_.call(null,i__$1,p1__12321_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__12328_12334 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__12329_12335 = null;var count__12330_12336 = 0;var i__12331_12337 = 0;while(true){
if((i__12331_12337 < count__12330_12336))
{var vec__12332_12338 = cljs.core._nth.call(null,chunk__12329_12335,i__12331_12337);var ev__3326__auto___12339 = cljs.core.nth.call(null,vec__12332_12338,0,null);var func__3327__auto___12340 = cljs.core.nth.call(null,vec__12332_12338,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12339,func__3327__auto___12340);
{
var G__12341 = seq__12328_12334;
var G__12342 = chunk__12329_12335;
var G__12343 = count__12330_12336;
var G__12344 = (i__12331_12337 + 1);
seq__12328_12334 = G__12341;
chunk__12329_12335 = G__12342;
count__12330_12336 = G__12343;
i__12331_12337 = G__12344;
continue;
}
} else
{var temp__4092__auto___12345 = cljs.core.seq.call(null,seq__12328_12334);if(temp__4092__auto___12345)
{var seq__12328_12346__$1 = temp__4092__auto___12345;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12328_12346__$1))
{var c__4262__auto___12347 = cljs.core.chunk_first.call(null,seq__12328_12346__$1);{
var G__12348 = cljs.core.chunk_rest.call(null,seq__12328_12346__$1);
var G__12349 = c__4262__auto___12347;
var G__12350 = cljs.core.count.call(null,c__4262__auto___12347);
var G__12351 = 0;
seq__12328_12334 = G__12348;
chunk__12329_12335 = G__12349;
count__12330_12336 = G__12350;
i__12331_12337 = G__12351;
continue;
}
} else
{var vec__12333_12352 = cljs.core.first.call(null,seq__12328_12346__$1);var ev__3326__auto___12353 = cljs.core.nth.call(null,vec__12333_12352,0,null);var func__3327__auto___12354 = cljs.core.nth.call(null,vec__12333_12352,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12353,func__3327__auto___12354);
{
var G__12355 = cljs.core.next.call(null,seq__12328_12346__$1);
var G__12356 = null;
var G__12357 = 0;
var G__12358 = 0;
seq__12328_12334 = G__12355;
chunk__12329_12335 = G__12356;
count__12330_12336 = G__12357;
i__12331_12337 = G__12358;
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__12365_12371 = 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__12366_12372 = null;var count__12367_12373 = 0;var i__12368_12374 = 0;while(true){
if((i__12368_12374 < count__12367_12373))
{var vec__12369_12375 = cljs.core._nth.call(null,chunk__12366_12372,i__12368_12374);var ev__3326__auto___12376 = cljs.core.nth.call(null,vec__12369_12375,0,null);var func__3327__auto___12377 = cljs.core.nth.call(null,vec__12369_12375,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12376,func__3327__auto___12377);
{
var G__12378 = seq__12365_12371;
var G__12379 = chunk__12366_12372;
var G__12380 = count__12367_12373;
var G__12381 = (i__12368_12374 + 1);
seq__12365_12371 = G__12378;
chunk__12366_12372 = G__12379;
count__12367_12373 = G__12380;
i__12368_12374 = G__12381;
continue;
}
} else
{var temp__4092__auto___12382 = cljs.core.seq.call(null,seq__12365_12371);if(temp__4092__auto___12382)
{var seq__12365_12383__$1 = temp__4092__auto___12382;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12365_12383__$1))
{var c__4262__auto___12384 = cljs.core.chunk_first.call(null,seq__12365_12383__$1);{
var G__12385 = cljs.core.chunk_rest.call(null,seq__12365_12383__$1);
var G__12386 = c__4262__auto___12384;
var G__12387 = cljs.core.count.call(null,c__4262__auto___12384);
var G__12388 = 0;
seq__12365_12371 = G__12385;
chunk__12366_12372 = G__12386;
count__12367_12373 = G__12387;
i__12368_12374 = G__12388;
continue;
}
} else
{var vec__12370_12389 = cljs.core.first.call(null,seq__12365_12383__$1);var ev__3326__auto___12390 = cljs.core.nth.call(null,vec__12370_12389,0,null);var func__3327__auto___12391 = cljs.core.nth.call(null,vec__12370_12389,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12390,func__3327__auto___12391);
{
var G__12392 = cljs.core.next.call(null,seq__12365_12383__$1);
var G__12393 = null;
var G__12394 = 0;
var G__12395 = 0;
seq__12365_12371 = G__12392;
chunk__12366_12372 = G__12393;
count__12367_12373 = G__12394;
i__12368_12374 = G__12395;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.sidebar.clients.connectors = (function connectors(this$,connectors__$1){var iter__4231__auto__ = (function iter__12404(s__12405){return (new cljs.core.LazySeq(null,(function (){var s__12405__$1 = s__12405;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__12405__$1);if(temp__4092__auto__)
{var s__12405__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__12405__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__12405__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__12407 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__12406 = 0;while(true){
if((i__12406 < size__4230__auto__))
{var vec__12410 = cljs.core._nth.call(null,c__4229__auto__,i__12406);var k = cljs.core.nth.call(null,vec__12410,0,null);var c = cljs.core.nth.call(null,vec__12410,1,null);cljs.core.chunk_append.call(null,b__12407,lt.objs.sidebar.clients.connection_type.call(null,this$,c));
{
var G__12412 = (i__12406 + 1);
i__12406 = G__12412;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12407),iter__12404.call(null,cljs.core.chunk_rest.call(null,s__12405__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__12407),null);
}
} else
{var vec__12411 = cljs.core.first.call(null,s__12405__$2);var k = cljs.core.nth.call(null,vec__12411,0,null);var c = cljs.core.nth.call(null,vec__12411,1,null);return cljs.core.cons.call(null,lt.objs.sidebar.clients.connection_type.call(null,this$,c),iter__12404.call(null,cljs.core.rest.call(null,s__12405__$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__12419_12425 = 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__12420_12426 = null;var count__12421_12427 = 0;var i__12422_12428 = 0;while(true){
if((i__12422_12428 < count__12421_12427))
{var vec__12423_12429 = cljs.core._nth.call(null,chunk__12420_12426,i__12422_12428);var ev__3326__auto___12430 = cljs.core.nth.call(null,vec__12423_12429,0,null);var func__3327__auto___12431 = cljs.core.nth.call(null,vec__12423_12429,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12430,func__3327__auto___12431);
{
var G__12432 = seq__12419_12425;
var G__12433 = chunk__12420_12426;
var G__12434 = count__12421_12427;
var G__12435 = (i__12422_12428 + 1);
seq__12419_12425 = G__12432;
chunk__12420_12426 = G__12433;
count__12421_12427 = G__12434;
i__12422_12428 = G__12435;
continue;
}
} else
{var temp__4092__auto___12436 = cljs.core.seq.call(null,seq__12419_12425);if(temp__4092__auto___12436)
{var seq__12419_12437__$1 = temp__4092__auto___12436;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12419_12437__$1))
{var c__4262__auto___12438 = cljs.core.chunk_first.call(null,seq__12419_12437__$1);{
var G__12439 = cljs.core.chunk_rest.call(null,seq__12419_12437__$1);
var G__12440 = c__4262__auto___12438;
var G__12441 = cljs.core.count.call(null,c__4262__auto___12438);
var G__12442 = 0;
seq__12419_12425 = G__12439;
chunk__12420_12426 = G__12440;
count__12421_12427 = G__12441;
i__12422_12428 = G__12442;
continue;
}
} else
{var vec__12424_12443 = cljs.core.first.call(null,seq__12419_12437__$1);var ev__3326__auto___12444 = cljs.core.nth.call(null,vec__12424_12443,0,null);var func__3327__auto___12445 = cljs.core.nth.call(null,vec__12424_12443,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12444,func__3327__auto___12445);
{
var G__12446 = cljs.core.next.call(null,seq__12419_12437__$1);
var G__12447 = null;
var G__12448 = 0;
var G__12449 = 0;
seq__12419_12425 = G__12446;
chunk__12420_12426 = G__12447;
count__12421_12427 = G__12448;
i__12422_12428 = G__12449;
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__12450_SHARP_){return cljs.core._EQ_.call(null,cur,cljs.core.val.call(null,p1__12450_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));
