// Compiled by ClojureScript 1.10.520 {}
goog.provide('weathergen.ui.common');
goog.require('cljs.core');
goog.require('clojure.data');
goog.require('cljs.pprint');
goog.require('clojure.set');
goog.require('clojure.string');
goog.require('garden.core');
goog.require('garden.selectors');
goog.require('garden.stylesheet');
goog.require('goog.dom');
goog.require('goog.string');
goog.require('goog.string.format');
goog.require('hoplon.core');
goog.require('hoplon.jquery');
goog.require('hoplon.storage_atom');
goog.require('hoplon.svg');
goog.require('javelin.core');
goog.require('taoensso.timbre');
goog.require('weathergen.falcon.files.images');
goog.require('weathergen.falcon.files.mission');
goog.require('weathergen.filesystem');
goog.require('weathergen.math');
goog.require('weathergen.settings');
goog.require('weathergen.time');
weathergen.ui.common.electron = require("electron");
weathergen.ui.common.tinycolor = require("tinycolor2");
/**
 * Parses an int from a string, returning the int, or nil if it cannot
 *   be parsed as an int.
 */
weathergen.ui.common.parse_int = (function weathergen$ui$common$parse_int(s){
var n = (new Number(s)).valueOf();
var l = cljs.core.long$.call(null,n);
if(cljs.core.int_QMARK_.call(null,n)){
return l;
} else {
return null;
}
});
/**
 * Parses a number from a string, returning it, or nil if it cannot
 *   be parsed.
 */
weathergen.ui.common.parse_float = (function weathergen$ui$common$parse_float(s){
var n = (new Number(s)).valueOf();
if(cljs.core.truth_(isNaN(n))){
return null;
} else {
return n;
}
});
var registry_31516 = cljs.core.atom.call(null,cljs.core.PersistentHashSet.EMPTY);
var batch_31517 = (10);
var min_interval_31518 = (1);
var interval_31519 = cljs.core.atom.call(null,min_interval_31518);
var max_interval_31520 = (200);
var pending_call_31521 = cljs.core.atom.call(null,false);
weathergen.ui.common.process = ((function (registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521){
return (function weathergen$ui$common$process(){
var processed_QMARK_ = (function (){var found_QMARK_ = false;
var G__31498 = cljs.core.take.call(null,batch_31517,cljs.core.shuffle.call(null,cljs.core.deref.call(null,registry_31516)));
var vec__31499 = G__31498;
var seq__31500 = cljs.core.seq.call(null,vec__31499);
var first__31501 = cljs.core.first.call(null,seq__31500);
var seq__31500__$1 = cljs.core.next.call(null,seq__31500);
var map__31502 = first__31501;
var map__31502__$1 = (((((!((map__31502 == null))))?(((((map__31502.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31502.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31502):map__31502);
var item = map__31502__$1;
var elem = cljs.core.get.call(null,map__31502__$1,new cljs.core.Keyword(null,"elem","elem",618631056));
var f = cljs.core.get.call(null,map__31502__$1,new cljs.core.Keyword(null,"f","f",-1597136552));
var more_items = seq__31500__$1;
var found_QMARK___$1 = found_QMARK_;
var G__31498__$1 = G__31498;
while(true){
var found_QMARK___$2 = found_QMARK___$1;
var vec__31510 = G__31498__$1;
var seq__31511 = cljs.core.seq.call(null,vec__31510);
var first__31512 = cljs.core.first.call(null,seq__31511);
var seq__31511__$1 = cljs.core.next.call(null,seq__31511);
var map__31513 = first__31512;
var map__31513__$1 = (((((!((map__31513 == null))))?(((((map__31513.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31513.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31513):map__31513);
var item__$1 = map__31513__$1;
var elem__$1 = cljs.core.get.call(null,map__31513__$1,new cljs.core.Keyword(null,"elem","elem",618631056));
var f__$1 = cljs.core.get.call(null,map__31513__$1,new cljs.core.Keyword(null,"f","f",-1597136552));
var more_items__$1 = seq__31511__$1;
var in_dom_QMARK_ = document.documentElement.contains(elem__$1);
if(cljs.core.truth_(in_dom_QMARK_)){
cljs.core.swap_BANG_.call(null,registry_31516,cljs.core.disj,item__$1);

try{f__$1.call(null);
}catch (e31515){var x_31522 = e31515;
warn.log("Error while invoking when-dom handler",elem__$1,x_31522);
}} else {
}

if(cljs.core.seq.call(null,more_items__$1)){
var G__31523 = (function (){var or__4131__auto__ = found_QMARK___$2;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return in_dom_QMARK_;
}
})();
var G__31524 = more_items__$1;
found_QMARK___$1 = G__31523;
G__31498__$1 = G__31524;
continue;
} else {
return found_QMARK___$2;
}
break;
}
})();
cljs.core.swap_BANG_.call(null,interval_31519,((function (processed_QMARK_,registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521){
return (function (current){
if(cljs.core.truth_(processed_QMARK_)){
return min_interval_31518;
} else {
var x__4219__auto__ = max_interval_31520;
var y__4220__auto__ = ((2) * current);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
}
});})(processed_QMARK_,registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521))
);

cljs.core.reset_BANG_.call(null,pending_call_31521,false);

return setTimeout(((function (processed_QMARK_,registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521){
return (function (){
return weathergen.ui.common.process.call(null);
});})(processed_QMARK_,registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521))
,cljs.core.deref.call(null,interval_31519));
});})(registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521))
;

setTimeout(((function (registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521){
return (function (){
return weathergen.ui.common.process.call(null);
});})(registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521))
,cljs.core.deref.call(null,interval_31519));

weathergen.ui.common.when_dom5 = ((function (registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521){
return (function weathergen$ui$common$when_dom5(elem,f){
cljs.core.swap_BANG_.call(null,registry_31516,cljs.core.conj,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"elem","elem",618631056),elem,new cljs.core.Keyword(null,"f","f",-1597136552),f], null));

if(cljs.core.truth_(cljs.core.deref.call(null,pending_call_31521))){
return null;
} else {
cljs.core.reset_BANG_.call(null,pending_call_31521,true);

return setTimeout(((function (registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521){
return (function (){
return weathergen.ui.common.process.call(null);
});})(registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521))
,min_interval_31518);
}
});})(registry_31516,batch_31517,min_interval_31518,interval_31519,max_interval_31520,pending_call_31521))
;
var agenda_31613 = cljs.core.atom.call(null,cljs.core.sorted_map.call(null));
var timer_interval_31614 = (5);
var max_interval_31615 = (150);
var now_31616 = ((function (agenda_31613,timer_interval_31614,max_interval_31615){
return (function (){
return (new Date()).getTime();
});})(agenda_31613,timer_interval_31614,max_interval_31615))
;
var process_31617 = ((function (agenda_31613,timer_interval_31614,max_interval_31615,now_31616){
return (function weathergen$ui$common$process(){
var t_31618 = now_31616.call(null);
var seq__31525_31619 = cljs.core.seq.call(null,cljs.core.filter.call(null,((function (t_31618,agenda_31613,timer_interval_31614,max_interval_31615,now_31616){
return (function (p__31571){
var vec__31572 = p__31571;
var k = cljs.core.nth.call(null,vec__31572,(0),null);
var v = cljs.core.nth.call(null,vec__31572,(1),null);
return (k < t_31618);
});})(t_31618,agenda_31613,timer_interval_31614,max_interval_31615,now_31616))
,cljs.core.deref.call(null,agenda_31613)));
var chunk__31526_31620 = null;
var count__31527_31621 = (0);
var i__31528_31622 = (0);
while(true){
if((i__31528_31622 < count__31527_31621)){
var vec__31575_31623 = cljs.core._nth.call(null,chunk__31526_31620,i__31528_31622);
var k_31624 = cljs.core.nth.call(null,vec__31575_31623,(0),null);
var v_31625 = cljs.core.nth.call(null,vec__31575_31623,(1),null);
cljs.core.swap_BANG_.call(null,agenda_31613,cljs.core.dissoc,k_31624);

var seq__31578_31626 = cljs.core.seq.call(null,v_31625);
var chunk__31579_31627 = null;
var count__31580_31628 = (0);
var i__31581_31629 = (0);
while(true){
if((i__31581_31629 < count__31580_31628)){
var map__31588_31630 = cljs.core._nth.call(null,chunk__31579_31627,i__31581_31629);
var map__31588_31631__$1 = (((((!((map__31588_31630 == null))))?(((((map__31588_31630.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31588_31630.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31588_31630):map__31588_31630);
var item_31632 = map__31588_31631__$1;
var elem_31633 = cljs.core.get.call(null,map__31588_31631__$1,new cljs.core.Keyword(null,"elem","elem",618631056));
var f_31634 = cljs.core.get.call(null,map__31588_31631__$1,new cljs.core.Keyword(null,"f","f",-1597136552));
var interval_31635 = cljs.core.get.call(null,map__31588_31631__$1,new cljs.core.Keyword(null,"interval","interval",1708495417));
if(cljs.core.truth_(document.documentElement.contains(elem_31633))){
try{f_31634.call(null);
}catch (e31590){var x_31636 = e31590;
warn.log("Error while invoking when-dom handler",elem_31633,x_31636);
}} else {
var new_interval_31637 = (function (){var x__4219__auto__ = max_interval_31615;
var y__4220__auto__ = ((2) * interval_31635);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})();
var new_time_31638 = (t_31618 + new_interval_31637);
cljs.core.swap_BANG_.call(null,agenda_31613,cljs.core.update,new_time_31638,cljs.core.conj,cljs.core.assoc.call(null,item_31632,new cljs.core.Keyword(null,"interval","interval",1708495417),new_interval_31637));
}


var G__31639 = seq__31578_31626;
var G__31640 = chunk__31579_31627;
var G__31641 = count__31580_31628;
var G__31642 = (i__31581_31629 + (1));
seq__31578_31626 = G__31639;
chunk__31579_31627 = G__31640;
count__31580_31628 = G__31641;
i__31581_31629 = G__31642;
continue;
} else {
var temp__5720__auto___31643 = cljs.core.seq.call(null,seq__31578_31626);
if(temp__5720__auto___31643){
var seq__31578_31644__$1 = temp__5720__auto___31643;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__31578_31644__$1)){
var c__4550__auto___31645 = cljs.core.chunk_first.call(null,seq__31578_31644__$1);
var G__31646 = cljs.core.chunk_rest.call(null,seq__31578_31644__$1);
var G__31647 = c__4550__auto___31645;
var G__31648 = cljs.core.count.call(null,c__4550__auto___31645);
var G__31649 = (0);
seq__31578_31626 = G__31646;
chunk__31579_31627 = G__31647;
count__31580_31628 = G__31648;
i__31581_31629 = G__31649;
continue;
} else {
var map__31591_31650 = cljs.core.first.call(null,seq__31578_31644__$1);
var map__31591_31651__$1 = (((((!((map__31591_31650 == null))))?(((((map__31591_31650.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31591_31650.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31591_31650):map__31591_31650);
var item_31652 = map__31591_31651__$1;
var elem_31653 = cljs.core.get.call(null,map__31591_31651__$1,new cljs.core.Keyword(null,"elem","elem",618631056));
var f_31654 = cljs.core.get.call(null,map__31591_31651__$1,new cljs.core.Keyword(null,"f","f",-1597136552));
var interval_31655 = cljs.core.get.call(null,map__31591_31651__$1,new cljs.core.Keyword(null,"interval","interval",1708495417));
if(cljs.core.truth_(document.documentElement.contains(elem_31653))){
try{f_31654.call(null);
}catch (e31593){var x_31656 = e31593;
warn.log("Error while invoking when-dom handler",elem_31653,x_31656);
}} else {
var new_interval_31657 = (function (){var x__4219__auto__ = max_interval_31615;
var y__4220__auto__ = ((2) * interval_31655);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})();
var new_time_31658 = (t_31618 + new_interval_31657);
cljs.core.swap_BANG_.call(null,agenda_31613,cljs.core.update,new_time_31658,cljs.core.conj,cljs.core.assoc.call(null,item_31652,new cljs.core.Keyword(null,"interval","interval",1708495417),new_interval_31657));
}


var G__31659 = cljs.core.next.call(null,seq__31578_31644__$1);
var G__31660 = null;
var G__31661 = (0);
var G__31662 = (0);
seq__31578_31626 = G__31659;
chunk__31579_31627 = G__31660;
count__31580_31628 = G__31661;
i__31581_31629 = G__31662;
continue;
}
} else {
}
}
break;
}


var G__31663 = seq__31525_31619;
var G__31664 = chunk__31526_31620;
var G__31665 = count__31527_31621;
var G__31666 = (i__31528_31622 + (1));
seq__31525_31619 = G__31663;
chunk__31526_31620 = G__31664;
count__31527_31621 = G__31665;
i__31528_31622 = G__31666;
continue;
} else {
var temp__5720__auto___31667 = cljs.core.seq.call(null,seq__31525_31619);
if(temp__5720__auto___31667){
var seq__31525_31668__$1 = temp__5720__auto___31667;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__31525_31668__$1)){
var c__4550__auto___31669 = cljs.core.chunk_first.call(null,seq__31525_31668__$1);
var G__31670 = cljs.core.chunk_rest.call(null,seq__31525_31668__$1);
var G__31671 = c__4550__auto___31669;
var G__31672 = cljs.core.count.call(null,c__4550__auto___31669);
var G__31673 = (0);
seq__31525_31619 = G__31670;
chunk__31526_31620 = G__31671;
count__31527_31621 = G__31672;
i__31528_31622 = G__31673;
continue;
} else {
var vec__31594_31674 = cljs.core.first.call(null,seq__31525_31668__$1);
var k_31675 = cljs.core.nth.call(null,vec__31594_31674,(0),null);
var v_31676 = cljs.core.nth.call(null,vec__31594_31674,(1),null);
cljs.core.swap_BANG_.call(null,agenda_31613,cljs.core.dissoc,k_31675);

var seq__31597_31677 = cljs.core.seq.call(null,v_31676);
var chunk__31598_31678 = null;
var count__31599_31679 = (0);
var i__31600_31680 = (0);
while(true){
if((i__31600_31680 < count__31599_31679)){
var map__31607_31681 = cljs.core._nth.call(null,chunk__31598_31678,i__31600_31680);
var map__31607_31682__$1 = (((((!((map__31607_31681 == null))))?(((((map__31607_31681.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31607_31681.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31607_31681):map__31607_31681);
var item_31683 = map__31607_31682__$1;
var elem_31684 = cljs.core.get.call(null,map__31607_31682__$1,new cljs.core.Keyword(null,"elem","elem",618631056));
var f_31685 = cljs.core.get.call(null,map__31607_31682__$1,new cljs.core.Keyword(null,"f","f",-1597136552));
var interval_31686 = cljs.core.get.call(null,map__31607_31682__$1,new cljs.core.Keyword(null,"interval","interval",1708495417));
if(cljs.core.truth_(document.documentElement.contains(elem_31684))){
try{f_31685.call(null);
}catch (e31609){var x_31687 = e31609;
warn.log("Error while invoking when-dom handler",elem_31684,x_31687);
}} else {
var new_interval_31688 = (function (){var x__4219__auto__ = max_interval_31615;
var y__4220__auto__ = ((2) * interval_31686);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})();
var new_time_31689 = (t_31618 + new_interval_31688);
cljs.core.swap_BANG_.call(null,agenda_31613,cljs.core.update,new_time_31689,cljs.core.conj,cljs.core.assoc.call(null,item_31683,new cljs.core.Keyword(null,"interval","interval",1708495417),new_interval_31688));
}


var G__31690 = seq__31597_31677;
var G__31691 = chunk__31598_31678;
var G__31692 = count__31599_31679;
var G__31693 = (i__31600_31680 + (1));
seq__31597_31677 = G__31690;
chunk__31598_31678 = G__31691;
count__31599_31679 = G__31692;
i__31600_31680 = G__31693;
continue;
} else {
var temp__5720__auto___31694__$1 = cljs.core.seq.call(null,seq__31597_31677);
if(temp__5720__auto___31694__$1){
var seq__31597_31695__$1 = temp__5720__auto___31694__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__31597_31695__$1)){
var c__4550__auto___31696 = cljs.core.chunk_first.call(null,seq__31597_31695__$1);
var G__31697 = cljs.core.chunk_rest.call(null,seq__31597_31695__$1);
var G__31698 = c__4550__auto___31696;
var G__31699 = cljs.core.count.call(null,c__4550__auto___31696);
var G__31700 = (0);
seq__31597_31677 = G__31697;
chunk__31598_31678 = G__31698;
count__31599_31679 = G__31699;
i__31600_31680 = G__31700;
continue;
} else {
var map__31610_31701 = cljs.core.first.call(null,seq__31597_31695__$1);
var map__31610_31702__$1 = (((((!((map__31610_31701 == null))))?(((((map__31610_31701.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31610_31701.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31610_31701):map__31610_31701);
var item_31703 = map__31610_31702__$1;
var elem_31704 = cljs.core.get.call(null,map__31610_31702__$1,new cljs.core.Keyword(null,"elem","elem",618631056));
var f_31705 = cljs.core.get.call(null,map__31610_31702__$1,new cljs.core.Keyword(null,"f","f",-1597136552));
var interval_31706 = cljs.core.get.call(null,map__31610_31702__$1,new cljs.core.Keyword(null,"interval","interval",1708495417));
if(cljs.core.truth_(document.documentElement.contains(elem_31704))){
try{f_31705.call(null);
}catch (e31612){var x_31707 = e31612;
warn.log("Error while invoking when-dom handler",elem_31704,x_31707);
}} else {
var new_interval_31708 = (function (){var x__4219__auto__ = max_interval_31615;
var y__4220__auto__ = ((2) * interval_31706);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})();
var new_time_31709 = (t_31618 + new_interval_31708);
cljs.core.swap_BANG_.call(null,agenda_31613,cljs.core.update,new_time_31709,cljs.core.conj,cljs.core.assoc.call(null,item_31703,new cljs.core.Keyword(null,"interval","interval",1708495417),new_interval_31708));
}


var G__31710 = cljs.core.next.call(null,seq__31597_31695__$1);
var G__31711 = null;
var G__31712 = (0);
var G__31713 = (0);
seq__31597_31677 = G__31710;
chunk__31598_31678 = G__31711;
count__31599_31679 = G__31712;
i__31600_31680 = G__31713;
continue;
}
} else {
}
}
break;
}


var G__31714 = cljs.core.next.call(null,seq__31525_31668__$1);
var G__31715 = null;
var G__31716 = (0);
var G__31717 = (0);
seq__31525_31619 = G__31714;
chunk__31526_31620 = G__31715;
count__31527_31621 = G__31716;
i__31528_31622 = G__31717;
continue;
}
} else {
}
}
break;
}

return setTimeout(((function (agenda_31613,timer_interval_31614,max_interval_31615,now_31616){
return (function (){
return weathergen$ui$common$process.call(null);
});})(agenda_31613,timer_interval_31614,max_interval_31615,now_31616))
,timer_interval_31614);
});})(agenda_31613,timer_interval_31614,max_interval_31615,now_31616))
;
setTimeout(((function (agenda_31613,timer_interval_31614,max_interval_31615,now_31616,process_31617){
return (function (){
return process_31617.call(null);
});})(agenda_31613,timer_interval_31614,max_interval_31615,now_31616,process_31617))
,timer_interval_31614);

weathergen.ui.common.when_dom6 = ((function (agenda_31613,timer_interval_31614,max_interval_31615,now_31616,process_31617){
return (function weathergen$ui$common$when_dom6(elem,f){
return cljs.core.swap_BANG_.call(null,agenda_31613,cljs.core.update,now_31616.call(null),cljs.core.conj,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"elem","elem",618631056),elem,new cljs.core.Keyword(null,"f","f",-1597136552),f,new cljs.core.Keyword(null,"interval","interval",1708495417),(1)], null));
});})(agenda_31613,timer_interval_31614,max_interval_31615,now_31616,process_31617))
;
/**
 * Like Hoplon's `when-dom`, but hopefully without the CPU problems.
 */
weathergen.ui.common.when_dom_STAR_ = (function weathergen$ui$common$when_dom_STAR_(elem,f){
weathergen.ui.common.when_dom6.call(null,elem,f);

return elem;
});
/**
 * Returns a measurement string, e.g. '2px'. Allows multiple
 *   arguments, in which case it will return a margin-style string,
 *   e.g. `(measurement "px" 1 2)` returns '1px 2px'.
 */
weathergen.ui.common.measurement = (function weathergen$ui$common$measurement(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31721 = arguments.length;
var i__4731__auto___31722 = (0);
while(true){
if((i__4731__auto___31722 < len__4730__auto___31721)){
args__4736__auto__.push((arguments[i__4731__auto___31722]));

var G__31723 = (i__4731__auto___31722 + (1));
i__4731__auto___31722 = G__31723;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((1) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((1)),(0),null)):null);
return weathergen.ui.common.measurement.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4737__auto__);
});

weathergen.ui.common.measurement.cljs$core$IFn$_invoke$arity$variadic = (function (unit,ns){
return clojure.string.join.call(null," ",cljs.core.map.call(null,(function (p1__31718_SHARP_){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(p1__31718_SHARP_),cljs.core.str.cljs$core$IFn$_invoke$arity$1(unit)].join('');
}),ns));
});

weathergen.ui.common.measurement.cljs$lang$maxFixedArity = (1);

/** @this {Function} */
weathergen.ui.common.measurement.cljs$lang$applyTo = (function (seq31719){
var G__31720 = cljs.core.first.call(null,seq31719);
var seq31719__$1 = cljs.core.next.call(null,seq31719);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31720,seq31719__$1);
});

/**
 * Returns a pixel measurement string, e.g. '2px'. See `measurement`.
 */
weathergen.ui.common.px = (function weathergen$ui$common$px(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31725 = arguments.length;
var i__4731__auto___31726 = (0);
while(true){
if((i__4731__auto___31726 < len__4730__auto___31725)){
args__4736__auto__.push((arguments[i__4731__auto___31726]));

var G__31727 = (i__4731__auto___31726 + (1));
i__4731__auto___31726 = G__31727;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((0) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((0)),(0),null)):null);
return weathergen.ui.common.px.cljs$core$IFn$_invoke$arity$variadic(argseq__4737__auto__);
});

weathergen.ui.common.px.cljs$core$IFn$_invoke$arity$variadic = (function (ns){
return cljs.core.apply.call(null,weathergen.ui.common.measurement,"px",ns);
});

weathergen.ui.common.px.cljs$lang$maxFixedArity = (0);

/** @this {Function} */
weathergen.ui.common.px.cljs$lang$applyTo = (function (seq31724){
var self__4718__auto__ = this;
return self__4718__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq31724));
});

/**
 * Returns a percentage measurement string, e.g. '50%'. See `measurement`.
 */
weathergen.ui.common.pct = (function weathergen$ui$common$pct(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31729 = arguments.length;
var i__4731__auto___31730 = (0);
while(true){
if((i__4731__auto___31730 < len__4730__auto___31729)){
args__4736__auto__.push((arguments[i__4731__auto___31730]));

var G__31731 = (i__4731__auto___31730 + (1));
i__4731__auto___31730 = G__31731;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((0) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((0)),(0),null)):null);
return weathergen.ui.common.pct.cljs$core$IFn$_invoke$arity$variadic(argseq__4737__auto__);
});

weathergen.ui.common.pct.cljs$core$IFn$_invoke$arity$variadic = (function (ns){
return cljs.core.apply.call(null,weathergen.ui.common.measurement,"%",ns);
});

weathergen.ui.common.pct.cljs$lang$maxFixedArity = (0);

/** @this {Function} */
weathergen.ui.common.pct.cljs$lang$applyTo = (function (seq31728){
var self__4718__auto__ = this;
return self__4718__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq31728));
});

/**
 * Returns a measurement string in em, e.g. '2em'. See `measurement`.
 */
weathergen.ui.common.ems = (function weathergen$ui$common$ems(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31733 = arguments.length;
var i__4731__auto___31734 = (0);
while(true){
if((i__4731__auto___31734 < len__4730__auto___31733)){
args__4736__auto__.push((arguments[i__4731__auto___31734]));

var G__31735 = (i__4731__auto___31734 + (1));
i__4731__auto___31734 = G__31735;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((0) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((0)),(0),null)):null);
return weathergen.ui.common.ems.cljs$core$IFn$_invoke$arity$variadic(argseq__4737__auto__);
});

weathergen.ui.common.ems.cljs$core$IFn$_invoke$arity$variadic = (function (ns){
return cljs.core.apply.call(null,weathergen.ui.common.measurement,"em",ns);
});

weathergen.ui.common.ems.cljs$lang$maxFixedArity = (0);

/** @this {Function} */
weathergen.ui.common.ems.cljs$lang$applyTo = (function (seq31732){
var self__4718__auto__ = this;
return self__4718__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq31732));
});

weathergen.ui.common.colors = new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"invalid","invalid",412869516),"#c70505",new cljs.core.Keyword(null,"invalid-background","invalid-background",-917496690),"#fcc",new cljs.core.Keyword(null,"error-message","error-message",1756021561),"#c70505",new cljs.core.Keyword(null,"edit","edit",-1641834166),"rgba(128,128,255,0.5)",new cljs.core.Keyword(null,"header-background","header-background",1686840154),"lightgray",new cljs.core.Keyword(null,"team","team",1355747699),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"dark-text","dark-text",814777253),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"white","white",-483998618),"gray",new cljs.core.Keyword(null,"green","green",-945526839),"green",new cljs.core.Keyword(null,"blue","blue",-622100620),"blue",new cljs.core.Keyword(null,"brown","brown",1414854429),"#923c25",new cljs.core.Keyword(null,"orange","orange",73816386),"darkorange",new cljs.core.Keyword(null,"yellow","yellow",-881035449),"#caae18",new cljs.core.Keyword(null,"red","red",-969428204),"red",new cljs.core.Keyword(null,"gray","gray",1013268388),"darkgray"], null),new cljs.core.Keyword(null,"light-text","light-text",-274885440),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"white","white",-483998618),"white",new cljs.core.Keyword(null,"green","green",-945526839),"lightgreen",new cljs.core.Keyword(null,"blue","blue",-622100620),"#8ddbf5",new cljs.core.Keyword(null,"brown","brown",1414854429),"#e27e43",new cljs.core.Keyword(null,"orange","orange",73816386),"orange",new cljs.core.Keyword(null,"yellow","yellow",-881035449),"yellow",new cljs.core.Keyword(null,"red","red",-969428204),"#f9adad",new cljs.core.Keyword(null,"gray","gray",1013268388),"lightgray"], null)], null)], null);
/**
 * Returns a color for a team.
 */
weathergen.ui.common.team_color = (function weathergen$ui$common$team_color(team,type){
return cljs.core.get_in.call(null,weathergen.ui.common.colors,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"team","team",1355747699),type,weathergen.falcon.files.mission.team_color.call(null,team)], null));
});
/**
 * Given a keyword, returns a string safe to use as a css class name.
 */
weathergen.ui.common.class_for = cljs.core.memoize.call(null,(function (kw){
return clojure.string.replace.call(null,cljs.core.subs.call(null,cljs.core.str.cljs$core$IFn$_invoke$arity$1(kw),(1)),/[^a-zA-Z0-9]/,"-");
}));
/**
 * Given a keyword, returns a garden class selector usable with class-for.
 */
weathergen.ui.common.class_selector_for = (function weathergen$ui$common$class_selector_for(kw){
return garden.selectors.selector.call(null,[".",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.class_for.call(null,kw))].join(''));
});
/**
 * Given a Hoplon-style map of classes to booleans, return a sequence of
 *   the class names whose values are true.
 */
weathergen.ui.common.classes = (function weathergen$ui$common$classes(m){
var iter__4523__auto__ = (function weathergen$ui$common$classes_$_iter__31736(s__31737){
return (new cljs.core.LazySeq(null,(function (){
var s__31737__$1 = s__31737;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__31737__$1);
if(temp__5720__auto__){
var s__31737__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__31737__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__31737__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__31739 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__31738 = (0);
while(true){
if((i__31738 < size__4522__auto__)){
var vec__31740 = cljs.core._nth.call(null,c__4521__auto__,i__31738);
var class$ = cljs.core.nth.call(null,vec__31740,(0),null);
var bool = cljs.core.nth.call(null,vec__31740,(1),null);
if(cljs.core.truth_(bool)){
cljs.core.chunk_append.call(null,b__31739,class$);

var G__31746 = (i__31738 + (1));
i__31738 = G__31746;
continue;
} else {
var G__31747 = (i__31738 + (1));
i__31738 = G__31747;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__31739),weathergen$ui$common$classes_$_iter__31736.call(null,cljs.core.chunk_rest.call(null,s__31737__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__31739),null);
}
} else {
var vec__31743 = cljs.core.first.call(null,s__31737__$2);
var class$ = cljs.core.nth.call(null,vec__31743,(0),null);
var bool = cljs.core.nth.call(null,vec__31743,(1),null);
if(cljs.core.truth_(bool)){
return cljs.core.cons.call(null,class$,weathergen$ui$common$classes_$_iter__31736.call(null,cljs.core.rest.call(null,s__31737__$2)));
} else {
var G__31748 = cljs.core.rest.call(null,s__31737__$2);
s__31737__$1 = G__31748;
continue;
}
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,m);
});
var registered_styles_31767 = cljs.core.atom.call(null,cljs.core.PersistentHashSet.EMPTY);
var pending_31768 = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
weathergen.ui.common.register_style_BANG_ = ((function (registered_styles_31767,pending_31768){
return (function weathergen$ui$common$register_style_BANG_(key,garden__$1){
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui.common",null,248,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (registered_styles_31767,pending_31768){
return (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Registering style",key], null);
});})(registered_styles_31767,pending_31768))
,null)),null,1293675230);

document.head.appendChild(hoplon.core.style.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text/css",new cljs.core.Keyword(null,"debug","debug",-1608172596),cljs.core.str.cljs$core$IFn$_invoke$arity$1(key),javelin.core.formula.call(null,((function (registered_styles_31767,pending_31768){
return (function (G__31749,G__31750){
return G__31749.call(null,G__31750);
});})(registered_styles_31767,pending_31768))
).call(null,garden.core.css,garden__$1)));

cljs.core.swap_BANG_.call(null,registered_styles_31767,cljs.core.conj,key);

return taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui.common",null,255,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (registered_styles_31767,pending_31768){
return (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Registered style",key], null);
});})(registered_styles_31767,pending_31768))
,null)),null,63824561);
});})(registered_styles_31767,pending_31768))
;

document.addEventListener("DOMContentLoaded",((function (registered_styles_31767,pending_31768){
return (function (_){
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui.common",null,260,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (registered_styles_31767,pending_31768){
return (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Document loaded. Registering pending styles."], null);
});})(registered_styles_31767,pending_31768))
,null)),null,1334802826);

var seq__31751_31769 = cljs.core.seq.call(null,cljs.core.deref.call(null,pending_31768));
var chunk__31752_31770 = null;
var count__31753_31771 = (0);
var i__31754_31772 = (0);
while(true){
if((i__31754_31772 < count__31753_31771)){
var vec__31761_31773 = cljs.core._nth.call(null,chunk__31752_31770,i__31754_31772);
var key_31774 = cljs.core.nth.call(null,vec__31761_31773,(0),null);
var garden_31775__$1 = cljs.core.nth.call(null,vec__31761_31773,(1),null);
weathergen.ui.common.register_style_BANG_.call(null,key_31774,garden_31775__$1);


var G__31776 = seq__31751_31769;
var G__31777 = chunk__31752_31770;
var G__31778 = count__31753_31771;
var G__31779 = (i__31754_31772 + (1));
seq__31751_31769 = G__31776;
chunk__31752_31770 = G__31777;
count__31753_31771 = G__31778;
i__31754_31772 = G__31779;
continue;
} else {
var temp__5720__auto___31780 = cljs.core.seq.call(null,seq__31751_31769);
if(temp__5720__auto___31780){
var seq__31751_31781__$1 = temp__5720__auto___31780;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__31751_31781__$1)){
var c__4550__auto___31782 = cljs.core.chunk_first.call(null,seq__31751_31781__$1);
var G__31783 = cljs.core.chunk_rest.call(null,seq__31751_31781__$1);
var G__31784 = c__4550__auto___31782;
var G__31785 = cljs.core.count.call(null,c__4550__auto___31782);
var G__31786 = (0);
seq__31751_31769 = G__31783;
chunk__31752_31770 = G__31784;
count__31753_31771 = G__31785;
i__31754_31772 = G__31786;
continue;
} else {
var vec__31764_31787 = cljs.core.first.call(null,seq__31751_31781__$1);
var key_31788 = cljs.core.nth.call(null,vec__31764_31787,(0),null);
var garden_31789__$1 = cljs.core.nth.call(null,vec__31764_31787,(1),null);
weathergen.ui.common.register_style_BANG_.call(null,key_31788,garden_31789__$1);


var G__31790 = cljs.core.next.call(null,seq__31751_31781__$1);
var G__31791 = null;
var G__31792 = (0);
var G__31793 = (0);
seq__31751_31769 = G__31790;
chunk__31752_31770 = G__31791;
count__31753_31771 = G__31792;
i__31754_31772 = G__31793;
continue;
}
} else {
}
}
break;
}

return cljs.core.reset_BANG_.call(null,pending_31768,cljs.core.PersistentArrayMap.EMPTY);
});})(registered_styles_31767,pending_31768))
);

/**
 * Adds styles to the head of the document. If already registered under `key`, does nothing.
 */
weathergen.ui.common.register_styles_BANG_ = ((function (registered_styles_31767,pending_31768){
return (function weathergen$ui$common$register_styles_BANG_(key,garden__$1){
if(cljs.core.contains_QMARK_.call(null,cljs.core.deref.call(null,registered_styles_31767),key)){
return null;
} else {
if((!(cljs.core._EQ_.call(null,"complete",document.readyState)))){
return cljs.core.swap_BANG_.call(null,pending_31768,cljs.core.assoc,key,garden__$1);
} else {
return weathergen.ui.common.register_style_BANG_.call(null,key,garden__$1);
}
}
});})(registered_styles_31767,pending_31768))
;
/**
 * Adds a style to the head of a document for abstract class `key`.
 *   `key` should be a namespaced keyword that can then be used as the
 *   `:class` of an element via `class-for`. `garden` is the tail of a
 *   garden style statement, i.e. everything except the seelctor.
 * 
 *   Example:
 * 
 *   (register-class!
 *  ::foobar
 *  [{:background "blue"} [:&:hover {:background "red"}]])
 */
weathergen.ui.common.register_class_BANG_ = (function weathergen$ui$common$register_class_BANG_(key,garden__$1){
return weathergen.ui.common.register_styles_BANG_.call(null,key,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.ui.common.class_selector_for.call(null,key)], null),garden__$1));
});
/**
 * Returns a color that contrasts well with the specified color.
 *   Optionally, the colors to use for dark and light can be specified.
 */
weathergen.ui.common.contrasting = (function weathergen$ui$common$contrasting(var_args){
var G__31795 = arguments.length;
switch (G__31795) {
case 1:
return weathergen.ui.common.contrasting.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 3:
return weathergen.ui.common.contrasting.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));

}
});

weathergen.ui.common.contrasting.cljs$core$IFn$_invoke$arity$1 = (function (color){
return weathergen.ui.common.contrasting.call(null,color,"black","white");
});

weathergen.ui.common.contrasting.cljs$core$IFn$_invoke$arity$3 = (function (color,dark,light){
return (function (){var G__31796 = weathergen.ui.common.tinycolor.mostReadable(color,[dark,light]);
return G__31796;
})().toHexString();
});

weathergen.ui.common.contrasting.cljs$lang$maxFixedArity = 3;

/**
 * Darkens a color by an amount from 0-100.
 */
weathergen.ui.common.darken = (function weathergen$ui$common$darken(color,amount){
return (function (){var G__31798 = (function (){var G__31799 = weathergen.ui.common.tinycolor.call(null,color);
return G__31799;
})().darken(amount);
return G__31798;
})().toHexString();
});
/**
 * Lightens a color by an amount from 0-100.
 */
weathergen.ui.common.lighten = (function weathergen$ui$common$lighten(color,amount){
return (function (){var G__31800 = (function (){var G__31801 = weathergen.ui.common.tinycolor.call(null,color);
return G__31801;
})().lighten(amount);
return G__31800;
})().toHexString();
});
/**
 * Rotates a color by an amount from 0 to 360 degrees.
 */
weathergen.ui.common.spin = (function weathergen$ui$common$spin(color,amount){
return (function (){var G__31802 = (function (){var G__31803 = weathergen.ui.common.tinycolor.call(null,color);
return G__31803;
})().spin(amount);
return G__31802;
})().toHexString();
});
/**
 * Converts a color to a hex string.
 */
weathergen.ui.common.to_hex_str = (function weathergen$ui$common$to_hex_str(color){
return (function (){var G__31804 = weathergen.ui.common.tinycolor.call(null,color);
return G__31804;
})().toHexString();
});
/**
 * Converts a color to a hex string including alpha.
 */
weathergen.ui.common.to_hex8_str = (function weathergen$ui$common$to_hex8_str(var_args){
var G__31806 = arguments.length;
switch (G__31806) {
case 1:
return weathergen.ui.common.to_hex8_str.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return weathergen.ui.common.to_hex8_str.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));

}
});

weathergen.ui.common.to_hex8_str.cljs$core$IFn$_invoke$arity$1 = (function (color){
return (function (){var G__31807 = weathergen.ui.common.tinycolor.call(null,color);
return G__31807;
})().toHex8String();
});

weathergen.ui.common.to_hex8_str.cljs$core$IFn$_invoke$arity$2 = (function (color,alpha){
return (function (){var G__31808 = (function (){var G__31809 = weathergen.ui.common.tinycolor.call(null,color);
return G__31809;
})();
G__31808.setAlpha(alpha);

return G__31808;
})().toHex8String();
});

weathergen.ui.common.to_hex8_str.cljs$lang$maxFixedArity = 2;

/**
 * Converts a color to an rgba string. Eight-digit hex strings are
 *   assumed to be in the format #AARRGGBB.
 */
weathergen.ui.common.to_rgba = (function weathergen$ui$common$to_rgba(color){
var color_STAR_ = (cljs.core.truth_((function (){var and__4120__auto__ = typeof color === 'string';
if(and__4120__auto__){
return cljs.core.re_matches.call(null,/#[0-9A-Fa-f]{8}/,color);
} else {
return and__4120__auto__;
}
})())?["#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.subs.call(null,color,(3),(9))),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.subs.call(null,color,(1),(3)))].join(''):color);
var tc = weathergen.ui.common.tinycolor.call(null,color_STAR_).toRgb();
return ["rgba(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(tc.r),", ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(tc.g),", ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(tc.b),", ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(tc.a),")"].join('');
});
/**
 * Creates an element which is a scope for a set of CSS rules,
 *   provided via a `:garden` attribute, by adding an element with a
 *   unique ID and new <style> element to the <head> of the document.
 * @param {...*} var_args
 */
weathergen.ui.common.styled = (function() { 
var weathergen$ui$common$styled__delegate = function (args__30233__auto__){
var vec__31811 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31811,(0),null);
var content = cljs.core.nth.call(null,vec__31811,(1),null);
var map__31814 = attrs;
var map__31814__$1 = (((((!((map__31814 == null))))?(((((map__31814.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31814.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31814):map__31814);
var garden__$1 = cljs.core.get.call(null,map__31814__$1,new cljs.core.Keyword(null,"garden","garden",-1966516149));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"garden","garden",-1966516149));
var head = (document.getElementsByTagName("head")[(0)]);
var id = cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null));
var styles = javelin.core.formula.call(null,((function (map__31814,map__31814__$1,garden__$1,attrs__$1,head,id,vec__31811,attrs,content){
return (function (G__31816,G__31819,G__31817,G__31818){
return G__31816.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [G__31817.call(null,["#",G__31818].join('')),G__31819], null));
});})(map__31814,map__31814__$1,garden__$1,attrs__$1,head,id,vec__31811,attrs,content))
).call(null,garden.core.css,garden__$1,cljs.core.keyword,id);
head.appendChild(hoplon.core.style.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text/css",styles));

return hoplon.core.div.call(null,cljs.core.merge.call(null,attrs__$1,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"id","id",-1388402092),id], null)),content);
};
var weathergen$ui$common$styled = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31820__i = 0, G__31820__a = new Array(arguments.length -  0);
while (G__31820__i < G__31820__a.length) {G__31820__a[G__31820__i] = arguments[G__31820__i + 0]; ++G__31820__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31820__a,0,null);
} 
return weathergen$ui$common$styled__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$styled.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$styled.cljs$lang$applyTo = (function (arglist__31821){
var args__30233__auto__ = cljs.core.seq(arglist__31821);
return weathergen$ui$common$styled__delegate(args__30233__auto__);
});
weathergen$ui$common$styled.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$styled__delegate;
return weathergen$ui$common$styled;
})()
;
/**
 * Creates an element that will open in an external browser.
 * @param {...*} var_args
 */
weathergen.ui.common.external_link = (function() { 
var weathergen$ui$common$external_link__delegate = function (args__30233__auto__){
var vec__31822 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31822,(0),null);
var content = cljs.core.nth.call(null,vec__31822,(1),null);
return hoplon.core.a.call(null,cljs.core.assoc.call(null,cljs.core.assoc.call(null,attrs,new cljs.core.Keyword(null,"href","href",-793805698),""),new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__31822,attrs,content){
return (function (e){
e.preventDefault();

return weathergen.ui.common.electron.shell.openExternal(new cljs.core.Keyword(null,"href","href",-793805698).cljs$core$IFn$_invoke$arity$1(attrs));
});})(vec__31822,attrs,content))
),content);
};
var weathergen$ui$common$external_link = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31825__i = 0, G__31825__a = new Array(arguments.length -  0);
while (G__31825__i < G__31825__a.length) {G__31825__a[G__31825__i] = arguments[G__31825__i + 0]; ++G__31825__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31825__a,0,null);
} 
return weathergen$ui$common$external_link__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$external_link.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$external_link.cljs$lang$applyTo = (function (arglist__31826){
var args__30233__auto__ = cljs.core.seq(arglist__31826);
return weathergen$ui$common$external_link__delegate(args__30233__auto__);
});
weathergen$ui$common$external_link.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$external_link__delegate;
return weathergen$ui$common$external_link;
})()
;
/**
 * @param {...*} var_args
 */
weathergen.ui.common.inl = (function() { 
var weathergen$ui$common$inl__delegate = function (args__30233__auto__){
var vec__31827 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31827,(0),null);
var content = cljs.core.nth.call(null,vec__31827,(1),null);
var map__31830 = attrs;
var map__31830__$1 = (((((!((map__31830 == null))))?(((((map__31830.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31830.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31830):map__31830);
var css = cljs.core.get.call(null,map__31830__$1,new cljs.core.Keyword(null,"css","css",1135045163));
return hoplon.core.div.call(null,cljs.core.update.call(null,attrs,new cljs.core.Keyword(null,"css","css",1135045163),((function (map__31830,map__31830__$1,css,vec__31827,attrs,content){
return (function (css_orig){
if(cljs.core.truth_(javelin.core.cell_QMARK_.call(null,css_orig))){
return javelin.core.formula.call(null,((function (map__31830,map__31830__$1,css,vec__31827,attrs,content){
return (function (css_orig__$1){
return cljs.core.assoc.call(null,css_orig__$1,new cljs.core.Keyword(null,"display","display",242065432),"inline-block");
});})(map__31830,map__31830__$1,css,vec__31827,attrs,content))
).call(null,css_orig);
} else {
return cljs.core.assoc.call(null,css_orig,new cljs.core.Keyword(null,"display","display",242065432),"inline-block");
}
});})(map__31830,map__31830__$1,css,vec__31827,attrs,content))
),content);
};
var weathergen$ui$common$inl = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31832__i = 0, G__31832__a = new Array(arguments.length -  0);
while (G__31832__i < G__31832__a.length) {G__31832__a[G__31832__i] = arguments[G__31832__i + 0]; ++G__31832__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31832__a,0,null);
} 
return weathergen$ui$common$inl__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$inl.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$inl.cljs$lang$applyTo = (function (arglist__31833){
var args__30233__auto__ = cljs.core.seq(arglist__31833);
return weathergen$ui$common$inl__delegate(args__30233__auto__);
});
weathergen$ui$common$inl.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$inl__delegate;
return weathergen$ui$common$inl;
})()
;
/**
 * Makes an inline-block div.
 */
weathergen.ui.common.rinl = (function weathergen$ui$common$rinl(var_args){
var args__4736__auto__ = [];
var len__4730__auto___31839 = arguments.length;
var i__4731__auto___31840 = (0);
while(true){
if((i__4731__auto___31840 < len__4730__auto___31839)){
args__4736__auto__.push((arguments[i__4731__auto___31840]));

var G__31841 = (i__4731__auto___31840 + (1));
i__4731__auto___31840 = G__31841;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((0) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((0)),(0),null)):null);
return weathergen.ui.common.rinl.cljs$core$IFn$_invoke$arity$variadic(argseq__4737__auto__);
});

weathergen.ui.common.rinl.cljs$core$IFn$_invoke$arity$variadic = (function (p__31835){
var vec__31836 = p__31835;
var seq__31837 = cljs.core.seq.call(null,vec__31836);
var first__31838 = cljs.core.first.call(null,seq__31837);
var seq__31837__$1 = cljs.core.next.call(null,seq__31837);
var props = first__31838;
var content = seq__31837__$1;
var args = vec__31836;
if(cljs.core.map_QMARK_.call(null,props)){
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"),content], null);
} else {
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block"], null)], null),args], null);
}
});

weathergen.ui.common.rinl.cljs$lang$maxFixedArity = (0);

/** @this {Function} */
weathergen.ui.common.rinl.cljs$lang$applyTo = (function (seq31834){
var self__4718__auto__ = this;
return self__4718__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq31834));
});

/**
 * Returns a CSS triangle. Rotation is zero when pointed down.
 * @param {...*} var_args
 */
weathergen.ui.common.css_triangle = (function() { 
var weathergen$ui$common$css_triangle__delegate = function (args__30233__auto__){
var vec__31842 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31842,(0),null);
var _ = cljs.core.nth.call(null,vec__31842,(1),null);
var map__31845 = attrs;
var map__31845__$1 = (((((!((map__31845 == null))))?(((((map__31845.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31845.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31845):map__31845);
var rotation = cljs.core.get.call(null,map__31845__$1,new cljs.core.Keyword(null,"rotation","rotation",-1728051644));
var color = cljs.core.get.call(null,map__31845__$1,new cljs.core.Keyword(null,"color","color",1011675173));
var size = cljs.core.get.call(null,map__31845__$1,new cljs.core.Keyword(null,"size","size",1098693007));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.Keyword(null,"rotation","rotation",-1728051644),new cljs.core.Keyword(null,"color","color",1011675173));
return hoplon.core.div.call(null,attrs__$1,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__31845,map__31845__$1,rotation,color,size,attrs__$1,vec__31842,attrs,_){
return (function (rotation__$1){
return cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"border-top-style","border-top-style",-668961567),new cljs.core.Keyword(null,"transform","transform",1381301764),new cljs.core.Keyword(null,"border-left-width","border-left-width",2037218085),new cljs.core.Keyword(null,"border-right-style","border-right-style",-1606013368),new cljs.core.Keyword(null,"border-left-color","border-left-color",-1166146583),new cljs.core.Keyword(null,"width","width",-384071477),new cljs.core.Keyword(null,"border-right-width","border-right-width",750273868),new cljs.core.Keyword(null,"border-right-color","border-right-color",2017953775),new cljs.core.Keyword(null,"border-left-style","border-left-style",65166675),new cljs.core.Keyword(null,"border-top-width","border-top-width",1612782932),new cljs.core.Keyword(null,"border-top-color","border-top-color",-804629899),new cljs.core.Keyword(null,"display","display",242065432),new cljs.core.Keyword(null,"height","height",1025178622)],["solid",["rotate(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(rotation__$1),"deg)"].join(''),weathergen.ui.common.px.call(null,(0.66 * size)),"solid","transparent",(0),weathergen.ui.common.px.call(null,(0.66 * size)),"transparent","solid",weathergen.ui.common.px.call(null,size),color,"inline-block",(0)]);
});})(map__31845,map__31845__$1,rotation,color,size,attrs__$1,vec__31842,attrs,_))
).call(null,rotation));
};
var weathergen$ui$common$css_triangle = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31847__i = 0, G__31847__a = new Array(arguments.length -  0);
while (G__31847__i < G__31847__a.length) {G__31847__a[G__31847__i] = arguments[G__31847__i + 0]; ++G__31847__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31847__a,0,null);
} 
return weathergen$ui$common$css_triangle__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$css_triangle.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$css_triangle.cljs$lang$applyTo = (function (arglist__31848){
var args__30233__auto__ = cljs.core.seq(arglist__31848);
return weathergen$ui$common$css_triangle__delegate(args__30233__auto__);
});
weathergen$ui$common$css_triangle.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$css_triangle__delegate;
return weathergen$ui$common$css_triangle;
})()
;
/**
 * @param {...*} var_args
 */
weathergen.ui.common.triangle = (function() { 
var weathergen$ui$common$triangle__delegate = function (args__30233__auto__){
var vec__31849 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31849,(0),null);
var _ = cljs.core.nth.call(null,vec__31849,(1),null);
var map__31852 = attrs;
var map__31852__$1 = (((((!((map__31852 == null))))?(((((map__31852.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31852.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31852):map__31852);
var r = cljs.core.get.call(null,map__31852__$1,new cljs.core.Keyword(null,"r","r",-471384190));
var r_STAR_ = javelin.core.formula.call(null,((function (map__31852,map__31852__$1,r,vec__31849,attrs,_){
return (function (G__31854){
return G__31854;
});})(map__31852,map__31852__$1,r,vec__31849,attrs,_))
).call(null,r);
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"r","r",-471384190));
var alpha = 0.8660254037844387;
var beta = 0.5;
var x = javelin.core.formula.call(null,((function (map__31852,map__31852__$1,r,r_STAR_,attrs__$1,alpha,beta,vec__31849,attrs,_){
return (function (G__31855,G__31856){
return (G__31855 * G__31856);
});})(map__31852,map__31852__$1,r,r_STAR_,attrs__$1,alpha,beta,vec__31849,attrs,_))
).call(null,r_STAR_,alpha);
var y = javelin.core.formula.call(null,((function (map__31852,map__31852__$1,r,r_STAR_,attrs__$1,alpha,beta,x,vec__31849,attrs,_){
return (function (G__31857,G__31858){
return (G__31857 * G__31858);
});})(map__31852,map__31852__$1,r,r_STAR_,attrs__$1,alpha,beta,x,vec__31849,attrs,_))
).call(null,r_STAR_,alpha);
return hoplon.svg.path.call(null,new cljs.core.Keyword(null,"d","d",1972142424),javelin.core.formula.call(null,((function (map__31852,map__31852__$1,r,r_STAR_,attrs__$1,alpha,beta,x,y,vec__31849,attrs,_){
return (function (x__$1,y__$1){
return goog.string.format("M%f,%f L%f,%f L%f,%f Z",(0),(- y__$1),x__$1,y__$1,(- x__$1),y__$1);
});})(map__31852,map__31852__$1,r,r_STAR_,attrs__$1,alpha,beta,x,y,vec__31849,attrs,_))
).call(null,x,y),attrs__$1);
};
var weathergen$ui$common$triangle = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31859__i = 0, G__31859__a = new Array(arguments.length -  0);
while (G__31859__i < G__31859__a.length) {G__31859__a[G__31859__i] = arguments[G__31859__i + 0]; ++G__31859__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31859__a,0,null);
} 
return weathergen$ui$common$triangle__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$triangle.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$triangle.cljs$lang$applyTo = (function (arglist__31860){
var args__30233__auto__ = cljs.core.seq(arglist__31860);
return weathergen$ui$common$triangle__delegate(args__30233__auto__);
});
weathergen$ui$common$triangle.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$triangle__delegate;
return weathergen$ui$common$triangle;
})()
;
/**
 * Rum version of `triangle`.
 */
weathergen.ui.common.rtriangle = (function weathergen$ui$common$rtriangle(attrs){
var map__31861 = attrs;
var map__31861__$1 = (((((!((map__31861 == null))))?(((((map__31861.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31861.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31861):map__31861);
var r = cljs.core.get.call(null,map__31861__$1,new cljs.core.Keyword(null,"r","r",-471384190));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"r","r",-471384190));
var alpha = 0.8660254037844387;
var beta = 0.5;
var x = (r * alpha);
var y = (r * alpha);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"path","path",-188191168),cljs.core.assoc.call(null,attrs__$1,new cljs.core.Keyword(null,"d","d",1972142424),goog.string.format("M%f,%f L%f,%f L%f,%f Z",(0),(- y),x,y,(- x),y))], null);
});
/**
 * Pretty-prints the value of cell c and displays it in a pre tag.
 */
weathergen.ui.common.pre_cell = (function weathergen$ui$common$pre_cell(title,c){
weathergen.ui.common.register_styles_BANG_.call(null,new cljs.core.Keyword("weathergen.ui.common","pre-cell","weathergen.ui.common/pre-cell",-1959908687),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,".pre-cell",".pre-cell",1928754490),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"background","background",-863952629),"black",new cljs.core.Keyword(null,"color","color",1011675173),"green",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace"], null)], null)], null));

return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"pre-cell",hoplon.core.h4.call(null,title),hoplon.core.pre.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),"pre-wrap"], null),javelin.core.formula.call(null,(function (G__31863,G__31864){
return G__31863.call(null,G__31864,new cljs.core.Keyword(null,"stream","stream",1534941648),null,new cljs.core.Keyword(null,"pretty","pretty",-1916372486),true);
})).call(null,cljs.pprint.write,c)));
});
/**
 * @param {...*} var_args
 */
weathergen.ui.common.control_section = (function() { 
var weathergen$ui$common$control_section__delegate = function (args__30233__auto__){
var vec__31865 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attributes = cljs.core.nth.call(null,vec__31865,(0),null);
var children = cljs.core.nth.call(null,vec__31865,(1),null);
var visible = javelin.core.cell.call(null,cljs.core.not.call(null,new cljs.core.Keyword(null,"collapsed?","collapsed?",-1661420674).cljs$core$IFn$_invoke$arity$1(attributes)));
var change_visibility = ((function (visible,vec__31865,attributes,children){
return (function (){
return cljs.core.swap_BANG_.call(null,visible,cljs.core.not);
});})(visible,vec__31865,attributes,children))
;
return hoplon.core.fieldset.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"controls",cljs.core.dissoc.call(null,attributes,new cljs.core.Keyword(null,"title","title",636505583),new cljs.core.Keyword(null,"collapsed?","collapsed?",-1661420674),new cljs.core.Keyword(null,"help-for","help-for",-1997101642)),hoplon.core.legend.call(null,hoplon.core.div.call(null,new cljs.core.Keyword(null,"click","click",1912301393),change_visibility,new cljs.core.Keyword(null,"class","class",-2030961996),javelin.core.formula.call(null,((function (visible,change_visibility,vec__31865,attributes,children){
return (function (visible__$1){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),true,new cljs.core.Keyword(null,"visible","visible",-1024216805),visible__$1], null);
});})(visible,change_visibility,vec__31865,attributes,children))
).call(null,visible),""),hoplon.core.span.call(null,new cljs.core.Keyword(null,"title","title",636505583).cljs$core$IFn$_invoke$arity$1(attributes))),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"control-visibility-container",new cljs.core.Keyword(null,"toggle","toggle",1291842030),visible,new cljs.core.Keyword(null,"fade-toggle","fade-toggle",-1468421852),visible,hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"control-container",children)));
};
var weathergen$ui$common$control_section = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31868__i = 0, G__31868__a = new Array(arguments.length -  0);
while (G__31868__i < G__31868__a.length) {G__31868__a[G__31868__i] = arguments[G__31868__i + 0]; ++G__31868__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31868__a,0,null);
} 
return weathergen$ui$common$control_section__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$control_section.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$control_section.cljs$lang$applyTo = (function (arglist__31869){
var args__30233__auto__ = cljs.core.seq(arglist__31869);
return weathergen$ui$common$control_section__delegate(args__30233__auto__);
});
weathergen$ui$common$control_section.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$control_section__delegate;
return weathergen$ui$common$control_section;
})()
;
/**
 * Formats a campaign time into a string. `opts` is a map of options:
 * 
 *   `:seconds?` - If true, format time including seconds.
 *   `:omit-day?` - If true, don't include the day in the result
 */
weathergen.ui.common.format_time = (function weathergen$ui$common$format_time(var_args){
var G__31871 = arguments.length;
switch (G__31871) {
case 1:
return weathergen.ui.common.format_time.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return weathergen.ui.common.format_time.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));

}
});

weathergen.ui.common.format_time.cljs$core$IFn$_invoke$arity$1 = (function (p__31872){
var map__31873 = p__31872;
var map__31873__$1 = (((((!((map__31873 == null))))?(((((map__31873.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31873.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31873):map__31873);
var time = map__31873__$1;
var day = cljs.core.get.call(null,map__31873__$1,new cljs.core.Keyword(null,"day","day",-274800446));
var hour = cljs.core.get.call(null,map__31873__$1,new cljs.core.Keyword(null,"hour","hour",-555989214));
var minute = cljs.core.get.call(null,map__31873__$1,new cljs.core.Keyword(null,"minute","minute",-642875969));
var second = cljs.core.get.call(null,map__31873__$1,new cljs.core.Keyword(null,"second","second",-444702010));
return weathergen.ui.common.format_time.call(null,time,cljs.core.PersistentArrayMap.EMPTY);
});

weathergen.ui.common.format_time.cljs$core$IFn$_invoke$arity$2 = (function (p__31875,p__31876){
var map__31877 = p__31875;
var map__31877__$1 = (((((!((map__31877 == null))))?(((((map__31877.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31877.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31877):map__31877);
var time = map__31877__$1;
var day = cljs.core.get.call(null,map__31877__$1,new cljs.core.Keyword(null,"day","day",-274800446));
var hour = cljs.core.get.call(null,map__31877__$1,new cljs.core.Keyword(null,"hour","hour",-555989214));
var minute = cljs.core.get.call(null,map__31877__$1,new cljs.core.Keyword(null,"minute","minute",-642875969));
var second = cljs.core.get.call(null,map__31877__$1,new cljs.core.Keyword(null,"second","second",-444702010));
var map__31878 = p__31876;
var map__31878__$1 = (((((!((map__31878 == null))))?(((((map__31878.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31878.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31878):map__31878);
var opts = map__31878__$1;
var seconds_QMARK_ = cljs.core.get.call(null,map__31878__$1,new cljs.core.Keyword(null,"seconds?","seconds?",-1600404958));
var omit_day_QMARK_ = cljs.core.get.call(null,map__31878__$1,new cljs.core.Keyword(null,"omit-day?","omit-day?",1622751707));
if(cljs.core.truth_(time)){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(omit_day_QMARK_)?"":goog.string.format("%02d/",day))),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(seconds_QMARK_)?goog.string.format("%02d:%02d:%02d",hour,minute,second):goog.string.format("%02d:%02d",hour,minute)))].join('');
} else {
return null;
}
});

weathergen.ui.common.format_time.cljs$lang$maxFixedArity = 2;

/**
 * Formats a heading
 */
weathergen.ui.common.format_heading = (function weathergen$ui$common$format_heading(heading){
var G__31882 = heading;
if((G__31882 == null)){
return null;
} else {
return G__31882.toFixed((0));
}
});
/**
 * Formats a distance
 */
weathergen.ui.common.format_distance = (function weathergen$ui$common$format_distance(distance){
var G__31883 = distance;
if((G__31883 == null)){
return null;
} else {
return G__31883.toFixed((1));
}
});
/**
 * Formats a speed.
 */
weathergen.ui.common.format_speed = (function weathergen$ui$common$format_speed(speed){
var G__31884 = speed;
var G__31884__$1 = (((G__31884 == null))?null:weathergen.math.nearest.call(null,G__31884,(5)));
if((G__31884__$1 == null)){
return null;
} else {
return G__31884__$1.toFixed((0));
}
});
/**
 * Formats a Mach number.
 */
weathergen.ui.common.format_mach = (function weathergen$ui$common$format_mach(mach){
var G__31885 = mach;
if((G__31885 == null)){
return null;
} else {
return G__31885.toFixed((2));
}
});
/**
 * Renders a color selection element. Attributes can include:
 * 
 * - `value` - a cell holding a hex color string.
 * 
 * - `alpha?` - a boolean indicating whether opacity selection is permitted.
 * 
 * - `change` - a function passed the new color, called when the selected
 *   color changes.
 * 
 * - `show` - a function of no arguments that will be called when the
 *   selection UI is shown.
 * 
 * - `hide` - a function of no arguments that will be called when the
 *   selection UI is hidden.
 * @param {...*} var_args
 */
weathergen.ui.common.color_picker = (function() { 
var weathergen$ui$common$color_picker__delegate = function (args__30233__auto__){
var vec__31886 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31886,(0),null);
var _ = cljs.core.nth.call(null,vec__31886,(1),null);
var map__31889 = attrs;
var map__31889__$1 = (((((!((map__31889 == null))))?(((((map__31889.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31889.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31889):map__31889);
var change = cljs.core.get.call(null,map__31889__$1,new cljs.core.Keyword(null,"change","change",-1163046502));
var show = cljs.core.get.call(null,map__31889__$1,new cljs.core.Keyword(null,"show","show",-576705889));
var alpha_QMARK_ = cljs.core.get.call(null,map__31889__$1,new cljs.core.Keyword(null,"alpha?","alpha?",1329751525));
var value = cljs.core.get.call(null,map__31889__$1,new cljs.core.Keyword(null,"value","value",305978217));
var hide = cljs.core.get.call(null,map__31889__$1,new cljs.core.Keyword(null,"hide","hide",-596913169));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"change","change",-1163046502),new cljs.core.Keyword(null,"hide","hide",-596913169),new cljs.core.Keyword(null,"show","show",-576705889),new cljs.core.Keyword(null,"alpha?","alpha?",1329751525),new cljs.core.Keyword(null,"value","value",305978217));
var open_QMARK_ = cljs.core.atom.call(null,false);
var i = hoplon.core.input.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null)),new cljs.core.Keyword(null,"value","value",305978217),cljs.core.deref.call(null,value),new cljs.core.Keyword(null,"class","class",-2030961996),"minicolors",new cljs.core.Keyword(null,"type","type",1174270348),"hidden");
cljs.core.add_watch.call(null,value,cljs.core.keyword.call(null,cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null))),((function (i,open_QMARK_,map__31889,map__31889__$1,change,show,alpha_QMARK_,value,hide,attrs__$1,vec__31886,attrs,_){
return (function (___$1,___$2,___$3,n){
if(cljs.core.truth_(n)){
return jQuery(i).minicolors("value",weathergen.ui.common.to_hex_str.call(null,n));
} else {
return null;
}
});})(i,open_QMARK_,map__31889,map__31889__$1,change,show,alpha_QMARK_,value,hide,attrs__$1,vec__31886,attrs,_))
);

weathergen.ui.common.when_dom_STAR_.call(null,i,((function (i,open_QMARK_,map__31889,map__31889__$1,change,show,alpha_QMARK_,value,hide,attrs__$1,vec__31886,attrs,_){
return (function (){
return (function (){var G__31891 = jQuery(i);
return G__31891;
})().minicolors(({"theme": "weathergen", "show": ((function (i,open_QMARK_,map__31889,map__31889__$1,change,show,alpha_QMARK_,value,hide,attrs__$1,vec__31886,attrs,_){
return (function (){
cljs.core.reset_BANG_.call(null,open_QMARK_,true);

if(cljs.core.truth_(show)){
return show.call(null);
} else {
return null;
}
});})(i,open_QMARK_,map__31889,map__31889__$1,change,show,alpha_QMARK_,value,hide,attrs__$1,vec__31886,attrs,_))
, "hide": ((function (i,open_QMARK_,map__31889,map__31889__$1,change,show,alpha_QMARK_,value,hide,attrs__$1,vec__31886,attrs,_){
return (function (){
cljs.core.reset_BANG_.call(null,open_QMARK_,false);

if(cljs.core.truth_(hide)){
return hide.call(null);
} else {
return null;
}
});})(i,open_QMARK_,map__31889,map__31889__$1,change,show,alpha_QMARK_,value,hide,attrs__$1,vec__31886,attrs,_))
, "opacity": cljs.core.boolean$.call(null,alpha_QMARK_)}));
});})(i,open_QMARK_,map__31889,map__31889__$1,change,show,alpha_QMARK_,value,hide,attrs__$1,vec__31886,attrs,_))
);

return i;
};
var weathergen$ui$common$color_picker = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31892__i = 0, G__31892__a = new Array(arguments.length -  0);
while (G__31892__i < G__31892__a.length) {G__31892__a[G__31892__i] = arguments[G__31892__i + 0]; ++G__31892__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31892__a,0,null);
} 
return weathergen$ui$common$color_picker__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$color_picker.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$color_picker.cljs$lang$applyTo = (function (arglist__31893){
var args__30233__auto__ = cljs.core.seq(arglist__31893);
return weathergen$ui$common$color_picker__delegate(args__30233__auto__);
});
weathergen$ui$common$color_picker.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$color_picker__delegate;
return weathergen$ui$common$color_picker;
})()
;
/**
 * Like `color-picker`, but uses spectrum.
 * @param {...*} var_args
 */
weathergen.ui.common.color_picker2 = (function() { 
var weathergen$ui$common$color_picker2__delegate = function (args__30233__auto__){
var vec__31894 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31894,(0),null);
var _ = cljs.core.nth.call(null,vec__31894,(1),null);
weathergen.ui.common.register_styles_BANG_.call(null,new cljs.core.Keyword("weathergen.ui.common","color-picker2","weathergen.ui.common/color-picker2",1693455994),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,".vmt-color-picker",".vmt-color-picker",-692568040),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"&.sp-replacer","&.sp-replacer",-1732597284),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),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,".sp-preview",".sp-preview",436894146),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(18)),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(18)),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(2))], null)], null)], null));

var map__31897 = attrs;
var map__31897__$1 = (((((!((map__31897 == null))))?(((((map__31897.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31897.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31897):map__31897);
var change = cljs.core.get.call(null,map__31897__$1,new cljs.core.Keyword(null,"change","change",-1163046502));
var alpha_QMARK_ = cljs.core.get.call(null,map__31897__$1,new cljs.core.Keyword(null,"alpha?","alpha?",1329751525));
var value = cljs.core.get.call(null,map__31897__$1,new cljs.core.Keyword(null,"value","value",305978217));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"change","change",-1163046502),new cljs.core.Keyword(null,"alpha?","alpha?",1329751525));
var elem = hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"hidden");
var change_STAR__31900 = ((function (elem,map__31897,map__31897__$1,change,alpha_QMARK_,value,attrs__$1,vec__31894,attrs,_){
return (function (color){
var hex = (cljs.core.truth_(alpha_QMARK_)?color.toHex8String():color.toHexString());
if(cljs.core.truth_(change)){
return change.call(null,hex);
} else {
return cljs.core.reset_BANG_.call(null,value,hex);
}
});})(elem,map__31897,map__31897__$1,change,alpha_QMARK_,value,attrs__$1,vec__31894,attrs,_))
;
var f_31901 = ((function (change_STAR__31900,elem,map__31897,map__31897__$1,change,alpha_QMARK_,value,attrs__$1,vec__31894,attrs,_){
return (function weathergen$ui$common$color_picker2_$_f(){
return setTimeout(((function (change_STAR__31900,elem,map__31897,map__31897__$1,change,alpha_QMARK_,value,attrs__$1,vec__31894,attrs,_){
return (function (){
var temp__5718__auto__ = (function (){var G__31899 = elem;
var G__31899__$1 = (((G__31899 == null))?null:jQuery(G__31899));
if((G__31899__$1 == null)){
return null;
} else {
return G__31899__$1.spectrum;
}
})();
if(cljs.core.truth_(temp__5718__auto__)){
var s = temp__5718__auto__;
cljs.core.add_watch.call(null,value,cljs.core.keyword.call(null,cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null))),((function (s,temp__5718__auto__,change_STAR__31900,elem,map__31897,map__31897__$1,change,alpha_QMARK_,value,attrs__$1,vec__31894,attrs,_){
return (function (___$1,___$2,___$3,n){
return jQuery(elem).spectrum("set",n);
});})(s,temp__5718__auto__,change_STAR__31900,elem,map__31897,map__31897__$1,change,alpha_QMARK_,value,attrs__$1,vec__31894,attrs,_))
);

return jQuery(elem).spectrum(({"color": cljs.core.deref.call(null,value), "showAlpha": cljs.core.boolean$.call(null,alpha_QMARK_), "replacerClassName": "vmt-color-picker", "containerClassName": "vmt-color-picker", "change": change_STAR__31900, "move": change_STAR__31900, "hide": change_STAR__31900}));
} else {
return weathergen$ui$common$color_picker2_$_f.call(null);
}
});})(change_STAR__31900,elem,map__31897,map__31897__$1,change,alpha_QMARK_,value,attrs__$1,vec__31894,attrs,_))
,(0));
});})(change_STAR__31900,elem,map__31897,map__31897__$1,change,alpha_QMARK_,value,attrs__$1,vec__31894,attrs,_))
;
f_31901.call(null);

return elem;
};
var weathergen$ui$common$color_picker2 = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31902__i = 0, G__31902__a = new Array(arguments.length -  0);
while (G__31902__i < G__31902__a.length) {G__31902__a[G__31902__i] = arguments[G__31902__i + 0]; ++G__31902__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31902__a,0,null);
} 
return weathergen$ui$common$color_picker2__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$color_picker2.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$color_picker2.cljs$lang$applyTo = (function (arglist__31903){
var args__30233__auto__ = cljs.core.seq(arglist__31903);
return weathergen$ui$common$color_picker2__delegate(args__30233__auto__);
});
weathergen$ui$common$color_picker2.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$color_picker2__delegate;
return weathergen$ui$common$color_picker2;
})()
;
/**
 * Returns UI for the display name of a side.
 * @param {...*} var_args
 */
weathergen.ui.common.side_label = (function() { 
var weathergen$ui$common$side_label__delegate = function (args__30233__auto__){
var vec__31906 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31906,(0),null);
var _ = cljs.core.nth.call(null,vec__31906,(1),null);
var map__31909 = attrs;
var map__31909__$1 = (((((!((map__31909 == null))))?(((((map__31909.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31909.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31909):map__31909);
var mission = cljs.core.get.call(null,map__31909__$1,new cljs.core.Keyword(null,"mission","mission",1740288522));
var side = cljs.core.get.call(null,map__31909__$1,new cljs.core.Keyword(null,"side","side",389652279));
var allies = javelin.core.formula.call(null,((function (map__31909,map__31909__$1,mission,side,vec__31906,attrs,_){
return (function (mission__$1,side__$1){
var side_teams = cljs.core.set.call(null,cljs.core.map.call(null,((function (map__31909,map__31909__$1,mission,side,vec__31906,attrs,_){
return (function (p1__31905_SHARP_){
return new cljs.core.Keyword(null,"who","who",-235935040).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"team","team",1355747699).cljs$core$IFn$_invoke$arity$1(p1__31905_SHARP_));
});})(map__31909,map__31909__$1,mission,side,vec__31906,attrs,_))
,cljs.core.filter.call(null,((function (map__31909,map__31909__$1,mission,side,vec__31906,attrs,_){
return (function (p1__31904_SHARP_){
return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"c-team","c-team",1058111407).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"team","team",1355747699).cljs$core$IFn$_invoke$arity$1(p1__31904_SHARP_)),side__$1);
});})(map__31909,map__31909__$1,mission,side,vec__31906,attrs,_))
,weathergen.falcon.files.mission.teams.call(null,mission__$1))));
return cljs.core.disj.call(null,side_teams,side__$1);
});})(map__31909,map__31909__$1,mission,side,vec__31906,attrs,_))
).call(null,mission,side);
return hoplon.core.div.call(null,cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"mission","mission",1740288522),new cljs.core.Keyword(null,"side","side",389652279)),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_){
return (function (mission__$1,side__$1,allies__$1){
return cljs.core.interpose.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"color","color",1011675173),"",new cljs.core.Keyword(null,"name","name",1843675177),"/"], null),(function (){var iter__4523__auto__ = ((function (map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_){
return (function weathergen$ui$common$side_label_$_iter__31911(s__31912){
return (new cljs.core.LazySeq(null,((function (map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_){
return (function (){
var s__31912__$1 = s__31912;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__31912__$1);
if(temp__5720__auto__){
var s__31912__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__31912__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__31912__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__31914 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__31913 = (0);
while(true){
if((i__31913 < size__4522__auto__)){
var team = cljs.core._nth.call(null,c__4521__auto__,i__31913);
cljs.core.chunk_append.call(null,b__31914,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"color","color",1011675173),weathergen.ui.common.team_color.call(null,team,new cljs.core.Keyword(null,"dark-text","dark-text",814777253)),new cljs.core.Keyword(null,"name","name",1843675177),weathergen.falcon.files.mission.team_name.call(null,mission__$1,team)], null));

var G__31928 = (i__31913 + (1));
i__31913 = G__31928;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__31914),weathergen$ui$common$side_label_$_iter__31911.call(null,cljs.core.chunk_rest.call(null,s__31912__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__31914),null);
}
} else {
var team = cljs.core.first.call(null,s__31912__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"color","color",1011675173),weathergen.ui.common.team_color.call(null,team,new cljs.core.Keyword(null,"dark-text","dark-text",814777253)),new cljs.core.Keyword(null,"name","name",1843675177),weathergen.falcon.files.mission.team_name.call(null,mission__$1,team)], null),weathergen$ui$common$side_label_$_iter__31911.call(null,cljs.core.rest.call(null,s__31912__$2)));
}
} else {
return null;
}
break;
}
});})(map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_))
,null,null));
});})(map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_))
;
return iter__4523__auto__.call(null,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [side__$1], null),allies__$1));
})());
});})(map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_))
).call(null,mission,side,allies),((function (map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_){
return (function (item__30277__auto__){
var vec__31915 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_){
return (function (elem){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [elem], null);
});})(map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_))
).call(null,item__30277__auto__));
var elem = cljs.core.nth.call(null,vec__31915,(0),null);
var vec__31920 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__31915,elem,map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_){
return (function (p__31923){
var map__31924 = p__31923;
var map__31924__$1 = (((((!((map__31924 == null))))?(((((map__31924.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31924.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31924):map__31924);
var color = cljs.core.get.call(null,map__31924__$1,new cljs.core.Keyword(null,"color","color",1011675173));
var name = cljs.core.get.call(null,map__31924__$1,new cljs.core.Keyword(null,"name","name",1843675177));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [color,name], null);
});})(vec__31915,elem,map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_))
).call(null,elem));
var color = cljs.core.nth.call(null,vec__31920,(0),null);
var name = cljs.core.nth.call(null,vec__31920,(1),null);
return hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__31920,color,name,vec__31915,elem,map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_){
return (function (G__31926){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),G__31926], null);
});})(vec__31920,color,name,vec__31915,elem,map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_))
).call(null,color),javelin.core.formula.call(null,((function (vec__31920,color,name,vec__31915,elem,map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_){
return (function (G__31927){
return G__31927;
});})(vec__31920,color,name,vec__31915,elem,map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_))
).call(null,name));
});})(map__31909,map__31909__$1,mission,side,allies,vec__31906,attrs,_))
));
};
var weathergen$ui$common$side_label = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31929__i = 0, G__31929__a = new Array(arguments.length -  0);
while (G__31929__i < G__31929__a.length) {G__31929__a[G__31929__i] = arguments[G__31929__i + 0]; ++G__31929__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31929__a,0,null);
} 
return weathergen$ui$common$side_label__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$side_label.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$side_label.cljs$lang$applyTo = (function (arglist__31930){
var args__30233__auto__ = cljs.core.seq(arglist__31930);
return weathergen$ui$common$side_label__delegate(args__30233__auto__);
});
weathergen$ui$common$side_label.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$side_label__delegate;
return weathergen$ui$common$side_label;
})()
;
weathergen.ui.common.iterator_seq = (function weathergen$ui$common$iterator_seq(iter){
var v = cljs.core.PersistentVector.EMPTY;
var curr = iter.next();
while(true){
if(cljs.core.truth_(curr.done)){
return v;
} else {
var G__31931 = cljs.core.conj.call(null,v,curr.value);
var G__31932 = iter.next();
v = G__31931;
curr = G__31932;
continue;
}
break;
}
});
/**
 * Renders a jQuery Select2 control. `:choices` is a (cell or non-cell)
 *   sequence of maps, each of which must contain a `:value` key. These
 *   values will be used to set the cell passed in for `:value`.
 *   `:formatter` is a function which, when passed one of the items from
 *   the `:choices` sequence, returns UI used to display it in the
 *   dropdown.
 * 
 *   Optional attributes:
 * 
 *   :formatter - defaults to `:label`.
 *   :placeholder - adds a choice with value nil when present
 *   :allow-clear? - Adds the 'clear' button.
 * @param {...*} var_args
 */
weathergen.ui.common.select2 = (function() { 
var weathergen$ui$common$select2__delegate = function (args__30233__auto__){
var vec__31934 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31934,(0),null);
var kids = cljs.core.nth.call(null,vec__31934,(1),null);
var map__31937 = attrs;
var map__31937__$1 = (((((!((map__31937 == null))))?(((((map__31937.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31937.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31937):map__31937);
var allow_clear_QMARK_ = cljs.core.get.call(null,map__31937__$1,new cljs.core.Keyword(null,"allow-clear?","allow-clear?",474545376));
var placeholder = cljs.core.get.call(null,map__31937__$1,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083));
var formatter = cljs.core.get.call(null,map__31937__$1,new cljs.core.Keyword(null,"formatter","formatter",-483008823));
var value = cljs.core.get.call(null,map__31937__$1,new cljs.core.Keyword(null,"value","value",305978217));
var choices = cljs.core.get.call(null,map__31937__$1,new cljs.core.Keyword(null,"choices","choices",1385611597));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.Keyword(null,"formatter","formatter",-483008823),new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),new cljs.core.Keyword(null,"allow-clear?","allow-clear?",474545376));
var choices_STAR_ = javelin.core.formula.call(null,((function (map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (choices__$1,placeholder__$1){
return cljs.core.into.call(null,(cljs.core.truth_(placeholder__$1)?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),null,new cljs.core.Keyword("weathergen.ui.common","placeholder?","weathergen.ui.common/placeholder?",539360064),true], null)], null):cljs.core.PersistentVector.EMPTY),choices__$1);
});})(map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
).call(null,choices,placeholder);
var formatter__$1 = (function (){var or__4131__auto__ = formatter;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return new cljs.core.Keyword(null,"label","label",1718410804);
}
})();
var index = javelin.core.formula.call(null,((function (choices_STAR_,formatter__$1,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (G__31945,G__31942,G__31944,G__31941,G__31939,G__31943,G__31940){
return G__31939.call(null,G__31940.call(null),G__31941.call(null,G__31942.call(null,((function (choices_STAR_,formatter__$1,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (p1__31933_SHARP_){
return G__31943.call(null,"%05d",p1__31933_SHARP_);
});})(choices_STAR_,formatter__$1,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
,G__31944.call(null)),G__31945));
});})(choices_STAR_,formatter__$1,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
).call(null,choices_STAR_,cljs.core.map,cljs.core.range,cljs.core.zipmap,cljs.core.into,goog.string.format,cljs.core.sorted_map);
var formatter_STAR_ = ((function (choices_STAR_,formatter__$1,index,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (state){
var val = cljs.core.get.call(null,cljs.core.deref.call(null,index),state.id);
if(cljs.core.truth_(val)){
return formatter__$1.call(null,val);
} else {
return placeholder;
}
});})(choices_STAR_,formatter__$1,index,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
;
var lookup = ((function (choices_STAR_,formatter__$1,index,formatter_STAR_,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (val){
var G__31946 = cljs.core.deref.call(null,index);
var G__31946__$1 = (((G__31946 == null))?null:cljs.core.filter.call(null,((function (G__31946,choices_STAR_,formatter__$1,index,formatter_STAR_,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (p__31947){
var vec__31948 = p__31947;
var id = cljs.core.nth.call(null,vec__31948,(0),null);
var item = cljs.core.nth.call(null,vec__31948,(1),null);
return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(item),val);
});})(G__31946,choices_STAR_,formatter__$1,index,formatter_STAR_,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
,G__31946));
var G__31946__$2 = (((G__31946__$1 == null))?null:cljs.core.first.call(null,G__31946__$1));
if((G__31946__$2 == null)){
return null;
} else {
return cljs.core.key.call(null,G__31946__$2);
}
});})(choices_STAR_,formatter__$1,index,formatter_STAR_,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
;
var elem = hoplon.core.select.call(null,attrs__$1,kids);
hoplon.core.do_watch.call(null,value,((function (elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (_,n){
var e = $(elem);
var temp__5718__auto__ = lookup.call(null,n);
if(cljs.core.truth_(temp__5718__auto__)){
var found = temp__5718__auto__;
var G__31951 = e;
G__31951.val(found);

G__31951.trigger("change");

return G__31951;
} else {
return console.warn("select2: item",cljs.core.pr_str.call(null,n),"not found");
}
});})(elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
);

cljs.core.add_watch.call(null,index,cljs.core.gensym.call(null),((function (elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (_,___$1,___$2,n){
var s = (function (){var G__31952 = jQuery(elem);
return G__31952;
})().empty();
return cljs.core.reduce.call(null,((function (s,elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (s__$1,p__31953){
var map__31954 = p__31953;
var map__31954__$1 = (((((!((map__31954 == null))))?(((((map__31954.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31954.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31954):map__31954);
var value__$1 = cljs.core.get.call(null,map__31954__$1,new cljs.core.Keyword(null,"value","value",305978217));
var placeholder_QMARK_ = cljs.core.get.call(null,map__31954__$1,new cljs.core.Keyword("weathergen.ui.common","placeholder?","weathergen.ui.common/placeholder?",539360064));
var id = (cljs.core.truth_(placeholder_QMARK_)?"":lookup.call(null,value__$1));
return s__$1.append((new Option(id,id,false,false)));
});})(s,elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
,s,cljs.core.deref.call(null,choices_STAR_)).val(lookup.call(null,cljs.core.deref.call(null,value))).trigger("change");
});})(elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
);

setTimeout(((function (elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (){
jQuery.fn.select2.defaults.set("width","resolve");

return (function (){var G__31956 = jQuery(elem);
return G__31956;
})().select2(cljs.core.clj__GT_js.call(null,(function (){var G__31957 = new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),cljs.core.clj__GT_js.call(null,(function (){var iter__4523__auto__ = ((function (elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function weathergen$ui$common$select2_$_iter__31958(s__31959){
return (new cljs.core.LazySeq(null,((function (elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (){
var s__31959__$1 = s__31959;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__31959__$1);
if(temp__5720__auto__){
var s__31959__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__31959__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__31959__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__31961 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__31960 = (0);
while(true){
if((i__31960 < size__4522__auto__)){
var vec__31962 = cljs.core._nth.call(null,c__4521__auto__,i__31960);
var id = cljs.core.nth.call(null,vec__31962,(0),null);
var item = cljs.core.nth.call(null,vec__31962,(1),null);
cljs.core.chunk_append.call(null,b__31961,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"text","text",-1790561697),(cljs.core.truth_(new cljs.core.Keyword("weathergen.ui.common","placeholder?","weathergen.ui.common/placeholder?",539360064).cljs$core$IFn$_invoke$arity$1(item))?"":id),new cljs.core.Keyword(null,"id","id",-1388402092),(cljs.core.truth_(new cljs.core.Keyword("weathergen.ui.common","placeholder?","weathergen.ui.common/placeholder?",539360064).cljs$core$IFn$_invoke$arity$1(item))?"":id)], null));

var G__31968 = (i__31960 + (1));
i__31960 = G__31968;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__31961),weathergen$ui$common$select2_$_iter__31958.call(null,cljs.core.chunk_rest.call(null,s__31959__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__31961),null);
}
} else {
var vec__31965 = cljs.core.first.call(null,s__31959__$2);
var id = cljs.core.nth.call(null,vec__31965,(0),null);
var item = cljs.core.nth.call(null,vec__31965,(1),null);
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"text","text",-1790561697),(cljs.core.truth_(new cljs.core.Keyword("weathergen.ui.common","placeholder?","weathergen.ui.common/placeholder?",539360064).cljs$core$IFn$_invoke$arity$1(item))?"":id),new cljs.core.Keyword(null,"id","id",-1388402092),(cljs.core.truth_(new cljs.core.Keyword("weathergen.ui.common","placeholder?","weathergen.ui.common/placeholder?",539360064).cljs$core$IFn$_invoke$arity$1(item))?"":id)], null),weathergen$ui$common$select2_$_iter__31958.call(null,cljs.core.rest.call(null,s__31959__$2)));
}
} else {
return null;
}
break;
}
});})(elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
,null,null));
});})(elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
;
return iter__4523__auto__.call(null,cljs.core.deref.call(null,index));
})()),new cljs.core.Keyword(null,"templateResult","templateResult",-405103851),formatter_STAR_,new cljs.core.Keyword(null,"templateSelection","templateSelection",-1100841272),formatter_STAR_,new cljs.core.Keyword(null,"allowClear","allowClear",2001597922),allow_clear_QMARK_], null);
if(cljs.core.truth_(placeholder)){
return cljs.core.merge.call(null,G__31957,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),placeholder], null));
} else {
return G__31957;
}
})())).on("change",((function (elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids){
return (function (e){
var v = new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(cljs.core.get.call(null,cljs.core.deref.call(null,index),e.currentTarget.value));
return cljs.core.reset_BANG_.call(null,value,v);
});})(elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
).val(lookup.call(null,cljs.core.deref.call(null,value))).trigger("change");
});})(elem,choices_STAR_,formatter__$1,index,formatter_STAR_,lookup,map__31937,map__31937__$1,allow_clear_QMARK_,placeholder,formatter,value,choices,attrs__$1,vec__31934,attrs,kids))
,(0));

return elem;
};
var weathergen$ui$common$select2 = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__31969__i = 0, G__31969__a = new Array(arguments.length -  0);
while (G__31969__i < G__31969__a.length) {G__31969__a[G__31969__i] = arguments[G__31969__i + 0]; ++G__31969__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__31969__a,0,null);
} 
return weathergen$ui$common$select2__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$select2.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$select2.cljs$lang$applyTo = (function (arglist__31970){
var args__30233__auto__ = cljs.core.seq(arglist__31970);
return weathergen$ui$common$select2__delegate(args__30233__auto__);
});
weathergen$ui$common$select2.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$select2__delegate;
return weathergen$ui$common$select2;
})()
;
/**
 * Returns a path to where we should cache an image.
 */
weathergen.ui.common.image_cache_path = (function weathergen$ui$common$image_cache_path(image_descriptor){
return weathergen.filesystem.path_combine.call(null,weathergen.settings.app_dir,"cache","images",[weathergen.falcon.files.images.cache_key.call(null,image_descriptor),".png"].join(''));
});
/**
 * Asynchronously saves `blob` to `path`.
 */
weathergen.ui.common.save_blob_async = (function weathergen$ui$common$save_blob_async(blob,path){
var reader = (new FileReader());
reader.onload = ((function (reader){
return (function (){
return weathergen.filesystem.save_data.call(null,path,Buffer.from(reader.result));
});})(reader))
;

return reader.readAsArrayBuffer(blob);
});
/**
 * Prompts the user for a path and saves a file.
 * 
 *   `:title` - the title of the dialog that will be shown.
 *   `:data`  - a string, Blob, or Buffer of data to save.
 *   `:filters` - A seq of maps containing `:name` (string) and
 *             `:extension` (vector of strings) to populate the
 *             dialog's filter dropdown with.
 *   `:default-path` - Absolute directory path, absolute file path,
 *                  or file name to use by default.
 */
weathergen.ui.common.save_data = (function weathergen$ui$common$save_data(p__31971){
var map__31972 = p__31971;
var map__31972__$1 = (((((!((map__31972 == null))))?(((((map__31972.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31972.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31972):map__31972);
var params = map__31972__$1;
var data = cljs.core.get.call(null,map__31972__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var title = cljs.core.get.call(null,map__31972__$1,new cljs.core.Keyword(null,"title","title",636505583));
var filters = cljs.core.get.call(null,map__31972__$1,new cljs.core.Keyword(null,"filters","filters",974726919));
var default_path = cljs.core.get.call(null,map__31972__$1,new cljs.core.Keyword(null,"default-path","default-path",-1046856029));
var temp__5720__auto__ = weathergen.ui.common.electron.remote.dialog.showSaveDialog(cljs.core.clj__GT_js.call(null,(function (){var G__31974 = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"title","title",636505583),title,new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [filters], null)], null);
if(cljs.core.truth_(default_path)){
return cljs.core.assoc.call(null,G__31974,new cljs.core.Keyword(null,"defaultPath","defaultPath",-582313676),default_path);
} else {
return G__31974;
}
})()));
if(cljs.core.truth_(temp__5720__auto__)){
var path = temp__5720__auto__;
if((data instanceof Blob)){
return weathergen.ui.common.save_blob_async.call(null,data,path);
} else {
return weathergen.filesystem.save_data.call(null,path,data);
}
} else {
return null;
}
});
/**
 * Prompts the user for a path from which to load a a file. Returns nil
 *   if no path was selected.
 * 
 *   `:title` - the title of the dialog that will be shown.
 *   `:mode` - `:file` or `:directory`. Defaults to `:file`.
 *   `:filters` - A seq of maps containing `:name` (string) and
 *             `:extensions` (vector of strings) to populate the
 *             dialog's filter dropdown with.
 *   `:default-path` - Absolute directory path, absolute file path,
 *                  or file name to use by default.
 */
weathergen.ui.common.get_path_for_load = (function weathergen$ui$common$get_path_for_load(p__31975){
var map__31976 = p__31975;
var map__31976__$1 = (((((!((map__31976 == null))))?(((((map__31976.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31976.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31976):map__31976);
var title = cljs.core.get.call(null,map__31976__$1,new cljs.core.Keyword(null,"title","title",636505583));
var filters = cljs.core.get.call(null,map__31976__$1,new cljs.core.Keyword(null,"filters","filters",974726919));
var default_path = cljs.core.get.call(null,map__31976__$1,new cljs.core.Keyword(null,"default-path","default-path",-1046856029));
var mode = cljs.core.get.call(null,map__31976__$1,new cljs.core.Keyword(null,"mode","mode",654403691));
var mode__$1 = (function (){var or__4131__auto__ = mode;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return new cljs.core.Keyword(null,"file","file",-1269645878);
}
})();
var filters__$1 = (function (){var or__4131__auto__ = filters;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})();
var temp__5720__auto__ = weathergen.ui.common.electron.remote.dialog.showOpenDialog(cljs.core.clj__GT_js.call(null,(function (){var G__31978 = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),title,new cljs.core.Keyword(null,"properties","properties",685819552),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"file","file",-1269645878),mode__$1))?"openFile":"openDirectory")], null),new cljs.core.Keyword(null,"filters","filters",974726919),filters__$1], null);
if(cljs.core.truth_(default_path)){
return cljs.core.assoc.call(null,G__31978,new cljs.core.Keyword(null,"defaultPath","defaultPath",-582313676),default_path);
} else {
return G__31978;
}
})()));
if(cljs.core.truth_(temp__5720__auto__)){
var vec__31979 = temp__5720__auto__;
var path = cljs.core.nth.call(null,vec__31979,(0),null);
return path;
} else {
return null;
}
});
/**
 * Return a URL for the image identified by `image-descriptor`.
 */
weathergen.ui.common.get_image = (function weathergen$ui$common$get_image(mission,image_descriptor){
if(cljs.core.truth_(new cljs.core.Keyword(null,"base","base",185279322).cljs$core$IFn$_invoke$arity$1(image_descriptor))){
} else {
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"warn","warn",-436710552),"weathergen.ui.common",null,888,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay((function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Trying to load an image with no base in its descriptor",new cljs.core.Keyword(null,"image-descriptor","image-descriptor",-1531626249),image_descriptor], null);
}),null)),null,-1734380709);
}

var path = weathergen.ui.common.image_cache_path.call(null,image_descriptor);
if(cljs.core.truth_(weathergen.filesystem.exists_QMARK_.call(null,path))){
return path;
} else {
var canvas = document.createElement("canvas");
var timer_name__15816__auto___31982 = ["Loading image ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"image-id","image-id",-988480565).cljs$core$IFn$_invoke$arity$1(image_descriptor))].join('');
var ignore__15817__auto___31983 = console.time(timer_name__15816__auto___31982);
var result__15818__auto___31984 = weathergen.falcon.files.images.read_image.call(null,mission,image_descriptor,((function (timer_name__15816__auto___31982,ignore__15817__auto___31983,canvas,path){
return (function (width,height){
canvas.width = width;

canvas.height = height;

var context = canvas.getContext("2d");
var image_data = context.getImageData((0),(0),width,height);
var buf = (new ArrayBuffer(image_data.data.length));
var buf8 = (new Uint8ClampedArray(buf));
var data = (new Uint32Array(buf));
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"set-pixel!","set-pixel!",1287500897),((function (context,image_data,buf,buf8,data,timer_name__15816__auto___31982,ignore__15817__auto___31983,canvas,path){
return (function (x,y,argb){
return (data[(x + (y * width))] = argb);
});})(context,image_data,buf,buf8,data,timer_name__15816__auto___31982,ignore__15817__auto___31983,canvas,path))
,new cljs.core.Keyword(null,"finalize","finalize",-1152897571),((function (context,image_data,buf,buf8,data,timer_name__15816__auto___31982,ignore__15817__auto___31983,canvas,path){
return (function (){
image_data.data.set(buf8);

return context.putImageData(image_data,(0),(0));
});})(context,image_data,buf,buf8,data,timer_name__15816__auto___31982,ignore__15817__auto___31983,canvas,path))
], null);
});})(timer_name__15816__auto___31982,ignore__15817__auto___31983,canvas,path))
);
console.timeEnd(timer_name__15816__auto___31982);


canvas.toBlob(((function (canvas,path){
return (function (blob){
return weathergen.ui.common.save_blob_async.call(null,blob,path);
});})(canvas,path))
);

return canvas.toDataURL();
}
});
/**
 * Renders an image centered in width and height.
 */
weathergen.ui.common.centered_image = (function weathergen$ui$common$centered_image(mission,image,size){
var dims = javelin.core.formula.call(null,(function (image__$1){
if(cljs.core.not.call(null,image__$1)){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"w","w",354169001),size,new cljs.core.Keyword(null,"h","h",1109658740),size], null);
} else {
var vec__31985 = cljs.core.get_in.call(null,image__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"image-data","image-data",-377483758),new cljs.core.Keyword(null,"size","size",1098693007)], null));
var w = cljs.core.nth.call(null,vec__31985,(0),null);
var h = cljs.core.nth.call(null,vec__31985,(1),null);
var aspect = (w / h);
if((aspect < (1))){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"w","w",354169001),(aspect * size),new cljs.core.Keyword(null,"h","h",1109658740),size], null);
} else {
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"w","w",354169001),size,new cljs.core.Keyword(null,"h","h",1109658740),(size / aspect)], null);
}
}
})).call(null,image);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (dims){
return (function (dims__$1){
return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(dims__$1),(0),(0)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center",new cljs.core.Keyword(null,"position","position",-2011731912),"relative"], null);
});})(dims))
).call(null,dims),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (dims){
return (function (){
return hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (dims){
return (function (dims__$1){
return new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"top","top",-1856271961),(0),new cljs.core.Keyword(null,"bottom","bottom",-1550509018),(0),new cljs.core.Keyword(null,"left","left",-399115937),(0),new cljs.core.Keyword(null,"right","right",-452581833),(0),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(dims__$1)),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(dims__$1)),new cljs.core.Keyword(null,"margin","margin",-995903681),"auto"], null);
});})(dims))
).call(null,dims),new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (dims){
return (function (G__31988,G__31989,G__31990){
return G__31988.call(null,G__31989,G__31990);
});})(dims))
).call(null,weathergen.ui.common.get_image,mission,image));
});})(dims))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,dims){
return (function (){
return " ";
});})(con__30287__auto__,dims))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,dims){
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__,dims))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,image);
})());
});
weathergen.ui.common.conform_nonnegative_integer = (function weathergen$ui$common$conform_nonnegative_integer(s){
return javelin.core.formula.call(null,(function (s__$1){
var parsed = weathergen.ui.common.parse_int.call(null,s__$1);
var valid_QMARK_ = (function (){var and__4120__auto__ = parsed;
if(cljs.core.truth_(and__4120__auto__)){
return (!((parsed < (0))));
} else {
return and__4120__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:"Must be whole number, greather than or equal to zero."),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
})).call(null,s);
});
weathergen.ui.common.conform_positive_integer = (function weathergen$ui$common$conform_positive_integer(s){
return javelin.core.formula.call(null,(function (s__$1){
var parsed = weathergen.ui.common.parse_int.call(null,s__$1);
var valid_QMARK_ = (function (){var and__4120__auto__ = parsed;
if(cljs.core.truth_(and__4120__auto__)){
return (parsed > (0));
} else {
return and__4120__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:"Must be an integer greater than zero."),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
})).call(null,s);
});
/**
 * Returns a conformer that will ensure a value parses to an int
 *   between `from` and `to`, inclusive.
 */
weathergen.ui.common.int_conformer = (function weathergen$ui$common$int_conformer(from,to){
var message = goog.string.format("Must be an integer between %d and %d.",from,to);
return ((function (message){
return (function (s){
return javelin.core.formula.call(null,((function (message){
return (function (s__$1){
var parsed = weathergen.ui.common.parse_int.call(null,s__$1);
var valid_QMARK_ = (function (){var and__4120__auto__ = parsed;
if(cljs.core.truth_(and__4120__auto__)){
return (((from <= parsed)) && ((parsed <= to)));
} else {
return and__4120__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:message),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
});})(message))
).call(null,s);
});
;})(message))
});
/**
 * Returns a conformer that will ensure a value parses to a floating
 *   point number between `from` and `to`, inclusive.
 */
weathergen.ui.common.float_conformer = (function weathergen$ui$common$float_conformer(from,to){
var message = goog.string.format("Must be a number between %f and %f.",from,to);
return ((function (message){
return (function (s){
return javelin.core.formula.call(null,((function (message){
return (function (s__$1){
var n = (new Number(s__$1)).valueOf();
var valid_QMARK_ = (((from <= n)) && ((n <= to)));
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),((valid_QMARK_)?null:message),new cljs.core.Keyword(null,"value","value",305978217),(cljs.core.truth_(isNaN(n))?null:n)], null);
});})(message))
).call(null,s);
});
;})(message))
});
weathergen.ui.common.conform_nonnegative_float = (function weathergen$ui$common$conform_nonnegative_float(s){
return javelin.core.formula.call(null,(function (s__$1){
var parsed = weathergen.ui.common.parse_float.call(null,s__$1);
var valid_QMARK_ = (function (){var and__4120__auto__ = parsed;
if(cljs.core.truth_(and__4120__auto__)){
return (!((parsed < (0))));
} else {
return and__4120__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:"Must be a number greater or equal to zero."),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
})).call(null,s);
});
weathergen.ui.common.time_conformer = (function weathergen$ui$common$time_conformer(max_time){
return (function (val){
return javelin.core.formula.call(null,(function (val__$1){
var vec__31991 = cljs.core.re_matches.call(null,/(\d+)\/(\d\d):(\d\d)/,(function (){var or__4131__auto__ = val__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "";
}
})());
var all = cljs.core.nth.call(null,vec__31991,(0),null);
var dd = cljs.core.nth.call(null,vec__31991,(1),null);
var hh = cljs.core.nth.call(null,vec__31991,(2),null);
var mm = cljs.core.nth.call(null,vec__31991,(3),null);
var day = cljs.core.long$.call(null,(new Number(dd)));
var hour = cljs.core.long$.call(null,(new Number(hh)));
var min = cljs.core.long$.call(null,(new Number(mm)));
var valid_QMARK_ = (function (){var and__4120__auto__ = dd;
if(cljs.core.truth_(and__4120__auto__)){
var and__4120__auto____$1 = hh;
if(cljs.core.truth_(and__4120__auto____$1)){
var and__4120__auto____$2 = mm;
if(cljs.core.truth_(and__4120__auto____$2)){
return ((cljs.core.int_QMARK_.call(null,day)) && (cljs.core.int_QMARK_.call(null,hour)) && (cljs.core.int_QMARK_.call(null,min)) && (((((0) <= hour)) && ((hour <= (23))))) && (((((0) <= min)) && ((min <= (59))))));
} else {
return and__4120__auto____$2;
}
} else {
return and__4120__auto____$1;
}
} else {
return and__4120__auto__;
}
})();
var val__$2 = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),day,new cljs.core.Keyword(null,"hour","hour",-555989214),hour,new cljs.core.Keyword(null,"minute","minute",-642875969),min], null);
var over_max_QMARK_ = (function (){var and__4120__auto__ = valid_QMARK_;
if(cljs.core.truth_(and__4120__auto__)){
var and__4120__auto____$1 = max_time;
if(cljs.core.truth_(and__4120__auto____$1)){
return (weathergen.time.campaign_time__GT_minutes.call(null,max_time) < weathergen.time.campaign_time__GT_minutes.call(null,val__$2));
} else {
return and__4120__auto____$1;
}
} else {
return and__4120__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),(function (){var and__4120__auto__ = valid_QMARK_;
if(cljs.core.truth_(and__4120__auto__)){
return cljs.core.not.call(null,over_max_QMARK_);
} else {
return and__4120__auto__;
}
})(),new cljs.core.Keyword(null,"message","message",-406056002),((cljs.core.not.call(null,valid_QMARK_))?"Time must be in the format 'dd/hh:mm'":(cljs.core.truth_(over_max_QMARK_)?["Time cannot be set later than ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.format_time.call(null,max_time))].join(''):null)),new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),day,new cljs.core.Keyword(null,"hour","hour",-555989214),hour,new cljs.core.Keyword(null,"minute","minute",-642875969),min], null)], null);
})).call(null,val);
});
});
/**
 * Given two conformers, returns a conformer that will validate only
 *   if both of them do. Checks c1 first.
 */
weathergen.ui.common.compose_conformers = (function weathergen$ui$common$compose_conformers(c1,c2){
return (function (s){
var p1 = c1.call(null,s);
var p2 = c2.call(null,s);
return javelin.core.formula.call(null,((function (p1,p2){
return (function (p1__$1,p2__$1){
if(cljs.core.truth_(new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(p1__$1))){
return p2__$1;
} else {
return p1__$1;
}
});})(p1,p2))
).call(null,p1,p2);
});
});
/**
 * Draws a grid of flags and checkboxes to pick teams.
 * @param {...*} var_args
 */
weathergen.ui.common.team_selector = (function() { 
var weathergen$ui$common$team_selector__delegate = function (args__30233__auto__){
var vec__31994 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__31994,(0),null);
var _ = cljs.core.nth.call(null,vec__31994,(1),null);
var map__31997 = attrs;
var map__31997__$1 = (((((!((map__31997 == null))))?(((((map__31997.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__31997.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__31997):map__31997);
var selectable_teams = cljs.core.get.call(null,map__31997__$1,new cljs.core.Keyword(null,"selectable-teams","selectable-teams",1104557919));
var mission = cljs.core.get.call(null,map__31997__$1,new cljs.core.Keyword(null,"mission","mission",1740288522));
var selected_teams = cljs.core.get.call(null,map__31997__$1,new cljs.core.Keyword(null,"selected-teams","selected-teams",317107671));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"mission","mission",1740288522),new cljs.core.Keyword(null,"selected-teams","selected-teams",317107671),new cljs.core.Keyword(null,"selectable-teams","selectable-teams",1104557919));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"5px"], null),attrs__$1,hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (G__31999,G__32000){
return G__31999.call(null,G__32000);
});})(map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
).call(null,weathergen.falcon.files.mission.teams,mission),((function (map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (item__30277__auto__){
var vec__32001 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (team){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [team], null);
});})(map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
).call(null,item__30277__auto__));
var team = cljs.core.nth.call(null,vec__32001,(0),null);
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (team__$1){
return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px",new cljs.core.Keyword(null,"padding","padding",1660304693),"3px",new cljs.core.Keyword(null,"border","border",1444987323),["2px solid ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.team_color.call(null,team__$1,new cljs.core.Keyword(null,"dark-text","dark-text",814777253)))].join(''),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"top"], null);
});})(vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
).call(null,team),hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px black"], null),new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (mission__$1,team__$1){
return weathergen.ui.common.get_image.call(null,mission__$1,weathergen.falcon.files.mission.team_flag.call(null,mission__$1,team__$1,new cljs.core.Keyword(null,"big-vert","big-vert",-1944398663)));
});})(vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
).call(null,mission,team)),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (G__32005,G__32004){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),G__32004.call(null,G__32005,new cljs.core.Keyword(null,"dark-text","dark-text",814777253))], null);
});})(vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
).call(null,team,weathergen.ui.common.team_color),javelin.core.formula.call(null,((function (vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (G__32006,G__32007,G__32008){
return G__32006.call(null,G__32007,new cljs.core.Keyword(null,"who","who",-235935040).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"team","team",1355747699).cljs$core$IFn$_invoke$arity$1(G__32008)));
});})(vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
).call(null,weathergen.falcon.files.mission.team_name,mission,team))),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center",new cljs.core.Keyword(null,"height","height",1025178622),"33px"], null),(function (){var val = javelin.core.formula.call(null,((function (vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (G__32009,G__32011,G__32012,G__32010){
return G__32009.call(null,G__32010,G__32011.call(null,G__32012));
});})(vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
).call(null,cljs.core.contains_QMARK_,weathergen.falcon.files.mission.team_number,team,selected_teams);
var enabled_QMARK_ = javelin.core.formula.call(null,((function (val,vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (G__32013,G__32014,G__32015,G__32016){
return G__32013.call(null,G__32014,G__32015.call(null,G__32016));
});})(val,vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
).call(null,cljs.core.contains_QMARK_,selectable_teams,weathergen.falcon.files.mission.team_number,team);
return hoplon.core.input.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),"auto"], null),new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"toggle","toggle",1291842030),enabled_QMARK_,new cljs.core.Keyword(null,"value","value",305978217),val,new cljs.core.Keyword(null,"change","change",-1163046502),((function (val,enabled_QMARK_,vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_){
return (function (){
return cljs.core.swap_BANG_.call(null,selected_teams,cljs.core.comp.call(null,cljs.core.set,(cljs.core.truth_(cljs.core.deref.call(null,val))?cljs.core.disj:cljs.core.conj)),weathergen.falcon.files.mission.team_number.call(null,cljs.core.deref.call(null,team)));
});})(val,enabled_QMARK_,vec__32001,team,map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
);
})()));
});})(map__31997,map__31997__$1,selectable_teams,mission,selected_teams,attrs__$1,vec__31994,attrs,_))
));
};
var weathergen$ui$common$team_selector = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__32017__i = 0, G__32017__a = new Array(arguments.length -  0);
while (G__32017__i < G__32017__a.length) {G__32017__a[G__32017__i] = arguments[G__32017__i + 0]; ++G__32017__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__32017__a,0,null);
} 
return weathergen$ui$common$team_selector__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$team_selector.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$team_selector.cljs$lang$applyTo = (function (arglist__32018){
var args__30233__auto__ = cljs.core.seq(arglist__32018);
return weathergen$ui$common$team_selector__delegate(args__30233__auto__);
});
weathergen$ui$common$team_selector.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$team_selector__delegate;
return weathergen$ui$common$team_selector;
})()
;
/**
 * Draws a grid of flags and checkboxes to pick sides.
 * @param {...*} var_args
 */
weathergen.ui.common.side_selector = (function() { 
var weathergen$ui$common$side_selector__delegate = function (args__30233__auto__){
var vec__32019 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__32019,(0),null);
var _ = cljs.core.nth.call(null,vec__32019,(1),null);
var map__32022 = attrs;
var map__32022__$1 = (((((!((map__32022 == null))))?(((((map__32022.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__32022.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__32022):map__32022);
var selected_sides = cljs.core.get.call(null,map__32022__$1,new cljs.core.Keyword(null,"selected-sides","selected-sides",-922979619));
var mission = cljs.core.get.call(null,map__32022__$1,new cljs.core.Keyword(null,"mission","mission",1740288522));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"mission","mission",1740288522),new cljs.core.Keyword(null,"selected-sides","selected-sides",-922979619));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"5px"], null),attrs__$1,hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (G__32025,G__32024){
return G__32024.call(null,G__32025);
});})(map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
).call(null,mission,weathergen.falcon.files.mission.sides),((function (map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (item__30277__auto__){
var vec__32026 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (side){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [side], null);
});})(map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
).call(null,item__30277__auto__));
var side = cljs.core.nth.call(null,vec__32026,(0),null);
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (side__$1){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px",new cljs.core.Keyword(null,"padding","padding",1660304693),"3px",new cljs.core.Keyword(null,"border","border",1444987323),["2px solid ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.team_color.call(null,side__$1,new cljs.core.Keyword(null,"dark-text","dark-text",814777253)))].join(''),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null);
});})(vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
).call(null,side),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (G__32030,G__32029,G__32031){
return G__32029.call(null,G__32030,G__32031);
});})(vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
).call(null,mission,weathergen.falcon.files.mission.teams_for_side,side),((function (vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (item__30277__auto____$1){
var vec__32032 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (team){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [team], null);
});})(vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
).call(null,item__30277__auto____$1));
var team = cljs.core.nth.call(null,vec__32032,(0),null);
return hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px black",new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"2px"], null),new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (vec__32032,team,vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (mission__$1,team__$1){
return weathergen.ui.common.get_image.call(null,mission__$1,weathergen.falcon.files.mission.team_flag.call(null,mission__$1,team__$1,new cljs.core.Keyword(null,"big-vert","big-vert",-1944398663)));
});})(vec__32032,team,vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
).call(null,mission,team));
});})(vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),weathergen.ui.common.side_label.call(null,new cljs.core.Keyword(null,"mission","mission",1740288522),mission,new cljs.core.Keyword(null,"side","side",389652279),side)),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),(function (){var val = javelin.core.formula.call(null,((function (vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (G__32035,G__32036,G__32037,G__32038){
return G__32035.call(null,G__32036,G__32037.call(null,G__32038));
});})(vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
).call(null,cljs.core.contains_QMARK_,selected_sides,weathergen.falcon.files.mission.team_number,side);
return hoplon.core.input.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),"auto"], null),new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),val,new cljs.core.Keyword(null,"change","change",-1163046502),((function (val,vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_){
return (function (){
return cljs.core.swap_BANG_.call(null,selected_sides,cljs.core.comp.call(null,cljs.core.set,(cljs.core.truth_(cljs.core.deref.call(null,val))?cljs.core.disj:cljs.core.conj)),weathergen.falcon.files.mission.team_number.call(null,cljs.core.deref.call(null,side)));
});})(val,vec__32026,side,map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
);
})()));
});})(map__32022,map__32022__$1,selected_sides,mission,attrs__$1,vec__32019,attrs,_))
));
};
var weathergen$ui$common$side_selector = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__32039__i = 0, G__32039__a = new Array(arguments.length -  0);
while (G__32039__i < G__32039__a.length) {G__32039__a[G__32039__i] = arguments[G__32039__i + 0]; ++G__32039__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__32039__a,0,null);
} 
return weathergen$ui$common$side_selector__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$side_selector.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$side_selector.cljs$lang$applyTo = (function (arglist__32040){
var args__30233__auto__ = cljs.core.seq(arglist__32040);
return weathergen$ui$common$side_selector__delegate(args__30233__auto__);
});
weathergen$ui$common$side_selector.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$side_selector__delegate;
return weathergen$ui$common$side_selector;
})()
;
/**
 * Renders an HTML select. Attrs include :value, a cell or lens
 *   containing the current choice, which will be updated when the choice
 *   changes, and :choices, a vector of maps containing :value and :label
 *   keys.
 * @param {...*} var_args
 */
weathergen.ui.common.dropdown = (function() { 
var weathergen$ui$common$dropdown__delegate = function (args__30233__auto__){
var vec__32042 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__32042,(0),null);
var _ = cljs.core.nth.call(null,vec__32042,(1),null);
var map__32045 = attrs;
var map__32045__$1 = (((((!((map__32045 == null))))?(((((map__32045.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__32045.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__32045):map__32045);
var change = cljs.core.get.call(null,map__32045__$1,new cljs.core.Keyword(null,"change","change",-1163046502));
var value = cljs.core.get.call(null,map__32045__$1,new cljs.core.Keyword(null,"value","value",305978217));
var choices = cljs.core.get.call(null,map__32045__$1,new cljs.core.Keyword(null,"choices","choices",1385611597));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.Keyword(null,"change","change",-1163046502));
var indexed = cljs.core.map_indexed.call(null,((function (map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_){
return (function (i,c){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.str.cljs$core$IFn$_invoke$arity$1(i),cljs.core.assoc.call(null,c,new cljs.core.Keyword("weathergen.ui.common","index","weathergen.ui.common/index",-813327910),cljs.core.str.cljs$core$IFn$_invoke$arity$1(i))], null);
});})(map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_))
,choices);
var by_index = cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,indexed);
var s = hoplon.core.select.call(null);
s.call(null,cljs.core.assoc.call(null,attrs__$1,new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_){
return (function (value__$1){
return new cljs.core.Keyword("weathergen.ui.common","index","weathergen.ui.common/index",-813327910).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,cljs.core.filter.call(null,((function (s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_){
return (function (p1__32041_SHARP_){
return cljs.core._EQ_.call(null,value__$1,new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(p1__32041_SHARP_));
});})(s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_))
,cljs.core.vals.call(null,by_index))));
});})(s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_))
).call(null,value),new cljs.core.Keyword(null,"change","change",-1163046502),((function (s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_){
return (function (v){
var n = new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(by_index.call(null,cljs.core.deref.call(null,v)));
if(cljs.core.truth_(change)){
change.call(null,n);
} else {
}

return cljs.core.reset_BANG_.call(null,value,n);
});})(s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_))
),(function (){var iter__4523__auto__ = ((function (s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_){
return (function weathergen$ui$common$dropdown_$_iter__32047(s__32048){
return (new cljs.core.LazySeq(null,((function (s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_){
return (function (){
var s__32048__$1 = s__32048;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__32048__$1);
if(temp__5720__auto__){
var s__32048__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__32048__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__32048__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__32050 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__32049 = (0);
while(true){
if((i__32049 < size__4522__auto__)){
var vec__32051 = cljs.core._nth.call(null,c__4521__auto__,i__32049);
var index = cljs.core.nth.call(null,vec__32051,(0),null);
var choice = cljs.core.nth.call(null,vec__32051,(1),null);
cljs.core.chunk_append.call(null,b__32050,hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),index,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.formula.call(null,((function (i__32049,vec__32051,index,choice,c__4521__auto__,size__4522__auto__,b__32050,s__32048__$2,temp__5720__auto__,s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_){
return (function (G__32056,G__32054,G__32055){
return G__32054.call(null,G__32055,new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(G__32056));
});})(i__32049,vec__32051,index,choice,c__4521__auto__,size__4522__auto__,b__32050,s__32048__$2,temp__5720__auto__,s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_))
).call(null,choice,cljs.core._EQ_,value),new cljs.core.Keyword(null,"label","label",1718410804).cljs$core$IFn$_invoke$arity$1(choice)));

var G__32063 = (i__32049 + (1));
i__32049 = G__32063;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__32050),weathergen$ui$common$dropdown_$_iter__32047.call(null,cljs.core.chunk_rest.call(null,s__32048__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__32050),null);
}
} else {
var vec__32057 = cljs.core.first.call(null,s__32048__$2);
var index = cljs.core.nth.call(null,vec__32057,(0),null);
var choice = cljs.core.nth.call(null,vec__32057,(1),null);
return cljs.core.cons.call(null,hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),index,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.formula.call(null,((function (vec__32057,index,choice,s__32048__$2,temp__5720__auto__,s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_){
return (function (G__32062,G__32060,G__32061){
return G__32060.call(null,G__32061,new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(G__32062));
});})(vec__32057,index,choice,s__32048__$2,temp__5720__auto__,s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_))
).call(null,choice,cljs.core._EQ_,value),new cljs.core.Keyword(null,"label","label",1718410804).cljs$core$IFn$_invoke$arity$1(choice)),weathergen$ui$common$dropdown_$_iter__32047.call(null,cljs.core.rest.call(null,s__32048__$2)));
}
} else {
return null;
}
break;
}
});})(s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_))
,null,null));
});})(s,indexed,by_index,map__32045,map__32045__$1,change,value,choices,attrs__$1,vec__32042,attrs,_))
;
return iter__4523__auto__.call(null,indexed);
})());

return s;
};
var weathergen$ui$common$dropdown = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__32064__i = 0, G__32064__a = new Array(arguments.length -  0);
while (G__32064__i < G__32064__a.length) {G__32064__a[G__32064__i] = arguments[G__32064__i + 0]; ++G__32064__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__32064__a,0,null);
} 
return weathergen$ui$common$dropdown__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$dropdown.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$dropdown.cljs$lang$applyTo = (function (arglist__32065){
var args__30233__auto__ = cljs.core.seq(arglist__32065);
return weathergen$ui$common$dropdown__delegate(args__30233__auto__);
});
weathergen$ui$common$dropdown.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$dropdown__delegate;
return weathergen$ui$common$dropdown;
})()
;
weathergen.ui.common.register_class_BANG_.call(null,new cljs.core.Keyword("weathergen.ui.common","disabled-radio-button","weathergen.ui.common/disabled-radio-button",1199738259),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),"none",new cljs.core.Keyword(null,"color","color",1011675173),"grey",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"default"], null)], null));
/**
 * Renders a group of HTML radio buttons. Attrs include :value, a cell
 *   or lens containing the current choice, which will be updated when
 *   the choice changes, and :choices, a vector of maps containing :value
 *   and :label keys, and optionally a :disabled? key.
 * @param {...*} var_args
 */
weathergen.ui.common.radio_group = (function() { 
var weathergen$ui$common$radio_group__delegate = function (args__30233__auto__){
var vec__32066 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__32066,(0),null);
var _ = cljs.core.nth.call(null,vec__32066,(1),null);
var map__32069 = attrs;
var map__32069__$1 = (((((!((map__32069 == null))))?(((((map__32069.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__32069.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__32069):map__32069);
var value = cljs.core.get.call(null,map__32069__$1,new cljs.core.Keyword(null,"value","value",305978217));
var choices = cljs.core.get.call(null,map__32069__$1,new cljs.core.Keyword(null,"choices","choices",1385611597));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"choices","choices",1385611597));
var choices_STAR_ = (cljs.core.truth_(javelin.core.cell_QMARK_.call(null,choices))?choices:javelin.core.cell.call(null,choices));
var indexed = javelin.core.formula.call(null,((function (choices_STAR_,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (choices_STAR___$1){
return cljs.core.map_indexed.call(null,((function (choices_STAR_,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (i,c){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.str.cljs$core$IFn$_invoke$arity$1(i),cljs.core.assoc.call(null,c,new cljs.core.Keyword("weathergen.ui.common","index","weathergen.ui.common/index",-813327910),cljs.core.str.cljs$core$IFn$_invoke$arity$1(i))], null);
});})(choices_STAR_,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
,choices_STAR___$1);
});})(choices_STAR_,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
).call(null,choices_STAR_);
var by_index = javelin.core.formula.call(null,((function (choices_STAR_,indexed,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (indexed__$1){
return cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,indexed__$1);
});})(choices_STAR_,indexed,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
).call(null,indexed);
var name = cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null));
return hoplon.core.div.call(null,attrs__$1,hoplon.core.loop_tpl_STAR_.call(null,indexed,((function (choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (item__30277__auto__){
var vec__32071 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (item){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [item], null);
});})(choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
).call(null,item__30277__auto__));
var item = cljs.core.nth.call(null,vec__32071,(0),null);
var vec__32080 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (p__32083){
var vec__32084 = p__32083;
var index = cljs.core.nth.call(null,vec__32084,(0),null);
var choice = cljs.core.nth.call(null,vec__32084,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [choice,index], null);
});})(vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
).call(null,item));
var choice = cljs.core.nth.call(null,vec__32080,(0),null);
var index = cljs.core.nth.call(null,vec__32080,(1),null);
var id = cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null));
return hoplon.core.div.call(null,(function (){var checked_QMARK_ = javelin.core.formula.call(null,((function (id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (value__$1,choice__$1){
var checked_QMARK_ = cljs.core._EQ_.call(null,value__$1,new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(choice__$1));
return checked_QMARK_;
});})(id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
).call(null,value,choice);
var disabled_QMARK_ = javelin.core.formula.call(null,((function (checked_QMARK_,id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (choice__$1){
return new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181).cljs$core$IFn$_invoke$arity$1(choice__$1);
});})(checked_QMARK_,id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
).call(null,choice);
var elem = hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"radio",new cljs.core.Keyword(null,"id","id",-1388402092),id,new cljs.core.Keyword(null,"name","name",1843675177),name,new cljs.core.Keyword(null,"value","value",305978217),index,new cljs.core.Keyword(null,"checked","checked",-50955819),checked_QMARK_,new cljs.core.Keyword(null,"class","class",-2030961996),javelin.core.formula.call(null,((function (checked_QMARK_,disabled_QMARK_,id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (disabled_QMARK___$1){
return cljs.core.PersistentArrayMap.createAsIfByAssoc([weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","disabled-radio-button","weathergen.ui.common/disabled-radio-button",1199738259)),disabled_QMARK___$1]);
});})(checked_QMARK_,disabled_QMARK_,id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
).call(null,disabled_QMARK_),new cljs.core.Keyword(null,"change","change",-1163046502),((function (checked_QMARK_,disabled_QMARK_,id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (e){
return cljs.core.reset_BANG_.call(null,value,new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(cljs.core.get.call(null,cljs.core.deref.call(null,by_index),e.currentTarget.value)));
});})(checked_QMARK_,disabled_QMARK_,id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
);
hoplon.core.do_watch.call(null,checked_QMARK_,((function (elem,checked_QMARK_,disabled_QMARK_,id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (___$1,new_val){
return elem.checked = new_val;
});})(elem,checked_QMARK_,disabled_QMARK_,id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
);

return elem;
})(),hoplon.core.label.call(null,new cljs.core.Keyword(null,"for","for",-1323786319),id,new cljs.core.Keyword(null,"class","class",-2030961996),javelin.core.formula.call(null,((function (id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (choice__$1){
return cljs.core.PersistentArrayMap.createAsIfByAssoc([weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","disabled-radio-button","weathergen.ui.common/disabled-radio-button",1199738259)),new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181).cljs$core$IFn$_invoke$arity$1(choice__$1)]);
});})(id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
).call(null,choice),javelin.core.formula.call(null,((function (id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_){
return (function (G__32087){
return new cljs.core.Keyword(null,"label","label",1718410804).cljs$core$IFn$_invoke$arity$1(G__32087);
});})(id,vec__32080,choice,index,vec__32071,item,choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
).call(null,choice)));
});})(choices_STAR_,indexed,by_index,name,map__32069,map__32069__$1,value,choices,attrs__$1,vec__32066,attrs,_))
));
};
var weathergen$ui$common$radio_group = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__32088__i = 0, G__32088__a = new Array(arguments.length -  0);
while (G__32088__i < G__32088__a.length) {G__32088__a[G__32088__i] = arguments[G__32088__i + 0]; ++G__32088__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__32088__a,0,null);
} 
return weathergen$ui$common$radio_group__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$radio_group.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$radio_group.cljs$lang$applyTo = (function (arglist__32089){
var args__30233__auto__ = cljs.core.seq(arglist__32089);
return weathergen$ui$common$radio_group__delegate(args__30233__auto__);
});
weathergen$ui$common$radio_group.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$radio_group__delegate;
return weathergen$ui$common$radio_group;
})()
;
/**
 * Renders an HTML range input. Synchronizes value with cell `:value`,
 *   which is limited to be between `:min`, and `:max`, inclusive.
 *   `:ticks` is the number of tickmarks shown on the slider. If `:int?`
 *   is true, value will be coerced to an integer.
 * @param {...*} var_args
 */
weathergen.ui.common.slider = (function() { 
var weathergen$ui$common$slider__delegate = function (args__30233__auto__){
var vec__32090 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__32090,(0),null);
var _ = cljs.core.nth.call(null,vec__32090,(1),null);
var map__32093 = attrs;
var map__32093__$1 = (((((!((map__32093 == null))))?(((((map__32093.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__32093.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__32093):map__32093);
var change = cljs.core.get.call(null,map__32093__$1,new cljs.core.Keyword(null,"change","change",-1163046502));
var min = cljs.core.get.call(null,map__32093__$1,new cljs.core.Keyword(null,"min","min",444991522));
var int_QMARK_ = cljs.core.get.call(null,map__32093__$1,new cljs.core.Keyword(null,"int?","int?",159198118));
var value = cljs.core.get.call(null,map__32093__$1,new cljs.core.Keyword(null,"value","value",305978217));
var max = cljs.core.get.call(null,map__32093__$1,new cljs.core.Keyword(null,"max","max",61366548));
var ticks = cljs.core.get.call(null,map__32093__$1,new cljs.core.Keyword(null,"ticks","ticks",-406190313));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"min","min",444991522),new cljs.core.Keyword(null,"max","max",61366548),new cljs.core.Keyword(null,"ticks","ticks",-406190313),new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"int?","int?",159198118),new cljs.core.Keyword(null,"change","change",-1163046502));
var id = cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null));
var coerce = (cljs.core.truth_(int_QMARK_)?cljs.core.long$:cljs.core.identity);
var v = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (id,coerce,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_){
return (function (value__$1){
return cljs.core.long$.call(null,(((value__$1 - min) / (max - min)) * (100)));
});})(id,coerce,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_))
).call(null,value),((function (id,coerce,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_){
return (function (v){
return cljs.core.reset_BANG_.call(null,value,coerce.call(null,(((v / 100.0) * (max - min)) + min)));
});})(id,coerce,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_))
);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(cljs.core.truth_(ticks)?hoplon.core.datalist.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),id,(function (){var iter__4523__auto__ = ((function (id,coerce,v,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_){
return (function weathergen$ui$common$slider_$_iter__32095(s__32096){
return (new cljs.core.LazySeq(null,((function (id,coerce,v,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_){
return (function (){
var s__32096__$1 = s__32096;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__32096__$1);
if(temp__5720__auto__){
var s__32096__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__32096__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__32096__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__32098 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__32097 = (0);
while(true){
if((i__32097 < size__4522__auto__)){
var val = cljs.core._nth.call(null,c__4521__auto__,i__32097);
cljs.core.chunk_append.call(null,b__32098,hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),val));

var G__32099 = (i__32097 + (1));
i__32097 = G__32099;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__32098),weathergen$ui$common$slider_$_iter__32095.call(null,cljs.core.chunk_rest.call(null,s__32096__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__32098),null);
}
} else {
var val = cljs.core.first.call(null,s__32096__$2);
return cljs.core.cons.call(null,hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),val),weathergen$ui$common$slider_$_iter__32095.call(null,cljs.core.rest.call(null,s__32096__$2)));
}
} else {
return null;
}
break;
}
});})(id,coerce,v,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_))
,null,null));
});})(id,coerce,v,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_))
;
return iter__4523__auto__.call(null,cljs.core.range.call(null,(0),(101),((100) / (ticks - (1)))));
})()):null),hoplon.core.input.call(null,cljs.core.merge.call(null,attrs__$1,new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"type","type",1174270348),"range",new cljs.core.Keyword(null,"list","list",765357683),(cljs.core.truth_(ticks)?id:null),new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"max","max",61366548),(100),new cljs.core.Keyword(null,"value","value",305978217),v,new cljs.core.Keyword(null,"input","input",556931961),((function (id,coerce,v,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_){
return (function (e){
var prev = cljs.core.deref.call(null,value);
cljs.core.reset_BANG_.call(null,v,cljs.core.deref.call(null,e));

if(cljs.core.truth_(change)){
return change.call(null,cljs.core.deref.call(null,value),prev);
} else {
return null;
}
});})(id,coerce,v,map__32093,map__32093__$1,change,min,int_QMARK_,value,max,ticks,attrs__$1,vec__32090,attrs,_))
], null)))], null);
};
var weathergen$ui$common$slider = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__32100__i = 0, G__32100__a = new Array(arguments.length -  0);
while (G__32100__i < G__32100__a.length) {G__32100__a[G__32100__i] = arguments[G__32100__i + 0]; ++G__32100__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__32100__a,0,null);
} 
return weathergen$ui$common$slider__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$slider.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$slider.cljs$lang$applyTo = (function (arglist__32101){
var args__30233__auto__ = cljs.core.seq(arglist__32101);
return weathergen$ui$common$slider__delegate(args__30233__auto__);
});
weathergen$ui$common$slider.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$slider__delegate;
return weathergen$ui$common$slider;
})()
;
/**
 * Renders an HTML checkbox.
 * @param {...*} var_args
 */
weathergen.ui.common.checkbox = (function() { 
var weathergen$ui$common$checkbox__delegate = function (args__30233__auto__){
var vec__32102 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__32102,(0),null);
var _ = cljs.core.nth.call(null,vec__32102,(1),null);
var map__32105 = attrs;
var map__32105__$1 = (((((!((map__32105 == null))))?(((((map__32105.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__32105.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__32105):map__32105);
var change = cljs.core.get.call(null,map__32105__$1,new cljs.core.Keyword(null,"change","change",-1163046502));
var value = cljs.core.get.call(null,map__32105__$1,new cljs.core.Keyword(null,"value","value",305978217));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"change","change",-1163046502),new cljs.core.Keyword(null,"value","value",305978217));
var change_STAR_ = (function (){var or__4131__auto__ = change;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return ((function (or__4131__auto__,map__32105,map__32105__$1,change,value,attrs__$1,vec__32102,attrs,_){
return (function (){
return cljs.core.swap_BANG_.call(null,value,cljs.core.not);
});
;})(or__4131__auto__,map__32105,map__32105__$1,change,value,attrs__$1,vec__32102,attrs,_))
}
})();
var change_STAR__STAR_ = ((function (change_STAR_,map__32105,map__32105__$1,change,value,attrs__$1,vec__32102,attrs,_){
return (function (e){
change_STAR_.call(null,e.currentTarget.checked);

e.preventDefault();

return false;
});})(change_STAR_,map__32105,map__32105__$1,change,value,attrs__$1,vec__32102,attrs,_))
;
return hoplon.core.input.call(null,cljs.core.assoc.call(null,attrs__$1,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"change","change",-1163046502),change_STAR__STAR_,new cljs.core.Keyword(null,"value","value",305978217),value));
};
var weathergen$ui$common$checkbox = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__32107__i = 0, G__32107__a = new Array(arguments.length -  0);
while (G__32107__i < G__32107__a.length) {G__32107__a[G__32107__i] = arguments[G__32107__i + 0]; ++G__32107__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__32107__a,0,null);
} 
return weathergen$ui$common$checkbox__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$checkbox.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$checkbox.cljs$lang$applyTo = (function (arglist__32108){
var args__30233__auto__ = cljs.core.seq(arglist__32108);
return weathergen$ui$common$checkbox__delegate(args__30233__auto__);
});
weathergen$ui$common$checkbox.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$checkbox__delegate;
return weathergen$ui$common$checkbox;
})()
;
weathergen.ui.common.ESCAPE_KEY = (27);
weathergen.ui.common.ENTER_KEY = (13);
weathergen.ui.common.UP_ARROW = (38);
weathergen.ui.common.DOWN_ARROW = (40);
/**
 * Renders a control that will provide feedback as to whether the
 *   contents are valid.
 * 
 *   :conform : A function of one argument, a cell containing the current
 *   value of the control. Returns a call whose value is a map with keys
 *   `:valid?`, `:value`, and `:message`, expressing whether the value is
 *   valid, and if not, why not.
 *   :fmt : A function that turns the validated value into a displayable
 *   string
 *   :source: A cell containing the source data for the input control.
 *   :update: A function that will be called with the new, valid value.
 *   Defaults to setting the source cell.
 *   :width: Width in pixels of the input area.
 *   :placeholder: Placeholder when input is empty.
 *   :css: Styling applied to container div.
 *   :align: Specifies text alignment of the input box
 * @param {...*} var_args
 */
weathergen.ui.common.validating_edit = (function() { 
var weathergen$ui$common$validating_edit__delegate = function (args__30233__auto__){
var vec__32111 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__32111,(0),null);
var _ = cljs.core.nth.call(null,vec__32111,(1),null);
var map__32114 = attrs;
var map__32114__$1 = (((((!((map__32114 == null))))?(((((map__32114.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__32114.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__32114):map__32114);
var align = cljs.core.get.call(null,map__32114__$1,new cljs.core.Keyword(null,"align","align",1964212802));
var fmt = cljs.core.get.call(null,map__32114__$1,new cljs.core.Keyword(null,"fmt","fmt",332300772));
var placeholder = cljs.core.get.call(null,map__32114__$1,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083));
var css = cljs.core.get.call(null,map__32114__$1,new cljs.core.Keyword(null,"css","css",1135045163));
var width = cljs.core.get.call(null,map__32114__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var update = cljs.core.get.call(null,map__32114__$1,new cljs.core.Keyword(null,"update","update",1045576396));
var conform = cljs.core.get.call(null,map__32114__$1,new cljs.core.Keyword(null,"conform","conform",1846236460));
var source = cljs.core.get.call(null,map__32114__$1,new cljs.core.Keyword(null,"source","source",-433931539));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"conform","conform",1846236460),new cljs.core.Keyword(null,"fmt","fmt",332300772),new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"update","update",1045576396),new cljs.core.Keyword(null,"width","width",-384071477),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.Keyword(null,"align","align",1964212802));
if(cljs.core.truth_(source)){
} else {
throw (new Error(["Assert failed: ","source is required","\n","source"].join('')));
}

if(cljs.core.truth_(conform)){
} else {
throw (new Error(["Assert failed: ","conform is required","\n","conform"].join('')));
}

var interim = javelin.core.cell.call(null,null);
var fmt__$1 = (function (){var or__4131__auto__ = fmt;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.str;
}
})();
var value = javelin.core.formula.call(null,((function (interim,fmt__$1,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (interim__$1,source__$1){
if(cljs.core.truth_(interim__$1)){
return interim__$1;
} else {
return fmt__$1.call(null,source__$1);
}
});})(interim,fmt__$1,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
).call(null,interim,source);
var parsed = conform.call(null,value);
var update__$1 = (function (){var or__4131__auto__ = update;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return ((function (or__4131__auto__,interim,fmt__$1,value,parsed,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (p1__32109_SHARP_){
return cljs.core.swap_BANG_.call(null,source,cljs.core.constantly.call(null,p1__32109_SHARP_));
});
;})(or__4131__auto__,interim,fmt__$1,value,parsed,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
}
})();
var state = javelin.core.cell.call(null,new cljs.core.Keyword(null,"set","set",304602554));
var focused_QMARK_ = javelin.core.cell.call(null,false);
var align__$1 = javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (G__32116){
return G__32116;
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
).call(null,align);
var valid_QMARK_ = javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (parsed__$1){
return cljs.core.empty_QMARK_.call(null,new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(parsed__$1));
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
).call(null,parsed);
return hoplon.core.div.call(null,attrs__$1,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"overflow","overflow",2058931880),"show",new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap",new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(function (){var or__4131__auto__ = width;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (125);
}
})()),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null),css),(function (){var i = hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),placeholder,new cljs.core.Keyword(null,"input","input",556931961),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (p1__32110_SHARP_){
cljs.core.reset_BANG_.call(null,interim,cljs.core.deref.call(null,p1__32110_SHARP_));

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"editing","editing",1365491601));
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
,new cljs.core.Keyword(null,"change","change",-1163046502),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (){
var p = cljs.core.deref.call(null,parsed);
var temp__5720__auto__ = new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(p);
if(cljs.core.truth_(temp__5720__auto__)){
var v = temp__5720__auto__;
return javelin.core.dosync_STAR_.call(null,((function (v,temp__5720__auto__,p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (){
update__$1.call(null,v);

cljs.core.reset_BANG_.call(null,interim,null);

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"set","set",304602554));
});})(v,temp__5720__auto__,p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
);
} else {
return null;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
,new cljs.core.Keyword(null,"keyup","keyup",-794526927),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (e){
if(cljs.core._EQ_.call(null,weathergen.ui.common.ESCAPE_KEY,e.keyCode)){
return javelin.core.dosync_STAR_.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (){
cljs.core.reset_BANG_.call(null,interim,null);

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"set","set",304602554));
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
);
} else {
return null;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
,new cljs.core.Keyword(null,"focus","focus",234677911),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (){
return cljs.core.reset_BANG_.call(null,focused_QMARK_,true);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
,new cljs.core.Keyword(null,"blur","blur",-453500461),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (){
var p = cljs.core.deref.call(null,parsed);
return javelin.core.dosync_STAR_.call(null,((function (p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (){
cljs.core.reset_BANG_.call(null,focused_QMARK_,false);

var temp__5720__auto__ = new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(p);
if(cljs.core.truth_(temp__5720__auto__)){
var v = temp__5720__auto__;
update__$1.call(null,v);

cljs.core.reset_BANG_.call(null,interim,null);

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"set","set",304602554));
} else {
return null;
}
});})(p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (state__$1,valid_QMARK___$1,align__$2,width__$1){
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"font-style","font-style",-773672352),((cljs.core._EQ_.call(null,state__$1,new cljs.core.Keyword(null,"editing","editing",1365491601)))?"italic":""),new cljs.core.Keyword(null,"color","color",1011675173),(cljs.core.truth_(valid_QMARK___$1)?"":weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"invalid","invalid",412869516))),new cljs.core.Keyword(null,"background","background",-863952629),(cljs.core.truth_(valid_QMARK___$1)?"":weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"invalid-background","invalid-background",-917496690))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,((function (){var or__4131__auto__ = width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (125);
}
})() - (cljs.core.truth_(valid_QMARK___$1)?(0):(20)))),new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),(cljs.core.truth_(valid_QMARK___$1)?null:weathergen.ui.common.px.call(null,(20))),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),(cljs.core.truth_(valid_QMARK___$1)?null:weathergen.ui.common.px.call(null,(-20))),new cljs.core.Keyword(null,"text-align","text-align",1786091845),(cljs.core.truth_(align__$2)?align__$2:null)], null);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
).call(null,state,valid_QMARK_,align__$1,width),new cljs.core.Keyword(null,"value","value",305978217),value);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [i,hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/error.png",new cljs.core.Keyword(null,"title","title",636505583),javelin.core.formula.call(null,((function (i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (G__32117){
return new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(G__32117);
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
).call(null,parsed),new cljs.core.Keyword(null,"click","click",1912301393),((function (i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (){
return (function (){var G__32118 = i;
return G__32118;
})().focus();
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (valid_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"right","right",-452581833),(0),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(14)),new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(2)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),(cljs.core.truth_(valid_QMARK___$1)?"none":null),new cljs.core.Keyword(null,"opacity","opacity",397153780),(cljs.core.truth_(valid_QMARK___$1)?"0":"1")], null);
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
).call(null,valid_QMARK_))], null);
})(),hoplon.core.div.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (G__32121,G__32120,G__32119){
var and__4120__auto__ = G__32119.call(null,G__32120);
if(cljs.core.truth_(and__4120__auto__)){
return G__32121;
} else {
return and__4120__auto__;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
).call(null,focused_QMARK_,valid_QMARK_,cljs.core.not),new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"min-width","min-width",1926193728),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),new cljs.core.Keyword(null,"top","top",-1856271961),new cljs.core.Keyword(null,"background","background",-863952629),new cljs.core.Keyword(null,"max-width","max-width",-1939924051),new cljs.core.Keyword(null,"z-index","z-index",1892827090),new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),new cljs.core.Keyword(null,"position","position",-2011731912),new cljs.core.Keyword(null,"border","border",1444987323)],[weathergen.ui.common.pct.call(null,(100)),weathergen.ui.common.pct.call(null,(75)),weathergen.ui.common.px.call(null,(24)),"rgba(221,221,221,0.95)",weathergen.ui.common.px.call(null,(500)),(1),weathergen.ui.common.px.call(null,(2)),"absolute","1px solid #888"]),javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_){
return (function (G__32122){
return new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(G__32122);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__32114,map__32114__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__32111,attrs,_))
).call(null,parsed)));
};
var weathergen$ui$common$validating_edit = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__32123__i = 0, G__32123__a = new Array(arguments.length -  0);
while (G__32123__i < G__32123__a.length) {G__32123__a[G__32123__i] = arguments[G__32123__i + 0]; ++G__32123__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__32123__a,0,null);
} 
return weathergen$ui$common$validating_edit__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$validating_edit.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$validating_edit.cljs$lang$applyTo = (function (arglist__32124){
var args__30233__auto__ = cljs.core.seq(arglist__32124);
return weathergen$ui$common$validating_edit__delegate(args__30233__auto__);
});
weathergen$ui$common$validating_edit.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$validating_edit__delegate;
return weathergen$ui$common$validating_edit;
})()
;
/**
 * @param {...*} var_args
 */
weathergen.ui.common.time_edit = (function() { 
var weathergen$ui$common$time_edit__delegate = function (args__30233__auto__){
var vec__32125 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__32125,(0),null);
var _ = cljs.core.nth.call(null,vec__32125,(1),null);
var map__32128 = attrs;
var map__32128__$1 = (((((!((map__32128 == null))))?(((((map__32128.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__32128.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__32128):map__32128);
var max_time = cljs.core.get.call(null,map__32128__$1,new cljs.core.Keyword(null,"max-time","max-time",857408479));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"max-time","max-time",857408479));
return weathergen.ui.common.validating_edit.call(null,attrs__$1,new cljs.core.Keyword(null,"width","width",-384071477),(65),new cljs.core.Keyword(null,"fmt","fmt",332300772),weathergen.ui.common.format_time,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"dd/hhmm",new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.time_conformer.call(null,max_time));
};
var weathergen$ui$common$time_edit = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__32130__i = 0, G__32130__a = new Array(arguments.length -  0);
while (G__32130__i < G__32130__a.length) {G__32130__a[G__32130__i] = arguments[G__32130__i + 0]; ++G__32130__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__32130__a,0,null);
} 
return weathergen$ui$common$time_edit__delegate.call(this,args__30233__auto__);};
weathergen$ui$common$time_edit.cljs$lang$maxFixedArity = 0;
weathergen$ui$common$time_edit.cljs$lang$applyTo = (function (arglist__32131){
var args__30233__auto__ = cljs.core.seq(arglist__32131);
return weathergen$ui$common$time_edit__delegate(args__30233__auto__);
});
weathergen$ui$common$time_edit.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$common$time_edit__delegate;
return weathergen$ui$common$time_edit;
})()
;
/**
 * Returns a cell backed by local storage under `key` (a namespaced
 *   key), where, if the `default` contents change, a new cell will be
 *   allocated. This allows changing defaults in the code to overwrite
 *   any stored copies.
 */
weathergen.ui.common.versioned_local_storage = (function weathergen$ui$common$versioned_local_storage(key,default$){
return hoplon.storage_atom.local_storage.call(null,javelin.core.cell.call(null,default$),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(key),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.hash.call(null,default$))].join(''));
});
/**
 * Returns an SVG scale string.
 */
weathergen.ui.common.svg_scale = (function weathergen$ui$common$svg_scale(var_args){
var G__32133 = arguments.length;
switch (G__32133) {
case 1:
return weathergen.ui.common.svg_scale.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return weathergen.ui.common.svg_scale.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));

}
});

weathergen.ui.common.svg_scale.cljs$core$IFn$_invoke$arity$1 = (function (s){
return goog.string.format("scale(%f)",s);
});

weathergen.ui.common.svg_scale.cljs$core$IFn$_invoke$arity$2 = (function (x,y){
return goog.string.format("scale(%f,%f)",x,y);
});

weathergen.ui.common.svg_scale.cljs$lang$maxFixedArity = 2;

/**
 * Returns an SVG translate string.
 */
weathergen.ui.common.svg_translate = (function weathergen$ui$common$svg_translate(x,y){
if(cljs.core.truth_((function (){var and__4120__auto__ = x;
if(cljs.core.truth_(and__4120__auto__)){
return y;
} else {
return and__4120__auto__;
}
})())){
return goog.string.format("translate(%f,%f)",x,y);
} else {
return "";
}
});
/**
 * Returns an SVG rotate string.
 */
weathergen.ui.common.svg_rotate = (function weathergen$ui$common$svg_rotate(deg){
return goog.string.format("rotate(%f)",deg);
});
/**
 * Combines xforms into a single SVG transformation string
 */
weathergen.ui.common.svg_xform_combine = (function weathergen$ui$common$svg_xform_combine(var_args){
var args__4736__auto__ = [];
var len__4730__auto___32136 = arguments.length;
var i__4731__auto___32137 = (0);
while(true){
if((i__4731__auto___32137 < len__4730__auto___32136)){
args__4736__auto__.push((arguments[i__4731__auto___32137]));

var G__32138 = (i__4731__auto___32137 + (1));
i__4731__auto___32137 = G__32138;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((0) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((0)),(0),null)):null);
return weathergen.ui.common.svg_xform_combine.cljs$core$IFn$_invoke$arity$variadic(argseq__4737__auto__);
});

weathergen.ui.common.svg_xform_combine.cljs$core$IFn$_invoke$arity$variadic = (function (xforms){
return clojure.string.join.call(null," ",xforms);
});

weathergen.ui.common.svg_xform_combine.cljs$lang$maxFixedArity = (0);

/** @this {Function} */
weathergen.ui.common.svg_xform_combine.cljs$lang$applyTo = (function (seq32135){
var self__4718__auto__ = this;
return self__4718__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq32135));
});

var interval_value_32139 = 0.45;
var interval_32140 = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(interval_value_32139),"s"].join('');
weathergen.ui.common.register_styles_BANG_.call(null,new cljs.core.Keyword("weathergen.ui.common","animations","weathergen.ui.common/animations",338673555),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [garden.stylesheet.at_keyframes.call(null,weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","pulse-animation","weathergen.ui.common/pulse-animation",-696492175)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"opacity","opacity",397153780),(1)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"opacity","opacity",397153780),(0)], null)], null))], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.ui.common.class_selector_for.call(null,new cljs.core.Keyword("weathergen.ui.common","pulse","weathergen.ui.common/pulse",-535065247)),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"animation-duration","animation-duration",-1261077706),interval_32140,new cljs.core.Keyword(null,"animation-name","animation-name",-302195330),weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","pulse-animation","weathergen.ui.common/pulse-animation",-696492175)),new cljs.core.Keyword(null,"animation-iteration-count","animation-iteration-count",-1410888227),"infinite",new cljs.core.Keyword(null,"animation-timing-function","animation-timing-function",-1186881521),"ease-in-out",new cljs.core.Keyword(null,"animation-direction","animation-direction",-362912441),"alternate",new cljs.core.Keyword(null,"animation-delay","animation-delay",-488570176),interval_32140], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [garden.stylesheet.at_keyframes.call(null,weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","collapse-animation","weathergen.ui.common/collapse-animation",-506320172)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_scale.call(null,(1)),new cljs.core.Keyword(null,"stroke-dashoffset","stroke-dashoffset",-782320340),(0)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_scale.call(null,0.02),new cljs.core.Keyword(null,"stroke-dashoffset","stroke-dashoffset",-782320340),(50)], null)], null))], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.ui.common.class_selector_for.call(null,new cljs.core.Keyword("weathergen.ui.common","collapse","weathergen.ui.common/collapse",-901062267)),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"animation-duration","animation-duration",-1261077706),interval_32140,new cljs.core.Keyword(null,"animation-name","animation-name",-302195330),weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","collapse-animation","weathergen.ui.common/collapse-animation",-506320172)),new cljs.core.Keyword(null,"animation-iteration-count","animation-iteration-count",-1410888227),(1),new cljs.core.Keyword(null,"animation-timing-function","animation-timing-function",-1186881521),"ease-out",new cljs.core.Keyword(null,"animation-direction","animation-direction",-362912441),"normal"], null)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [garden.stylesheet.at_keyframes.call(null,weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","delayed-fade-out-animation","weathergen.ui.common/delayed-fade-out-animation",-813416372)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"opacity","opacity",397153780),0.35], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["80%",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"opacity","opacity",397153780),0.35], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"opacity","opacity",397153780),(0)], null)], null))], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.ui.common.class_selector_for.call(null,new cljs.core.Keyword("weathergen.ui.common","delayed-fade-out","weathergen.ui.common/delayed-fade-out",1307931935)),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"animation-duration","animation-duration",-1261077706),[cljs.core.str.cljs$core$IFn$_invoke$arity$1((interval_value_32139 / 0.8)),"s"].join(''),new cljs.core.Keyword(null,"animation-name","animation-name",-302195330),weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","delayed-fade-out-animation","weathergen.ui.common/delayed-fade-out-animation",-813416372)),new cljs.core.Keyword(null,"animation-iteration-count","animation-iteration-count",-1410888227),(1),new cljs.core.Keyword(null,"animation-timing-function","animation-timing-function",-1186881521),"ease-out",new cljs.core.Keyword(null,"animation-direction","animation-direction",-362912441),"normal"], null)], null)], null));
weathergen.ui.common.pulse_class = weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","pulse","weathergen.ui.common/pulse",-535065247));
weathergen.ui.common.collapse_class = weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","collapse","weathergen.ui.common/collapse",-901062267));
weathergen.ui.common.delayed_fade_out_class = weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.common","delayed-fade-out","weathergen.ui.common/delayed-fade-out",1307931935));
/**
 * Renders a heading - white text on a black background
 */
weathergen.ui.common.heading = (function weathergen$ui$common$heading(var_args){
var G__32142 = arguments.length;
switch (G__32142) {
case 1:
return weathergen.ui.common.heading.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return weathergen.ui.common.heading.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));

}
});

weathergen.ui.common.heading.cljs$core$IFn$_invoke$arity$1 = (function (content){
return weathergen.ui.common.heading.call(null,cljs.core.PersistentArrayMap.EMPTY,content);
});

weathergen.ui.common.heading.cljs$core$IFn$_invoke$arity$2 = (function (p__32143,content){
var map__32144 = p__32143;
var map__32144__$1 = (((((!((map__32144 == null))))?(((((map__32144.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__32144.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__32144):map__32144);
var margin_top = cljs.core.get.call(null,map__32144__$1,new cljs.core.Keyword(null,"margin-top","margin-top",392161226));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"background","background",-863952629),"black",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),weathergen.ui.common.px.call(null,(function (){var or__4131__auto__ = margin_top;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (15);
}
})()),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(2))], null),content);
});

weathergen.ui.common.heading.cljs$lang$maxFixedArity = 2;

/**
 * Returns a lens over a `get-in` style path `p` into cell `c`. Path `p`
 *   can be a cell.
 */
weathergen.ui.common.path_lens = (function weathergen$ui$common$path_lens(c,p){
return javelin.core.lens.call(null,javelin.core.formula.call(null,(function (c__$1,p__$1){
return cljs.core.get_in.call(null,c__$1,p__$1);
})).call(null,c,p),(function (v){
return cljs.core.swap_BANG_.call(null,c,cljs.core.assoc_in,(cljs.core.truth_(javelin.core.cell_QMARK_.call(null,p))?cljs.core.deref.call(null,p):p),v);
}));
});
/**
 * Returns a lens over item at key `k` in map `m`, where both `m` and
 *   `k` are cells.
 */
weathergen.ui.common.map_lens = (function weathergen$ui$common$map_lens(m,k){
return javelin.core.lens.call(null,javelin.core.formula.call(null,(function (m__$1,k__$1){
return cljs.core.get.call(null,m__$1,k__$1);
})).call(null,m,k),(function (v){
return cljs.core.swap_BANG_.call(null,m,cljs.core.assoc,cljs.core.deref.call(null,k),v);
}));
});
/**
 * Returns a lens over cell `c` where the value of the lens is `(f c)`
 *   and the inverse of `f`. `f'` most be the inverse of `f`.
 */
weathergen.ui.common.xform_lens = (function weathergen$ui$common$xform_lens(c,f,f_SINGLEQUOTE_){
return javelin.core.lens.call(null,javelin.core.formula.call(null,(function (c__$1){
return f.call(null,c__$1);
})).call(null,c),(function (v){
return cljs.core.reset_BANG_.call(null,c,f_SINGLEQUOTE_.call(null,v));
}));
});
/**
 * Returns a lens that is the logical inverse of `c`.
 */
weathergen.ui.common.not_lens = (function weathergen$ui$common$not_lens(c){
return weathergen.ui.common.xform_lens.call(null,c,cljs.core.not,cljs.core.not);
});
/**
 * Like Hoplon's `loop-tpl*` but accepts a `key-fn` which, given an item
 *   returns an (immutable) key under which to cache it. `tpl` is passed
 *   a cell containing a value from `items` and its (non-cell) id.
 */
weathergen.ui.common.keyed_loop_tpl_STAR_ = (function weathergen$ui$common$keyed_loop_tpl_STAR_(items,key_fn,tpl){
var kindex = javelin.core.formula.call(null,(function (items__$1){
var ks = cljs.core.mapv.call(null,key_fn,items__$1);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"keys","keys",1068423698),ks,new cljs.core.Keyword(null,"item-map","item-map",677069923),cljs.core.zipmap.call(null,ks,items__$1)], null);
})).call(null,items);
var priors = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var ui_cache = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var current = javelin.core.cell.call(null,cljs.core.PersistentVector.EMPTY);
hoplon.core.do_watch.call(null,kindex,((function (current,kindex,priors,ui_cache){
return (function (o,n){
var old_keys = cljs.core.set.call(null,new cljs.core.Keyword(null,"keys","keys",1068423698).cljs$core$IFn$_invoke$arity$1(o));
var new_keys = cljs.core.set.call(null,new cljs.core.Keyword(null,"keys","keys",1068423698).cljs$core$IFn$_invoke$arity$1(n));
var gone_keys = clojure.set.difference.call(null,old_keys,new_keys);
var added_keys = clojure.set.difference.call(null,new_keys,old_keys,cljs.core.set.call(null,cljs.core.keys.call(null,cljs.core.deref.call(null,ui_cache))));
if(cljs.core.not_EQ_.call(null,new cljs.core.Keyword(null,"keys","keys",1068423698).cljs$core$IFn$_invoke$arity$1(o),new cljs.core.Keyword(null,"keys","keys",1068423698).cljs$core$IFn$_invoke$arity$1(n))){
var seq__32147_32159 = cljs.core.seq.call(null,gone_keys);
var chunk__32148_32160 = null;
var count__32149_32161 = (0);
var i__32150_32162 = (0);
while(true){
if((i__32150_32162 < count__32149_32161)){
var k_32163 = cljs.core._nth.call(null,chunk__32148_32160,i__32150_32162);
cljs.core.swap_BANG_.call(null,priors,cljs.core.assoc,k_32163,cljs.core.get_in.call(null,o,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"item-map","item-map",677069923),k_32163], null)));


var G__32164 = seq__32147_32159;
var G__32165 = chunk__32148_32160;
var G__32166 = count__32149_32161;
var G__32167 = (i__32150_32162 + (1));
seq__32147_32159 = G__32164;
chunk__32148_32160 = G__32165;
count__32149_32161 = G__32166;
i__32150_32162 = G__32167;
continue;
} else {
var temp__5720__auto___32168 = cljs.core.seq.call(null,seq__32147_32159);
if(temp__5720__auto___32168){
var seq__32147_32169__$1 = temp__5720__auto___32168;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__32147_32169__$1)){
var c__4550__auto___32170 = cljs.core.chunk_first.call(null,seq__32147_32169__$1);
var G__32171 = cljs.core.chunk_rest.call(null,seq__32147_32169__$1);
var G__32172 = c__4550__auto___32170;
var G__32173 = cljs.core.count.call(null,c__4550__auto___32170);
var G__32174 = (0);
seq__32147_32159 = G__32171;
chunk__32148_32160 = G__32172;
count__32149_32161 = G__32173;
i__32150_32162 = G__32174;
continue;
} else {
var k_32175 = cljs.core.first.call(null,seq__32147_32169__$1);
cljs.core.swap_BANG_.call(null,priors,cljs.core.assoc,k_32175,cljs.core.get_in.call(null,o,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"item-map","item-map",677069923),k_32175], null)));


var G__32176 = cljs.core.next.call(null,seq__32147_32169__$1);
var G__32177 = null;
var G__32178 = (0);
var G__32179 = (0);
seq__32147_32159 = G__32176;
chunk__32148_32160 = G__32177;
count__32149_32161 = G__32178;
i__32150_32162 = G__32179;
continue;
}
} else {
}
}
break;
}

return cljs.core.reset_BANG_.call(null,current,(function (){var frag = document.createDocumentFragment();
var seq__32151_32180 = cljs.core.seq.call(null,added_keys);
var chunk__32152_32181 = null;
var count__32153_32182 = (0);
var i__32154_32183 = (0);
while(true){
if((i__32154_32183 < count__32153_32182)){
var k_32184 = cljs.core._nth.call(null,chunk__32152_32181,i__32154_32183);
cljs.core.swap_BANG_.call(null,ui_cache,cljs.core.assoc,k_32184,tpl.call(null,javelin.core.formula.call(null,((function (seq__32151_32180,chunk__32152_32181,count__32153_32182,i__32154_32183,k_32184,frag,old_keys,new_keys,gone_keys,added_keys,current,kindex,priors,ui_cache){
return (function (kindex__$1){
return cljs.core.get_in.call(null,kindex__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"item-map","item-map",677069923),k_32184], null),cljs.core.get.call(null,cljs.core.deref.call(null,priors),k_32184));
});})(seq__32151_32180,chunk__32152_32181,count__32153_32182,i__32154_32183,k_32184,frag,old_keys,new_keys,gone_keys,added_keys,current,kindex,priors,ui_cache))
).call(null,kindex),k_32184));


var G__32185 = seq__32151_32180;
var G__32186 = chunk__32152_32181;
var G__32187 = count__32153_32182;
var G__32188 = (i__32154_32183 + (1));
seq__32151_32180 = G__32185;
chunk__32152_32181 = G__32186;
count__32153_32182 = G__32187;
i__32154_32183 = G__32188;
continue;
} else {
var temp__5720__auto___32189 = cljs.core.seq.call(null,seq__32151_32180);
if(temp__5720__auto___32189){
var seq__32151_32190__$1 = temp__5720__auto___32189;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__32151_32190__$1)){
var c__4550__auto___32191 = cljs.core.chunk_first.call(null,seq__32151_32190__$1);
var G__32192 = cljs.core.chunk_rest.call(null,seq__32151_32190__$1);
var G__32193 = c__4550__auto___32191;
var G__32194 = cljs.core.count.call(null,c__4550__auto___32191);
var G__32195 = (0);
seq__32151_32180 = G__32192;
chunk__32152_32181 = G__32193;
count__32153_32182 = G__32194;
i__32154_32183 = G__32195;
continue;
} else {
var k_32196 = cljs.core.first.call(null,seq__32151_32190__$1);
cljs.core.swap_BANG_.call(null,ui_cache,cljs.core.assoc,k_32196,tpl.call(null,javelin.core.formula.call(null,((function (seq__32151_32180,chunk__32152_32181,count__32153_32182,i__32154_32183,k_32196,seq__32151_32190__$1,temp__5720__auto___32189,frag,old_keys,new_keys,gone_keys,added_keys,current,kindex,priors,ui_cache){
return (function (kindex__$1){
return cljs.core.get_in.call(null,kindex__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"item-map","item-map",677069923),k_32196], null),cljs.core.get.call(null,cljs.core.deref.call(null,priors),k_32196));
});})(seq__32151_32180,chunk__32152_32181,count__32153_32182,i__32154_32183,k_32196,seq__32151_32190__$1,temp__5720__auto___32189,frag,old_keys,new_keys,gone_keys,added_keys,current,kindex,priors,ui_cache))
).call(null,kindex),k_32196));


var G__32197 = cljs.core.next.call(null,seq__32151_32190__$1);
var G__32198 = null;
var G__32199 = (0);
var G__32200 = (0);
seq__32151_32180 = G__32197;
chunk__32152_32181 = G__32198;
count__32153_32182 = G__32199;
i__32154_32183 = G__32200;
continue;
}
} else {
}
}
break;
}

var seq__32155_32201 = cljs.core.seq.call(null,new cljs.core.Keyword(null,"keys","keys",1068423698).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,kindex)));
var chunk__32156_32202 = null;
var count__32157_32203 = (0);
var i__32158_32204 = (0);
while(true){
if((i__32158_32204 < count__32157_32203)){
var k_32205 = cljs.core._nth.call(null,chunk__32156_32202,i__32158_32204);
var v_32206 = cljs.core.get.call(null,cljs.core.deref.call(null,ui_cache),k_32205);
if((v_32206 == null)){
console.warn("keyed-loop-tpl*: not appending nil node",k_32205,v_32206);
} else {
if((!((v_32206 instanceof Node)))){
console.error("keyed-loop-tpl*: trying to append non-node",k_32205,v_32206);
} else {
goog.dom.appendChild(frag,v_32206);

}
}


var G__32207 = seq__32155_32201;
var G__32208 = chunk__32156_32202;
var G__32209 = count__32157_32203;
var G__32210 = (i__32158_32204 + (1));
seq__32155_32201 = G__32207;
chunk__32156_32202 = G__32208;
count__32157_32203 = G__32209;
i__32158_32204 = G__32210;
continue;
} else {
var temp__5720__auto___32211 = cljs.core.seq.call(null,seq__32155_32201);
if(temp__5720__auto___32211){
var seq__32155_32212__$1 = temp__5720__auto___32211;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__32155_32212__$1)){
var c__4550__auto___32213 = cljs.core.chunk_first.call(null,seq__32155_32212__$1);
var G__32214 = cljs.core.chunk_rest.call(null,seq__32155_32212__$1);
var G__32215 = c__4550__auto___32213;
var G__32216 = cljs.core.count.call(null,c__4550__auto___32213);
var G__32217 = (0);
seq__32155_32201 = G__32214;
chunk__32156_32202 = G__32215;
count__32157_32203 = G__32216;
i__32158_32204 = G__32217;
continue;
} else {
var k_32218 = cljs.core.first.call(null,seq__32155_32212__$1);
var v_32219 = cljs.core.get.call(null,cljs.core.deref.call(null,ui_cache),k_32218);
if((v_32219 == null)){
console.warn("keyed-loop-tpl*: not appending nil node",k_32218,v_32219);
} else {
if((!((v_32219 instanceof Node)))){
console.error("keyed-loop-tpl*: trying to append non-node",k_32218,v_32219);
} else {
goog.dom.appendChild(frag,v_32219);

}
}


var G__32220 = cljs.core.next.call(null,seq__32155_32212__$1);
var G__32221 = null;
var G__32222 = (0);
var G__32223 = (0);
seq__32155_32201 = G__32220;
chunk__32156_32202 = G__32221;
count__32157_32203 = G__32222;
i__32158_32204 = G__32223;
continue;
}
} else {
}
}
break;
}

return frag;
})());
} else {
return null;
}
});})(current,kindex,priors,ui_cache))
);

return current;
});
