// Compiled by ClojureScript 1.9.562 {}
goog.provide('weathergen.ui.trees');
goog.require('cljs.core');
goog.require('cljs.pprint');
goog.require('weathergen.ui.common');
goog.require('rum.core');
goog.require('taoensso.timbre');
goog.require('javelin.core');
goog.require('hoplon.jquery');
goog.require('hoplon.core');
/**
 * Helper function for the tree control.
 */
weathergen.ui.trees.tree_STAR_ = (function weathergen$ui$trees$tree_STAR_(expand_state,levels,items,level_number){
var vec__38106 = levels;
var seq__38107 = cljs.core.seq.call(null,vec__38106);
var first__38108 = cljs.core.first.call(null,seq__38107);
var seq__38107__$1 = cljs.core.next.call(null,seq__38107);
var level = first__38108;
var more_levels = seq__38107__$1;
var map__38109 = level;
var map__38109__$1 = ((((!((map__38109 == null)))?((((map__38109.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__38109.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__38109):map__38109);
var formatter = cljs.core.get.call(null,map__38109__$1,new cljs.core.Keyword(null,"formatter","formatter",-483008823));
var children = cljs.core.get.call(null,map__38109__$1,new cljs.core.Keyword(null,"children","children",-940561982));
var attrs = cljs.core.get.call(null,map__38109__$1,new cljs.core.Keyword(null,"attrs","attrs",-2090668713));
return weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",723558921),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"-28px"], null)], null),hoplon.core.ol.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"list-style-type","list-style-type",-1703248598),"none"], null),hoplon.core.loop_tpl_STAR_.call(null,items,((function (vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (item__29818__auto__){
var vec__38111 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (item){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [item], null);
});})(vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
).call(null,item__29818__auto__));
var item = cljs.core.nth.call(null,vec__38111,(0),null);
var kids = (cljs.core.truth_(children)?children.call(null,item):javelin.core.cell.call(null,null));
var expanded_QMARK_ = javelin.core.cell.call(null,true);
if(cljs.core.truth_(expand_state)){
hoplon.core.do_watch.call(null,expand_state,((function (kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (_,n){
if(cljs.core._EQ_.call(null,n,new cljs.core.Keyword(null,"all-expanded","all-expanded",1437674225))){
return cljs.core.reset_BANG_.call(null,expanded_QMARK_,true);
} else {
if(cljs.core._EQ_.call(null,n,new cljs.core.Keyword(null,"all-collapsed","all-collapsed",437702622))){
return cljs.core.reset_BANG_.call(null,expanded_QMARK_,false);
} else {
if(cljs.core._EQ_.call(null,cljs.core.first.call(null,n),new cljs.core.Keyword(null,"expand-through-level","expand-through-level",-1840001384))){
var e = (level_number < cljs.core.second.call(null,n));
return cljs.core.reset_BANG_.call(null,expanded_QMARK_,e);
} else {
return null;
}
}
}
});})(kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
);
} else {
}

return hoplon.core.li.call(null,(cljs.core.truth_(attrs)?attrs.call(null,item):cljs.core.PersistentArrayMap.EMPTY),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap"], null),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),"15px",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"top"], null),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"background","background",-863952629),"transparent"], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (){
cljs.core.swap_BANG_.call(null,expanded_QMARK_,cljs.core.not);

if(cljs.core.truth_(expand_state)){
return cljs.core.reset_BANG_.call(null,expand_state,null);
} else {
return null;
}
});})(kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
);
});})(kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
,hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (expanded_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"width","width",-384071477),(0),new cljs.core.Keyword(null,"height","height",1025178622),(0),new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"transform","transform",1381301764),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rotate("),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK___$1)?(0):(-90))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("deg)")].join('')], null);
});})(kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
).call(null,expanded_QMARK_)));
});})(kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (){
return "";
});})(con__29828__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (G__38114,G__38115){
return G__38114.call(null,G__38115);
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
).call(null,cljs.core.seq,kids));
})()),formatter.call(null,expanded_QMARK_,item)),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (){
return weathergen.ui.trees.tree_STAR_.call(null,expand_state,more_levels,kids,(level_number + (1)));
});})(kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (){
return null;
});})(con__29828__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs){
return (function (G__38116,G__38117){
var and__23326__auto__ = G__38116;
if(cljs.core.truth_(and__23326__auto__)){
return G__38117;
} else {
return and__23326__auto__;
}
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,kids,expanded_QMARK_,vec__38111,item,vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
).call(null,expanded_QMARK_,kids));
})());
});})(vec__38106,seq__38107,first__38108,seq__38107__$1,level,more_levels,map__38109,map__38109__$1,formatter,children,attrs))
)));
});
/**
 * Returns a collapable tree with hierarchy defined by `levels`, a seq
 *   of maps with `:formatter` and `:children` keys, each a function of a
 *   single item in the hierarchy. The formatter returns UI for that
 *   item, and children (if present) returns items that will be rendered
 *   as children. `expand-state` is either nil or a cell containing
 *   keyword `:all-expanded`, keyword `:all-collapsed`, or vector
 *   `[:expand-through n]`, where `n` is a nonnegative integer. Changing
 *   to these values will cause the list to behave as specified.
 */
weathergen.ui.trees.tree = (function weathergen$ui$trees$tree(expand_state,levels,items){
return weathergen.ui.trees.tree_STAR_.call(null,expand_state,levels,items,(0));
});
weathergen.ui.trees.inline = (function weathergen$ui$trees$inline(var_args){
var args__24566__auto__ = [];
var len__24559__auto___38120 = arguments.length;
var i__24560__auto___38121 = (0);
while(true){
if((i__24560__auto___38121 < len__24559__auto___38120)){
args__24566__auto__.push((arguments[i__24560__auto___38121]));

var G__38122 = (i__24560__auto___38121 + (1));
i__24560__auto___38121 = G__38122;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((1) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((1)),(0),null)):null);
return weathergen.ui.trees.inline.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24567__auto__);
});

weathergen.ui.trees.inline.cljs$core$IFn$_invoke$arity$variadic = (function (props,args){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),cljs.core.assoc_in.call(null,props,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.Keyword(null,"display","display",242065432)], null),"inline-block"),args], null);
});

weathergen.ui.trees.inline.cljs$lang$maxFixedArity = (1);

weathergen.ui.trees.inline.cljs$lang$applyTo = (function (seq38118){
var G__38119 = cljs.core.first.call(null,seq38118);
var seq38118__$1 = cljs.core.next.call(null,seq38118);
return weathergen.ui.trees.inline.cljs$core$IFn$_invoke$arity$variadic(G__38119,seq38118__$1);
});

weathergen.ui.trees.RTree = rum.core.build_defc.call(null,(function (expander,items){
return React.createElement("ol",({"style": ({"listStyleType": "none"})}),cljs.core.into_array.call(null,(function (){var iter__24200__auto__ = (function weathergen$ui$trees$iter__38124(s__38125){
return (new cljs.core.LazySeq(null,(function (){
var s__38125__$1 = s__38125;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__38125__$1);
if(temp__5278__auto__){
var s__38125__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__38125__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__38125__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__38127 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__38126 = (0);
while(true){
if((i__38126 < size__24199__auto__)){
var map__38132 = cljs.core._nth.call(null,c__24198__auto__,i__38126);
var map__38132__$1 = ((((!((map__38132 == null)))?((((map__38132.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__38132.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__38132):map__38132);
var item = map__38132__$1;
var ui = cljs.core.get.call(null,map__38132__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var attrs = cljs.core.get.call(null,map__38132__$1,new cljs.core.Keyword(null,"attrs","attrs",-2090668713));
var expanded_QMARK_ = cljs.core.get.call(null,map__38132__$1,new cljs.core.Keyword(null,"expanded?","expanded?",2055832296));
var children = cljs.core.get.call(null,map__38132__$1,new cljs.core.Keyword(null,"children","children",-940561982));
var id = cljs.core.get.call(null,map__38132__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
cljs.core.chunk_append.call(null,b__38127,(function (){var attrs38123 = cljs.core.assoc.call(null,attrs,new cljs.core.Keyword(null,"key","key",-1516042587),id);
return cljs.core.apply.call(null,React.createElement,"li",((cljs.core.map_QMARK_.call(null,attrs38123))?sablono.interpreter.attributes.call(null,attrs38123):null),((cljs.core.map_QMARK_.call(null,attrs38123))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [React.createElement("div",({"style": ({"display": "inline-flex", "whiteSpace": "nowrap"})}),sablono.interpreter.interpret.call(null,weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(15)),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(120)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"top"], null)], null),((cljs.core.empty_QMARK_.call(null,children))?"":weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"background","background",-863952629),"transparent"], null),new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (i__38126,attrs38123,map__38132,map__38132__$1,item,ui,attrs,expanded_QMARK_,children,id,c__24198__auto__,size__24199__auto__,b__38127,s__38125__$2,temp__5278__auto__){
return (function (e){
return expander.call(null,id);
});})(i__38126,attrs38123,map__38132,map__38132__$1,item,ui,attrs,expanded_QMARK_,children,id,c__24198__auto__,size__24199__auto__,b__38127,s__38125__$2,temp__5278__auto__))
], null),weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"width","width",-384071477),(0),new cljs.core.Keyword(null,"height","height",1025178622),(0),new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),weathergen.ui.common.px.call(null,(-8)),new cljs.core.Keyword(null,"transform","transform",1381301764),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rotate("),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK_)?(0):(-90))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("deg)")].join('')], null)], null)))))),sablono.interpreter.interpret.call(null,ui)),sablono.interpreter.interpret.call(null,(cljs.core.truth_((function (){var and__23326__auto__ = expanded_QMARK_;
if(cljs.core.truth_(and__23326__auto__)){
return children;
} else {
return and__23326__auto__;
}
})())?weathergen.ui.trees.RTree.call(null,expander,children):null))], null):new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [sablono.interpreter.interpret.call(null,attrs38123),React.createElement("div",({"style": ({"display": "inline-flex", "whiteSpace": "nowrap"})}),sablono.interpreter.interpret.call(null,weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(15)),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(120)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"top"], null)], null),((cljs.core.empty_QMARK_.call(null,children))?"":weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"background","background",-863952629),"transparent"], null),new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (i__38126,attrs38123,map__38132,map__38132__$1,item,ui,attrs,expanded_QMARK_,children,id,c__24198__auto__,size__24199__auto__,b__38127,s__38125__$2,temp__5278__auto__){
return (function (e){
return expander.call(null,id);
});})(i__38126,attrs38123,map__38132,map__38132__$1,item,ui,attrs,expanded_QMARK_,children,id,c__24198__auto__,size__24199__auto__,b__38127,s__38125__$2,temp__5278__auto__))
], null),weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"width","width",-384071477),(0),new cljs.core.Keyword(null,"height","height",1025178622),(0),new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),weathergen.ui.common.px.call(null,(-8)),new cljs.core.Keyword(null,"transform","transform",1381301764),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rotate("),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK_)?(0):(-90))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("deg)")].join('')], null)], null)))))),sablono.interpreter.interpret.call(null,ui)),sablono.interpreter.interpret.call(null,(cljs.core.truth_((function (){var and__23326__auto__ = expanded_QMARK_;
if(cljs.core.truth_(and__23326__auto__)){
return children;
} else {
return and__23326__auto__;
}
})())?weathergen.ui.trees.RTree.call(null,expander,children):null))], null)));
})());

var G__38136 = (i__38126 + (1));
i__38126 = G__38136;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__38127),weathergen$ui$trees$iter__38124.call(null,cljs.core.chunk_rest.call(null,s__38125__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__38127),null);
}
} else {
var map__38134 = cljs.core.first.call(null,s__38125__$2);
var map__38134__$1 = ((((!((map__38134 == null)))?((((map__38134.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__38134.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__38134):map__38134);
var item = map__38134__$1;
var ui = cljs.core.get.call(null,map__38134__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var attrs = cljs.core.get.call(null,map__38134__$1,new cljs.core.Keyword(null,"attrs","attrs",-2090668713));
var expanded_QMARK_ = cljs.core.get.call(null,map__38134__$1,new cljs.core.Keyword(null,"expanded?","expanded?",2055832296));
var children = cljs.core.get.call(null,map__38134__$1,new cljs.core.Keyword(null,"children","children",-940561982));
var id = cljs.core.get.call(null,map__38134__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
return cljs.core.cons.call(null,(function (){var attrs38123 = cljs.core.assoc.call(null,attrs,new cljs.core.Keyword(null,"key","key",-1516042587),id);
return cljs.core.apply.call(null,React.createElement,"li",((cljs.core.map_QMARK_.call(null,attrs38123))?sablono.interpreter.attributes.call(null,attrs38123):null),((cljs.core.map_QMARK_.call(null,attrs38123))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [React.createElement("div",({"style": ({"display": "inline-flex", "whiteSpace": "nowrap"})}),sablono.interpreter.interpret.call(null,weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(15)),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(120)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"top"], null)], null),((cljs.core.empty_QMARK_.call(null,children))?"":weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"background","background",-863952629),"transparent"], null),new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (attrs38123,map__38134,map__38134__$1,item,ui,attrs,expanded_QMARK_,children,id,s__38125__$2,temp__5278__auto__){
return (function (e){
return expander.call(null,id);
});})(attrs38123,map__38134,map__38134__$1,item,ui,attrs,expanded_QMARK_,children,id,s__38125__$2,temp__5278__auto__))
], null),weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"width","width",-384071477),(0),new cljs.core.Keyword(null,"height","height",1025178622),(0),new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),weathergen.ui.common.px.call(null,(-8)),new cljs.core.Keyword(null,"transform","transform",1381301764),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rotate("),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK_)?(0):(-90))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("deg)")].join('')], null)], null)))))),sablono.interpreter.interpret.call(null,ui)),sablono.interpreter.interpret.call(null,(cljs.core.truth_((function (){var and__23326__auto__ = expanded_QMARK_;
if(cljs.core.truth_(and__23326__auto__)){
return children;
} else {
return and__23326__auto__;
}
})())?weathergen.ui.trees.RTree.call(null,expander,children):null))], null):new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [sablono.interpreter.interpret.call(null,attrs38123),React.createElement("div",({"style": ({"display": "inline-flex", "whiteSpace": "nowrap"})}),sablono.interpreter.interpret.call(null,weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(15)),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(120)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"top"], null)], null),((cljs.core.empty_QMARK_.call(null,children))?"":weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"background","background",-863952629),"transparent"], null),new cljs.core.Keyword(null,"on-click","on-click",1632826543),((function (attrs38123,map__38134,map__38134__$1,item,ui,attrs,expanded_QMARK_,children,id,s__38125__$2,temp__5278__auto__){
return (function (e){
return expander.call(null,id);
});})(attrs38123,map__38134,map__38134__$1,item,ui,attrs,expanded_QMARK_,children,id,s__38125__$2,temp__5278__auto__))
], null),weathergen.ui.trees.inline.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"width","width",-384071477),(0),new cljs.core.Keyword(null,"height","height",1025178622),(0),new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),weathergen.ui.common.px.call(null,(-8)),new cljs.core.Keyword(null,"transform","transform",1381301764),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rotate("),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK_)?(0):(-90))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("deg)")].join('')], null)], null)))))),sablono.interpreter.interpret.call(null,ui)),sablono.interpreter.interpret.call(null,(cljs.core.truth_((function (){var and__23326__auto__ = expanded_QMARK_;
if(cljs.core.truth_(and__23326__auto__)){
return children;
} else {
return and__23326__auto__;
}
})())?weathergen.ui.trees.RTree.call(null,expander,children):null))], null)));
})(),weathergen$ui$trees$iter__38124.call(null,cljs.core.rest.call(null,s__38125__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,items);
})()));
}),null,"RTree");
weathergen.ui.trees.rtree = (function weathergen$ui$trees$rtree(items,expander){
var parent = weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ol","ol",932524051),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-indent","text-indent",-1987214414),weathergen.ui.common.px.call(null,(2))], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",723558921),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(-28))], null)], null)], null));
hoplon.core.do_watch.call(null,items,((function (parent){
return (function (_,items_STAR_){
return rum.core.mount.call(null,weathergen.ui.trees.RTree.call(null,expander,items_STAR_),parent);
});})(parent))
);

return parent;
});
