// Compiled by ClojureScript 1.10.520 {}
goog.provide('weathergen.ui.trees');
goog.require('cljs.core');
goog.require('cljs.pprint');
goog.require('hoplon.core');
goog.require('javelin.core');
goog.require('weathergen.ui.common');
goog.require('rum.core');
goog.require('taoensso.timbre');
/**
 * 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__35635 = levels;
var seq__35636 = cljs.core.seq.call(null,vec__35635);
var first__35637 = cljs.core.first.call(null,seq__35636);
var seq__35636__$1 = cljs.core.next.call(null,seq__35636);
var level = first__35637;
var more_levels = seq__35636__$1;
var map__35638 = level;
var map__35638__$1 = (((((!((map__35638 == null))))?(((((map__35638.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__35638.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__35638):map__35638);
var formatter = cljs.core.get.call(null,map__35638__$1,new cljs.core.Keyword(null,"formatter","formatter",-483008823));
var children = cljs.core.get.call(null,map__35638__$1,new cljs.core.Keyword(null,"children","children",-940561982));
var attrs = cljs.core.get.call(null,map__35638__$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__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs){
return (function (item__30277__auto__){
var vec__35640 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs){
return (function (item){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [item], null);
});})(vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
).call(null,item__30277__auto__));
var item = cljs.core.nth.call(null,vec__35640,(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__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$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__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$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__30287__auto__ = (new cljs.core.Delay(((function (kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$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__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$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__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
);
});})(kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$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__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$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),["rotate(",cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK___$1)?(0):(-90))),"deg)"].join('')], null);
});})(kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
).call(null,expanded_QMARK_)));
});})(kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs){
return (function (){
return "";
});})(con__30287__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs){
return (function (G__35643,G__35644){
return G__35643.call(null,G__35644);
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
).call(null,cljs.core.seq,kids));
})()),formatter.call(null,expanded_QMARK_,item)),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$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__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs){
return (function (){
return null;
});})(con__30287__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs){
return (function (G__35645,G__35646){
var and__4120__auto__ = G__35645;
if(cljs.core.truth_(and__4120__auto__)){
return G__35646;
} else {
return and__4120__auto__;
}
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,kids,expanded_QMARK_,vec__35640,item,vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$1,formatter,children,attrs))
).call(null,expanded_QMARK_,kids));
})());
});})(vec__35635,seq__35636,first__35637,seq__35636__$1,level,more_levels,map__35638,map__35638__$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.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__4523__auto__ = (function weathergen$ui$trees$iter__35648(s__35649){
return (new cljs.core.LazySeq(null,(function (){
var s__35649__$1 = s__35649;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__35649__$1);
if(temp__5720__auto__){
var s__35649__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__35649__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__35649__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__35651 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__35650 = (0);
while(true){
if((i__35650 < size__4522__auto__)){
var map__35652 = cljs.core._nth.call(null,c__4521__auto__,i__35650);
var map__35652__$1 = (((((!((map__35652 == null))))?(((((map__35652.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__35652.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__35652):map__35652);
var item = map__35652__$1;
var ui = cljs.core.get.call(null,map__35652__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var attrs = cljs.core.get.call(null,map__35652__$1,new cljs.core.Keyword(null,"attrs","attrs",-2090668713));
var expanded_QMARK_ = cljs.core.get.call(null,map__35652__$1,new cljs.core.Keyword(null,"expanded?","expanded?",2055832296));
var children = cljs.core.get.call(null,map__35652__$1,new cljs.core.Keyword(null,"children","children",-940561982));
var id = cljs.core.get.call(null,map__35652__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
cljs.core.chunk_append.call(null,b__35651,(function (){var attrs35647 = 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,attrs35647))?sablono.interpreter.attributes.call(null,attrs35647):null),((cljs.core.map_QMARK_.call(null,attrs35647))?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.common.rinl.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.common.rinl.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__35650,attrs35647,map__35652,map__35652__$1,item,ui,attrs,expanded_QMARK_,children,id,c__4521__auto__,size__4522__auto__,b__35651,s__35649__$2,temp__5720__auto__){
return (function (e){
return expander.call(null,id);
});})(i__35650,attrs35647,map__35652,map__35652__$1,item,ui,attrs,expanded_QMARK_,children,id,c__4521__auto__,size__4522__auto__,b__35651,s__35649__$2,temp__5720__auto__))
], null),weathergen.ui.common.rinl.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),["rotate(",cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK_)?(0):(-90))),"deg)"].join('')], null)], null)))))),sablono.interpreter.interpret.call(null,ui)),sablono.interpreter.interpret.call(null,(cljs.core.truth_((function (){var and__4120__auto__ = expanded_QMARK_;
if(cljs.core.truth_(and__4120__auto__)){
return children;
} else {
return and__4120__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,attrs35647),React.createElement("div",({"style": ({"display": "inline-flex", "whiteSpace": "nowrap"})}),sablono.interpreter.interpret.call(null,weathergen.ui.common.rinl.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.common.rinl.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__35650,attrs35647,map__35652,map__35652__$1,item,ui,attrs,expanded_QMARK_,children,id,c__4521__auto__,size__4522__auto__,b__35651,s__35649__$2,temp__5720__auto__){
return (function (e){
return expander.call(null,id);
});})(i__35650,attrs35647,map__35652,map__35652__$1,item,ui,attrs,expanded_QMARK_,children,id,c__4521__auto__,size__4522__auto__,b__35651,s__35649__$2,temp__5720__auto__))
], null),weathergen.ui.common.rinl.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),["rotate(",cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK_)?(0):(-90))),"deg)"].join('')], null)], null)))))),sablono.interpreter.interpret.call(null,ui)),sablono.interpreter.interpret.call(null,(cljs.core.truth_((function (){var and__4120__auto__ = expanded_QMARK_;
if(cljs.core.truth_(and__4120__auto__)){
return children;
} else {
return and__4120__auto__;
}
})())?weathergen.ui.trees.RTree.call(null,expander,children):null))], null)));
})());

var G__35656 = (i__35650 + (1));
i__35650 = G__35656;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__35651),weathergen$ui$trees$iter__35648.call(null,cljs.core.chunk_rest.call(null,s__35649__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__35651),null);
}
} else {
var map__35654 = cljs.core.first.call(null,s__35649__$2);
var map__35654__$1 = (((((!((map__35654 == null))))?(((((map__35654.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__35654.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__35654):map__35654);
var item = map__35654__$1;
var ui = cljs.core.get.call(null,map__35654__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var attrs = cljs.core.get.call(null,map__35654__$1,new cljs.core.Keyword(null,"attrs","attrs",-2090668713));
var expanded_QMARK_ = cljs.core.get.call(null,map__35654__$1,new cljs.core.Keyword(null,"expanded?","expanded?",2055832296));
var children = cljs.core.get.call(null,map__35654__$1,new cljs.core.Keyword(null,"children","children",-940561982));
var id = cljs.core.get.call(null,map__35654__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
return cljs.core.cons.call(null,(function (){var attrs35647 = 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,attrs35647))?sablono.interpreter.attributes.call(null,attrs35647):null),((cljs.core.map_QMARK_.call(null,attrs35647))?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.common.rinl.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.common.rinl.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 (attrs35647,map__35654,map__35654__$1,item,ui,attrs,expanded_QMARK_,children,id,s__35649__$2,temp__5720__auto__){
return (function (e){
return expander.call(null,id);
});})(attrs35647,map__35654,map__35654__$1,item,ui,attrs,expanded_QMARK_,children,id,s__35649__$2,temp__5720__auto__))
], null),weathergen.ui.common.rinl.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),["rotate(",cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK_)?(0):(-90))),"deg)"].join('')], null)], null)))))),sablono.interpreter.interpret.call(null,ui)),sablono.interpreter.interpret.call(null,(cljs.core.truth_((function (){var and__4120__auto__ = expanded_QMARK_;
if(cljs.core.truth_(and__4120__auto__)){
return children;
} else {
return and__4120__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,attrs35647),React.createElement("div",({"style": ({"display": "inline-flex", "whiteSpace": "nowrap"})}),sablono.interpreter.interpret.call(null,weathergen.ui.common.rinl.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.common.rinl.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 (attrs35647,map__35654,map__35654__$1,item,ui,attrs,expanded_QMARK_,children,id,s__35649__$2,temp__5720__auto__){
return (function (e){
return expander.call(null,id);
});})(attrs35647,map__35654,map__35654__$1,item,ui,attrs,expanded_QMARK_,children,id,s__35649__$2,temp__5720__auto__))
], null),weathergen.ui.common.rinl.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),["rotate(",cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(expanded_QMARK_)?(0):(-90))),"deg)"].join('')], null)], null)))))),sablono.interpreter.interpret.call(null,ui)),sablono.interpreter.interpret.call(null,(cljs.core.truth_((function (){var and__4120__auto__ = expanded_QMARK_;
if(cljs.core.truth_(and__4120__auto__)){
return children;
} else {
return and__4120__auto__;
}
})())?weathergen.ui.trees.RTree.call(null,expander,children):null))], null)));
})(),weathergen$ui$trees$iter__35648.call(null,cljs.core.rest.call(null,s__35649__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__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;
});
