// Compiled by ClojureScript 1.10.520 {}
goog.provide('weathergen.ui');
goog.require('cljs.core');
goog.require('hoplon.jquery');
goog.require('clojure.data');
goog.require('cljs.pprint');
goog.require('clojure.set');
goog.require('clojure.string');
goog.require('garden.core');
goog.require('javelin.core');
goog.require('hoplon.core');
goog.require('hoplon.svg');
goog.require('garden.selectors');
goog.require('goog.dom');
goog.require('goog.crypt.base64');
goog.require('goog.events');
goog.require('goog.events.MouseWheelHandler');
goog.require('goog.string');
goog.require('goog.string.format');
goog.require('goog.style');
goog.require('octet.core');
goog.require('vmt.fmap');
goog.require('vmt.clouds');
goog.require('weathergen.canvas');
goog.require('weathergen.compression');
goog.require('weathergen.coordinates');
goog.require('weathergen.damage');
goog.require('weathergen.database');
goog.require('weathergen.dtc');
goog.require('weathergen.encoding');
goog.require('weathergen.falcon.constants');
goog.require('weathergen.falcon.files.images');
goog.require('weathergen.falcon.files.mission');
goog.require('weathergen.falcon.install');
goog.require('weathergen.filesystem');
goog.require('weathergen.fmap');
goog.require('weathergen.help');
goog.require('weathergen.ipc');
goog.require('weathergen.math');
goog.require('weathergen.model');
goog.require('weathergen.progress');
goog.require('weathergen.settings');
goog.require('weathergen.time');
goog.require('weathergen.twx');
goog.require('weathergen.ui.buttons');
goog.require('weathergen.ui.common');
goog.require('weathergen.ui.grids');
goog.require('weathergen.ui.layers.acmi');
goog.require('weathergen.ui.layers.annotations');
goog.require('weathergen.ui.layers.flights');
goog.require('weathergen.ui.select');
goog.require('weathergen.ui.trees');
goog.require('weathergen.ui.tabs');
goog.require('weathergen.util');
goog.require('weathergen.wind');
goog.require('cljs.core.async');
goog.require('cljs.reader');
goog.require('taoensso.timbre');
weathergen.ui.revision = (8);
weathergen.ui.agents = (function (){var is_agent_QMARK_ = (function (agent){
return (!((navigator.userAgent.indexOf(agent) < (0))));
});
var agent_props = new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"chrome","chrome",1718738387),"Chrome",new cljs.core.Keyword(null,"msie","msie",719469183),"MSIE",new cljs.core.Keyword(null,"trident","trident",1372708537),"Trident",new cljs.core.Keyword(null,"firefox","firefox",1283768880),"Firefox",new cljs.core.Keyword(null,"safari","safari",497115653),"Safari",new cljs.core.Keyword(null,"opera","opera",658572996),"op"], null);
return cljs.core.zipmap.call(null,cljs.core.keys.call(null,agent_props),cljs.core.map.call(null,is_agent_QMARK_,cljs.core.vals.call(null,agent_props)));
})();
weathergen.ui.safari_QMARK_ = (function (){var and__4120__auto__ = new cljs.core.Keyword(null,"safari","safari",497115653).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
if(cljs.core.truth_(and__4120__auto__)){
return cljs.core.not.call(null,new cljs.core.Keyword(null,"chrome","chrome",1718738387).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents));
} else {
return and__4120__auto__;
}
})();
weathergen.ui.ie_QMARK_ = (function (){var or__4131__auto__ = new cljs.core.Keyword(null,"msie","msie",719469183).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return new cljs.core.Keyword(null,"trident","trident",1372708537).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
}
})();
weathergen.ui.electron = require("electron");
document.addEventListener("click",(function (event){
if(cljs.core.truth_((function (){var and__4120__auto__ = cljs.core._EQ_.call(null,event.target.tagName,"A");
if(and__4120__auto__){
return event.target.href.startsWith("http");
} else {
return and__4120__auto__;
}
})())){
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui",null,147,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, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Clicked a link",event.target.href], null);
}),null)),null,-1985938396);

event.preventDefault();

return weathergen.ui.electron.shell.openExternal(event.target.href);
} else {
return null;
}
}));
weathergen.ui.ipcRenderer = weathergen.ui.electron.ipcRenderer;
var window_40640 = jQuery(window);
weathergen.ui.window_size = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [window_40640.width(),window_40640.height()], null));

window_40640.resize(((function (window_40640){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.window_size,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [window_40640.width(),window_40640.height()], null));
});})(window_40640))
);
weathergen.ui.towering_thresholds = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"none","none",1333468478),(0),new cljs.core.Keyword(null,"rare","rare",2097092605),0.3,new cljs.core.Keyword(null,"some","some",-1951079573),0.4,new cljs.core.Keyword(null,"common","common",-1822281391),0.5,new cljs.core.Keyword(null,"frequent","frequent",-611072590),0.6,new cljs.core.Keyword(null,"prevalent","prevalent",1008099287),0.7,new cljs.core.Keyword(null,"always","always",-1772028770),(1)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"none","none",1333468478),(0),new cljs.core.Keyword(null,"rare","rare",2097092605),0.2,new cljs.core.Keyword(null,"some","some",-1951079573),0.25,new cljs.core.Keyword(null,"common","common",-1822281391),0.4,new cljs.core.Keyword(null,"frequent","frequent",-611072590),0.45,new cljs.core.Keyword(null,"prevalent","prevalent",1008099287),0.5,new cljs.core.Keyword(null,"always","always",-1772028770),(1)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"none","none",1333468478),(0),new cljs.core.Keyword(null,"rare","rare",2097092605),0.07,new cljs.core.Keyword(null,"some","some",-1951079573),0.1,new cljs.core.Keyword(null,"common","common",-1822281391),0.2,new cljs.core.Keyword(null,"frequent","frequent",-611072590),0.35,new cljs.core.Keyword(null,"prevalent","prevalent",1008099287),0.45,new cljs.core.Keyword(null,"always","always",-1772028770),(1)], null)], null);
weathergen.ui.towering_threshold_names = new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"none","none",1333468478),"None"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"rare","rare",2097092605),"Rare"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"some","some",-1951079573),"Some"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"common","common",-1822281391),"Common"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"frequent","frequent",-611072590),"Frequent"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"prevalent","prevalent",1008099287),"Prevalent"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"always","always",-1772028770),"Always"], null)], null);
weathergen.ui.default_weather_params = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"temp-uniformity","temp-uniformity",836756864),new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"evolution","evolution",944820557),new cljs.core.Keyword(null,"seed","seed",68613327),new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),new cljs.core.Keyword(null,"feature-size","feature-size",-878734864),new cljs.core.Keyword(null,"cell-count","cell-count",-441457582),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.Keyword(null,"turbulence","turbulence",-915506410),new cljs.core.Keyword(null,"origin","origin",1037372088),new cljs.core.Keyword(null,"wind-uniformity","wind-uniformity",827531801),new cljs.core.Keyword(null,"crossfade","crossfade",-118506406),new cljs.core.Keyword(null,"prevailing-wind","prevailing-wind",-190580386)],[0.7,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"min","min",444991522),(28),new cljs.core.Keyword(null,"max","max",61366548),(31),new cljs.core.Keyword(null,"variance","variance",1132010827),1.2,new cljs.core.Keyword(null,"speed","speed",1257663751),(100)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"offset","offset",296498311),(1234),new cljs.core.Keyword(null,"current","current",-1088038603),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(5),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null),new cljs.core.Keyword(null,"max","max",61366548),null], null),(3600),(1234),cljs.core.PersistentHashMap.fromArrays([(12000),(18000),(3000),(9000),(40000),(30000),(24000),(50000),(6000)],[new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(8),new cljs.core.Keyword(null,"to","to",192099007),(12)], null),new cljs.core.Keyword(null,"bias","bias",-315297926),0.4], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(11),new cljs.core.Keyword(null,"to","to",192099007),(13)], null),new cljs.core.Keyword(null,"bias","bias",-315297926),0.5], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(2),new cljs.core.Keyword(null,"to","to",192099007),(3)], null),new cljs.core.Keyword(null,"bias","bias",-315297926),0.1], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(7),new cljs.core.Keyword(null,"to","to",192099007),(9)], null),new cljs.core.Keyword(null,"bias","bias",-315297926),0.3], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(18),new cljs.core.Keyword(null,"to","to",192099007),(22)], null),new cljs.core.Keyword(null,"bias","bias",-315297926),0.8], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(16),new cljs.core.Keyword(null,"to","to",192099007),(18)], null),new cljs.core.Keyword(null,"bias","bias",-315297926),0.7], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(13),new cljs.core.Keyword(null,"to","to",192099007),(17)], null),new cljs.core.Keyword(null,"bias","bias",-315297926),0.6], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(20),new cljs.core.Keyword(null,"to","to",192099007),(25)], null),new cljs.core.Keyword(null,"bias","bias",-315297926),0.9], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(4),new cljs.core.Keyword(null,"to","to",192099007),(6)], null),new cljs.core.Keyword(null,"bias","bias",-315297926),0.2], null)]),(10),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(59),(59)], null),cljs.core.PersistentVector.EMPTY,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"weight","weight",-1262796205),(50),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(5),new cljs.core.Keyword(null,"mean","mean",-1359234715),(10),new cljs.core.Keyword(null,"max","max",61366548),(30)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(20),new cljs.core.Keyword(null,"mean","mean",-1359234715),(22),new cljs.core.Keyword(null,"max","max",61366548),(24)], null),new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(24),new cljs.core.Keyword(null,"to","to",192099007),(48)], null)], null),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"weight","weight",-1262796205),(50),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"mean","mean",-1359234715),(7),new cljs.core.Keyword(null,"max","max",61366548),(20)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(18),new cljs.core.Keyword(null,"mean","mean",-1359234715),(21),new cljs.core.Keyword(null,"max","max",61366548),(23)], null),new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(16),new cljs.core.Keyword(null,"to","to",192099007),(48)], null),new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(3000),new cljs.core.Keyword(null,"to","to",192099007),(10000)], null),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(0),new cljs.core.Keyword(null,"to","to",192099007),(5)], null),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"few","few",941665998),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"broken","broken",-1742446874)], null),new cljs.core.Keyword(null,"towering","towering",-44547353),0.4], null)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"weight","weight",-1262796205),(50),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(10),new cljs.core.Keyword(null,"mean","mean",-1359234715),(15),new cljs.core.Keyword(null,"max","max",61366548),(30)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(15),new cljs.core.Keyword(null,"mean","mean",-1359234715),(18),new cljs.core.Keyword(null,"max","max",61366548),(21)], null),new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(8),new cljs.core.Keyword(null,"to","to",192099007),(16)], null),new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(0),new cljs.core.Keyword(null,"to","to",192099007),(10000)], null),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(0),new cljs.core.Keyword(null,"to","to",192099007),(5)], null),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"overcast","overcast",-2096313755)], null),new cljs.core.Keyword(null,"towering","towering",-44547353),0.4], null)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"weight","weight",-1262796205),(50),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(15),new cljs.core.Keyword(null,"mean","mean",-1359234715),(25),new cljs.core.Keyword(null,"max","max",61366548),(60)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(12),new cljs.core.Keyword(null,"mean","mean",-1359234715),(14),new cljs.core.Keyword(null,"max","max",61366548),(16)], null),new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(3),new cljs.core.Keyword(null,"to","to",192099007),(11)], null),new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(0),new cljs.core.Keyword(null,"to","to",192099007),(10000)], null),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),(0),new cljs.core.Keyword(null,"to","to",192099007),(5)], null),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"overcast","overcast",-2096313755)], null),new cljs.core.Keyword(null,"towering","towering",-44547353),0.35], null)], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(1),new cljs.core.Keyword(null,"power","power",-937852079),(250)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1000),(1000)], null),0.7,0.1,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"heading","heading",-1312171873),(325)], null)]);
weathergen.ui.weather_params = javelin.core.cell.call(null,null);
weathergen.ui.random_int = (function weathergen$ui$random_int(var_args){
var G__40642 = arguments.length;
switch (G__40642) {
case 2:
return weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return weathergen.ui.random_int.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.random_int.cljs$core$IFn$_invoke$arity$2 = (function (from,to){
return weathergen.ui.random_int.call(null,from,to,(1));
});

weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$3 = (function (from,to,step){
var range = (to - from);
var steps = (cljs.core.long$.call(null,(range / step)) + (1));
return ((cljs.core.long$.call(null,(cljs.core.rand.call(null) * steps)) * step) + from);
});

weathergen.ui.random_int.cljs$lang$maxFixedArity = 3;

weathergen.ui.random_atmosphere_params = (function weathergen$ui$random_atmosphere_params(){
var vec__40646 = cljs.core.sort.call(null,cljs.core.map.call(null,(function (p1__40644_SHARP_){
return (p1__40644_SHARP_ / (10));
}),cljs.core.repeatedly.call(null,(4),(function (){
return weathergen.ui.random_int.call(null,(0),(600));
}))));
var vis_i = cljs.core.nth.call(null,vec__40646,(0),null);
var vis_p = cljs.core.nth.call(null,vec__40646,(1),null);
var vis_f = cljs.core.nth.call(null,vec__40646,(2),null);
var vis_s = cljs.core.nth.call(null,vec__40646,(3),null);
var vec__40649 = cljs.core.sort.call(null,cljs.core.map.call(null,((function (vec__40646,vis_i,vis_p,vis_f,vis_s){
return (function (p1__40645_SHARP_){
return (p1__40645_SHARP_ / (10));
});})(vec__40646,vis_i,vis_p,vis_f,vis_s))
,cljs.core.repeatedly.call(null,(4),((function (vec__40646,vis_i,vis_p,vis_f,vis_s){
return (function (){
return weathergen.ui.random_int.call(null,(1),(150));
});})(vec__40646,vis_i,vis_p,vis_f,vis_s))
)));
var visd_s = cljs.core.nth.call(null,vec__40649,(0),null);
var visd_f = cljs.core.nth.call(null,vec__40649,(1),null);
var visd_p = cljs.core.nth.call(null,vec__40649,(2),null);
var visd_i = cljs.core.nth.call(null,vec__40649,(3),null);
var vec__40652 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(6),((function (vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i){
return (function (){
return weathergen.ui.random_int.call(null,(0),(10000),(100));
});})(vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i))
));
var base_i_from = cljs.core.nth.call(null,vec__40652,(0),null);
var base_p_from = cljs.core.nth.call(null,vec__40652,(1),null);
var base_f_from = cljs.core.nth.call(null,vec__40652,(2),null);
var base_i_to = cljs.core.nth.call(null,vec__40652,(3),null);
var base_p_to = cljs.core.nth.call(null,vec__40652,(4),null);
var base_f_to = cljs.core.nth.call(null,vec__40652,(5),null);
var vec__40655 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(2),((function (vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to){
return (function (){
return (cljs.core.rand.call(null) * (5));
});})(vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to))
));
var size_i_from = cljs.core.nth.call(null,vec__40655,(0),null);
var size_i_to = cljs.core.nth.call(null,vec__40655,(1),null);
var vec__40658 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(2),((function (vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to){
return (function (){
return (cljs.core.rand.call(null) * (5));
});})(vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to))
));
var size_p_from = cljs.core.nth.call(null,vec__40658,(0),null);
var size_p_to = cljs.core.nth.call(null,vec__40658,(1),null);
var vec__40661 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(2),((function (vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to,vec__40658,size_p_from,size_p_to){
return (function (){
return (cljs.core.rand.call(null) * (5));
});})(vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to,vec__40658,size_p_from,size_p_to))
));
var size_f_from = cljs.core.nth.call(null,vec__40661,(0),null);
var size_f_to = cljs.core.nth.call(null,vec__40661,(1),null);
var coverages = new cljs.core.PersistentArrayMap(null, 4, [(1),new cljs.core.Keyword(null,"few","few",941665998),(2),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),(3),new cljs.core.Keyword(null,"broken","broken",-1742446874),(4),new cljs.core.Keyword(null,"overcast","overcast",-2096313755)], null);
var vec__40664 = cljs.core.map.call(null,coverages,cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(2),((function (vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to,vec__40658,size_p_from,size_p_to,vec__40661,size_f_from,size_f_to,coverages){
return (function (){
return weathergen.ui.random_int.call(null,(3),(4));
});})(vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to,vec__40658,size_p_from,size_p_to,vec__40661,size_f_from,size_f_to,coverages))
)));
var cover_i_from = cljs.core.nth.call(null,vec__40664,(0),null);
var cover_i_to = cljs.core.nth.call(null,vec__40664,(1),null);
var vec__40667 = cljs.core.map.call(null,coverages,cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(2),((function (vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to,vec__40658,size_p_from,size_p_to,vec__40661,size_f_from,size_f_to,coverages,vec__40664,cover_i_from,cover_i_to){
return (function (){
return weathergen.ui.random_int.call(null,(3),(4));
});})(vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to,vec__40658,size_p_from,size_p_to,vec__40661,size_f_from,size_f_to,coverages,vec__40664,cover_i_from,cover_i_to))
)));
var cover_p_from = cljs.core.nth.call(null,vec__40667,(0),null);
var cover_p_to = cljs.core.nth.call(null,vec__40667,(1),null);
var vec__40670 = cljs.core.map.call(null,coverages,cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(2),((function (vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to,vec__40658,size_p_from,size_p_to,vec__40661,size_f_from,size_f_to,coverages,vec__40664,cover_i_from,cover_i_to,vec__40667,cover_p_from,cover_p_to){
return (function (){
return weathergen.ui.random_int.call(null,(1),(3));
});})(vec__40646,vis_i,vis_p,vis_f,vis_s,vec__40649,visd_s,visd_f,visd_p,visd_i,vec__40652,base_i_from,base_p_from,base_f_from,base_i_to,base_p_to,base_f_to,vec__40655,size_i_from,size_i_to,vec__40658,size_p_from,size_p_to,vec__40661,size_f_from,size_f_to,coverages,vec__40664,cover_i_from,cover_i_to,vec__40667,cover_p_from,cover_p_to))
)));
var cover_f_from = cljs.core.nth.call(null,vec__40670,(0),null);
var cover_f_to = cljs.core.nth.call(null,vec__40670,(1),null);
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),vis_s,new cljs.core.Keyword(null,"to","to",192099007),weathergen.math.clamp.call(null,(0),(30),(vis_s + visd_s))], null)], null),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),vis_f,new cljs.core.Keyword(null,"to","to",192099007),weathergen.math.clamp.call(null,(0),(30),(vis_f + visd_f))], null),new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),base_f_from,new cljs.core.Keyword(null,"to","to",192099007),base_f_to], null),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),size_f_from,new cljs.core.Keyword(null,"to","to",192099007),size_f_to], null),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),cover_f_from,new cljs.core.Keyword(null,"to","to",192099007),cover_f_to], null),new cljs.core.Keyword(null,"towering","towering",-44547353),cljs.core.rand_nth.call(null,cljs.core.remove.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"frequent","frequent",-611072590),null,new cljs.core.Keyword(null,"prevalent","prevalent",1008099287),null,new cljs.core.Keyword(null,"always","always",-1772028770),null], null), null),cljs.core.vals.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423).cljs$core$IFn$_invoke$arity$1(weathergen.ui.towering_thresholds))))], null)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),vis_p,new cljs.core.Keyword(null,"to","to",192099007),weathergen.math.clamp.call(null,(0),(30),(vis_p + visd_p))], null),new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),base_p_from,new cljs.core.Keyword(null,"to","to",192099007),base_p_to], null),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),size_p_from,new cljs.core.Keyword(null,"to","to",192099007),size_p_to], null),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),cover_p_from,new cljs.core.Keyword(null,"to","to",192099007),cover_p_to], null),new cljs.core.Keyword(null,"towering","towering",-44547353),cljs.core.rand_nth.call(null,cljs.core.remove.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"prevalent","prevalent",1008099287),null,new cljs.core.Keyword(null,"always","always",-1772028770),null], null), null),cljs.core.vals.call(null,new cljs.core.Keyword(null,"poor","poor",1462482211).cljs$core$IFn$_invoke$arity$1(weathergen.ui.towering_thresholds))))], null)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),vis_i,new cljs.core.Keyword(null,"to","to",192099007),weathergen.math.clamp.call(null,(0),(30),(vis_i + visd_i))], null),new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),base_i_from,new cljs.core.Keyword(null,"to","to",192099007),base_i_to], null),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),size_i_from,new cljs.core.Keyword(null,"to","to",192099007),size_i_to], null),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),cover_i_from,new cljs.core.Keyword(null,"to","to",192099007),cover_i_to], null),new cljs.core.Keyword(null,"towering","towering",-44547353),cljs.core.rand_nth.call(null,cljs.core.remove.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"always","always",-1772028770),null], null), null),cljs.core.vals.call(null,new cljs.core.Keyword(null,"inclement","inclement",-550669382).cljs$core$IFn$_invoke$arity$1(weathergen.ui.towering_thresholds))))], null)], null)], null)], null);
});
weathergen.ui.random_wind_params = (function weathergen$ui$random_wind_params(){
var vec__40673 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(4),(function (){
return weathergen.ui.random_int.call(null,(0),(25));
})));
var wind_mean_s = cljs.core.nth.call(null,vec__40673,(0),null);
var wind_mean_f = cljs.core.nth.call(null,vec__40673,(1),null);
var wind_mean_p = cljs.core.nth.call(null,vec__40673,(2),null);
var wind_mean_i = cljs.core.nth.call(null,vec__40673,(3),null);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"mean","mean",-1359234715),wind_mean_s,new cljs.core.Keyword(null,"max","max",61366548),weathergen.ui.random_int.call(null,wind_mean_s,(30))], null)], null),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"mean","mean",-1359234715),wind_mean_f,new cljs.core.Keyword(null,"max","max",61366548),weathergen.ui.random_int.call(null,wind_mean_f,(30))], null)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),weathergen.ui.random_int.call(null,(0),wind_mean_p),new cljs.core.Keyword(null,"mean","mean",-1359234715),wind_mean_p,new cljs.core.Keyword(null,"max","max",61366548),weathergen.ui.random_int.call(null,wind_mean_p,(50))], null)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),weathergen.ui.random_int.call(null,(0),wind_mean_i),new cljs.core.Keyword(null,"mean","mean",-1359234715),wind_mean_i,new cljs.core.Keyword(null,"max","max",61366548),weathergen.ui.random_int.call(null,wind_mean_i,(55))], null)], null)], null),new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),(function (){var alts = new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [(3000),(6000),(9000),(12000),(18000),(24000),(30000),(40000),(50000)], null);
var deltas = cljs.core.repeatedly.call(null,cljs.core.count.call(null,alts),((function (alts,vec__40673,wind_mean_s,wind_mean_f,wind_mean_p,wind_mean_i){
return (function (){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"speed-from","speed-from",-1525408351),weathergen.ui.random_int.call(null,(-5),(10)),new cljs.core.Keyword(null,"speed-to","speed-to",-313116144),weathergen.ui.random_int.call(null,(1),(5)),new cljs.core.Keyword(null,"bias","bias",-315297926),((cljs.core.rand.call(null) - 0.1) / (4))], null);
});})(alts,vec__40673,wind_mean_s,wind_mean_f,wind_mean_p,wind_mean_i))
);
var cumulative = cljs.core.zipmap.call(null,alts,cljs.core.reductions.call(null,((function (alts,deltas,vec__40673,wind_mean_s,wind_mean_f,wind_mean_p,wind_mean_i){
return (function (a,b){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"speed-from","speed-from",-1525408351),(new cljs.core.Keyword(null,"speed-from","speed-from",-1525408351).cljs$core$IFn$_invoke$arity$1(a) + new cljs.core.Keyword(null,"speed-from","speed-from",-1525408351).cljs$core$IFn$_invoke$arity$1(b)),new cljs.core.Keyword(null,"speed-to","speed-to",-313116144),((new cljs.core.Keyword(null,"speed-from","speed-from",-1525408351).cljs$core$IFn$_invoke$arity$1(a) + new cljs.core.Keyword(null,"speed-from","speed-from",-1525408351).cljs$core$IFn$_invoke$arity$1(b)) + new cljs.core.Keyword(null,"speed-to","speed-to",-313116144).cljs$core$IFn$_invoke$arity$1(b)),new cljs.core.Keyword(null,"bias","bias",-315297926),weathergen.math.clamp.call(null,(0),(1),(new cljs.core.Keyword(null,"bias","bias",-315297926).cljs$core$IFn$_invoke$arity$1(a) + new cljs.core.Keyword(null,"bias","bias",-315297926).cljs$core$IFn$_invoke$arity$1(b)))], null);
});})(alts,deltas,vec__40673,wind_mean_s,wind_mean_f,wind_mean_p,wind_mean_i))
,deltas));
return cljs.core.reduce_kv.call(null,((function (alts,deltas,cumulative,vec__40673,wind_mean_s,wind_mean_f,wind_mean_p,wind_mean_i){
return (function (m,k,v){
return cljs.core.assoc.call(null,m,k,(function (){var map__40676 = v;
var map__40676__$1 = (((((!((map__40676 == null))))?(((((map__40676.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__40676.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__40676):map__40676);
var speed_from = cljs.core.get.call(null,map__40676__$1,new cljs.core.Keyword(null,"speed-from","speed-from",-1525408351));
var speed_to = cljs.core.get.call(null,map__40676__$1,new cljs.core.Keyword(null,"speed-to","speed-to",-313116144));
var bias = cljs.core.get.call(null,map__40676__$1,new cljs.core.Keyword(null,"bias","bias",-315297926));
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),speed_from,new cljs.core.Keyword(null,"to","to",192099007),speed_to], null),new cljs.core.Keyword(null,"bias","bias",-315297926),weathergen.math.clamp.call(null,(0),(1),bias)], null);
})());
});})(alts,deltas,cumulative,vec__40673,wind_mean_s,wind_mean_f,wind_mean_p,wind_mean_i))
,cljs.core.PersistentArrayMap.EMPTY,cumulative);
})()], null);
});
weathergen.ui.random_temp_params = (function weathergen$ui$random_temp_params(){
var temp_mean_i = weathergen.ui.random_int.call(null,(-10),(40));
var vec__40678 = cljs.core.map.call(null,((function (temp_mean_i){
return (function (){
return temp_mean_i;
});})(temp_mean_i))
,cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(3),((function (temp_mean_i){
return (function (){
return weathergen.ui.random_int.call(null,(1),(10));
});})(temp_mean_i))
)));
var temp_mean_p = cljs.core.nth.call(null,vec__40678,(0),null);
var temp_mean_f = cljs.core.nth.call(null,vec__40678,(1),null);
var temp_mean_s = cljs.core.nth.call(null,vec__40678,(2),null);
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(temp_mean_s - weathergen.ui.random_int.call(null,(1),(5))),new cljs.core.Keyword(null,"mean","mean",-1359234715),temp_mean_s,new cljs.core.Keyword(null,"max","max",61366548),(temp_mean_s + weathergen.ui.random_int.call(null,(1),(5)))], null)], null),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(temp_mean_f - weathergen.ui.random_int.call(null,(1),(5))),new cljs.core.Keyword(null,"mean","mean",-1359234715),temp_mean_f,new cljs.core.Keyword(null,"max","max",61366548),(temp_mean_f + weathergen.ui.random_int.call(null,(1),(5)))], null)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(temp_mean_p - weathergen.ui.random_int.call(null,(1),(5))),new cljs.core.Keyword(null,"mean","mean",-1359234715),temp_mean_p,new cljs.core.Keyword(null,"max","max",61366548),(temp_mean_p + weathergen.ui.random_int.call(null,(1),(5)))], null)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(temp_mean_i - weathergen.ui.random_int.call(null,(1),(5))),new cljs.core.Keyword(null,"mean","mean",-1359234715),temp_mean_i,new cljs.core.Keyword(null,"max","max",61366548),(temp_mean_i + weathergen.ui.random_int.call(null,(1),(5)))], null)], null)], null)], null);
});
weathergen.ui.default_cloud_params = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"stratus-z-fair","stratus-z-fair",2031975528),(43300),new cljs.core.Keyword(null,"stratus-z-inclement","stratus-z-inclement",1983411333),(33000),new cljs.core.Keyword(null,"contrails","contrails",1430581743),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(34000),new cljs.core.Keyword(null,"fair","fair",1684139423),(28000),new cljs.core.Keyword(null,"poor","poor",1462482211),(25000),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(20000)], null)], null);
/**
 * Returns a plausible but random set of global weather paramaters.
 */
weathergen.ui.random_cloud_params = (function weathergen$ui$random_cloud_params(){
var vec__40681 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(2),(function (){
return weathergen.ui.random_int.call(null,(16000),(40000),(500));
})));
var stratus_inclement = cljs.core.nth.call(null,vec__40681,(0),null);
var stratus_fair = cljs.core.nth.call(null,vec__40681,(1),null);
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"stratus-z-fair","stratus-z-fair",2031975528),stratus_fair,new cljs.core.Keyword(null,"stratus-z-inclement","stratus-z-inclement",1983411333),stratus_inclement,new cljs.core.Keyword(null,"contrails","contrails",1430581743),(function (){var vec__40684 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(4),((function (vec__40681,stratus_inclement,stratus_fair){
return (function (){
return weathergen.ui.random_int.call(null,(20000),(40000),(1000));
});})(vec__40681,stratus_inclement,stratus_fair))
));
var i = cljs.core.nth.call(null,vec__40684,(0),null);
var p = cljs.core.nth.call(null,vec__40684,(1),null);
var f = cljs.core.nth.call(null,vec__40684,(2),null);
var s = cljs.core.nth.call(null,vec__40684,(3),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),s,new cljs.core.Keyword(null,"fair","fair",1684139423),f,new cljs.core.Keyword(null,"poor","poor",1462482211),p,new cljs.core.Keyword(null,"inclement","inclement",-550669382),i], null);
})()], null);
});
weathergen.ui.cloud_params = javelin.core.cell.call(null,weathergen.ui.default_cloud_params);
weathergen.ui.movement_params = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"step","step",1288888124),(60),new cljs.core.Keyword(null,"direction","direction",-633359395),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"heading","heading",-1312171873),(135),new cljs.core.Keyword(null,"speed","speed",1257663751),(20)], null),new cljs.core.Keyword(null,"looping?","looping?",78344245),false], null));
weathergen.ui.controls_min_width = (575);
weathergen.ui.titlebar_fullsize_QMARK_ = weathergen.ui.common.versioned_local_storage.call(null,new cljs.core.Keyword("weathergen.ui","titlebar-fullsize?","weathergen.ui/titlebar-fullsize?",-884441460),true);
weathergen.ui.titlebar_height = javelin.core.formula.call(null,(function (G__40687){
if(cljs.core.truth_(G__40687)){
return (64);
} else {
return (27);
}
})).call(null,weathergen.ui.titlebar_fullsize_QMARK_);
weathergen.ui.map_size = javelin.core.formula.call(null,(function (window_size,titlebar_height){
var vec__40688 = window_size;
var window_width = cljs.core.nth.call(null,vec__40688,(0),null);
var window_height = cljs.core.nth.call(null,vec__40688,(1),null);
var dim = (function (){var x__4219__auto__ = (250);
var y__4220__auto__ = (function (){var x__4222__auto__ = (window_width - weathergen.ui.controls_min_width);
var y__4223__auto__ = ((window_height - titlebar_height) - (57));
return ((x__4222__auto__ < y__4223__auto__) ? x__4222__auto__ : y__4223__auto__);
})();
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})();
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dim,dim], null);
})).call(null,weathergen.ui.window_size,weathergen.ui.titlebar_height);
weathergen.ui.display_params = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"opacity","opacity",397153780),0.33,new cljs.core.Keyword(null,"display","display",242065432),new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"mouse-mode","mouse-mode",-1901710690),new cljs.core.Keyword(null,"select","select",1147833503),new cljs.core.Keyword(null,"overlay","overlay",-139131598),null,new cljs.core.Keyword(null,"wind-alt","wind-alt",1733172827),(0),new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243),new cljs.core.Keyword(null,"inhg","inhg",-863180091),new cljs.core.Keyword(null,"flight-paths","flight-paths",159519268),null,new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"mission-name","mission-name",1479736582),null,new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(5),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(10),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null),new cljs.core.Keyword(null,"step","step",1288888124),(60)], null)], null));
weathergen.ui.map_display = javelin.core.cell.call(null,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"flight-path-size","flight-path-size",-1809746301),new cljs.core.Keyword(null,"icon-size","icon-size",414161352),new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003),new cljs.core.Keyword(null,"brightness","brightness",1067055820),new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435),new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514),new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954),new cljs.core.Keyword(null,"text-size","text-size",-945618309),new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124)],[(0),(0),true,0.5,true,new cljs.core.Keyword(null,"all","all",892129742),true,(0),true]));
weathergen.ui.map_text_scale = javelin.core.formula.call(null,(function (G__40691,G__40692){
return G__40691.call(null,4.0,new cljs.core.Keyword(null,"text-size","text-size",-945618309).cljs$core$IFn$_invoke$arity$1(G__40692));
})).call(null,Math.pow,weathergen.ui.map_display);
weathergen.ui.map_icon_scale = javelin.core.formula.call(null,(function (G__40693,G__40694){
return G__40693.call(null,4.0,new cljs.core.Keyword(null,"icon-size","icon-size",414161352).cljs$core$IFn$_invoke$arity$1(G__40694));
})).call(null,Math.pow,weathergen.ui.map_display);
weathergen.ui.map_show_text_background_QMARK_ = javelin.core.formula.call(null,(function (G__40695){
return new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124).cljs$core$IFn$_invoke$arity$1(G__40695);
})).call(null,weathergen.ui.map_display);
weathergen.ui.selected_cell = javelin.core.cell.call(null,null);
weathergen.ui.hover_cell = javelin.core.cell.call(null,null);
weathergen.ui.mouse_location = javelin.core.cell.call(null,null);
weathergen.ui.mouse_raw_offset = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0)], null));
weathergen.ui.suppress_bullseye_info_box_QMARK_ = javelin.core.cell.call(null,false);
weathergen.ui.prevent_recomputation_QMARK_ = javelin.core.cell.call(null,false);
/**
 * Holds the time that's in the 'jump/set to time' boxes because we
 *   need to retain a temporary value while people are making up their
 *   minds.
 */
weathergen.ui.time_params = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"displayed","displayed",-436192586),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(5),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null)], null));
weathergen.ui.weather_data = javelin.core.cell.call(null,null);
weathergen.ui.weather_data_params = javelin.core.cell.call(null,null);
weathergen.ui.computing = javelin.core.cell.call(null,true);
weathergen.ui.messages = javelin.core.cell.call(null,cljs.core.PersistentVector.EMPTY);
weathergen.ui.mission = javelin.core.cell.call(null,null);
weathergen.ui.hide_empty_airbases_QMARK_ = javelin.core.cell.call(null,true);
weathergen.ui.hide_inoperable_airbases_QMARK_ = javelin.core.cell.call(null,false);
weathergen.ui.included_squadron_types = javelin.core.cell.call(null,cljs.core.PersistentHashSet.EMPTY);
weathergen.ui.checked_airbases = javelin.core.cell.call(null,cljs.core.PersistentHashSet.EMPTY);
weathergen.ui.highlighted_airbase = javelin.core.cell.call(null,null);
cljs.core.add_watch.call(null,weathergen.ui.mission,new cljs.core.Keyword(null,"reset-object-data-on-mission-change","reset-object-data-on-mission-change",1100510422),(function (_,___$1,___$2,___$3){
return javelin.core.dosync_STAR_.call(null,(function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,null);

return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.PersistentHashSet.EMPTY);
}));
}));
weathergen.ui.settings = javelin.core.cell.call(null,weathergen.settings.load_settings.call(null));
weathergen.ui.zoom_speed = javelin.core.formula.call(null,(function (G__40696){
var or__4131__auto__ = new cljs.core.Keyword(null,"zoom-speed","zoom-speed",1787688902).cljs$core$IFn$_invoke$arity$1(G__40696);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return 0.95;
}
})).call(null,weathergen.ui.settings);
weathergen.ui.map_zoom = javelin.core.cell.call(null,(1));
weathergen.ui.map_pan = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0)], null));
weathergen.ui.zoom_min = (1);
weathergen.ui.zoom_max = (200);
weathergen.ui.map_viewbox = javelin.core.formula.call(null,(function (weather_params,map_zoom,map_pan){
var vec__40697 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(weather_params);
var nx = cljs.core.nth.call(null,vec__40697,(0),null);
var ny = cljs.core.nth.call(null,vec__40697,(1),null);
var map__40700 = map_pan;
var map__40700__$1 = (((((!((map__40700 == null))))?(((((map__40700.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__40700.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__40700):map__40700);
var x = cljs.core.get.call(null,map__40700__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__40700__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),(nx / map_zoom),new cljs.core.Keyword(null,"height","height",1025178622),(ny / map_zoom)], null);
})).call(null,weathergen.ui.weather_params,weathergen.ui.map_zoom,weathergen.ui.map_pan);
weathergen.ui.display_mode = javelin.core.cell.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166));
weathergen.ui.visible_sides = javelin.core.cell.call(null,null);
weathergen.ui.effective_visible_sides = javelin.core.formula.call(null,(function (mission,visible_sides,display_mode){
if(cljs.core.not.call(null,mission)){
return cljs.core.PersistentHashSet.EMPTY;
} else {
if(cljs.core.not.call(null,visible_sides)){
return cljs.core.set.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166),display_mode)){
return cljs.core.set.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
} else {
return visible_sides;

}
}
}
})).call(null,weathergen.ui.mission,weathergen.ui.visible_sides,weathergen.ui.display_mode);
weathergen.ui.visible_teams = javelin.core.formula.call(null,(function (mission,effective_visible_sides){
return cljs.core.set.call(null,(cljs.core.truth_((function (){var and__4120__auto__ = mission;
if(cljs.core.truth_(and__4120__auto__)){
return effective_visible_sides;
} else {
return and__4120__auto__;
}
})())?cljs.core.map.call(null,weathergen.falcon.files.mission.team_number,cljs.core.filter.call(null,(function (p1__40702_SHARP_){
return effective_visible_sides.call(null,weathergen.falcon.files.mission.side.call(null,mission,p1__40702_SHARP_));
}),weathergen.falcon.files.mission.teams.call(null,mission))):weathergen.falcon.files.mission.teams.call(null,mission)));
})).call(null,weathergen.ui.mission,weathergen.ui.effective_visible_sides);
weathergen.ui.briefing_notes = javelin.core.cell.call(null,"");
/**
 * Parses the contents of the build.txt file into a map.
 */
weathergen.ui.parse_build_info = (function weathergen$ui$parse_build_info(build_info){
return cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.call(null,(function (line){
var vec__40703 = clojure.string.split.call(null,line,/=/);
var name = cljs.core.nth.call(null,vec__40703,(0),null);
var value = cljs.core.nth.call(null,vec__40703,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__4131__auto__ = name;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "";
}
})(),(function (){var or__4131__auto__ = value;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "";
}
})()], null);
}),cljs.core.remove.call(null,clojure.string.blank_QMARK_,clojure.string.split_lines.call(null,build_info))));
});
weathergen.ui.build_info = (function (){var path = weathergen.filesystem.path_combine.call(null,weathergen.ui.electron.remote.app.getAppPath(),"build.txt");
if(cljs.core.truth_(weathergen.filesystem.exists_QMARK_.call(null,path))){
return weathergen.ui.parse_build_info.call(null,weathergen.filesystem.file_text.call(null,path));
} else {
return null;
}
})();
/**
 * Whether or not the tools tab is visible
 */
weathergen.ui.tools_visible_QMARK_ = javelin.core.cell.call(null,true);
weathergen.ui.flight_paths_layer = weathergen.ui.layers.flights.create.call(null,weathergen.ui.mission,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337),weathergen.ui.map_zoom,new cljs.core.Keyword(null,"map-text-scale","map-text-scale",1420206123),weathergen.ui.map_text_scale,new cljs.core.Keyword(null,"map-show-text-background?","map-show-text-background?",409410295),weathergen.ui.map_show_text_background_QMARK_,new cljs.core.Keyword(null,"visible-teams","visible-teams",-110455752),weathergen.ui.visible_teams], null));
weathergen.ui.annotations_layer = weathergen.ui.layers.annotations.create.call(null,weathergen.ui.mission,new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"map-viewbox","map-viewbox",860086717),weathergen.ui.map_viewbox,new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337),weathergen.ui.map_zoom,new cljs.core.Keyword(null,"map-text-scale","map-text-scale",1420206123),weathergen.ui.map_text_scale,new cljs.core.Keyword(null,"map-icon-scale","map-icon-scale",-1307959664),weathergen.ui.map_icon_scale,new cljs.core.Keyword(null,"suppress-bullseye-info-box?","suppress-bullseye-info-box?",-1654633798),weathergen.ui.suppress_bullseye_info_box_QMARK_,new cljs.core.Keyword(null,"build-info","build-info",-622713066),weathergen.ui.build_info], null));
weathergen.ui.acmi_layer = weathergen.ui.layers.acmi.create.call(null,weathergen.ui.mission,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337),weathergen.ui.map_zoom,new cljs.core.Keyword(null,"map-text-scale","map-text-scale",1420206123),weathergen.ui.map_text_scale,new cljs.core.Keyword(null,"map-icon-scale","map-icon-scale",-1307959664),weathergen.ui.map_icon_scale,new cljs.core.Keyword(null,"suppress-bullseye-info-box?","suppress-bullseye-info-box?",-1654633798),weathergen.ui.suppress_bullseye_info_box_QMARK_], null));
weathergen.ui.selected_cell_weather = javelin.core.formula.call(null,(function (G__40706,G__40708,G__40707){
return G__40706.call(null,G__40707,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__40708));
})).call(null,cljs.core.get,weathergen.ui.selected_cell,weathergen.ui.weather_data);
weathergen.ui.cell_count = javelin.core.formula.call(null,(function (G__40709){
return new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(G__40709);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.weather_overrides = javelin.core.formula.call(null,(function (G__40710){
return new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(G__40710);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.forecast = javelin.core.formula.call(null,(function (selected_cell,weather_params,movement_params){
var timer_name__15816__auto__ = "computing forecast";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = (cljs.core.truth_(selected_cell)?weathergen.model.forecast.call(null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(selected_cell),(function (){var temp__5718__auto__ = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(weather_params));
if(cljs.core.truth_(temp__5718__auto__)){
var max_time = temp__5718__auto__;
return weathergen.model.jump_to_time.call(null,weather_params,movement_params,max_time);
} else {
return weather_params;
}
})(),movement_params,(60),(6)):null);
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
})).call(null,weathergen.ui.selected_cell,weathergen.ui.weather_params,weathergen.ui.movement_params);
weathergen.ui.location_type = javelin.core.formula.call(null,(function (G__40712,G__40711){
if(cljs.core.truth_(G__40711.call(null,new cljs.core.Keyword(null,"location","location",1815599388).cljs$core$IFn$_invoke$arity$1(G__40712)))){
return new cljs.core.Keyword(null,"named","named",-422393479);
} else {
if(cljs.core.truth_(new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__40712))){
return new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668);
} else {
return new cljs.core.Keyword(null,"none","none",1333468478);

}
}
})).call(null,weathergen.ui.selected_cell,cljs.core.not_empty);
weathergen.ui.pressure_unit = javelin.core.formula.call(null,(function (G__40713){
return new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243).cljs$core$IFn$_invoke$arity$1(G__40713);
})).call(null,weathergen.ui.display_params);
weathergen.ui.all_squadrons = javelin.core.formula.call(null,(function (G__40716,G__40715,G__40714,G__40717){
return G__40714.call(null,cljs.core.PersistentHashSet.EMPTY,G__40715.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110),new cljs.core.Keyword(null,"air","air",-104121788).cljs$core$IFn$_invoke$arity$1(G__40716.call(null,G__40717))));
})).call(null,weathergen.falcon.files.mission.order_of_battle,cljs.core.mapcat,cljs.core.into,weathergen.ui.mission);
weathergen.ui.all_squadron_types = javelin.core.formula.call(null,(function (G__40720,G__40719,G__40723,G__40722,G__40721){
return G__40719.call(null,cljs.core.PersistentHashSet.EMPTY,G__40720.call(null,(function (p1__40718_SHARP_){
return G__40721.call(null,G__40722,p1__40718_SHARP_);
}),G__40723));
})).call(null,cljs.core.map,cljs.core.into,weathergen.ui.all_squadrons,weathergen.ui.mission,weathergen.falcon.files.mission.squadron_type);
weathergen.ui.included_squadrons = javelin.core.formula.call(null,(function (G__40725,G__40730,G__40727,G__40729,G__40728,G__40726){
return G__40725.call(null,G__40726.call(null,(function (p1__40724_SHARP_){
return G__40727.call(null,G__40728.call(null,G__40729,p1__40724_SHARP_));
}),G__40730));
})).call(null,cljs.core.set,weathergen.ui.all_squadrons,weathergen.ui.included_squadron_types,weathergen.ui.mission,weathergen.falcon.files.mission.squadron_type,cljs.core.filter);
cljs.core.add_watch.call(null,weathergen.ui.all_squadron_types,new cljs.core.Keyword(null,"update-included-squadron-types","update-included-squadron-types",-1854825437),(function (_,___$1,___$2,n){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,n);
}));
/**
 * Return true if an airbase be shown in the list of airbases.
 */
weathergen.ui.list_airbase_QMARK_ = (function weathergen$ui$list_airbase_QMARK_(airbase,hide_empty_QMARK_,hide_inoperable_QMARK_,included_squadrons){
var is_empty_QMARK_ = (cljs.core.count.call(null,cljs.core.filter.call(null,included_squadrons,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase))) === (0));
var is_inoperable_QMARK_ = (new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(airbase) === (0));
var hide_QMARK_ = (function (){var or__4131__auto__ = (function (){var and__4120__auto__ = is_empty_QMARK_;
if(and__4120__auto__){
return hide_empty_QMARK_;
} else {
return and__4120__auto__;
}
})();
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
var and__4120__auto__ = is_inoperable_QMARK_;
if(and__4120__auto__){
return hide_inoperable_QMARK_;
} else {
return and__4120__auto__;
}
}
})();
return cljs.core.not.call(null,hide_QMARK_);
});
weathergen.ui.all_airbases = javelin.core.formula.call(null,(function (G__40733,G__40732){
var G__40731 = G__40732;
var G__40731__$1 = (cljs.core.truth_((G__40731 == null))?null:G__40733.call(null,G__40731));
if(cljs.core.truth_((G__40731__$1 == null))){
return null;
} else {
return new cljs.core.Keyword(null,"air","air",-104121788).cljs$core$IFn$_invoke$arity$1(G__40731__$1);
}
})).call(null,weathergen.falcon.files.mission.order_of_battle,weathergen.ui.mission);
weathergen.ui.listed_airbases = javelin.core.formula.call(null,(function (all_airbases,hide_empty_airbases_QMARK_,hide_inoperable_airbases_QMARK_,included_squadrons){
return cljs.core.set.call(null,cljs.core.filter.call(null,(function (p1__40734_SHARP_){
return weathergen.ui.list_airbase_QMARK_.call(null,p1__40734_SHARP_,hide_empty_airbases_QMARK_,hide_inoperable_airbases_QMARK_,included_squadrons);
}),all_airbases));
})).call(null,weathergen.ui.all_airbases,weathergen.ui.hide_empty_airbases_QMARK_,weathergen.ui.hide_inoperable_airbases_QMARK_,weathergen.ui.included_squadrons);
weathergen.ui.displayed_airbases = javelin.core.formula.call(null,(function (checked_airbases,listed_airbases){
return clojure.set.intersection.call(null,checked_airbases,listed_airbases);
})).call(null,weathergen.ui.checked_airbases,weathergen.ui.listed_airbases);
weathergen.ui.worker_count = (4);
weathergen.ui.workers = (function (){var all_cells = (function (){var iter__4523__auto__ = (function weathergen$ui$iter__40735(s__40736){
return (new cljs.core.LazySeq(null,(function (){
var s__40736__$1 = s__40736;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__40736__$1);
if(temp__5720__auto__){
var xs__6277__auto__ = temp__5720__auto__;
var x = cljs.core.first.call(null,xs__6277__auto__);
var iterys__4519__auto__ = ((function (s__40736__$1,x,xs__6277__auto__,temp__5720__auto__){
return (function weathergen$ui$iter__40735_$_iter__40737(s__40738){
return (new cljs.core.LazySeq(null,((function (s__40736__$1,x,xs__6277__auto__,temp__5720__auto__){
return (function (){
var s__40738__$1 = s__40738;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__40738__$1);
if(temp__5720__auto____$1){
var s__40738__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__40738__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__40738__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__40740 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__40739 = (0);
while(true){
if((i__40739 < size__4522__auto__)){
var y = cljs.core._nth.call(null,c__4521__auto__,i__40739);
cljs.core.chunk_append.call(null,b__40740,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__40741 = (i__40739 + (1));
i__40739 = G__40741;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__40740),weathergen$ui$iter__40735_$_iter__40737.call(null,cljs.core.chunk_rest.call(null,s__40738__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__40740),null);
}
} else {
var y = cljs.core.first.call(null,s__40738__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),weathergen$ui$iter__40735_$_iter__40737.call(null,cljs.core.rest.call(null,s__40738__$2)));
}
} else {
return null;
}
break;
}
});})(s__40736__$1,x,xs__6277__auto__,temp__5720__auto__))
,null,null));
});})(s__40736__$1,x,xs__6277__auto__,temp__5720__auto__))
;
var fs__4520__auto__ = cljs.core.seq.call(null,iterys__4519__auto__.call(null,cljs.core.range.call(null,(59))));
if(fs__4520__auto__){
return cljs.core.concat.call(null,fs__4520__auto__,weathergen$ui$iter__40735.call(null,cljs.core.rest.call(null,s__40736__$1)));
} else {
var G__40742 = cljs.core.rest.call(null,s__40736__$1);
s__40736__$1 = G__40742;
continue;
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,cljs.core.range.call(null,(59)));
})();
return cljs.core.map.call(null,((function (all_cells){
return (function (n,cells){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"worker","worker",938239996),(new Worker("worker.js")),new cljs.core.Keyword(null,"n","n",562130025),n,new cljs.core.Keyword(null,"ch","ch",-554717905),cljs.core.async.chan.call(null),new cljs.core.Keyword(null,"cells","cells",-985166822),cells], null);
});})(all_cells))
,cljs.core.range.call(null,weathergen.ui.worker_count),cljs.core.partition_all.call(null,(((59) * (59)) / weathergen.ui.worker_count),all_cells));
})();
weathergen.ui.command_ch = cljs.core.async.chan.call(null,cljs.core.async.dropping_buffer.call(null,(1)));
var seq__40743_40799 = cljs.core.seq.call(null,weathergen.ui.workers);
var chunk__40744_40800 = null;
var count__40745_40801 = (0);
var i__40746_40802 = (0);
while(true){
if((i__40746_40802 < count__40745_40801)){
var map__40773_40803 = cljs.core._nth.call(null,chunk__40744_40800,i__40746_40802);
var map__40773_40804__$1 = (((((!((map__40773_40803 == null))))?(((((map__40773_40803.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__40773_40803.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__40773_40803):map__40773_40803);
var worker_40805 = cljs.core.get.call(null,map__40773_40804__$1,new cljs.core.Keyword(null,"worker","worker",938239996));
var ch_40806 = cljs.core.get.call(null,map__40773_40804__$1,new cljs.core.Keyword(null,"ch","ch",-554717905));
worker_40805.onmessage = ((function (seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,map__40773_40803,map__40773_40804__$1,worker_40805,ch_40806){
return (function (e){
var c__38370__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,c__38370__auto__,map__40773_40803,map__40773_40804__$1,worker_40805,ch_40806){
return (function (){
var f__38371__auto__ = (function (){var switch__38275__auto__ = ((function (seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,c__38370__auto__,map__40773_40803,map__40773_40804__$1,worker_40805,ch_40806){
return (function (state_40780){
var state_val_40781 = (state_40780[(1)]);
if((state_val_40781 === (1))){
var inst_40775 = (e["data"]);
var inst_40776 = weathergen.encoding.decode.call(null,inst_40775);
var state_40780__$1 = state_40780;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_40780__$1,(2),ch_40806,inst_40776);
} else {
if((state_val_40781 === (2))){
var inst_40778 = (state_40780[(2)]);
var state_40780__$1 = state_40780;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_40780__$1,inst_40778);
} else {
return null;
}
}
});})(seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,c__38370__auto__,map__40773_40803,map__40773_40804__$1,worker_40805,ch_40806))
;
return ((function (seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,switch__38275__auto__,c__38370__auto__,map__40773_40803,map__40773_40804__$1,worker_40805,ch_40806){
return (function() {
var weathergen$ui$state_machine__38276__auto__ = null;
var weathergen$ui$state_machine__38276__auto____0 = (function (){
var statearr_40782 = [null,null,null,null,null,null,null];
(statearr_40782[(0)] = weathergen$ui$state_machine__38276__auto__);

(statearr_40782[(1)] = (1));

return statearr_40782;
});
var weathergen$ui$state_machine__38276__auto____1 = (function (state_40780){
while(true){
var ret_value__38277__auto__ = (function (){try{while(true){
var result__38278__auto__ = switch__38275__auto__.call(null,state_40780);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38278__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38278__auto__;
}
break;
}
}catch (e40783){if((e40783 instanceof Object)){
var ex__38279__auto__ = e40783;
var statearr_40784_40807 = state_40780;
(statearr_40784_40807[(5)] = ex__38279__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_40780);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e40783;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38277__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__40808 = state_40780;
state_40780 = G__40808;
continue;
} else {
return ret_value__38277__auto__;
}
break;
}
});
weathergen$ui$state_machine__38276__auto__ = function(state_40780){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38276__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38276__auto____1.call(this,state_40780);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38276__auto____0;
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38276__auto____1;
return weathergen$ui$state_machine__38276__auto__;
})()
;})(seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,switch__38275__auto__,c__38370__auto__,map__40773_40803,map__40773_40804__$1,worker_40805,ch_40806))
})();
var state__38372__auto__ = (function (){var statearr_40785 = f__38371__auto__.call(null);
(statearr_40785[(6)] = c__38370__auto__);

return statearr_40785;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__38372__auto__);
});})(seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,c__38370__auto__,map__40773_40803,map__40773_40804__$1,worker_40805,ch_40806))
);

return c__38370__auto__;
});})(seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,map__40773_40803,map__40773_40804__$1,worker_40805,ch_40806))
;


var G__40809 = seq__40743_40799;
var G__40810 = chunk__40744_40800;
var G__40811 = count__40745_40801;
var G__40812 = (i__40746_40802 + (1));
seq__40743_40799 = G__40809;
chunk__40744_40800 = G__40810;
count__40745_40801 = G__40811;
i__40746_40802 = G__40812;
continue;
} else {
var temp__5720__auto___40813 = cljs.core.seq.call(null,seq__40743_40799);
if(temp__5720__auto___40813){
var seq__40743_40814__$1 = temp__5720__auto___40813;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__40743_40814__$1)){
var c__4550__auto___40815 = cljs.core.chunk_first.call(null,seq__40743_40814__$1);
var G__40816 = cljs.core.chunk_rest.call(null,seq__40743_40814__$1);
var G__40817 = c__4550__auto___40815;
var G__40818 = cljs.core.count.call(null,c__4550__auto___40815);
var G__40819 = (0);
seq__40743_40799 = G__40816;
chunk__40744_40800 = G__40817;
count__40745_40801 = G__40818;
i__40746_40802 = G__40819;
continue;
} else {
var map__40786_40820 = cljs.core.first.call(null,seq__40743_40814__$1);
var map__40786_40821__$1 = (((((!((map__40786_40820 == null))))?(((((map__40786_40820.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__40786_40820.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__40786_40820):map__40786_40820);
var worker_40822 = cljs.core.get.call(null,map__40786_40821__$1,new cljs.core.Keyword(null,"worker","worker",938239996));
var ch_40823 = cljs.core.get.call(null,map__40786_40821__$1,new cljs.core.Keyword(null,"ch","ch",-554717905));
worker_40822.onmessage = ((function (seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,map__40786_40820,map__40786_40821__$1,worker_40822,ch_40823,seq__40743_40814__$1,temp__5720__auto___40813){
return (function (e){
var c__38370__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,c__38370__auto__,map__40786_40820,map__40786_40821__$1,worker_40822,ch_40823,seq__40743_40814__$1,temp__5720__auto___40813){
return (function (){
var f__38371__auto__ = (function (){var switch__38275__auto__ = ((function (seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,c__38370__auto__,map__40786_40820,map__40786_40821__$1,worker_40822,ch_40823,seq__40743_40814__$1,temp__5720__auto___40813){
return (function (state_40793){
var state_val_40794 = (state_40793[(1)]);
if((state_val_40794 === (1))){
var inst_40788 = (e["data"]);
var inst_40789 = weathergen.encoding.decode.call(null,inst_40788);
var state_40793__$1 = state_40793;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_40793__$1,(2),ch_40823,inst_40789);
} else {
if((state_val_40794 === (2))){
var inst_40791 = (state_40793[(2)]);
var state_40793__$1 = state_40793;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_40793__$1,inst_40791);
} else {
return null;
}
}
});})(seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,c__38370__auto__,map__40786_40820,map__40786_40821__$1,worker_40822,ch_40823,seq__40743_40814__$1,temp__5720__auto___40813))
;
return ((function (seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,switch__38275__auto__,c__38370__auto__,map__40786_40820,map__40786_40821__$1,worker_40822,ch_40823,seq__40743_40814__$1,temp__5720__auto___40813){
return (function() {
var weathergen$ui$state_machine__38276__auto__ = null;
var weathergen$ui$state_machine__38276__auto____0 = (function (){
var statearr_40795 = [null,null,null,null,null,null,null];
(statearr_40795[(0)] = weathergen$ui$state_machine__38276__auto__);

(statearr_40795[(1)] = (1));

return statearr_40795;
});
var weathergen$ui$state_machine__38276__auto____1 = (function (state_40793){
while(true){
var ret_value__38277__auto__ = (function (){try{while(true){
var result__38278__auto__ = switch__38275__auto__.call(null,state_40793);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38278__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38278__auto__;
}
break;
}
}catch (e40796){if((e40796 instanceof Object)){
var ex__38279__auto__ = e40796;
var statearr_40797_40824 = state_40793;
(statearr_40797_40824[(5)] = ex__38279__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_40793);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e40796;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38277__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__40825 = state_40793;
state_40793 = G__40825;
continue;
} else {
return ret_value__38277__auto__;
}
break;
}
});
weathergen$ui$state_machine__38276__auto__ = function(state_40793){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38276__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38276__auto____1.call(this,state_40793);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38276__auto____0;
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38276__auto____1;
return weathergen$ui$state_machine__38276__auto__;
})()
;})(seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,switch__38275__auto__,c__38370__auto__,map__40786_40820,map__40786_40821__$1,worker_40822,ch_40823,seq__40743_40814__$1,temp__5720__auto___40813))
})();
var state__38372__auto__ = (function (){var statearr_40798 = f__38371__auto__.call(null);
(statearr_40798[(6)] = c__38370__auto__);

return statearr_40798;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__38372__auto__);
});})(seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,c__38370__auto__,map__40786_40820,map__40786_40821__$1,worker_40822,ch_40823,seq__40743_40814__$1,temp__5720__auto___40813))
);

return c__38370__auto__;
});})(seq__40743_40799,chunk__40744_40800,count__40745_40801,i__40746_40802,map__40786_40820,map__40786_40821__$1,worker_40822,ch_40823,seq__40743_40814__$1,temp__5720__auto___40813))
;


var G__40826 = cljs.core.next.call(null,seq__40743_40814__$1);
var G__40827 = null;
var G__40828 = (0);
var G__40829 = (0);
seq__40743_40799 = G__40826;
chunk__40744_40800 = G__40827;
count__40745_40801 = G__40828;
i__40746_40802 = G__40829;
continue;
}
} else {
}
}
break;
}
/**
 * Helper function to post a message to a worker. Needed because the
 *   go-loop rewrites code so much I can't get type hints to work inside
 *   it.
 */
weathergen.ui.post_message = (function weathergen$ui$post_message(worker,message){
return worker.postMessage(message);
});
var c__38370__auto___41069 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__38370__auto___41069){
return (function (){
var f__38371__auto__ = (function (){var switch__38275__auto__ = ((function (c__38370__auto___41069){
return (function (state_40994){
var state_val_40995 = (state_40994[(1)]);
if((state_val_40995 === (7))){
var inst_40852 = (state_40994[(7)]);
var inst_40844 = (state_40994[(8)]);
var inst_40846 = (state_40994[(9)]);
var inst_40852__$1 = cljs.core._nth.call(null,inst_40844,inst_40846);
var inst_40854 = (inst_40852__$1 == null);
var inst_40855 = cljs.core.not.call(null,inst_40854);
var state_40994__$1 = (function (){var statearr_40996 = state_40994;
(statearr_40996[(7)] = inst_40852__$1);

return statearr_40996;
})();
if(inst_40855){
var statearr_40997_41070 = state_40994__$1;
(statearr_40997_41070[(1)] = (10));

} else {
var statearr_40998_41071 = state_40994__$1;
(statearr_40998_41071[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (20))){
var state_40994__$1 = state_40994;
var statearr_40999_41072 = state_40994__$1;
(statearr_40999_41072[(2)] = null);

(statearr_40999_41072[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (27))){
var inst_40908 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
if(cljs.core.truth_(inst_40908)){
var statearr_41000_41073 = state_40994__$1;
(statearr_41000_41073[(1)] = (31));

} else {
var statearr_41001_41074 = state_40994__$1;
(statearr_41001_41074[(1)] = (32));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (1))){
var state_40994__$1 = state_40994;
var statearr_41002_41075 = state_40994__$1;
(statearr_41002_41075[(2)] = null);

(statearr_41002_41075[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (24))){
var inst_40922 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
var statearr_41003_41076 = state_40994__$1;
(statearr_41003_41076[(2)] = inst_40922);

(statearr_41003_41076[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (39))){
var inst_40946 = cljs.core.async.timeout.call(null,(500));
var state_40994__$1 = state_40994;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_40994__$1,(42),inst_40946);
} else {
if((state_val_40995 === (46))){
var inst_40936 = (state_40994[(10)]);
var inst_40937 = (state_40994[(11)]);
var inst_40978 = (state_40994[(2)]);
var inst_40979 = cljs.core.nth.call(null,inst_40978,(0),null);
var inst_40980 = cljs.core.nth.call(null,inst_40978,(1),null);
var inst_40981 = cljs.core.disj.call(null,inst_40936,inst_40980);
var inst_40982 = cljs.core.merge.call(null,inst_40937,inst_40979);
var inst_40936__$1 = inst_40981;
var inst_40937__$1 = inst_40982;
var state_40994__$1 = (function (){var statearr_41004 = state_40994;
(statearr_41004[(10)] = inst_40936__$1);

(statearr_41004[(11)] = inst_40937__$1);

return statearr_41004;
})();
var statearr_41005_41077 = state_40994__$1;
(statearr_41005_41077[(2)] = null);

(statearr_41005_41077[(1)] = (34));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (4))){
var inst_40835 = (state_40994[(12)]);
var inst_40835__$1 = (state_40994[(2)]);
var inst_40836 = cljs.core.nth.call(null,inst_40835__$1,(0),null);
var inst_40837 = cljs.core.nth.call(null,inst_40835__$1,(1),null);
var inst_40842 = cljs.core.seq.call(null,weathergen.ui.workers);
var inst_40843 = inst_40842;
var inst_40844 = null;
var inst_40845 = (0);
var inst_40846 = (0);
var state_40994__$1 = (function (){var statearr_41006 = state_40994;
(statearr_41006[(12)] = inst_40835__$1);

(statearr_41006[(13)] = inst_40837);

(statearr_41006[(8)] = inst_40844);

(statearr_41006[(14)] = inst_40836);

(statearr_41006[(15)] = inst_40843);

(statearr_41006[(9)] = inst_40846);

(statearr_41006[(16)] = inst_40845);

return statearr_41006;
})();
var statearr_41007_41078 = state_40994__$1;
(statearr_41007_41078[(2)] = null);

(statearr_41007_41078[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (15))){
var inst_40865 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
var statearr_41008_41079 = state_40994__$1;
(statearr_41008_41079[(2)] = inst_40865);

(statearr_41008_41079[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (21))){
var inst_40925 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
var statearr_41009_41080 = state_40994__$1;
(statearr_41009_41080[(2)] = inst_40925);

(statearr_41009_41080[(1)] = (9));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (31))){
var inst_40892 = (state_40994[(17)]);
var inst_40910 = cljs.core.apply.call(null,cljs.core.hash_map,inst_40892);
var state_40994__$1 = state_40994;
var statearr_41010_41081 = state_40994__$1;
(statearr_41010_41081[(2)] = inst_40910);

(statearr_41010_41081[(1)] = (33));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (32))){
var inst_40892 = (state_40994[(17)]);
var state_40994__$1 = state_40994;
var statearr_41011_41082 = state_40994__$1;
(statearr_41011_41082[(2)] = inst_40892);

(statearr_41011_41082[(1)] = (33));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (40))){
var state_40994__$1 = state_40994;
var statearr_41012_41083 = state_40994__$1;
(statearr_41012_41083[(2)] = null);

(statearr_41012_41083[(1)] = (41));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (33))){
var inst_40882 = (state_40994[(18)]);
var inst_40837 = (state_40994[(13)]);
var inst_40913 = (state_40994[(2)]);
var inst_40914 = cljs.core.get.call(null,inst_40913,new cljs.core.Keyword(null,"cells","cells",-985166822));
var inst_40915 = cljs.core.get.call(null,inst_40913,new cljs.core.Keyword(null,"worker","worker",938239996));
var inst_40916 = cljs.core.assoc.call(null,inst_40837,new cljs.core.Keyword(null,"cells","cells",-985166822),inst_40914);
var inst_40917 = weathergen.encoding.encode.call(null,inst_40916);
var inst_40918 = weathergen.ui.post_message.call(null,inst_40915,inst_40917);
var inst_40919 = cljs.core.next.call(null,inst_40882);
var inst_40843 = inst_40919;
var inst_40844 = null;
var inst_40845 = (0);
var inst_40846 = (0);
var state_40994__$1 = (function (){var statearr_41013 = state_40994;
(statearr_41013[(19)] = inst_40918);

(statearr_41013[(8)] = inst_40844);

(statearr_41013[(15)] = inst_40843);

(statearr_41013[(9)] = inst_40846);

(statearr_41013[(16)] = inst_40845);

return statearr_41013;
})();
var statearr_41014_41084 = state_40994__$1;
(statearr_41014_41084[(2)] = null);

(statearr_41014_41084[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (13))){
var state_40994__$1 = state_40994;
var statearr_41015_41085 = state_40994__$1;
(statearr_41015_41085[(2)] = true);

(statearr_41015_41085[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (22))){
var inst_40882 = (state_40994[(18)]);
var inst_40886 = cljs.core.chunk_first.call(null,inst_40882);
var inst_40887 = cljs.core.chunk_rest.call(null,inst_40882);
var inst_40888 = cljs.core.count.call(null,inst_40886);
var inst_40843 = inst_40887;
var inst_40844 = inst_40886;
var inst_40845 = inst_40888;
var inst_40846 = (0);
var state_40994__$1 = (function (){var statearr_41016 = state_40994;
(statearr_41016[(8)] = inst_40844);

(statearr_41016[(15)] = inst_40843);

(statearr_41016[(9)] = inst_40846);

(statearr_41016[(16)] = inst_40845);

return statearr_41016;
})();
var statearr_41017_41086 = state_40994__$1;
(statearr_41017_41086[(2)] = null);

(statearr_41017_41086[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (36))){
var inst_40835 = (state_40994[(12)]);
var inst_40936 = (state_40994[(10)]);
var inst_40837 = (state_40994[(13)]);
var inst_40836 = (state_40994[(14)]);
var inst_40932 = (state_40994[(20)]);
var inst_40937 = (state_40994[(11)]);
var inst_40941 = (function (){var vec__40831 = inst_40835;
var command = inst_40836;
var params = inst_40837;
var timer_name__15816__auto__ = "Receive weather results";
var ignore__15817__auto__ = inst_40932;
var chs = inst_40936;
var data = inst_40937;
return ((function (vec__40831,command,params,timer_name__15816__auto__,ignore__15817__auto__,chs,data,inst_40835,inst_40936,inst_40837,inst_40836,inst_40932,inst_40937,state_val_40995,c__38370__auto___41069){
return (function (){
console.timeEnd("compute-weather");

cljs.core.reset_BANG_.call(null,weathergen.ui.weather_data,data);

return cljs.core.reset_BANG_.call(null,weathergen.ui.weather_data_params,params);
});
;})(vec__40831,command,params,timer_name__15816__auto__,ignore__15817__auto__,chs,data,inst_40835,inst_40936,inst_40837,inst_40836,inst_40932,inst_40937,state_val_40995,c__38370__auto___41069))
})();
var inst_40942 = javelin.core.dosync_STAR_.call(null,inst_40941);
var inst_40943 = cljs.core.deref.call(null,weathergen.ui.movement_params);
var inst_40944 = new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(inst_40943);
var state_40994__$1 = (function (){var statearr_41018 = state_40994;
(statearr_41018[(21)] = inst_40942);

return statearr_41018;
})();
if(cljs.core.truth_(inst_40944)){
var statearr_41019_41087 = state_40994__$1;
(statearr_41019_41087[(1)] = (39));

} else {
var statearr_41020_41088 = state_40994__$1;
(statearr_41020_41088[(1)] = (40));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (41))){
var inst_40971 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
var statearr_41021_41089 = state_40994__$1;
(statearr_41021_41089[(2)] = inst_40971);

(statearr_41021_41089[(1)] = (38));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (43))){
var inst_40959 = ((-60) * (6));
var inst_40960 = cljs.core.deref.call(null,weathergen.ui.movement_params);
var inst_40961 = new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(inst_40960);
var inst_40962 = (inst_40959 / inst_40961);
var inst_40963 = Math.floor(inst_40962);
var inst_40964 = weathergen.ui.move.call(null,inst_40963);
var state_40994__$1 = state_40994;
var statearr_41022_41090 = state_40994__$1;
(statearr_41022_41090[(2)] = inst_40964);

(statearr_41022_41090[(1)] = (45));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (29))){
var state_40994__$1 = state_40994;
var statearr_41023_41091 = state_40994__$1;
(statearr_41023_41091[(2)] = false);

(statearr_41023_41091[(1)] = (30));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (44))){
var inst_40966 = weathergen.ui.move.call(null,(1));
var state_40994__$1 = state_40994;
var statearr_41024_41092 = state_40994__$1;
(statearr_41024_41092[(2)] = inst_40966);

(statearr_41024_41092[(1)] = (45));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (6))){
var inst_40929 = (state_40994[(2)]);
var inst_40930 = cljs.core.reset_BANG_.call(null,weathergen.ui.computing,true);
var inst_40931 = console.time("compute-weather");
var inst_40932 = console.time("Receive weather results");
var inst_40933 = cljs.core.map.call(null,new cljs.core.Keyword(null,"ch","ch",-554717905),weathergen.ui.workers);
var inst_40934 = cljs.core.set.call(null,inst_40933);
var inst_40935 = cljs.core.PersistentHashMap.EMPTY;
var inst_40936 = inst_40934;
var inst_40937 = inst_40935;
var state_40994__$1 = (function (){var statearr_41025 = state_40994;
(statearr_41025[(22)] = inst_40929);

(statearr_41025[(10)] = inst_40936);

(statearr_41025[(20)] = inst_40932);

(statearr_41025[(23)] = inst_40931);

(statearr_41025[(11)] = inst_40937);

(statearr_41025[(24)] = inst_40930);

return statearr_41025;
})();
var statearr_41026_41093 = state_40994__$1;
(statearr_41026_41093[(2)] = null);

(statearr_41026_41093[(1)] = (34));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (28))){
var state_40994__$1 = state_40994;
var statearr_41027_41094 = state_40994__$1;
(statearr_41027_41094[(2)] = true);

(statearr_41027_41094[(1)] = (30));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (25))){
var inst_40892 = (state_40994[(17)]);
var inst_40897 = inst_40892.cljs$lang$protocol_mask$partition0$;
var inst_40898 = (inst_40897 & (64));
var inst_40899 = inst_40892.cljs$core$ISeq$;
var inst_40900 = (cljs.core.PROTOCOL_SENTINEL === inst_40899);
var inst_40901 = ((inst_40898) || (inst_40900));
var state_40994__$1 = state_40994;
if(cljs.core.truth_(inst_40901)){
var statearr_41028_41095 = state_40994__$1;
(statearr_41028_41095[(1)] = (28));

} else {
var statearr_41029_41096 = state_40994__$1;
(statearr_41029_41096[(1)] = (29));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (34))){
var inst_40936 = (state_40994[(10)]);
var inst_40939 = cljs.core.empty_QMARK_.call(null,inst_40936);
var state_40994__$1 = state_40994;
if(inst_40939){
var statearr_41030_41097 = state_40994__$1;
(statearr_41030_41097[(1)] = (36));

} else {
var statearr_41031_41098 = state_40994__$1;
(statearr_41031_41098[(1)] = (37));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (17))){
var inst_40852 = (state_40994[(7)]);
var state_40994__$1 = state_40994;
var statearr_41032_41099 = state_40994__$1;
(statearr_41032_41099[(2)] = inst_40852);

(statearr_41032_41099[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (3))){
var inst_40992 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_40994__$1,inst_40992);
} else {
if((state_val_40995 === (12))){
var inst_40868 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
if(cljs.core.truth_(inst_40868)){
var statearr_41033_41100 = state_40994__$1;
(statearr_41033_41100[(1)] = (16));

} else {
var statearr_41034_41101 = state_40994__$1;
(statearr_41034_41101[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (2))){
var state_40994__$1 = state_40994;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_40994__$1,(4),weathergen.ui.command_ch);
} else {
if((state_val_40995 === (23))){
var inst_40882 = (state_40994[(18)]);
var inst_40892 = (state_40994[(17)]);
var inst_40892__$1 = cljs.core.first.call(null,inst_40882);
var inst_40894 = (inst_40892__$1 == null);
var inst_40895 = cljs.core.not.call(null,inst_40894);
var state_40994__$1 = (function (){var statearr_41035 = state_40994;
(statearr_41035[(17)] = inst_40892__$1);

return statearr_41035;
})();
if(inst_40895){
var statearr_41036_41102 = state_40994__$1;
(statearr_41036_41102[(1)] = (25));

} else {
var statearr_41037_41103 = state_40994__$1;
(statearr_41037_41103[(1)] = (26));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (35))){
var inst_40987 = (state_40994[(2)]);
var inst_40988 = console.timeEnd("Receive weather results");
var inst_40989 = cljs.core.reset_BANG_.call(null,weathergen.ui.computing,false);
var state_40994__$1 = (function (){var statearr_41038 = state_40994;
(statearr_41038[(25)] = inst_40988);

(statearr_41038[(26)] = inst_40989);

(statearr_41038[(27)] = inst_40987);

return statearr_41038;
})();
var statearr_41039_41104 = state_40994__$1;
(statearr_41039_41104[(2)] = null);

(statearr_41039_41104[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (19))){
var inst_40882 = (state_40994[(18)]);
var inst_40884 = cljs.core.chunked_seq_QMARK_.call(null,inst_40882);
var state_40994__$1 = state_40994;
if(inst_40884){
var statearr_41040_41105 = state_40994__$1;
(statearr_41040_41105[(1)] = (22));

} else {
var statearr_41041_41106 = state_40994__$1;
(statearr_41041_41106[(1)] = (23));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (11))){
var state_40994__$1 = state_40994;
var statearr_41042_41107 = state_40994__$1;
(statearr_41042_41107[(2)] = false);

(statearr_41042_41107[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (9))){
var inst_40927 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
var statearr_41043_41108 = state_40994__$1;
(statearr_41043_41108[(2)] = inst_40927);

(statearr_41043_41108[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (5))){
var inst_40846 = (state_40994[(9)]);
var inst_40845 = (state_40994[(16)]);
var inst_40848 = (inst_40846 < inst_40845);
var inst_40849 = inst_40848;
var state_40994__$1 = state_40994;
if(cljs.core.truth_(inst_40849)){
var statearr_41044_41109 = state_40994__$1;
(statearr_41044_41109[(1)] = (7));

} else {
var statearr_41045_41110 = state_40994__$1;
(statearr_41045_41110[(1)] = (8));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (14))){
var state_40994__$1 = state_40994;
var statearr_41046_41111 = state_40994__$1;
(statearr_41046_41111[(2)] = false);

(statearr_41046_41111[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (45))){
var inst_40968 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
var statearr_41047_41112 = state_40994__$1;
(statearr_41047_41112[(2)] = inst_40968);

(statearr_41047_41112[(1)] = (41));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (26))){
var state_40994__$1 = state_40994;
var statearr_41048_41113 = state_40994__$1;
(statearr_41048_41113[(2)] = false);

(statearr_41048_41113[(1)] = (27));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (16))){
var inst_40852 = (state_40994[(7)]);
var inst_40870 = cljs.core.apply.call(null,cljs.core.hash_map,inst_40852);
var state_40994__$1 = state_40994;
var statearr_41049_41114 = state_40994__$1;
(statearr_41049_41114[(2)] = inst_40870);

(statearr_41049_41114[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (38))){
var inst_40985 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
var statearr_41050_41115 = state_40994__$1;
(statearr_41050_41115[(2)] = inst_40985);

(statearr_41050_41115[(1)] = (35));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (30))){
var inst_40905 = (state_40994[(2)]);
var state_40994__$1 = state_40994;
var statearr_41054_41116 = state_40994__$1;
(statearr_41054_41116[(2)] = inst_40905);

(statearr_41054_41116[(1)] = (27));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (10))){
var inst_40852 = (state_40994[(7)]);
var inst_40857 = inst_40852.cljs$lang$protocol_mask$partition0$;
var inst_40858 = (inst_40857 & (64));
var inst_40859 = inst_40852.cljs$core$ISeq$;
var inst_40860 = (cljs.core.PROTOCOL_SENTINEL === inst_40859);
var inst_40861 = ((inst_40858) || (inst_40860));
var state_40994__$1 = state_40994;
if(cljs.core.truth_(inst_40861)){
var statearr_41055_41117 = state_40994__$1;
(statearr_41055_41117[(1)] = (13));

} else {
var statearr_41056_41118 = state_40994__$1;
(statearr_41056_41118[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (18))){
var inst_40837 = (state_40994[(13)]);
var inst_40844 = (state_40994[(8)]);
var inst_40843 = (state_40994[(15)]);
var inst_40846 = (state_40994[(9)]);
var inst_40845 = (state_40994[(16)]);
var inst_40873 = (state_40994[(2)]);
var inst_40874 = cljs.core.get.call(null,inst_40873,new cljs.core.Keyword(null,"cells","cells",-985166822));
var inst_40875 = cljs.core.get.call(null,inst_40873,new cljs.core.Keyword(null,"worker","worker",938239996));
var inst_40876 = cljs.core.assoc.call(null,inst_40837,new cljs.core.Keyword(null,"cells","cells",-985166822),inst_40874);
var inst_40877 = weathergen.encoding.encode.call(null,inst_40876);
var inst_40878 = weathergen.ui.post_message.call(null,inst_40875,inst_40877);
var inst_40879 = (inst_40846 + (1));
var tmp41051 = inst_40844;
var tmp41052 = inst_40843;
var tmp41053 = inst_40845;
var inst_40843__$1 = tmp41052;
var inst_40844__$1 = tmp41051;
var inst_40845__$1 = tmp41053;
var inst_40846__$1 = inst_40879;
var state_40994__$1 = (function (){var statearr_41057 = state_40994;
(statearr_41057[(8)] = inst_40844__$1);

(statearr_41057[(28)] = inst_40878);

(statearr_41057[(15)] = inst_40843__$1);

(statearr_41057[(9)] = inst_40846__$1);

(statearr_41057[(16)] = inst_40845__$1);

return statearr_41057;
})();
var statearr_41058_41119 = state_40994__$1;
(statearr_41058_41119[(2)] = null);

(statearr_41058_41119[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (42))){
var inst_40948 = (state_40994[(2)]);
var inst_40949 = cljs.core.deref.call(null,weathergen.ui.weather_data_params);
var inst_40950 = new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(inst_40949);
var inst_40951 = new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(inst_40950);
var inst_40952 = weathergen.time.campaign_time__GT_minutes.call(null,inst_40951);
var inst_40953 = cljs.core.deref.call(null,weathergen.ui.weather_data_params);
var inst_40954 = new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(inst_40953);
var inst_40955 = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(inst_40954);
var inst_40956 = weathergen.time.campaign_time__GT_minutes.call(null,inst_40955);
var inst_40957 = cljs.core._EQ_.call(null,inst_40952,inst_40956);
var state_40994__$1 = (function (){var statearr_41059 = state_40994;
(statearr_41059[(29)] = inst_40948);

return statearr_41059;
})();
if(inst_40957){
var statearr_41060_41120 = state_40994__$1;
(statearr_41060_41120[(1)] = (43));

} else {
var statearr_41061_41121 = state_40994__$1;
(statearr_41061_41121[(1)] = (44));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_40995 === (37))){
var inst_40936 = (state_40994[(10)]);
var inst_40976 = cljs.core.vec.call(null,inst_40936);
var state_40994__$1 = state_40994;
return cljs.core.async.ioc_alts_BANG_.call(null,state_40994__$1,(46),inst_40976);
} else {
if((state_val_40995 === (8))){
var inst_40882 = (state_40994[(18)]);
var inst_40843 = (state_40994[(15)]);
var inst_40882__$1 = cljs.core.seq.call(null,inst_40843);
var state_40994__$1 = (function (){var statearr_41062 = state_40994;
(statearr_41062[(18)] = inst_40882__$1);

return statearr_41062;
})();
if(inst_40882__$1){
var statearr_41063_41122 = state_40994__$1;
(statearr_41063_41122[(1)] = (19));

} else {
var statearr_41064_41123 = state_40994__$1;
(statearr_41064_41123[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__38370__auto___41069))
;
return ((function (switch__38275__auto__,c__38370__auto___41069){
return (function() {
var weathergen$ui$state_machine__38276__auto__ = null;
var weathergen$ui$state_machine__38276__auto____0 = (function (){
var statearr_41065 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_41065[(0)] = weathergen$ui$state_machine__38276__auto__);

(statearr_41065[(1)] = (1));

return statearr_41065;
});
var weathergen$ui$state_machine__38276__auto____1 = (function (state_40994){
while(true){
var ret_value__38277__auto__ = (function (){try{while(true){
var result__38278__auto__ = switch__38275__auto__.call(null,state_40994);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38278__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38278__auto__;
}
break;
}
}catch (e41066){if((e41066 instanceof Object)){
var ex__38279__auto__ = e41066;
var statearr_41067_41124 = state_40994;
(statearr_41067_41124[(5)] = ex__38279__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_40994);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e41066;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38277__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__41125 = state_40994;
state_40994 = G__41125;
continue;
} else {
return ret_value__38277__auto__;
}
break;
}
});
weathergen$ui$state_machine__38276__auto__ = function(state_40994){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38276__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38276__auto____1.call(this,state_40994);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38276__auto____0;
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38276__auto____1;
return weathergen$ui$state_machine__38276__auto__;
})()
;})(switch__38275__auto__,c__38370__auto___41069))
})();
var state__38372__auto__ = (function (){var statearr_41068 = f__38371__auto__.call(null);
(statearr_41068[(6)] = c__38370__auto___41069);

return statearr_41068;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__38372__auto__);
});})(c__38370__auto___41069))
);

weathergen.ui.recompute = (function weathergen$ui$recompute(params){
var c__38370__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__38370__auto__){
return (function (){
var f__38371__auto__ = (function (){var switch__38275__auto__ = ((function (c__38370__auto__){
return (function (state_41132){
var state_val_41133 = (state_41132[(1)]);
if((state_val_41133 === (1))){
var inst_41126 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_41127 = [new cljs.core.Keyword(null,"compute-weather","compute-weather",-1681954694),params];
var inst_41128 = (new cljs.core.PersistentVector(null,2,(5),inst_41126,inst_41127,null));
var state_41132__$1 = state_41132;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_41132__$1,(2),weathergen.ui.command_ch,inst_41128);
} else {
if((state_val_41133 === (2))){
var inst_41130 = (state_41132[(2)]);
var state_41132__$1 = state_41132;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_41132__$1,inst_41130);
} else {
return null;
}
}
});})(c__38370__auto__))
;
return ((function (switch__38275__auto__,c__38370__auto__){
return (function() {
var weathergen$ui$recompute_$_state_machine__38276__auto__ = null;
var weathergen$ui$recompute_$_state_machine__38276__auto____0 = (function (){
var statearr_41134 = [null,null,null,null,null,null,null];
(statearr_41134[(0)] = weathergen$ui$recompute_$_state_machine__38276__auto__);

(statearr_41134[(1)] = (1));

return statearr_41134;
});
var weathergen$ui$recompute_$_state_machine__38276__auto____1 = (function (state_41132){
while(true){
var ret_value__38277__auto__ = (function (){try{while(true){
var result__38278__auto__ = switch__38275__auto__.call(null,state_41132);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38278__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38278__auto__;
}
break;
}
}catch (e41135){if((e41135 instanceof Object)){
var ex__38279__auto__ = e41135;
var statearr_41136_41138 = state_41132;
(statearr_41136_41138[(5)] = ex__38279__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_41132);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e41135;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38277__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__41139 = state_41132;
state_41132 = G__41139;
continue;
} else {
return ret_value__38277__auto__;
}
break;
}
});
weathergen$ui$recompute_$_state_machine__38276__auto__ = function(state_41132){
switch(arguments.length){
case 0:
return weathergen$ui$recompute_$_state_machine__38276__auto____0.call(this);
case 1:
return weathergen$ui$recompute_$_state_machine__38276__auto____1.call(this,state_41132);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
weathergen$ui$recompute_$_state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$recompute_$_state_machine__38276__auto____0;
weathergen$ui$recompute_$_state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$recompute_$_state_machine__38276__auto____1;
return weathergen$ui$recompute_$_state_machine__38276__auto__;
})()
;})(switch__38275__auto__,c__38370__auto__))
})();
var state__38372__auto__ = (function (){var statearr_41137 = f__38371__auto__.call(null);
(statearr_41137[(6)] = c__38370__auto__);

return statearr_41137;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__38372__auto__);
});})(c__38370__auto__))
);

return c__38370__auto__;
});
weathergen.ui.fmap_load_state = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"not-loaded","not-loaded",666902159)], null));
weathergen.ui.fmap_worker = new cljs.core.Keyword(null,"disabled","disabled",-1529784218);
weathergen.ui.handle_fmap_worker_message = (function weathergen$ui$handle_fmap_worker_message(data){
var vec__41140 = data;
var seq__41141 = cljs.core.seq.call(null,vec__41140);
var first__41142 = cljs.core.first.call(null,seq__41141);
var seq__41141__$1 = cljs.core.next.call(null,seq__41141);
var type = first__41142;
var payload = seq__41141__$1;
cljs.core.swap_BANG_.call(null,weathergen.ui.fmap_load_state,cljs.core.update,new cljs.core.Keyword(null,"maps-loaded","maps-loaded",-320462859),cljs.core.inc);

if((new cljs.core.Keyword(null,"maps-to-load","maps-to-load",-73197204).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.fmap_load_state)) === (0))){
return cljs.core.swap_BANG_.call(null,weathergen.ui.fmap_load_state,cljs.core.assoc,new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"loaded","loaded",-1246482293));
} else {
return null;
}
});
weathergen.ui.fmap_worker.onmessage = (function (e){
return weathergen.ui.handle_fmap_worker_message.call(null,(e["data"]));
});
weathergen.ui.load_fmap = (function weathergen$ui$load_fmap(fmap_map){
if(cljs.core.empty_QMARK_.call(null,fmap_map)){
return null;
} else {
var vec__41143 = cljs.core.first.call(null,fmap_map);
var k = cljs.core.nth.call(null,vec__41143,(0),null);
var v = cljs.core.nth.call(null,vec__41143,(1),null);
console.debug("Dispatching load of fmap",v);

weathergen.ui.post_message.call(null,weathergen.ui.fmap_worker,["load-fmap",k,v,weathergen.filesystem.file_buf.call(null,v)]);

return setTimeout(((function (vec__41143,k,v){
return (function (){
return weathergen.ui.load_fmap.call(null,cljs.core.dissoc.call(null,fmap_map,k));
});})(vec__41143,k,v))
,(0));
}
});
/**
 * Asynchronously loads the fmaps for the mission, storing the data in
 *   the worker for future computation.
 */
weathergen.ui.load_fmaps = (function weathergen$ui$load_fmaps(){
var mission_path = new cljs.core.Keyword(null,"path","path",-188191168).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission));
var mission_time = weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission));
var mission_dir = weathergen.filesystem.parent.call(null,mission_path);
var mission_name = weathergen.filesystem.basename.call(null,mission_path,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"omit-extension?","omit-extension?",-1855127967),true], null));
var twx_path = weathergen.filesystem.path_combine.call(null,mission_dir,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(mission_name),".twx"].join(''));
var twx_data = (function (){try{if(cljs.core.truth_(weathergen.filesystem.exists_QMARK_.call(null,twx_path))){
var G__41148 = twx_path;
var G__41148__$1 = (((G__41148 == null))?null:weathergen.filesystem.file_buf.call(null,G__41148));
if((G__41148__$1 == null)){
return null;
} else {
return weathergen.twx.parse.call(null,G__41148__$1);
}
} else {
return null;
}
}catch (e41147){var _ = e41147;
console.warn("Could not parse TWX data at",twx_path);

return null;
}})();
var fmap_path = weathergen.filesystem.path_combine.call(null,mission_dir,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(mission_name),".fmap"].join(''));
var initial_fmap = (cljs.core.truth_((function (){var and__4120__auto__ = weathergen.filesystem.exists_QMARK_.call(null,fmap_path);
if(cljs.core.truth_(and__4120__auto__)){
return cljs.core._EQ_.call(null,weathergen.twx.map_model,new cljs.core.Keyword(null,"model","model",331153215).cljs$core$IFn$_invoke$arity$1(twx_data));
} else {
return and__4120__auto__;
}
})())?cljs.core.PersistentArrayMap.createAsIfByAssoc([cljs.core.select_keys.call(null,mission_time,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"day","day",-274800446),new cljs.core.Keyword(null,"hour","hour",-555989214),new cljs.core.Keyword(null,"minute","minute",-642875969)], null)),fmap_path]):null);
var maps_dir = weathergen.filesystem.path_combine.call(null,mission_dir,"WeatherMapsUpdates");
var fmap_list = cljs.core.remove.call(null,cljs.core.nil_QMARK_,cljs.core.map.call(null,((function (mission_path,mission_time,mission_dir,mission_name,twx_path,twx_data,fmap_path,initial_fmap,maps_dir){
return (function (p1__41146_SHARP_){
return cljs.core.re_matches.call(null,/([1-9]?[0-9])([0-9]{2})([0-9]{2}).[fF][mM][aA][pP]/,p1__41146_SHARP_);
});})(mission_path,mission_time,mission_dir,mission_name,twx_path,twx_data,fmap_path,initial_fmap,maps_dir))
,weathergen.filesystem.ls.call(null,maps_dir)));
var fmap_map = cljs.core.reduce.call(null,((function (mission_path,mission_time,mission_dir,mission_name,twx_path,twx_data,fmap_path,initial_fmap,maps_dir,fmap_list){
return (function (fmaps,fmap_match){
var vec__41149 = fmap_match;
var f = cljs.core.nth.call(null,vec__41149,(0),null);
var d = cljs.core.nth.call(null,vec__41149,(1),null);
var h = cljs.core.nth.call(null,vec__41149,(2),null);
var m = cljs.core.nth.call(null,vec__41149,(3),null);
return cljs.core.assoc.call(null,fmaps,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),weathergen.util.str__GT_long.call(null,d),new cljs.core.Keyword(null,"hour","hour",-555989214),weathergen.util.str__GT_long.call(null,h),new cljs.core.Keyword(null,"minute","minute",-642875969),weathergen.util.str__GT_long.call(null,m)], null),weathergen.filesystem.path_combine.call(null,maps_dir,f));
});})(mission_path,mission_time,mission_dir,mission_name,twx_path,twx_data,fmap_path,initial_fmap,maps_dir,fmap_list))
,initial_fmap,fmap_list);
cljs.core.swap_BANG_.call(null,weathergen.ui.fmap_load_state,cljs.core.assoc,new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"loading","loading",-737050189),new cljs.core.Keyword(null,"maps-loaded","maps-loaded",-320462859),(0),new cljs.core.Keyword(null,"maps-to-load","maps-to-load",-73197204),cljs.core.count.call(null,fmap_map));

weathergen.ui.post_message.call(null,weathergen.ui.fmap_worker,["clear-fmaps"]);

return weathergen.ui.load_fmap.call(null,fmap_map);
});
javelin.core.formula.call(null,(function (weather_params,prevent_recomputation_QMARK_){
if(cljs.core.truth_((function (){var and__4120__auto__ = cljs.core.not.call(null,prevent_recomputation_QMARK_);
if(and__4120__auto__){
return weather_params;
} else {
return and__4120__auto__;
}
})())){
return weathergen.ui.recompute.call(null,weather_params);
} else {
return null;
}
})).call(null,weathergen.ui.weather_params,weathergen.ui.prevent_recomputation_QMARK_);
/**
 * Advances the weather by `steps` steps, unless that would move past
 *   the max time.
 */
weathergen.ui.move = (function weathergen$ui$move(steps){
return javelin.core.dosync_STAR_.call(null,(function (){
var minutes = (steps * new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)));
var current_time = weathergen.time.campaign_time__GT_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))));
var desired_time = (current_time + minutes);
var new_time = (function (){var temp__5718__auto__ = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)));
if(cljs.core.truth_(temp__5718__auto__)){
var max_time = temp__5718__auto__;
var x__4222__auto__ = weathergen.time.campaign_time__GT_minutes.call(null,max_time);
var y__4223__auto__ = desired_time;
return ((x__4222__auto__ < y__4223__auto__) ? x__4222__auto__ : y__4223__auto__);
} else {
return desired_time;
}
})();
var actual_steps = ((new_time - current_time) / new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)));
var map__41152 = cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.step,cljs.core.deref.call(null,weathergen.ui.movement_params),actual_steps);
var map__41152__$1 = (((((!((map__41152 == null))))?(((((map__41152.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41152.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41152):map__41152);
var time = cljs.core.get.call(null,map__41152__$1,new cljs.core.Keyword(null,"time","time",1385887882));
return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc,new cljs.core.Keyword(null,"displayed","displayed",-436192586),new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(time));
}));
});
weathergen.ui.jump_to_time_STAR_ = (function weathergen$ui$jump_to_time_STAR_(t){
return javelin.core.dosync_STAR_.call(null,(function (){
var map__41154 = cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.jump_to_time,cljs.core.deref.call(null,weathergen.ui.movement_params),t);
var map__41154__$1 = (((((!((map__41154 == null))))?(((((map__41154.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41154.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41154):map__41154);
var time = cljs.core.get.call(null,map__41154__$1,new cljs.core.Keyword(null,"time","time",1385887882));
return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc,new cljs.core.Keyword(null,"displayed","displayed",-436192586),new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(time));
}));
});
/**
 * Adjust the time coordinate to match the displayed time.
 */
weathergen.ui.jump_to_time = (function weathergen$ui$jump_to_time(){
var desired = new cljs.core.Keyword(null,"displayed","displayed",-436192586).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.time_params));
var max_time = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)));
if(((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166),cljs.core.deref.call(null,weathergen.ui.display_mode))) || (cljs.core.not.call(null,max_time)) || ((weathergen.time.campaign_time__GT_minutes.call(null,desired) <= weathergen.time.campaign_time__GT_minutes.call(null,max_time))))){
return weathergen.ui.jump_to_time_STAR_.call(null,new cljs.core.Keyword(null,"displayed","displayed",-436192586).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.time_params)));
} else {
return null;
}
});
/**
 * Adjust the time coordinate so that the current time is adjusted to
 *   match the displayed time without changing the location in weather
 *   space.
 */
weathergen.ui.set_time = (function weathergen$ui$set_time(){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.set_time,new cljs.core.Keyword(null,"displayed","displayed",-436192586).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.time_params)));
});
weathergen.ui.change_location = (function weathergen$ui$change_location(mission,airbase){
if(cljs.core.empty_QMARK_.call(null,airbase)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.selected_cell,null);
} else {
return cljs.core.reset_BANG_.call(null,weathergen.ui.selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),airbase,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),cljs.core.mapv.call(null,cljs.core.long$,cljs.core.juxt.call(null,new cljs.core.Keyword(null,"x","x",2099068185),new cljs.core.Keyword(null,"y","y",-1757859776)).call(null,weathergen.coordinates.fgrid__GT_weather.call(null,mission,new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(airbase),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(airbase))))], null));
}
});
/**
 * Compute the extensionless name of the mission file, or default to
 *   'vmt'.
 */
weathergen.ui.mission_name_base = (function weathergen$ui$mission_name_base(mission_name){
if(cljs.core.empty_QMARK_.call(null,mission_name)){
return "vmt";
} else {
var i = mission_name.lastIndexOf(".");
if((i < (0))){
return mission_name;
} else {
return cljs.core.subs.call(null,mission_name,(0),i);
}
}
});
weathergen.ui.safari_safe_binary = (function weathergen$ui$safari_safe_binary(blob){
if(cljs.core.truth_(weathergen.ui.safari_QMARK_)){
return (new Blob([blob],({"type": "application/octet-stream"})));
} else {
return blob;
}
});
/**
 * Returns the filename for an FMAP at time `t`.
 */
weathergen.ui.fmap_filename = (function weathergen$ui$fmap_filename(t){
return goog.string.format("%d%02d%02d.fmap",new cljs.core.Keyword(null,"day","day",-274800446).cljs$core$IFn$_invoke$arity$1(t),new cljs.core.Keyword(null,"hour","hour",-555989214).cljs$core$IFn$_invoke$arity$1(t),new cljs.core.Keyword(null,"minute","minute",-642875969).cljs$core$IFn$_invoke$arity$1(t));
});
weathergen.ui.twx_filename = (function weathergen$ui$twx_filename(mission_name){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,mission_name)),".twx"].join('');
});
weathergen.ui.save_fmap = (function weathergen$ui$save_fmap(weather_params,movement_params,cloud_params,weather_data){
var t = cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)], null));
var vec__41156 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(weather_params);
var x_cells = cljs.core.nth.call(null,vec__41156,(0),null);
var y_cells = cljs.core.nth.call(null,vec__41156,(1),null);
var data = ((cljs.core._EQ_.call(null,weather_params,weathergen.ui.weather_data_params))?weather_data:weathergen.model.weather_grid.call(null,cljs.core.assoc.call(null,weather_params,new cljs.core.Keyword(null,"cells","cells",-985166822),(function (){var iter__4523__auto__ = ((function (t,vec__41156,x_cells,y_cells){
return (function weathergen$ui$save_fmap_$_iter__41159(s__41160){
return (new cljs.core.LazySeq(null,((function (t,vec__41156,x_cells,y_cells){
return (function (){
var s__41160__$1 = s__41160;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__41160__$1);
if(temp__5720__auto__){
var xs__6277__auto__ = temp__5720__auto__;
var x = cljs.core.first.call(null,xs__6277__auto__);
var iterys__4519__auto__ = ((function (s__41160__$1,x,xs__6277__auto__,temp__5720__auto__,t,vec__41156,x_cells,y_cells){
return (function weathergen$ui$save_fmap_$_iter__41159_$_iter__41161(s__41162){
return (new cljs.core.LazySeq(null,((function (s__41160__$1,x,xs__6277__auto__,temp__5720__auto__,t,vec__41156,x_cells,y_cells){
return (function (){
var s__41162__$1 = s__41162;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__41162__$1);
if(temp__5720__auto____$1){
var s__41162__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__41162__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__41162__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__41164 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__41163 = (0);
while(true){
if((i__41163 < size__4522__auto__)){
var y = cljs.core._nth.call(null,c__4521__auto__,i__41163);
cljs.core.chunk_append.call(null,b__41164,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__41165 = (i__41163 + (1));
i__41163 = G__41165;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41164),weathergen$ui$save_fmap_$_iter__41159_$_iter__41161.call(null,cljs.core.chunk_rest.call(null,s__41162__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41164),null);
}
} else {
var y = cljs.core.first.call(null,s__41162__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),weathergen$ui$save_fmap_$_iter__41159_$_iter__41161.call(null,cljs.core.rest.call(null,s__41162__$2)));
}
} else {
return null;
}
break;
}
});})(s__41160__$1,x,xs__6277__auto__,temp__5720__auto__,t,vec__41156,x_cells,y_cells))
,null,null));
});})(s__41160__$1,x,xs__6277__auto__,temp__5720__auto__,t,vec__41156,x_cells,y_cells))
;
var fs__4520__auto__ = cljs.core.seq.call(null,iterys__4519__auto__.call(null,cljs.core.range.call(null,y_cells)));
if(fs__4520__auto__){
return cljs.core.concat.call(null,fs__4520__auto__,weathergen$ui$save_fmap_$_iter__41159.call(null,cljs.core.rest.call(null,s__41160__$1)));
} else {
var G__41166 = cljs.core.rest.call(null,s__41160__$1);
s__41160__$1 = G__41166;
continue;
}
} else {
return null;
}
break;
}
});})(t,vec__41156,x_cells,y_cells))
,null,null));
});})(t,vec__41156,x_cells,y_cells))
;
return iter__4523__auto__.call(null,cljs.core.range.call(null,x_cells));
})())));
var buf = vmt.fmap.encode.call(null,data,weather_params,movement_params,cloud_params);
return weathergen.ui.common.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),Buffer.from(buf.buffer),new cljs.core.Keyword(null,"title","title",636505583),"Save FMAP",new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"FMAP Files",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["fmap"], null)], null),new cljs.core.Keyword(null,"default-path","default-path",-1046856029),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)))),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.fmap_filename.call(null,t))].join('')], null));
});
weathergen.ui.settings_blob = (function weathergen$ui$settings_blob(){
return (new Blob([cljs.core.pr_str.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),cljs.core.deref.call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"display-params","display-params",573405707),cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"revision","revision",-1350113114),weathergen.ui.revision], null))],({"type": "text/plain"})));
});
weathergen.ui.settings_filename = (function weathergen$ui$settings_filename(mission_name){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,mission_name)),".vmtw"].join('');
});
weathergen.ui.save_weather_settings = (function weathergen$ui$save_weather_settings(_){
return weathergen.ui.common.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),cljs.core.pr_str.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),cljs.core.deref.call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"display-params","display-params",573405707),cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"revision","revision",-1350113114),weathergen.ui.revision], null)),new cljs.core.Keyword(null,"title","title",636505583),"Save weather settings",new cljs.core.Keyword(null,"default-path","default-path",-1046856029),weathergen.ui.settings_filename.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission))),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"VMT Weather Settings",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtw"], null)], null)], null)], null));
});
/**
 * Returns a JS blob containing TWX file data.
 */
weathergen.ui.twx_blob = (function weathergen$ui$twx_blob(){
return (new Blob([weathergen.twx.get_twx.call(null)]));
});
/**
 * Initiates a download of a TWX file.
 */
weathergen.ui.save_twx = (function weathergen$ui$save_twx(mission_name){
return weathergen.ui.common.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),weathergen.ui.safari_safe_binary.call(null,weathergen.ui.twx_blob.call(null)),new cljs.core.Keyword(null,"title","title",636505583),"Save TWX",new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"TWX Files",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["twx"], null)], null)], null),new cljs.core.Keyword(null,"default-path","default-path",-1046856029),weathergen.ui.twx_filename.call(null,mission_name)], null));
});
weathergen.ui.load_weather_settings = (function weathergen$ui$load_weather_settings(_){
var vec__41167 = weathergen.ui.electron.remote.dialog.showOpenDialog(cljs.core.clj__GT_js.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"title","title",636505583),"Select a VMT or Weathergen Weather File",new cljs.core.Keyword(null,"properties","properties",685819552),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["openFile"], null),new cljs.core.Keyword(null,"defaultPath","defaultPath",-582313676),weathergen.falcon.files.mission.campaign_dir.call(null,cljs.core.deref.call(null,weathergen.ui.mission)),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"VMT Weather Settings",new cljs.core.Keyword(null,"extensions","extensions",-1103629196),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtw"], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"WeatherGen Settings",new cljs.core.Keyword(null,"extensions","extensions",-1103629196),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["edn"], null)], null)], null)], null)));
var path = cljs.core.nth.call(null,vec__41167,(0),null);
if(cljs.core.truth_(path)){
var data = weathergen.model.upgrade.call(null,cljs.reader.read_string.call(null,weathergen.filesystem.file_text.call(null,path)),weathergen.ui.revision);
var t = weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission));
return javelin.core.dosync_STAR_.call(null,((function (data,t,vec__41167,path){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in.call(null,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365).cljs$core$IFn$_invoke$arity$1(data),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)], null),t));

cljs.core.reset_BANG_.call(null,weathergen.ui.display_params,cljs.core.assoc.call(null,new cljs.core.Keyword(null,"display-params","display-params",573405707).cljs$core$IFn$_invoke$arity$1(data),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"mission-name","mission-name",1479736582),null,new cljs.core.Keyword(null,"from","from",1815293044),t,new cljs.core.Keyword(null,"to","to",192099007),weathergen.time.add_minutes.call(null,t,((6) * (60))),new cljs.core.Keyword(null,"step","step",1288888124),new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"movement-params","movement-params",293385966).cljs$core$IFn$_invoke$arity$1(data))], null)));

cljs.core.reset_BANG_.call(null,weathergen.ui.movement_params,new cljs.core.Keyword(null,"movement-params","movement-params",293385966).cljs$core$IFn$_invoke$arity$1(data));

cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983).cljs$core$IFn$_invoke$arity$1(data));

return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc,new cljs.core.Keyword(null,"displayed","displayed",-436192586),t);
});})(data,t,vec__41167,path))
);
} else {
return null;
}
});
hoplon.core.do_watch.call(null,weathergen.ui.mission,(function (_,mission){
if(cljs.core.truth_(mission)){
var current = weathergen.falcon.files.mission.mission_time.call(null,mission);
cljs.core.swap_BANG_.call(null,weathergen.ui.display_params,cljs.core.update,new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),((function (current){
return (function (ms){
return cljs.core.assoc.call(null,ms,new cljs.core.Keyword(null,"from","from",1815293044),current,new cljs.core.Keyword(null,"to","to",192099007),weathergen.time.add_minutes.call(null,current,((60) * (6))));
});})(current))
);

cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.jump_to_time,cljs.core.deref.call(null,weathergen.ui.movement_params),current);

return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"displayed","displayed",-436192586)], null),current);
} else {
return null;
}
}));
/**
 * Loads a mission (.cam/.tac) mission file.
 */
weathergen.ui.load_mission = (function weathergen$ui$load_mission(installs,path){
var timer_name__15816__auto__ = "load-mission";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = (function (){var mission_data = (function (){var timer_name__15816__auto____$1 = "read-mission";
var ignore__15817__auto____$1 = console.time(timer_name__15816__auto____$1);
var result__15818__auto__ = weathergen.falcon.files.mission.read_mission.call(null,installs,path);
console.timeEnd(timer_name__15816__auto____$1);

return result__15818__auto__;
})();
return weathergen.progress.with_step.call(null,"Preparing views",((function (mission_data,timer_name__15816__auto__,ignore__15817__auto__){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (mission_data,timer_name__15816__auto__,ignore__15817__auto__){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.mission,mission_data);

var current = weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission));
return cljs.core.reset_BANG_.call(null,weathergen.ui.visible_sides,cljs.core.PersistentHashSet.createAsIfByAssoc([(function (){var G__41171 = weathergen.falcon.files.mission.side.call(null,mission_data,weathergen.falcon.files.mission.last_player_team.call(null,mission_data));
return G__41171;
})()]));
});})(mission_data,timer_name__15816__auto__,ignore__15817__auto__))
);
});})(mission_data,timer_name__15816__auto__,ignore__15817__auto__))
);
})();
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
});
weathergen.ui.StringDecoder = (require("string_decoder")["StringDecoder"]);
/**
 * Converts a buffer to a string.
 */
weathergen.ui.buf__GT_string = (function weathergen$ui$buf__GT_string(buf){
return (new weathergen.ui.StringDecoder()).write(buf);
});
/**
 * Converts a buffer to a string.
 */
weathergen.ui.string__GT_buf = (function weathergen$ui$string__GT_buf(s){
return Buffer.from(s);
});
/**
 * Loads a briefing (.vmtb) file given a path to a briefing and a map
 *   from installation names to their directories.
 */
weathergen.ui.load_briefing = (function weathergen$ui$load_briefing(installations,path){
return weathergen.progress.with_step.call(null,"Reading briefing file",(function (){
var map__41173 = weathergen.encoding.decode.call(null,weathergen.compression.decompress.call(null,weathergen.filesystem.file_buffer.call(null,path)));
var map__41173__$1 = (((((!((map__41173 == null))))?(((((map__41173.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41173.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41173):map__41173);
var vmtb = map__41173__$1;
var revision = cljs.core.get.call(null,map__41173__$1,new cljs.core.Keyword(null,"revision","revision",-1350113114));
var install_id = cljs.core.get.call(null,map__41173__$1,new cljs.core.Keyword(null,"install-id","install-id",-1310868737));
var briefing = cljs.core.get.call(null,map__41173__$1,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui",null,1278,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (map__41173,map__41173__$1,vmtb,revision,install_id,briefing){
return (function (){
return new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, ["load-briefing",new cljs.core.Keyword(null,"installations","installations",-2091217739),installations,new cljs.core.Keyword(null,"revision","revision",-1350113114),revision,new cljs.core.Keyword(null,"briefing?","briefing?",-568550789),(!((briefing == null)))], null);
});})(map__41173,map__41173__$1,vmtb,revision,install_id,briefing))
,null)),null,-1076552197);

if((revision < (8))){
throw cljs.core.ex_info.call(null,["This version of VMT cannot be used to load briefing files from prior versions - file format changes in BMS 4.34 resulted in incompatibilities. You will need to ask the mission creator for a new briefing file. Briefing revision: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(revision)].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"omit-stack-trace?","omit-stack-trace?",1080142229),true,new cljs.core.Keyword(null,"revision","revision",-1350113114),revision], null));
} else {
}

var mission_data = weathergen.progress.with_step.call(null,["Loading briefing from ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(path)].join(''),((function (map__41173,map__41173__$1,vmtb,revision,install_id,briefing){
return (function (){
var briefing_version_41175 = cljs.core.get_in.call(null,briefing,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"build-info","build-info",-622713066),"VERSION"], null));
var this_version_41176 = cljs.core.get.call(null,weathergen.ui.build_info,"VERSION");
if(cljs.core._EQ_.call(null,briefing_version_41175,this_version_41176)){
} else {
weathergen.progress.step_warn.call(null,["The version used to save this briefing file was ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4131__auto__ = briefing_version_41175;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "(no version present)";
}
})()),". The version of VMT you are running is ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4131__auto__ = this_version_41176;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "(no version present)";
}
})()),". While different versions of VMT generally work just fine together, if anything doesn't work right you might want to make sure you and the mission creator are using the same version."].join(''));
}

return weathergen.falcon.files.mission.briefing__GT_mission.call(null,installations,briefing,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("database","version","database/version",1963983397),(100)], null));
});})(map__41173,map__41173__$1,vmtb,revision,install_id,briefing))
);
var unedit = ((function (mission_data,map__41173,map__41173__$1,vmtb,revision,install_id,briefing){
return (function (m){
return cljs.core.assoc.call(null,m,new cljs.core.Keyword(null,"editing?","editing?",1646440800),false);
});})(mission_data,map__41173,map__41173__$1,vmtb,revision,install_id,briefing))
;
return weathergen.progress.with_step.call(null,"Preparing views",((function (mission_data,unedit,map__41173,map__41173__$1,vmtb,revision,install_id,briefing){
return (function (){
javelin.core.dosync_STAR_.call(null,((function (mission_data,unedit,map__41173,map__41173__$1,vmtb,revision,install_id,briefing){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.display_mode,new cljs.core.Keyword(null,"briefing","briefing",-176308969));

cljs.core.reset_BANG_.call(null,weathergen.ui.mission,mission_data);

cljs.core.reset_BANG_.call(null,weathergen.ui.visible_sides,new cljs.core.Keyword(null,"visible-sides","visible-sides",391079481).cljs$core$IFn$_invoke$arity$1(vmtb));

cljs.core.reset_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in.call(null,cljs.core.update.call(null,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),((function (mission_data,unedit,map__41173,map__41173__$1,vmtb,revision,install_id,briefing){
return (function (p1__41172_SHARP_){
return cljs.core.map.call(null,unedit,p1__41172_SHARP_);
});})(mission_data,unedit,map__41173,map__41173__$1,vmtb,revision,install_id,briefing))
),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"max","max",61366548)], null),weathergen.falcon.files.mission.mission_time.call(null,mission_data)));

cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)));

cljs.core.reset_BANG_.call(null,weathergen.ui.movement_params,new cljs.core.Keyword(null,"movement-params","movement-params",293385966).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)));

cljs.core.reset_BANG_.call(null,weathergen.ui.display_params,new cljs.core.Keyword(null,"display-params","display-params",573405707).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)));

return cljs.core.reset_BANG_.call(null,weathergen.ui.briefing_notes,(function (){var or__4131__auto__ = new cljs.core.Keyword(null,"briefing-notes","briefing-notes",-1524193117).cljs$core$IFn$_invoke$arity$1(vmtb);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "";
}
})());
});})(mission_data,unedit,map__41173,map__41173__$1,vmtb,revision,install_id,briefing))
);

weathergen.ui.layers.annotations.load_briefing_data.call(null,weathergen.ui.annotations_layer,new cljs.core.Keyword(null,"annotations","annotations",1640956248).cljs$core$IFn$_invoke$arity$1(vmtb));

return weathergen.ui.layers.flights.load_briefing_data.call(null,weathergen.ui.flight_paths_layer,new cljs.core.Keyword(null,"flights","flights",-1637719124).cljs$core$IFn$_invoke$arity$1(vmtb));
});})(mission_data,unedit,map__41173,map__41173__$1,vmtb,revision,install_id,briefing))
);
}));
});
/**
 * Prompts the user for a path and saves a briefing file to it.
 */
weathergen.ui.save_briefing = (function weathergen$ui$save_briefing(install_id,visible_sides){
return weathergen.ui.common.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),weathergen.compression.compress.call(null,weathergen.encoding.encode.call(null,new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"revision","revision",-1350113114),weathergen.ui.revision,new cljs.core.Keyword(null,"vmt-version","vmt-version",587039393),cljs.core.get.call(null,weathergen.ui.build_info,"VERSION"),new cljs.core.Keyword(null,"briefing","briefing",-176308969),weathergen.falcon.files.mission.mission__GT_briefing.call(null,cljs.core.deref.call(null,weathergen.ui.mission),install_id,weathergen.ui.build_info),new cljs.core.Keyword(null,"weather","weather",1320452344),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),cljs.core.deref.call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"display-params","display-params",573405707),cljs.core.deref.call(null,weathergen.ui.display_params)], null),new cljs.core.Keyword(null,"visible-sides","visible-sides",391079481),visible_sides,new cljs.core.Keyword(null,"briefing-notes","briefing-notes",-1524193117),cljs.core.deref.call(null,weathergen.ui.briefing_notes),new cljs.core.Keyword(null,"annotations","annotations",1640956248),weathergen.ui.layers.annotations.briefing_data.call(null,weathergen.ui.annotations_layer),new cljs.core.Keyword(null,"flights","flights",-1637719124),weathergen.ui.layers.flights.briefing_data.call(null,weathergen.ui.flight_paths_layer)], null))),new cljs.core.Keyword(null,"title","title",636505583),"Save a briefing file",new cljs.core.Keyword(null,"default-path","default-path",-1046856029),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)))),".vmtb"].join(''),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"VMT Briefing",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtb"], null)], null)], null)], null));
});
weathergen.ui.weather_worker = (function (){var worker = (new Worker("worker.js"));
var command_ch = cljs.core.async.chan.call(null);
var result_ch = cljs.core.async.chan.call(null);
var output_ch = cljs.core.async.chan.call(null);
worker.onmessage = ((function (worker,command_ch,result_ch,output_ch){
return (function (e){
var c__38370__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__38370__auto__,worker,command_ch,result_ch,output_ch){
return (function (){
var f__38371__auto__ = (function (){var switch__38275__auto__ = ((function (c__38370__auto__,worker,command_ch,result_ch,output_ch){
return (function (state_41182){
var state_val_41183 = (state_41182[(1)]);
if((state_val_41183 === (1))){
var inst_41177 = e.data;
var inst_41178 = weathergen.encoding.decode.call(null,inst_41177);
var state_41182__$1 = state_41182;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_41182__$1,(2),result_ch,inst_41178);
} else {
if((state_val_41183 === (2))){
var inst_41180 = (state_41182[(2)]);
var state_41182__$1 = state_41182;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_41182__$1,inst_41180);
} else {
return null;
}
}
});})(c__38370__auto__,worker,command_ch,result_ch,output_ch))
;
return ((function (switch__38275__auto__,c__38370__auto__,worker,command_ch,result_ch,output_ch){
return (function() {
var weathergen$ui$state_machine__38276__auto__ = null;
var weathergen$ui$state_machine__38276__auto____0 = (function (){
var statearr_41184 = [null,null,null,null,null,null,null];
(statearr_41184[(0)] = weathergen$ui$state_machine__38276__auto__);

(statearr_41184[(1)] = (1));

return statearr_41184;
});
var weathergen$ui$state_machine__38276__auto____1 = (function (state_41182){
while(true){
var ret_value__38277__auto__ = (function (){try{while(true){
var result__38278__auto__ = switch__38275__auto__.call(null,state_41182);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38278__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38278__auto__;
}
break;
}
}catch (e41185){if((e41185 instanceof Object)){
var ex__38279__auto__ = e41185;
var statearr_41186_41211 = state_41182;
(statearr_41186_41211[(5)] = ex__38279__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_41182);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e41185;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38277__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__41212 = state_41182;
state_41182 = G__41212;
continue;
} else {
return ret_value__38277__auto__;
}
break;
}
});
weathergen$ui$state_machine__38276__auto__ = function(state_41182){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38276__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38276__auto____1.call(this,state_41182);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38276__auto____0;
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38276__auto____1;
return weathergen$ui$state_machine__38276__auto__;
})()
;})(switch__38275__auto__,c__38370__auto__,worker,command_ch,result_ch,output_ch))
})();
var state__38372__auto__ = (function (){var statearr_41187 = f__38371__auto__.call(null);
(statearr_41187[(6)] = c__38370__auto__);

return statearr_41187;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__38372__auto__);
});})(c__38370__auto__,worker,command_ch,result_ch,output_ch))
);

return c__38370__auto__;
});})(worker,command_ch,result_ch,output_ch))
;

return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"command-ch","command-ch",508874766),command_ch,new cljs.core.Keyword(null,"worker","worker",938239996),worker,new cljs.core.Keyword(null,"output-ch","output-ch",1069791231),output_ch,new cljs.core.Keyword(null,"loop","loop",-395552849),(function (){var c__38370__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__38370__auto__,worker,command_ch,result_ch,output_ch){
return (function (){
var f__38371__auto__ = (function (){var switch__38275__auto__ = ((function (c__38370__auto__,worker,command_ch,result_ch,output_ch){
return (function (state_41201){
var state_val_41202 = (state_41201[(1)]);
if((state_val_41202 === (1))){
var state_41201__$1 = state_41201;
var statearr_41203_41213 = state_41201__$1;
(statearr_41203_41213[(2)] = null);

(statearr_41203_41213[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41202 === (2))){
var state_41201__$1 = state_41201;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_41201__$1,(4),command_ch);
} else {
if((state_val_41202 === (3))){
var inst_41199 = (state_41201[(2)]);
var state_41201__$1 = state_41201;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_41201__$1,inst_41199);
} else {
if((state_val_41202 === (4))){
var inst_41190 = (state_41201[(2)]);
var inst_41191 = weathergen.encoding.encode.call(null,inst_41190);
var inst_41192 = worker.postMessage(inst_41191);
var state_41201__$1 = (function (){var statearr_41204 = state_41201;
(statearr_41204[(7)] = inst_41192);

return statearr_41204;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_41201__$1,(6),result_ch);
} else {
if((state_val_41202 === (5))){
var inst_41196 = (state_41201[(2)]);
var state_41201__$1 = (function (){var statearr_41205 = state_41201;
(statearr_41205[(8)] = inst_41196);

return statearr_41205;
})();
var statearr_41206_41214 = state_41201__$1;
(statearr_41206_41214[(2)] = null);

(statearr_41206_41214[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41202 === (6))){
var inst_41194 = (state_41201[(2)]);
var state_41201__$1 = state_41201;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_41201__$1,(5),output_ch,inst_41194);
} else {
return null;
}
}
}
}
}
}
});})(c__38370__auto__,worker,command_ch,result_ch,output_ch))
;
return ((function (switch__38275__auto__,c__38370__auto__,worker,command_ch,result_ch,output_ch){
return (function() {
var weathergen$ui$state_machine__38276__auto__ = null;
var weathergen$ui$state_machine__38276__auto____0 = (function (){
var statearr_41207 = [null,null,null,null,null,null,null,null,null];
(statearr_41207[(0)] = weathergen$ui$state_machine__38276__auto__);

(statearr_41207[(1)] = (1));

return statearr_41207;
});
var weathergen$ui$state_machine__38276__auto____1 = (function (state_41201){
while(true){
var ret_value__38277__auto__ = (function (){try{while(true){
var result__38278__auto__ = switch__38275__auto__.call(null,state_41201);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38278__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38278__auto__;
}
break;
}
}catch (e41208){if((e41208 instanceof Object)){
var ex__38279__auto__ = e41208;
var statearr_41209_41215 = state_41201;
(statearr_41209_41215[(5)] = ex__38279__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_41201);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e41208;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38277__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__41216 = state_41201;
state_41201 = G__41216;
continue;
} else {
return ret_value__38277__auto__;
}
break;
}
});
weathergen$ui$state_machine__38276__auto__ = function(state_41201){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38276__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38276__auto____1.call(this,state_41201);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38276__auto____0;
weathergen$ui$state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38276__auto____1;
return weathergen$ui$state_machine__38276__auto__;
})()
;})(switch__38275__auto__,c__38370__auto__,worker,command_ch,result_ch,output_ch))
})();
var state__38372__auto__ = (function (){var statearr_41210 = f__38371__auto__.call(null);
(statearr_41210[(6)] = c__38370__auto__);

return statearr_41210;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__38372__auto__);
});})(c__38370__auto__,worker,command_ch,result_ch,output_ch))
);

return c__38370__auto__;
})()], null);
})();
weathergen.ui.save_weather_files = (function weathergen$ui$save_weather_files(p__41217){
var map__41218 = p__41217;
var map__41218__$1 = (((((!((map__41218 == null))))?(((((map__41218.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41218.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41218):map__41218);
var ny = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"ny","ny",1701791641));
var progress = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"progress","progress",244323547));
var weather_params = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365));
var step = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"step","step",1288888124));
var to = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"to","to",192099007));
var mission_name = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582));
var movement_params = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"movement-params","movement-params",293385966));
var cloud_params = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983));
var save_file = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"save-file","save-file",-250442926));
var nx = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"nx","nx",-1996436366));
var from = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"from","from",1815293044));
var campaign_dir = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"campaign-dir","campaign-dir",-1278307883));
var weather_direction = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"weather-direction","weather-direction",-1789808873));
var cancel = cljs.core.get.call(null,map__41218__$1,new cljs.core.Keyword(null,"cancel","cancel",-1964088360));
var cells = (function (){var iter__4523__auto__ = ((function (map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function weathergen$ui$save_weather_files_$_iter__41220(s__41221){
return (new cljs.core.LazySeq(null,((function (map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var s__41221__$1 = s__41221;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__41221__$1);
if(temp__5720__auto__){
var xs__6277__auto__ = temp__5720__auto__;
var x = cljs.core.first.call(null,xs__6277__auto__);
var iterys__4519__auto__ = ((function (s__41221__$1,x,xs__6277__auto__,temp__5720__auto__,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function weathergen$ui$save_weather_files_$_iter__41220_$_iter__41222(s__41223){
return (new cljs.core.LazySeq(null,((function (s__41221__$1,x,xs__6277__auto__,temp__5720__auto__,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var s__41223__$1 = s__41223;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__41223__$1);
if(temp__5720__auto____$1){
var s__41223__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__41223__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__41223__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__41225 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__41224 = (0);
while(true){
if((i__41224 < size__4522__auto__)){
var y = cljs.core._nth.call(null,c__4521__auto__,i__41224);
cljs.core.chunk_append.call(null,b__41225,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__41313 = (i__41224 + (1));
i__41224 = G__41313;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41225),weathergen$ui$save_weather_files_$_iter__41220_$_iter__41222.call(null,cljs.core.chunk_rest.call(null,s__41223__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41225),null);
}
} else {
var y = cljs.core.first.call(null,s__41223__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),weathergen$ui$save_weather_files_$_iter__41220_$_iter__41222.call(null,cljs.core.rest.call(null,s__41223__$2)));
}
} else {
return null;
}
break;
}
});})(s__41221__$1,x,xs__6277__auto__,temp__5720__auto__,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
,null,null));
});})(s__41221__$1,x,xs__6277__auto__,temp__5720__auto__,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
var fs__4520__auto__ = cljs.core.seq.call(null,iterys__4519__auto__.call(null,cljs.core.range.call(null,ny)));
if(fs__4520__auto__){
return cljs.core.concat.call(null,fs__4520__auto__,weathergen$ui$save_weather_files_$_iter__41220.call(null,cljs.core.rest.call(null,s__41221__$1)));
} else {
var G__41314 = cljs.core.rest.call(null,s__41221__$1);
s__41221__$1 = G__41314;
continue;
}
} else {
return null;
}
break;
}
});})(map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
,null,null));
});})(map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
return iter__4523__auto__.call(null,cljs.core.range.call(null,nx));
})();
var start = weathergen.time.campaign_time__GT_minutes.call(null,from);
var end = weathergen.time.campaign_time__GT_minutes.call(null,to);
var steps = (cljs.core.long$.call(null,((end - start) / step)) + (1));
var updates_dir = weathergen.filesystem.path_combine.call(null,campaign_dir,"WeatherMapsUpdates");
var save_blob = ((function (cells,start,end,steps,updates_dir,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (blob,path){
cljs.core.reset_BANG_.call(null,save_file,path);

return weathergen.ui.common.save_blob_async.call(null,blob,weathergen.filesystem.path_combine.call(null,campaign_dir,path));
});})(cells,start,end,steps,updates_dir,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
var save_buffer = ((function (cells,start,end,steps,updates_dir,save_blob,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (buf,path){
cljs.core.reset_BANG_.call(null,save_file,path);

return weathergen.filesystem.save_data_async.call(null,weathergen.filesystem.path_combine.call(null,campaign_dir,path),buf);
});})(cells,start,end,steps,updates_dir,save_blob,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
var c__38370__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__38370__auto__,cells,start,end,steps,updates_dir,save_blob,save_buffer,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var f__38371__auto__ = (function (){var switch__38275__auto__ = ((function (c__38370__auto__,cells,start,end,steps,updates_dir,save_blob,save_buffer,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (state_41286){
var state_val_41287 = (state_41286[(1)]);
if((state_val_41287 === (7))){
var inst_41255 = (state_41286[(2)]);
var inst_41256 = new cljs.core.Keyword(null,"output-ch","output-ch",1069791231).cljs$core$IFn$_invoke$arity$1(weathergen.ui.weather_worker);
var state_41286__$1 = (function (){var statearr_41288 = state_41286;
(statearr_41288[(7)] = inst_41255);

return statearr_41288;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_41286__$1,(8),inst_41256);
} else {
if((state_val_41287 === (1))){
var inst_41226 = start;
var inst_41227 = false;
var state_41286__$1 = (function (){var statearr_41289 = state_41286;
(statearr_41289[(8)] = inst_41227);

(statearr_41289[(9)] = inst_41226);

return statearr_41289;
})();
var statearr_41290_41315 = state_41286__$1;
(statearr_41290_41315[(2)] = null);

(statearr_41290_41315[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (4))){
var inst_41239 = weathergen.ui.twx_blob.call(null);
var inst_41240 = weathergen.ui.twx_filename.call(null,mission_name);
var inst_41241 = save_blob.call(null,inst_41239,inst_41240);
var inst_41242 = weathergen.ui.settings_blob.call(null);
var inst_41243 = weathergen.ui.settings_filename.call(null,mission_name);
var inst_41244 = save_blob.call(null,inst_41242,inst_41243);
var inst_41245 = cljs.core.reset_BANG_.call(null,progress,null);
var state_41286__$1 = (function (){var statearr_41291 = state_41286;
(statearr_41291[(10)] = inst_41241);

(statearr_41291[(11)] = inst_41244);

return statearr_41291;
})();
var statearr_41292_41316 = state_41286__$1;
(statearr_41292_41316[(2)] = inst_41245);

(statearr_41292_41316[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (13))){
var inst_41226 = (state_41286[(9)]);
var inst_41277 = (inst_41226 + step);
var inst_41226__$1 = inst_41277;
var inst_41227 = true;
var state_41286__$1 = (function (){var statearr_41293 = state_41286;
(statearr_41293[(8)] = inst_41227);

(statearr_41293[(9)] = inst_41226__$1);

return statearr_41293;
})();
var statearr_41294_41317 = state_41286__$1;
(statearr_41294_41317[(2)] = null);

(statearr_41294_41317[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (6))){
var inst_41282 = (state_41286[(2)]);
var state_41286__$1 = state_41286;
var statearr_41295_41318 = state_41286__$1;
(statearr_41295_41318[(2)] = inst_41282);

(statearr_41295_41318[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (3))){
var inst_41284 = (state_41286[(2)]);
var state_41286__$1 = state_41286;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_41286__$1,inst_41284);
} else {
if((state_val_41287 === (12))){
var inst_41275 = cljs.core.reset_BANG_.call(null,progress,null);
var state_41286__$1 = state_41286;
var statearr_41296_41319 = state_41286__$1;
(statearr_41296_41319[(2)] = inst_41275);

(statearr_41296_41319[(1)] = (14));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (2))){
var inst_41227 = (state_41286[(8)]);
var inst_41226 = (state_41286[(9)]);
var inst_41229 = (inst_41226 - start);
var inst_41230 = (end - start);
var inst_41231 = (inst_41229 / inst_41230);
var inst_41232 = ((inst_41231 < (1)) ? inst_41231 : (1));
var inst_41233 = (function (){var t = inst_41226;
var first_done_QMARK_ = inst_41227;
var p = inst_41232;
return ((function (t,first_done_QMARK_,p,inst_41227,inst_41226,inst_41229,inst_41230,inst_41231,inst_41232,state_val_41287,c__38370__auto__,cells,start,end,steps,updates_dir,save_blob,save_buffer,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["progress",p], null);
});
;})(t,first_done_QMARK_,p,inst_41227,inst_41226,inst_41229,inst_41230,inst_41231,inst_41232,state_val_41287,c__38370__auto__,cells,start,end,steps,updates_dir,save_blob,save_buffer,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
})();
var inst_41234 = (new cljs.core.Delay(inst_41233,null));
var inst_41235 = taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui",null,1390,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),inst_41234,null,560864689);
var inst_41236 = cljs.core.reset_BANG_.call(null,progress,inst_41232);
var inst_41237 = (end < inst_41226);
var state_41286__$1 = (function (){var statearr_41297 = state_41286;
(statearr_41297[(12)] = inst_41236);

(statearr_41297[(13)] = inst_41235);

return statearr_41297;
})();
if(cljs.core.truth_(inst_41237)){
var statearr_41298_41320 = state_41286__$1;
(statearr_41298_41320[(1)] = (4));

} else {
var statearr_41299_41321 = state_41286__$1;
(statearr_41299_41321[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (11))){
var inst_41261 = (state_41286[(14)]);
var inst_41226 = (state_41286[(9)]);
var inst_41268 = (state_41286[(2)]);
var inst_41269 = weathergen.time.minutes__GT_campaign_time.call(null,inst_41226);
var inst_41270 = weathergen.ui.fmap_filename.call(null,inst_41269);
var inst_41271 = weathergen.filesystem.path_combine.call(null,"WeatherMapsUpdates",inst_41270);
var inst_41272 = save_buffer.call(null,inst_41261,inst_41271);
var inst_41273 = cljs.core.deref.call(null,cancel);
var state_41286__$1 = (function (){var statearr_41300 = state_41286;
(statearr_41300[(15)] = inst_41272);

(statearr_41300[(16)] = inst_41268);

return statearr_41300;
})();
if(cljs.core.truth_(inst_41273)){
var statearr_41301_41322 = state_41286__$1;
(statearr_41301_41322[(1)] = (12));

} else {
var statearr_41302_41323 = state_41286__$1;
(statearr_41302_41323[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (9))){
var state_41286__$1 = state_41286;
var statearr_41303_41324 = state_41286__$1;
(statearr_41303_41324[(2)] = null);

(statearr_41303_41324[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (5))){
var inst_41226 = (state_41286[(9)]);
var inst_41247 = new cljs.core.Keyword(null,"command-ch","command-ch",508874766).cljs$core$IFn$_invoke$arity$1(weathergen.ui.weather_worker);
var inst_41248 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_41249 = [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)];
var inst_41250 = (new cljs.core.PersistentVector(null,2,(5),inst_41248,inst_41249,null));
var inst_41251 = weathergen.time.minutes__GT_campaign_time.call(null,inst_41226);
var inst_41252 = cljs.core.assoc_in.call(null,weather_params,inst_41250,inst_41251);
var inst_41253 = cljs.core.assoc.call(null,inst_41252,new cljs.core.Keyword(null,"cells","cells",-985166822),cells);
var state_41286__$1 = state_41286;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_41286__$1,(7),inst_41247,inst_41253);
} else {
if((state_val_41287 === (14))){
var inst_41280 = (state_41286[(2)]);
var state_41286__$1 = state_41286;
var statearr_41304_41325 = state_41286__$1;
(statearr_41304_41325[(2)] = inst_41280);

(statearr_41304_41325[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (10))){
var inst_41261 = (state_41286[(14)]);
var inst_41264 = weathergen.ui.mission_name_base.call(null,mission_name);
var inst_41265 = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(inst_41264),".fmap"].join('');
var inst_41266 = save_buffer.call(null,inst_41261,inst_41265);
var state_41286__$1 = state_41286;
var statearr_41305_41326 = state_41286__$1;
(statearr_41305_41326[(2)] = inst_41266);

(statearr_41305_41326[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41287 === (8))){
var inst_41227 = (state_41286[(8)]);
var inst_41258 = (state_41286[(2)]);
var inst_41259 = vmt.fmap.encode.call(null,inst_41258,weather_params,movement_params,cloud_params);
var inst_41260 = inst_41259.buffer;
var inst_41261 = Buffer.from(inst_41260);
var state_41286__$1 = (function (){var statearr_41306 = state_41286;
(statearr_41306[(14)] = inst_41261);

return statearr_41306;
})();
if(cljs.core.truth_(inst_41227)){
var statearr_41307_41327 = state_41286__$1;
(statearr_41307_41327[(1)] = (9));

} else {
var statearr_41308_41328 = state_41286__$1;
(statearr_41308_41328[(1)] = (10));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__38370__auto__,cells,start,end,steps,updates_dir,save_blob,save_buffer,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
return ((function (switch__38275__auto__,c__38370__auto__,cells,start,end,steps,updates_dir,save_blob,save_buffer,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function() {
var weathergen$ui$save_weather_files_$_state_machine__38276__auto__ = null;
var weathergen$ui$save_weather_files_$_state_machine__38276__auto____0 = (function (){
var statearr_41309 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_41309[(0)] = weathergen$ui$save_weather_files_$_state_machine__38276__auto__);

(statearr_41309[(1)] = (1));

return statearr_41309;
});
var weathergen$ui$save_weather_files_$_state_machine__38276__auto____1 = (function (state_41286){
while(true){
var ret_value__38277__auto__ = (function (){try{while(true){
var result__38278__auto__ = switch__38275__auto__.call(null,state_41286);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38278__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38278__auto__;
}
break;
}
}catch (e41310){if((e41310 instanceof Object)){
var ex__38279__auto__ = e41310;
var statearr_41311_41329 = state_41286;
(statearr_41311_41329[(5)] = ex__38279__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_41286);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e41310;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38277__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__41330 = state_41286;
state_41286 = G__41330;
continue;
} else {
return ret_value__38277__auto__;
}
break;
}
});
weathergen$ui$save_weather_files_$_state_machine__38276__auto__ = function(state_41286){
switch(arguments.length){
case 0:
return weathergen$ui$save_weather_files_$_state_machine__38276__auto____0.call(this);
case 1:
return weathergen$ui$save_weather_files_$_state_machine__38276__auto____1.call(this,state_41286);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
weathergen$ui$save_weather_files_$_state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$save_weather_files_$_state_machine__38276__auto____0;
weathergen$ui$save_weather_files_$_state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$save_weather_files_$_state_machine__38276__auto____1;
return weathergen$ui$save_weather_files_$_state_machine__38276__auto__;
})()
;})(switch__38275__auto__,c__38370__auto__,cells,start,end,steps,updates_dir,save_blob,save_buffer,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
})();
var state__38372__auto__ = (function (){var statearr_41312 = f__38371__auto__.call(null);
(statearr_41312[(6)] = c__38370__auto__);

return statearr_41312;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__38372__auto__);
});})(c__38370__auto__,cells,start,end,steps,updates_dir,save_blob,save_buffer,map__41218,map__41218__$1,ny,progress,weather_params,step,to,mission_name,movement_params,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
);

return c__38370__auto__;
});
weathergen.ui.remove_nth = (function weathergen$ui$remove_nth(coll,n){
return cljs.core.vec.call(null,cljs.core.concat.call(null,cljs.core.take.call(null,n,coll),cljs.core.drop.call(null,(n + (1)),coll)));
});
weathergen.ui.invert_map = (function weathergen$ui$invert_map(m){
return cljs.core.zipmap.call(null,cljs.core.vals.call(null,m),cljs.core.keys.call(null,m));
});
weathergen.ui.map_name__GT_key = new cljs.core.PersistentArrayMap(null, 4, ["Israel",new cljs.core.Keyword(null,"israel","israel",893888780),"Balkans",new cljs.core.Keyword(null,"balkans","balkans",-514308101),"Korea",new cljs.core.Keyword(null,"korea","korea",-1788137114),"Kuriles",new cljs.core.Keyword(null,"kuriles","kuriles",1501726930)], null);
weathergen.ui.map_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.map_name__GT_key);
weathergen.ui.type_name__GT_key = new cljs.core.PersistentArrayMap(null, 4, ["Sunny",new cljs.core.Keyword(null,"sunny","sunny",1448267778),"Fair",new cljs.core.Keyword(null,"fair","fair",1684139423),"Poor",new cljs.core.Keyword(null,"poor","poor",1462482211),"Inclement",new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null);
weathergen.ui.type_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.type_name__GT_key);
weathergen.ui.mbar_per_inhg = 33.8637526;
weathergen.ui.mbar__GT_inhg = (function weathergen$ui$mbar__GT_inhg(mbar){
return (mbar / weathergen.ui.mbar_per_inhg);
});
weathergen.ui.inhg__GT_mbar = (function weathergen$ui$inhg__GT_mbar(inhg){
return (inhg * weathergen.ui.mbar_per_inhg);
});
/**
 * Returns a string describing a weather type.
 */
weathergen.ui.format_type = (function weathergen$ui$format_type(type){
var pred__41331 = cljs.core._EQ_;
var expr__41332 = type;
if(cljs.core.truth_(pred__41331.call(null,new cljs.core.Keyword(null,"sunny","sunny",1448267778),expr__41332))){
return "Sunny";
} else {
if(cljs.core.truth_(pred__41331.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423),expr__41332))){
return "Fair";
} else {
if(cljs.core.truth_(pred__41331.call(null,new cljs.core.Keyword(null,"poor","poor",1462482211),expr__41332))){
return "Poor";
} else {
if(cljs.core.truth_(pred__41331.call(null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),expr__41332))){
return "Incl.";
} else {
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__41332)].join('')));
}
}
}
}
});
/**
 * Format a pressure in inches Mercury as appropriate for the unit.
 */
weathergen.ui.format_pressure = (function weathergen$ui$format_pressure(inhg,unit){
if(cljs.core.not.call(null,inhg)){
return "";
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"inhg","inhg",-863180091),unit)){
return inhg.toFixed((2));
} else {
return (function (){var G__41334 = weathergen.ui.inhg__GT_mbar.call(null,inhg);
return G__41334;
})().toFixed((0));
}
}
});
/**
 * Format a temperature string
 */
weathergen.ui.format_temperature = (function weathergen$ui$format_temperature(temp){
if(cljs.core.not.call(null,temp)){
return "";
} else {
return temp.toFixed((0));
}
});
/**
 * Format a wind string.
 */
weathergen.ui.format_wind = (function weathergen$ui$format_wind(wind){
if(cljs.core.not.call(null,wind)){
return "";
} else {
var map__41335 = wind;
var map__41335__$1 = (((((!((map__41335 == null))))?(((((map__41335.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41335.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41335):map__41335);
var speed = cljs.core.get.call(null,map__41335__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading = cljs.core.get.call(null,map__41335__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%03d",heading)),"@",cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%02d",(function (){var G__41338 = speed;
return G__41338;
})().toFixed((0)))),"kts"].join('');
}
});
/**
 * Format a visibility so that only numbers below 1 get decimal places.
 */
weathergen.ui.format_visibility = (function weathergen$ui$format_visibility(vis){
if(cljs.core.not.call(null,vis)){
return "";
} else {
if((vis < (2))){
return vis.toFixed((1));
} else {
return vis.toFixed((0));
}
}
});
weathergen.ui.format_coords = (function weathergen$ui$format_coords(x,y){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),", ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join('');
});
weathergen.ui.cloud_descriptions = (function weathergen$ui$cloud_descriptions(cloud_params,type,low_clouds){
if(cljs.core._EQ_.call(null,type,new cljs.core.Keyword(null,"sunny","sunny",1448267778))){
return "SKC";
} else {
var cumulus_base = new cljs.core.Keyword(null,"base","base",185279322).cljs$core$IFn$_invoke$arity$1(low_clouds);
var density_str = new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"few","few",941665998),"FEW",new cljs.core.Keyword(null,"scattered","scattered",-1263632526),"SCT",new cljs.core.Keyword(null,"broken","broken",-1742446874),"BKN",new cljs.core.Keyword(null,"overcast","overcast",-2096313755),"OVC"], null).call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651).cljs$core$IFn$_invoke$arity$1(low_clouds));
var cumulus_level = goog.string.format("%03d",cljs.core.long$.call(null,(cumulus_base / (100))));
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(density_str),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cumulus_level)," "].join('');
}
});
weathergen.ui.contrail_description = (function weathergen$ui$contrail_description(cloud_params,type){
return goog.string.format("COTRA%03d",cljs.core.long$.call(null,(cljs.core.get.call(null,new cljs.core.Keyword(null,"contrails","contrails",1430581743).cljs$core$IFn$_invoke$arity$1(cloud_params),type) / (100))));
});
/**
 * Returns a string describing the clouds for the given weather type.
 */
weathergen.ui.format_cloud = (function weathergen$ui$format_cloud(cloud_params,type,low_clouds){
return [weathergen.ui.cloud_descriptions.call(null,cloud_params,type,low_clouds)," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.contrail_description.call(null,cloud_params,type))].join('');
});
/**
 * Returns a string describing precipitation.
 */
weathergen.ui.format_precipitation = (function weathergen$ui$format_precipitation(temperature,type){
if(cljs.core._EQ_.call(null,type,new cljs.core.Keyword(null,"inclement","inclement",-550669382))){
if((temperature > (0))){
return "Rain";
} else {
return "Snow";
}
} else {
return "None";
}
});
/**
 * Returns bullseye (a map of `:heading` and `:distance`) given
 *   weatherspace coordinates (a map of `:x` and `:y`).
 */
weathergen.ui.bullseye = (function weathergen$ui$bullseye(mission,p__41339){
var map__41340 = p__41339;
var map__41340__$1 = (((((!((map__41340 == null))))?(((((map__41340.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41340.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41340):map__41340);
var x = cljs.core.get.call(null,map__41340__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__41340__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var map__41342 = new cljs.core.Keyword(null,"campaign-info","campaign-info",1158908966).cljs$core$IFn$_invoke$arity$1(mission);
var map__41342__$1 = (((((!((map__41342 == null))))?(((((map__41342.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41342.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41342):map__41342);
var bullseye_x = cljs.core.get.call(null,map__41342__$1,new cljs.core.Keyword(null,"bullseye-x","bullseye-x",-1698783852));
var bullseye_y = cljs.core.get.call(null,map__41342__$1,new cljs.core.Keyword(null,"bullseye-y","bullseye-y",904460818));
return goog.string.format("%f %f (%d %d)",x,y,bullseye_x,bullseye_y);
});
/**
 * Returns a bullseye string given bullseye coordinates.
 */
weathergen.ui.format_bullseye = (function weathergen$ui$format_bullseye(bullseye){
if(cljs.core.not.call(null,bullseye)){
return "";
} else {
var map__41344 = bullseye;
var map__41344__$1 = (((((!((map__41344 == null))))?(((((map__41344.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41344.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41344):map__41344);
var heading = cljs.core.get.call(null,map__41344__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var distance = cljs.core.get.call(null,map__41344__$1,new cljs.core.Keyword(null,"distance","distance",-1671893894));
return goog.string.format("%03d %d",(function (){var h = cljs.core.long$.call(null,cljs.core.mod.call(null,heading,(360)));
if((h === (0))){
return (360);
} else {
return h;
}
})(),cljs.core.long$.call(null,distance));
}
});
/**
 * Given a mouse event, determined where on the map it occurred, in weatherspace.
 *   Returns coordinates as an [x y] pair, where x and y can be
 *   fractional.
 */
weathergen.ui.mouse_weather_coords = (function weathergen$ui$mouse_weather_coords(var_args){
var G__41347 = arguments.length;
switch (G__41347) {
case 1:
return weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 3:
return weathergen.ui.mouse_weather_coords.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.mouse_weather_coords.cljs$core$IFn$_invoke$arity$1 = (function (e){
return weathergen.ui.mouse_weather_coords.call(null,e,cljs.core.deref.call(null,weathergen.ui.map_zoom),cljs.core.deref.call(null,weathergen.ui.map_pan));
});

weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$3 = (function (e,zoom,pan){
try{var browser_zoom = window.devicePixelRatio;
var ox = ((e["offsetX"]) * browser_zoom);
var oy = ((e["offsetY"]) * browser_zoom);
var vec__41349 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params));
var nx = cljs.core.nth.call(null,vec__41349,(0),null);
var ny = cljs.core.nth.call(null,vec__41349,(1),null);
var map__41352 = pan;
var map__41352__$1 = (((((!((map__41352 == null))))?(((((map__41352.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41352.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41352):map__41352);
var x = cljs.core.get.call(null,map__41352__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__41352__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var vec__41353 = cljs.core.deref.call(null,weathergen.ui.map_size);
var width = cljs.core.nth.call(null,vec__41353,(0),null);
var height = cljs.core.nth.call(null,vec__41353,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(((((ox * nx) / width) / zoom) / browser_zoom) + x),(((((oy * ny) / height) / zoom) / browser_zoom) + y)], null);
}catch (e41348){var err = e41348;
return taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"error","error",-978969032),"weathergen.ui",null,1600,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (err){
return (function (){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [err,"mouse-weather-coords error",new cljs.core.Keyword(null,"e","e",1381269198),e], null);
});})(err))
,null)),null,-498409962);
}});

weathergen.ui.mouse_weather_coords.cljs$lang$maxFixedArity = 3;

/**
 * Perform `f` asynchronously every `interval` milliseconds until it
 *   returns a logical true value.
 */
weathergen.ui.retry = (function weathergen$ui$retry(interval,f){
var c__38370__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__38370__auto__){
return (function (){
var f__38371__auto__ = (function (){var switch__38275__auto__ = ((function (c__38370__auto__){
return (function (state_41371){
var state_val_41372 = (state_41371[(1)]);
if((state_val_41372 === (1))){
var state_41371__$1 = state_41371;
var statearr_41373_41384 = state_41371__$1;
(statearr_41373_41384[(2)] = null);

(statearr_41373_41384[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41372 === (2))){
var inst_41359 = f.call(null);
var state_41371__$1 = state_41371;
if(cljs.core.truth_(inst_41359)){
var statearr_41374_41385 = state_41371__$1;
(statearr_41374_41385[(1)] = (4));

} else {
var statearr_41375_41386 = state_41371__$1;
(statearr_41375_41386[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41372 === (3))){
var inst_41369 = (state_41371[(2)]);
var state_41371__$1 = state_41371;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_41371__$1,inst_41369);
} else {
if((state_val_41372 === (4))){
var state_41371__$1 = state_41371;
var statearr_41376_41387 = state_41371__$1;
(statearr_41376_41387[(2)] = null);

(statearr_41376_41387[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41372 === (5))){
var inst_41362 = cljs.core.async.timeout.call(null,interval);
var state_41371__$1 = state_41371;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_41371__$1,(7),inst_41362);
} else {
if((state_val_41372 === (6))){
var inst_41367 = (state_41371[(2)]);
var state_41371__$1 = state_41371;
var statearr_41377_41388 = state_41371__$1;
(statearr_41377_41388[(2)] = inst_41367);

(statearr_41377_41388[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_41372 === (7))){
var inst_41364 = (state_41371[(2)]);
var state_41371__$1 = (function (){var statearr_41378 = state_41371;
(statearr_41378[(7)] = inst_41364);

return statearr_41378;
})();
var statearr_41379_41389 = state_41371__$1;
(statearr_41379_41389[(2)] = null);

(statearr_41379_41389[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(c__38370__auto__))
;
return ((function (switch__38275__auto__,c__38370__auto__){
return (function() {
var weathergen$ui$retry_$_state_machine__38276__auto__ = null;
var weathergen$ui$retry_$_state_machine__38276__auto____0 = (function (){
var statearr_41380 = [null,null,null,null,null,null,null,null];
(statearr_41380[(0)] = weathergen$ui$retry_$_state_machine__38276__auto__);

(statearr_41380[(1)] = (1));

return statearr_41380;
});
var weathergen$ui$retry_$_state_machine__38276__auto____1 = (function (state_41371){
while(true){
var ret_value__38277__auto__ = (function (){try{while(true){
var result__38278__auto__ = switch__38275__auto__.call(null,state_41371);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38278__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38278__auto__;
}
break;
}
}catch (e41381){if((e41381 instanceof Object)){
var ex__38279__auto__ = e41381;
var statearr_41382_41390 = state_41371;
(statearr_41382_41390[(5)] = ex__38279__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_41371);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e41381;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38277__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__41391 = state_41371;
state_41371 = G__41391;
continue;
} else {
return ret_value__38277__auto__;
}
break;
}
});
weathergen$ui$retry_$_state_machine__38276__auto__ = function(state_41371){
switch(arguments.length){
case 0:
return weathergen$ui$retry_$_state_machine__38276__auto____0.call(this);
case 1:
return weathergen$ui$retry_$_state_machine__38276__auto____1.call(this,state_41371);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
weathergen$ui$retry_$_state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$retry_$_state_machine__38276__auto____0;
weathergen$ui$retry_$_state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$retry_$_state_machine__38276__auto____1;
return weathergen$ui$retry_$_state_machine__38276__auto__;
})()
;})(switch__38275__auto__,c__38370__auto__))
})();
var state__38372__auto__ = (function (){var statearr_41383 = f__38371__auto__.call(null);
(statearr_41383[(6)] = c__38370__auto__);

return statearr_41383;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__38372__auto__);
});})(c__38370__auto__))
);

return c__38370__auto__;
});
/**
 * Perform `f` asynchronously `interval` milliseconds from now.
 */
weathergen.ui.later = (function weathergen$ui$later(interval,f){
var c__38370__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__38370__auto__){
return (function (){
var f__38371__auto__ = (function (){var switch__38275__auto__ = ((function (c__38370__auto__){
return (function (state_41397){
var state_val_41398 = (state_41397[(1)]);
if((state_val_41398 === (1))){
var inst_41392 = cljs.core.async.timeout.call(null,interval);
var state_41397__$1 = state_41397;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_41397__$1,(2),inst_41392);
} else {
if((state_val_41398 === (2))){
var inst_41394 = (state_41397[(2)]);
var inst_41395 = f.call(null);
var state_41397__$1 = (function (){var statearr_41399 = state_41397;
(statearr_41399[(7)] = inst_41394);

return statearr_41399;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_41397__$1,inst_41395);
} else {
return null;
}
}
});})(c__38370__auto__))
;
return ((function (switch__38275__auto__,c__38370__auto__){
return (function() {
var weathergen$ui$later_$_state_machine__38276__auto__ = null;
var weathergen$ui$later_$_state_machine__38276__auto____0 = (function (){
var statearr_41400 = [null,null,null,null,null,null,null,null];
(statearr_41400[(0)] = weathergen$ui$later_$_state_machine__38276__auto__);

(statearr_41400[(1)] = (1));

return statearr_41400;
});
var weathergen$ui$later_$_state_machine__38276__auto____1 = (function (state_41397){
while(true){
var ret_value__38277__auto__ = (function (){try{while(true){
var result__38278__auto__ = switch__38275__auto__.call(null,state_41397);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38278__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38278__auto__;
}
break;
}
}catch (e41401){if((e41401 instanceof Object)){
var ex__38279__auto__ = e41401;
var statearr_41402_41404 = state_41397;
(statearr_41402_41404[(5)] = ex__38279__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_41397);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e41401;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38277__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__41405 = state_41397;
state_41397 = G__41405;
continue;
} else {
return ret_value__38277__auto__;
}
break;
}
});
weathergen$ui$later_$_state_machine__38276__auto__ = function(state_41397){
switch(arguments.length){
case 0:
return weathergen$ui$later_$_state_machine__38276__auto____0.call(this);
case 1:
return weathergen$ui$later_$_state_machine__38276__auto____1.call(this,state_41397);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
weathergen$ui$later_$_state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$later_$_state_machine__38276__auto____0;
weathergen$ui$later_$_state_machine__38276__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$later_$_state_machine__38276__auto____1;
return weathergen$ui$later_$_state_machine__38276__auto__;
})()
;})(switch__38275__auto__,c__38370__auto__))
})();
var state__38372__auto__ = (function (){var statearr_41403 = f__38371__auto__.call(null);
(statearr_41403[(6)] = c__38370__auto__);

return statearr_41403;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__38372__auto__);
});})(c__38370__auto__))
);

return c__38370__auto__;
});
weathergen.ui.resize_handle_size = 0.75;
weathergen.ui.triangle_style = (function weathergen$ui$triangle_style(){
return new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"width","width",-384071477),(0),new cljs.core.Keyword(null,"height","height",1025178622),(0),new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null);
});
/**
 * Returns UI for a dropdown that lets you pick what the displayed wind altitude is.
 * @param {...*} var_args
 */
weathergen.ui.wind_alt_selector = (function() { 
var weathergen$ui$wind_alt_selector__delegate = function (args__30233__auto__){
var vec__41406 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__41406,(0),null);
var _ = cljs.core.nth.call(null,vec__41406,(1),null);
return weathergen.ui.common.dropdown.call(null,attrs,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-alt","wind-alt",1733172827)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),(function (){var iter__4523__auto__ = ((function (vec__41406,attrs,_){
return (function weathergen$ui$wind_alt_selector_$_iter__41409(s__41410){
return (new cljs.core.LazySeq(null,((function (vec__41406,attrs,_){
return (function (){
var s__41410__$1 = s__41410;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__41410__$1);
if(temp__5720__auto__){
var s__41410__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__41410__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__41410__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__41412 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__41411 = (0);
while(true){
if((i__41411 < size__4522__auto__)){
var alt = cljs.core._nth.call(null,c__4521__auto__,i__41411);
cljs.core.chunk_append.call(null,b__41412,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(alt)," ft"].join(''),new cljs.core.Keyword(null,"value","value",305978217),alt], null));

var G__41413 = (i__41411 + (1));
i__41411 = G__41413;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41412),weathergen$ui$wind_alt_selector_$_iter__41409.call(null,cljs.core.chunk_rest.call(null,s__41410__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41412),null);
}
} else {
var alt = cljs.core.first.call(null,s__41410__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(alt)," ft"].join(''),new cljs.core.Keyword(null,"value","value",305978217),alt], null),weathergen$ui$wind_alt_selector_$_iter__41409.call(null,cljs.core.rest.call(null,s__41410__$2)));
}
} else {
return null;
}
break;
}
});})(vec__41406,attrs,_))
,null,null));
});})(vec__41406,attrs,_))
;
return iter__4523__auto__.call(null,weathergen.model.wind_alts);
})());
};
var weathergen$ui$wind_alt_selector = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__41414__i = 0, G__41414__a = new Array(arguments.length -  0);
while (G__41414__i < G__41414__a.length) {G__41414__a[G__41414__i] = arguments[G__41414__i + 0]; ++G__41414__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__41414__a,0,null);
} 
return weathergen$ui$wind_alt_selector__delegate.call(this,args__30233__auto__);};
weathergen$ui$wind_alt_selector.cljs$lang$maxFixedArity = 0;
weathergen$ui$wind_alt_selector.cljs$lang$applyTo = (function (arglist__41415){
var args__30233__auto__ = cljs.core.seq(arglist__41415);
return weathergen$ui$wind_alt_selector__delegate(args__30233__auto__);
});
weathergen$ui$wind_alt_selector.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$wind_alt_selector__delegate;
return weathergen$ui$wind_alt_selector;
})()
;
/**
 * Creates a three-layer border with :inner and :outer colors.
 * @param {...*} var_args
 */
weathergen.ui.triple_border = (function() { 
var weathergen$ui$triple_border__delegate = function (args__30233__auto__){
var vec__41416 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__41416,(0),null);
var contents = cljs.core.nth.call(null,vec__41416,(1),null);
var map__41419 = attrs;
var map__41419__$1 = (((((!((map__41419 == null))))?(((((map__41419.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41419.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41419):map__41419);
var inner = cljs.core.get.call(null,map__41419__$1,new cljs.core.Keyword(null,"inner","inner",-1383171215));
var outer = cljs.core.get.call(null,map__41419__$1,new cljs.core.Keyword(null,"outer","outer",-375185956));
var css = cljs.core.get.call(null,map__41419__$1,new cljs.core.Keyword(null,"css","css",1135045163));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"inner","inner",-1383171215),new cljs.core.Keyword(null,"outer","outer",-375185956),new cljs.core.Keyword(null,"css","css",1135045163));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__41419,map__41419__$1,inner,outer,css,attrs__$1,vec__41416,attrs,contents){
return (function (G__41422,G__41423,G__41421){
return G__41421.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),"1px",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),G__41422,new cljs.core.Keyword(null,"margin","margin",-995903681),(0),new cljs.core.Keyword(null,"padding","padding",1660304693),(0)], null),G__41423);
});})(map__41419,map__41419__$1,inner,outer,css,attrs__$1,vec__41416,attrs,contents))
).call(null,outer,css,cljs.core.merge),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__41419,map__41419__$1,inner,outer,css,attrs__$1,vec__41416,attrs,contents){
return (function (G__41426,G__41424,G__41425){
return G__41424.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),"2px",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),G__41425,new cljs.core.Keyword(null,"margin","margin",-995903681),(0),new cljs.core.Keyword(null,"padding","padding",1660304693),(0)], null),G__41426);
});})(map__41419,map__41419__$1,inner,outer,css,attrs__$1,vec__41416,attrs,contents))
).call(null,css,cljs.core.merge,inner),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__41419,map__41419__$1,inner,outer,css,attrs__$1,vec__41416,attrs,contents){
return (function (G__41428,G__41429,G__41427){
return G__41427.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),"1px",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),G__41428,new cljs.core.Keyword(null,"margin","margin",-995903681),(0)], null),G__41429);
});})(map__41419,map__41419__$1,inner,outer,css,attrs__$1,vec__41416,attrs,contents))
).call(null,outer,css,cljs.core.merge),contents)));
};
var weathergen$ui$triple_border = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__41430__i = 0, G__41430__a = new Array(arguments.length -  0);
while (G__41430__i < G__41430__a.length) {G__41430__a[G__41430__i] = arguments[G__41430__i + 0]; ++G__41430__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__41430__a,0,null);
} 
return weathergen$ui$triple_border__delegate.call(this,args__30233__auto__);};
weathergen$ui$triple_border.cljs$lang$maxFixedArity = 0;
weathergen$ui$triple_border.cljs$lang$applyTo = (function (arglist__41431){
var args__30233__auto__ = cljs.core.seq(arglist__41431);
return weathergen$ui$triple_border__delegate(args__30233__auto__);
});
weathergen$ui$triple_border.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$triple_border__delegate;
return weathergen$ui$triple_border;
})()
;
/**
 * Renders a bordered box with a title bar.
 * @param {...*} var_args
 */
weathergen.ui.control_subsection = (function() { 
var weathergen$ui$control_subsection__delegate = function (args__30233__auto__){
var vec__41432 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attributes = cljs.core.nth.call(null,vec__41432,(0),null);
var children = cljs.core.nth.call(null,vec__41432,(1),null);
var map__41435 = attributes;
var map__41435__$1 = (((((!((map__41435 == null))))?(((((map__41435.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41435.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41435):map__41435);
var title = cljs.core.get.call(null,map__41435__$1,new cljs.core.Keyword(null,"title","title",636505583));
return hoplon.core.div.call(null,cljs.core.dissoc.call(null,attributes,new cljs.core.Keyword(null,"title","title",636505583)),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px #444",new cljs.core.Keyword(null,"margin","margin",-995903681),"3px",new cljs.core.Keyword(null,"padding-bottom","padding-bottom",-1899795591),"2px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"background","background",-863952629),weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"header-background","header-background",1686840154)),new cljs.core.Keyword(null,"margin","margin",-995903681),"3px",new cljs.core.Keyword(null,"padding","padding",1660304693),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),(0),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"90%",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),title),children);
};
var weathergen$ui$control_subsection = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__41437__i = 0, G__41437__a = new Array(arguments.length -  0);
while (G__41437__i < G__41437__a.length) {G__41437__a[G__41437__i] = arguments[G__41437__i + 0]; ++G__41437__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__41437__a,0,null);
} 
return weathergen$ui$control_subsection__delegate.call(this,args__30233__auto__);};
weathergen$ui$control_subsection.cljs$lang$maxFixedArity = 0;
weathergen$ui$control_subsection.cljs$lang$applyTo = (function (arglist__41438){
var args__30233__auto__ = cljs.core.seq(arglist__41438);
return weathergen$ui$control_subsection__delegate(args__30233__auto__);
});
weathergen$ui$control_subsection.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$control_subsection__delegate;
return weathergen$ui$control_subsection;
})()
;
weathergen.ui.forecast_section = (function weathergen$ui$forecast_section(p__41441){
var map__41442 = p__41441;
var map__41442__$1 = (((((!((map__41442 == null))))?(((((map__41442.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41442.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41442):map__41442);
var opts = map__41442__$1;
var limit_time_QMARK_ = cljs.core.get.call(null,map__41442__$1,new cljs.core.Keyword(null,"limit-time?","limit-time?",-602984376));
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Forecast"),new cljs.core.Keyword(null,"id","id",-1388402092),"forecast-section",hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"forecast",hoplon.core.table.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,"Forecast for:"),(function (){var airbases = javelin.core.formula.call(null,((function (map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (G__41444,G__41447,G__41445,G__41446){
return G__41444.call(null,((function (map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (p1__41439_SHARP_){
return G__41445.call(null,G__41446,p1__41439_SHARP_);
});})(map__41442,map__41442__$1,opts,limit_time_QMARK_))
,G__41447.call(null,G__41446));
});})(map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,cljs.core.sort_by,weathergen.falcon.files.mission.oob_air,weathergen.falcon.files.mission.objective_name,weathergen.ui.mission);
var vec__41450 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (p__41453){
var map__41454 = p__41453;
var map__41454__$1 = (((((!((map__41454 == null))))?(((((map__41454.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41454.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41454):map__41454);
var coordinates = cljs.core.get.call(null,map__41454__$1,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668));
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [coordinates], null);
});})(airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.selected_cell));
var coordinates = cljs.core.nth.call(null,vec__41450,(0),null);
var vec__41462 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (p__41465){
var vec__41466 = p__41465;
var x = cljs.core.nth.call(null,vec__41466,(0),null);
var y = cljs.core.nth.call(null,vec__41466,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null);
});})(vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,coordinates));
var x = cljs.core.nth.call(null,vec__41462,(0),null);
var y = cljs.core.nth.call(null,vec__41462,(1),null);
return hoplon.core.select.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"locations",new cljs.core.Keyword(null,"change","change",-1163046502),((function (vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (p1__41440_SHARP_){
return weathergen.ui.change_location.call(null,cljs.core.deref.call(null,weathergen.ui.mission),cljs.core.nth.call(null,cljs.core.deref.call(null,airbases),weathergen.util.str__GT_long.call(null,cljs.core.deref.call(null,p1__41440_SHARP_))));
});})(vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
,hoplon.core.option.call(null,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.formula.call(null,((function (vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (G__41470,G__41469){
return G__41469.call(null,new cljs.core.Keyword(null,"named","named",-422393479),G__41470);
});})(vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.location_type,cljs.core.not_EQ_),new cljs.core.Keyword(null,"value","value",305978217),"",javelin.core.formula.call(null,((function (vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (location_type,x__$1,y__$1){
var pred__41471 = cljs.core._EQ_;
var expr__41472 = location_type;
if(cljs.core.truth_(pred__41471.call(null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),expr__41472))){
return ["Location ",weathergen.ui.format_coords.call(null,x__$1,y__$1)].join('');
} else {
if(cljs.core.truth_(pred__41471.call(null,new cljs.core.Keyword(null,"named","named",-422393479),expr__41472))){
return "";
} else {
if(cljs.core.truth_(pred__41471.call(null,new cljs.core.Keyword(null,"none","none",1333468478),expr__41472))){
return "None selected";
} else {
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__41472)].join('')));
}
}
}
});})(vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.location_type,x,y)),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (G__41474,G__41476,G__41475){
return G__41474.call(null,G__41475,G__41476);
});})(vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,cljs.core.map_indexed,airbases,cljs.core.vector),((function (vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (item__30277__auto__){
var vec__41477 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (indexed){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [indexed], null);
});})(vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,item__30277__auto__));
var indexed = cljs.core.nth.call(null,vec__41477,(0),null);
var vec__41486 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__41477,indexed,vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (p__41489){
var vec__41490 = p__41489;
var index = cljs.core.nth.call(null,vec__41490,(0),null);
var ab = cljs.core.nth.call(null,vec__41490,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [ab,index], null);
});})(vec__41477,indexed,vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,indexed));
var ab = cljs.core.nth.call(null,vec__41486,(0),null);
var index = cljs.core.nth.call(null,vec__41486,(1),null);
return 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__41486,ab,index,vec__41477,indexed,vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (G__41494,G__41493,G__41495){
return G__41493.call(null,G__41494,new cljs.core.Keyword(null,"location","location",1815599388).cljs$core$IFn$_invoke$arity$1(G__41495));
});})(vec__41486,ab,index,vec__41477,indexed,vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,ab,cljs.core._EQ_,weathergen.ui.selected_cell),javelin.core.formula.call(null,((function (vec__41486,ab,index,vec__41477,indexed,vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (G__41498,G__41496,G__41497){
return G__41496.call(null,G__41497,G__41498);
});})(vec__41486,ab,index,vec__41477,indexed,vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,ab,weathergen.falcon.files.mission.objective_name,weathergen.ui.mission));
});})(vec__41462,x,y,vec__41450,coordinates,airbases,map__41442,map__41442__$1,opts,limit_time_QMARK_))
));
})()),hoplon.core.tr.call(null,hoplon.core.td.call(null,"Show winds at:"),hoplon.core.td.call(null,weathergen.ui.wind_alt_selector.call(null)))),(function (){var wind_alt = javelin.core.formula.call(null,((function (map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (G__41499){
return new cljs.core.Keyword(null,"wind-alt","wind-alt",1733172827).cljs$core$IFn$_invoke$arity$1(G__41499);
});})(map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.display_params);
return javelin.core.formula.call(null,((function (wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (pressure_unit,forecast,cloud_params,wind_alt__$1){
var td1 = ((function (wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function() { 
var G__41514__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.td,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"3px",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px"], null),args);
};
var G__41514 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__41515__i = 0, G__41515__a = new Array(arguments.length -  0);
while (G__41515__i < G__41515__a.length) {G__41515__a[G__41515__i] = arguments[G__41515__i + 0]; ++G__41515__i;}
  args = new cljs.core.IndexedSeq(G__41515__a,0,null);
} 
return G__41514__delegate.call(this,args);};
G__41514.cljs$lang$maxFixedArity = 0;
G__41514.cljs$lang$applyTo = (function (arglist__41516){
var args = cljs.core.seq(arglist__41516);
return G__41514__delegate(args);
});
G__41514.cljs$core$IFn$_invoke$arity$variadic = G__41514__delegate;
return G__41514;
})()
;})(wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_))
;
var td2 = ((function (td1,wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function() { 
var G__41517__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.td,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"3px",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),args);
};
var G__41517 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__41518__i = 0, G__41518__a = new Array(arguments.length -  0);
while (G__41518__i < G__41518__a.length) {G__41518__a[G__41518__i] = arguments[G__41518__i + 0]; ++G__41518__i;}
  args = new cljs.core.IndexedSeq(G__41518__a,0,null);
} 
return G__41517__delegate.call(this,args);};
G__41517.cljs$lang$maxFixedArity = 0;
G__41517.cljs$lang$applyTo = (function (arglist__41519){
var args = cljs.core.seq(arglist__41519);
return G__41517__delegate(args);
});
G__41517.cljs$core$IFn$_invoke$arity$variadic = G__41517__delegate;
return G__41517;
})()
;})(td1,wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_))
;
return hoplon.core.table.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"info-grid",hoplon.core.thead.call(null,hoplon.core.tr.call(null,td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"time","time",1385887882)], null),"Weather Time")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"type","type",1174270348)], null),"Type")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),"Press")),td2.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"temperature","temperature",899018429)], null),"Temp")),td2.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"wind","wind",-527553074)], null),"Wind")),td2.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"visibility","visibility",1338380893)], null),"Vis")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"precipitation","precipitation",485418199)], null),"Precip")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"cloud","cloud",-1976521303)], null),"Cloud")))),hoplon.core.tbody.call(null,((cljs.core.not.call(null,forecast))?hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(8),"No location is selected. Choose a location from the list, or click on the weather map to select one.")):(function (){var iter__4523__auto__ = ((function (td1,td2,wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function weathergen$ui$forecast_section_$_iter__41500(s__41501){
return (new cljs.core.LazySeq(null,((function (td1,td2,wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_){
return (function (){
var s__41501__$1 = s__41501;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__41501__$1);
if(temp__5720__auto__){
var s__41501__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__41501__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__41501__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__41503 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__41502 = (0);
while(true){
if((i__41502 < size__4522__auto__)){
var vec__41504 = cljs.core._nth.call(null,c__4521__auto__,i__41502);
var time = cljs.core.nth.call(null,vec__41504,(0),null);
var weather = cljs.core.nth.call(null,vec__41504,(1),null);
var map__41507 = weather;
var map__41507__$1 = (((((!((map__41507 == null))))?(((((map__41507.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41507.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41507):map__41507);
var pressure = cljs.core.get.call(null,map__41507__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__41507__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__41507__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__41507__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var low_clouds = cljs.core.get.call(null,map__41507__$1,new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471));
var visibility = cljs.core.get.call(null,map__41507__$1,new cljs.core.Keyword(null,"visibility","visibility",1338380893));
cljs.core.chunk_append.call(null,b__41503,hoplon.core.tr.call(null,td1.call(null,weathergen.ui.common.format_time.call(null,time)),td1.call(null,weathergen.ui.format_type.call(null,type)),td1.call(null,weathergen.ui.format_pressure.call(null,pressure,pressure_unit)),td2.call(null,weathergen.ui.format_temperature.call(null,temperature)),td1.call(null,weathergen.ui.format_wind.call(null,cljs.core.get.call(null,wind,wind_alt__$1))),td2.call(null,weathergen.ui.format_visibility.call(null,visibility)),td1.call(null,weathergen.ui.format_precipitation.call(null,temperature,type)),td1.call(null,weathergen.ui.format_cloud.call(null,cloud_params,type,low_clouds))));

var G__41520 = (i__41502 + (1));
i__41502 = G__41520;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41503),weathergen$ui$forecast_section_$_iter__41500.call(null,cljs.core.chunk_rest.call(null,s__41501__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41503),null);
}
} else {
var vec__41509 = cljs.core.first.call(null,s__41501__$2);
var time = cljs.core.nth.call(null,vec__41509,(0),null);
var weather = cljs.core.nth.call(null,vec__41509,(1),null);
var map__41512 = weather;
var map__41512__$1 = (((((!((map__41512 == null))))?(((((map__41512.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41512.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41512):map__41512);
var pressure = cljs.core.get.call(null,map__41512__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__41512__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__41512__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__41512__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var low_clouds = cljs.core.get.call(null,map__41512__$1,new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471));
var visibility = cljs.core.get.call(null,map__41512__$1,new cljs.core.Keyword(null,"visibility","visibility",1338380893));
return cljs.core.cons.call(null,hoplon.core.tr.call(null,td1.call(null,weathergen.ui.common.format_time.call(null,time)),td1.call(null,weathergen.ui.format_type.call(null,type)),td1.call(null,weathergen.ui.format_pressure.call(null,pressure,pressure_unit)),td2.call(null,weathergen.ui.format_temperature.call(null,temperature)),td1.call(null,weathergen.ui.format_wind.call(null,cljs.core.get.call(null,wind,wind_alt__$1))),td2.call(null,weathergen.ui.format_visibility.call(null,visibility)),td1.call(null,weathergen.ui.format_precipitation.call(null,temperature,type)),td1.call(null,weathergen.ui.format_cloud.call(null,cloud_params,type,low_clouds))),weathergen$ui$forecast_section_$_iter__41500.call(null,cljs.core.rest.call(null,s__41501__$2)));
}
} else {
return null;
}
break;
}
});})(td1,td2,wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_))
,null,null));
});})(td1,td2,wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_))
;
return iter__4523__auto__.call(null,forecast);
})())));
});})(wind_alt,map__41442,map__41442__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.pressure_unit,weathergen.ui.forecast,weathergen.ui.cloud_params,wind_alt);
})()));
});
weathergen.ui.weather_color = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),0.25], null),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(255),(0),(1)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(0),(1)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(192),(0),(0),(1)], null),null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(0),(0),(1)], null)], null);
weathergen.ui.pressure_map = new cljs.core.PersistentArrayMap(null, 7, [28.5,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(192),(0),(0),(1)], null),28.9,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(192),(0),(0),(1)], null),29.3,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(0),(1)], null),29.5,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(255),(0),(1)], null),29.9,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(128),(255),(1)], null),30.2,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),(1)], null),31.0,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),(1)], null)], null);
weathergen.ui.gradient_color = (function weathergen$ui$gradient_color(color_map,val){
var vec__41521 = cljs.core.first.call(null,cljs.core.filter.call(null,(function (p__41530){
var vec__41531 = p__41530;
var vec__41534 = cljs.core.nth.call(null,vec__41531,(0),null);
var low = cljs.core.nth.call(null,vec__41534,(0),null);
var l = cljs.core.nth.call(null,vec__41534,(1),null);
var vec__41537 = cljs.core.nth.call(null,vec__41531,(1),null);
var high = cljs.core.nth.call(null,vec__41537,(0),null);
var h = cljs.core.nth.call(null,vec__41537,(1),null);
return (((low <= val)) && ((val <= high)));
}),cljs.core.partition.call(null,(2),(1),cljs.core.into.call(null,cljs.core.sorted_map.call(null),color_map))));
var vec__41524 = cljs.core.nth.call(null,vec__41521,(0),null);
var low = cljs.core.nth.call(null,vec__41524,(0),null);
var l = cljs.core.nth.call(null,vec__41524,(1),null);
var vec__41527 = cljs.core.nth.call(null,vec__41521,(1),null);
var high = cljs.core.nth.call(null,vec__41527,(0),null);
var h = cljs.core.nth.call(null,vec__41527,(1),null);
return weathergen.math.vector_interpolate.call(null,l,h,val,low,high);
});
weathergen.ui.pressure_color = (function weathergen$ui$pressure_color(pressure){
var vec__41540 = weathergen.ui.gradient_color.call(null,weathergen.ui.pressure_map,pressure);
var r = cljs.core.nth.call(null,vec__41540,(0),null);
var g = cljs.core.nth.call(null,vec__41540,(1),null);
var b = cljs.core.nth.call(null,vec__41540,(2),null);
var a = cljs.core.nth.call(null,vec__41540,(3),null);
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.long$.call(null,r),cljs.core.long$.call(null,g),cljs.core.long$.call(null,b),a], null);
});
weathergen.ui.temp_map = new cljs.core.PersistentArrayMap(null, 3, [(0),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0),(255),(1)], null),(20),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(255),(0),(1)], null),(40),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(0),(0),(1)], null)], null);
weathergen.ui.temperature_color = (function weathergen$ui$temperature_color(temp){
var vec__41543 = weathergen.ui.gradient_color.call(null,weathergen.ui.temp_map,temp);
var r = cljs.core.nth.call(null,vec__41543,(0),null);
var g = cljs.core.nth.call(null,vec__41543,(1),null);
var b = cljs.core.nth.call(null,vec__41543,(2),null);
var a = cljs.core.nth.call(null,vec__41543,(3),null);
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.long$.call(null,r),cljs.core.long$.call(null,g),cljs.core.long$.call(null,b),a], null);
});
weathergen.ui.transparent = new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0),(0),(1)], null);
weathergen.ui.fill_color = (function weathergen$ui$fill_color(display,w){
var pred__41546 = cljs.core._EQ_;
var expr__41547 = display;
if(cljs.core.truth_(pred__41546.call(null,new cljs.core.Keyword(null,"type","type",1174270348),expr__41547))){
return weathergen.ui.weather_color.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(w));
} else {
if(cljs.core.truth_(pred__41546.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),expr__41547))){
return weathergen.ui.pressure_color.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747).cljs$core$IFn$_invoke$arity$1(w));
} else {
if(cljs.core.truth_(pred__41546.call(null,new cljs.core.Keyword(null,"temperature","temperature",899018429),expr__41547))){
return weathergen.ui.temperature_color.call(null,new cljs.core.Keyword(null,"temperature","temperature",899018429).cljs$core$IFn$_invoke$arity$1(w));
} else {
return weathergen.ui.transparent;
}
}
}
});
/**
 * Return a pressure in inches Mercury given a value and a unit
 */
weathergen.ui.convert_pressure = (function weathergen$ui$convert_pressure(val,unit){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"inhg","inhg",-863180091),unit)){
return val;
} else {
return weathergen.ui.mbar__GT_inhg.call(null,val);
}
});
weathergen.ui.max_wind_vector_speed = (150);
weathergen.ui.wind_vector_id = (function weathergen$ui$wind_vector_id(speed){
return ["wind-vector-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.math.clamp.call(null,(5),weathergen.ui.max_wind_vector_speed,weathergen.math.nearest.call(null,speed,(5))))].join('');
});
weathergen.ui.update_wind_layer = (function weathergen$ui$update_wind_layer(weather_data,display_params){
var timer_name__15816__auto__ = "update-wind-layer";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = (function (){var seq__41549 = cljs.core.seq.call(null,weather_data);
var chunk__41551 = null;
var count__41552 = (0);
var i__41553 = (0);
while(true){
if((i__41553 < count__41552)){
var vec__41571 = cljs.core._nth.call(null,chunk__41551,i__41553);
var vec__41574 = cljs.core.nth.call(null,vec__41571,(0),null);
var x = cljs.core.nth.call(null,vec__41574,(0),null);
var y = cljs.core.nth.call(null,vec__41574,(1),null);
var weather = cljs.core.nth.call(null,vec__41571,(1),null);
var wind_alt_41587 = new cljs.core.Keyword(null,"wind-alt","wind-alt",1733172827).cljs$core$IFn$_invoke$arity$1(display_params);
var map__41577_41588 = cljs.core.get_in.call(null,weather,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),wind_alt_41587], null));
var map__41577_41589__$1 = (((((!((map__41577_41588 == null))))?(((((map__41577_41588.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41577_41588.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41577_41588):map__41577_41588);
var speed_41590 = cljs.core.get.call(null,map__41577_41589__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading_41591 = cljs.core.get.call(null,map__41577_41589__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var cell_41592 = goog.dom.getElement(["grid-wind-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_41592.setAttribute("transform",weathergen.ui.common.svg_rotate.call(null,heading_41591));

cell_41592.setAttributeNS("http://www.w3.org/1999/xlink","href",["#",weathergen.ui.wind_vector_id.call(null,speed_41590)].join(''));


var G__41593 = seq__41549;
var G__41594 = chunk__41551;
var G__41595 = count__41552;
var G__41596 = (i__41553 + (1));
seq__41549 = G__41593;
chunk__41551 = G__41594;
count__41552 = G__41595;
i__41553 = G__41596;
continue;
} else {
var temp__5720__auto__ = cljs.core.seq.call(null,seq__41549);
if(temp__5720__auto__){
var seq__41549__$1 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__41549__$1)){
var c__4550__auto__ = cljs.core.chunk_first.call(null,seq__41549__$1);
var G__41597 = cljs.core.chunk_rest.call(null,seq__41549__$1);
var G__41598 = c__4550__auto__;
var G__41599 = cljs.core.count.call(null,c__4550__auto__);
var G__41600 = (0);
seq__41549 = G__41597;
chunk__41551 = G__41598;
count__41552 = G__41599;
i__41553 = G__41600;
continue;
} else {
var vec__41579 = cljs.core.first.call(null,seq__41549__$1);
var vec__41582 = cljs.core.nth.call(null,vec__41579,(0),null);
var x = cljs.core.nth.call(null,vec__41582,(0),null);
var y = cljs.core.nth.call(null,vec__41582,(1),null);
var weather = cljs.core.nth.call(null,vec__41579,(1),null);
var wind_alt_41601 = new cljs.core.Keyword(null,"wind-alt","wind-alt",1733172827).cljs$core$IFn$_invoke$arity$1(display_params);
var map__41585_41602 = cljs.core.get_in.call(null,weather,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),wind_alt_41601], null));
var map__41585_41603__$1 = (((((!((map__41585_41602 == null))))?(((((map__41585_41602.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41585_41602.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41585_41602):map__41585_41602);
var speed_41604 = cljs.core.get.call(null,map__41585_41603__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading_41605 = cljs.core.get.call(null,map__41585_41603__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var cell_41606 = goog.dom.getElement(["grid-wind-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_41606.setAttribute("transform",weathergen.ui.common.svg_rotate.call(null,heading_41605));

cell_41606.setAttributeNS("http://www.w3.org/1999/xlink","href",["#",weathergen.ui.wind_vector_id.call(null,speed_41604)].join(''));


var G__41607 = cljs.core.next.call(null,seq__41549__$1);
var G__41608 = null;
var G__41609 = (0);
var G__41610 = (0);
seq__41549 = G__41607;
chunk__41551 = G__41608;
count__41552 = G__41609;
i__41553 = G__41610;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
});
var ids_41611 = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"none","none",1333468478),"cloud-coverage-none",new cljs.core.Keyword(null,"few","few",941665998),"cloud-coverage-few",new cljs.core.Keyword(null,"scattered","scattered",-1263632526),"cloud-coverage-scattered",new cljs.core.Keyword(null,"broken","broken",-1742446874),"cloud-coverage-broken",new cljs.core.Keyword(null,"overcast","overcast",-2096313755),"cloud-coverage-overcast"], null);
weathergen.ui.cloud_coverage_id = ((function (ids_41611){
return (function weathergen$ui$cloud_coverage_id(coverage,towering_QMARK_){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.get.call(null,ids_41611,coverage)),(cljs.core.truth_(towering_QMARK_)?"-towering":null)].join('');
});})(ids_41611))
;
weathergen.ui.update_coverage_layer = (function weathergen$ui$update_coverage_layer(weather_data,display_params){
var timer_name__15816__auto__ = "update-coverage-layer";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = (function (){var seq__41612 = cljs.core.seq.call(null,weather_data);
var chunk__41614 = null;
var count__41615 = (0);
var i__41616 = (0);
while(true){
if((i__41616 < count__41615)){
var vec__41630 = cljs.core._nth.call(null,chunk__41614,i__41616);
var vec__41633 = cljs.core.nth.call(null,vec__41630,(0),null);
var x = cljs.core.nth.call(null,vec__41633,(0),null);
var y = cljs.core.nth.call(null,vec__41633,(1),null);
var weather = cljs.core.nth.call(null,vec__41630,(1),null);
var coverage_41642 = cljs.core.get_in.call(null,weather,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"coverage","coverage",1606292651)], null));
var towering_QMARK__41643 = cljs.core.get_in.call(null,weather,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"towering?","towering?",2005070836)], null));
var cell_41644 = goog.dom.getElement(["cloud-coverage-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_41644.setAttributeNS("http://www.w3.org/1999/xlink","href",["#",weathergen.ui.cloud_coverage_id.call(null,coverage_41642,towering_QMARK__41643)].join(''));


var G__41645 = seq__41612;
var G__41646 = chunk__41614;
var G__41647 = count__41615;
var G__41648 = (i__41616 + (1));
seq__41612 = G__41645;
chunk__41614 = G__41646;
count__41615 = G__41647;
i__41616 = G__41648;
continue;
} else {
var temp__5720__auto__ = cljs.core.seq.call(null,seq__41612);
if(temp__5720__auto__){
var seq__41612__$1 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__41612__$1)){
var c__4550__auto__ = cljs.core.chunk_first.call(null,seq__41612__$1);
var G__41649 = cljs.core.chunk_rest.call(null,seq__41612__$1);
var G__41650 = c__4550__auto__;
var G__41651 = cljs.core.count.call(null,c__4550__auto__);
var G__41652 = (0);
seq__41612 = G__41649;
chunk__41614 = G__41650;
count__41615 = G__41651;
i__41616 = G__41652;
continue;
} else {
var vec__41636 = cljs.core.first.call(null,seq__41612__$1);
var vec__41639 = cljs.core.nth.call(null,vec__41636,(0),null);
var x = cljs.core.nth.call(null,vec__41639,(0),null);
var y = cljs.core.nth.call(null,vec__41639,(1),null);
var weather = cljs.core.nth.call(null,vec__41636,(1),null);
var coverage_41653 = cljs.core.get_in.call(null,weather,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"coverage","coverage",1606292651)], null));
var towering_QMARK__41654 = cljs.core.get_in.call(null,weather,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"towering?","towering?",2005070836)], null));
var cell_41655 = goog.dom.getElement(["cloud-coverage-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_41655.setAttributeNS("http://www.w3.org/1999/xlink","href",["#",weathergen.ui.cloud_coverage_id.call(null,coverage_41653,towering_QMARK__41654)].join(''));


var G__41656 = cljs.core.next.call(null,seq__41612__$1);
var G__41657 = null;
var G__41658 = (0);
var G__41659 = (0);
seq__41612 = G__41656;
chunk__41614 = G__41657;
count__41615 = G__41658;
i__41616 = G__41659;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
});
if((typeof weathergen !== 'undefined') && (typeof weathergen.ui !== 'undefined') && (typeof weathergen.ui.overlay_text !== 'undefined')){
} else {
weathergen.ui.overlay_text = (function (){var method_table__4613__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4614__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4615__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4616__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4617__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"weathergen.ui","overlay-text"),((function (method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__){
return (function (weather,display_params){
return new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params);
});})(method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__4617__auto__,method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__));
})();
}
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"default","default",-1987822328),(function (_,___$1){
return "";
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"pressure","pressure",505343747),(function (weather,display_params){
return weathergen.ui.format_pressure.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747).cljs$core$IFn$_invoke$arity$1(weather),new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243).cljs$core$IFn$_invoke$arity$1(display_params));
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"temperature","temperature",899018429),(function (weather,_){
return (function (){var G__41660 = new cljs.core.Keyword(null,"temperature","temperature",899018429).cljs$core$IFn$_invoke$arity$1(weather);
return G__41660;
})().toFixed((1));
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"visibility","visibility",1338380893),(function (weather,_){
return weathergen.ui.format_visibility.call(null,(function (){var G__41661 = new cljs.core.Keyword(null,"visibility","visibility",1338380893).cljs$core$IFn$_invoke$arity$1(weather);
return G__41661;
})());
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"cloud-base","cloud-base",826793857),(function (weather,_){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(weather),new cljs.core.Keyword(null,"sunny","sunny",1448267778))){
return "";
} else {
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.long$.call(null,(function (){var G__41663 = new cljs.core.Keyword(null,"base","base",185279322).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471).cljs$core$IFn$_invoke$arity$1(weather));
return G__41663;
})()));
}
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"cloud-size","cloud-size",-1568256381),(function (weather,_){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(weather),new cljs.core.Keyword(null,"sunny","sunny",1448267778))){
return "";
} else {
return (function (){var G__41664 = new cljs.core.Keyword(null,"size","size",1098693007).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471).cljs$core$IFn$_invoke$arity$1(weather));
return G__41664;
})().toFixed((2));
}
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"type","type",1174270348),(function (weather,_){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),"S",new cljs.core.Keyword(null,"fair","fair",1684139423),"F",new cljs.core.Keyword(null,"poor","poor",1462482211),"P",new cljs.core.Keyword(null,"inclement","inclement",-550669382),"I"], null).call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(weather));
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"coords","coords",-599429112),(function (weather,overlay){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(weather)),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(weather))].join('');
}));
weathergen.ui.update_text_layer = (function weathergen$ui$update_text_layer(weather_data,display_params){
var timer_name__15816__auto__ = "update-text-layer";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = (function (){var seq__41665 = cljs.core.seq.call(null,weather_data);
var chunk__41667 = null;
var count__41668 = (0);
var i__41669 = (0);
while(true){
if((i__41669 < count__41668)){
var vec__41683 = cljs.core._nth.call(null,chunk__41667,i__41669);
var vec__41686 = cljs.core.nth.call(null,vec__41683,(0),null);
var x = cljs.core.nth.call(null,vec__41686,(0),null);
var y = cljs.core.nth.call(null,vec__41686,(1),null);
var weather = cljs.core.nth.call(null,vec__41683,(1),null);
var text_41695 = weathergen.ui.overlay_text.call(null,weather,display_params);
var cell_41696 = goog.dom.getElement(["grid-text-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_41696.innerHTML = text_41695;


var G__41697 = seq__41665;
var G__41698 = chunk__41667;
var G__41699 = count__41668;
var G__41700 = (i__41669 + (1));
seq__41665 = G__41697;
chunk__41667 = G__41698;
count__41668 = G__41699;
i__41669 = G__41700;
continue;
} else {
var temp__5720__auto__ = cljs.core.seq.call(null,seq__41665);
if(temp__5720__auto__){
var seq__41665__$1 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__41665__$1)){
var c__4550__auto__ = cljs.core.chunk_first.call(null,seq__41665__$1);
var G__41701 = cljs.core.chunk_rest.call(null,seq__41665__$1);
var G__41702 = c__4550__auto__;
var G__41703 = cljs.core.count.call(null,c__4550__auto__);
var G__41704 = (0);
seq__41665 = G__41701;
chunk__41667 = G__41702;
count__41668 = G__41703;
i__41669 = G__41704;
continue;
} else {
var vec__41689 = cljs.core.first.call(null,seq__41665__$1);
var vec__41692 = cljs.core.nth.call(null,vec__41689,(0),null);
var x = cljs.core.nth.call(null,vec__41692,(0),null);
var y = cljs.core.nth.call(null,vec__41692,(1),null);
var weather = cljs.core.nth.call(null,vec__41689,(1),null);
var text_41705 = weathergen.ui.overlay_text.call(null,weather,display_params);
var cell_41706 = goog.dom.getElement(["grid-text-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_41706.innerHTML = text_41705;


var G__41707 = cljs.core.next.call(null,seq__41665__$1);
var G__41708 = null;
var G__41709 = (0);
var G__41710 = (0);
seq__41665 = G__41707;
chunk__41667 = G__41708;
count__41668 = G__41709;
i__41669 = G__41710;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
});
weathergen.ui.update_overlay = (function weathergen$ui$update_overlay(weather_data,display_params){
var timer_name__15816__auto__ = "update-overlay";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = (function (){var G__41711 = new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params);
var G__41711__$1 = (((G__41711 instanceof cljs.core.Keyword))?G__41711.fqn:null);
switch (G__41711__$1) {
case "wind":
return weathergen.ui.update_wind_layer.call(null,weather_data,display_params);

break;
case "cloud-cover":
return weathergen.ui.update_coverage_layer.call(null,weather_data,display_params);

break;
case "type":
case "pressure":
case "temperature":
case "visibility":
case "cloud-size":
case "cloud-base":
return weathergen.ui.update_text_layer.call(null,weather_data,display_params);

break;
default:
return null;

}
})();
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
});
weathergen.ui.update_primary_layer = (function weathergen$ui$update_primary_layer(weather_data,display_params){
var timer_name__15816__auto__ = "update-primary-layer";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = (function (){var seq__41713 = cljs.core.seq.call(null,weather_data);
var chunk__41715 = null;
var count__41716 = (0);
var i__41717 = (0);
while(true){
if((i__41717 < count__41716)){
var vec__41737 = cljs.core._nth.call(null,chunk__41715,i__41717);
var vec__41740 = cljs.core.nth.call(null,vec__41737,(0),null);
var x = cljs.core.nth.call(null,vec__41740,(0),null);
var y = cljs.core.nth.call(null,vec__41740,(1),null);
var weather = cljs.core.nth.call(null,vec__41737,(1),null);
var vec__41743_41755 = weathergen.ui.fill_color.call(null,new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(display_params),weather);
var r_41756 = cljs.core.nth.call(null,vec__41743_41755,(0),null);
var g_41757 = cljs.core.nth.call(null,vec__41743_41755,(1),null);
var b_41758 = cljs.core.nth.call(null,vec__41743_41755,(2),null);
var a_41759 = cljs.core.nth.call(null,vec__41743_41755,(3),null);
var cell_41760 = goog.dom.getElement(["grid-primary-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
if(cljs.core.truth_(cell_41760)){
cell_41760.setAttribute("fill",["rgba(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r_41756),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g_41757),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b_41758),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(a_41759),")"].join(''));
} else {
}


var G__41761 = seq__41713;
var G__41762 = chunk__41715;
var G__41763 = count__41716;
var G__41764 = (i__41717 + (1));
seq__41713 = G__41761;
chunk__41715 = G__41762;
count__41716 = G__41763;
i__41717 = G__41764;
continue;
} else {
var temp__5720__auto__ = cljs.core.seq.call(null,seq__41713);
if(temp__5720__auto__){
var seq__41713__$1 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__41713__$1)){
var c__4550__auto__ = cljs.core.chunk_first.call(null,seq__41713__$1);
var G__41765 = cljs.core.chunk_rest.call(null,seq__41713__$1);
var G__41766 = c__4550__auto__;
var G__41767 = cljs.core.count.call(null,c__4550__auto__);
var G__41768 = (0);
seq__41713 = G__41765;
chunk__41715 = G__41766;
count__41716 = G__41767;
i__41717 = G__41768;
continue;
} else {
var vec__41746 = cljs.core.first.call(null,seq__41713__$1);
var vec__41749 = cljs.core.nth.call(null,vec__41746,(0),null);
var x = cljs.core.nth.call(null,vec__41749,(0),null);
var y = cljs.core.nth.call(null,vec__41749,(1),null);
var weather = cljs.core.nth.call(null,vec__41746,(1),null);
var vec__41752_41769 = weathergen.ui.fill_color.call(null,new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(display_params),weather);
var r_41770 = cljs.core.nth.call(null,vec__41752_41769,(0),null);
var g_41771 = cljs.core.nth.call(null,vec__41752_41769,(1),null);
var b_41772 = cljs.core.nth.call(null,vec__41752_41769,(2),null);
var a_41773 = cljs.core.nth.call(null,vec__41752_41769,(3),null);
var cell_41774 = goog.dom.getElement(["grid-primary-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
if(cljs.core.truth_(cell_41774)){
cell_41774.setAttribute("fill",["rgba(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r_41770),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g_41771),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b_41772),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(a_41773),")"].join(''));
} else {
}


var G__41775 = cljs.core.next.call(null,seq__41713__$1);
var G__41776 = null;
var G__41777 = (0);
var G__41778 = (0);
seq__41713 = G__41775;
chunk__41715 = G__41776;
count__41716 = G__41777;
i__41717 = G__41778;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
});
weathergen.ui.update_grid_data = (function weathergen$ui$update_grid_data(weather_data,display_params){
var timer_name__15816__auto__ = "update-grid-data";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = (function (){
weathergen.ui.update_primary_layer.call(null,weather_data,display_params);

return weathergen.ui.update_overlay.call(null,weather_data,display_params);
})()
;
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
});
weathergen.ui.update_grid = (function weathergen$ui$update_grid(weather_data,display_params){
var timer_name__15816__auto__ = "update-grid";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = weathergen.ui.update_grid_data.call(null,weather_data,display_params);
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
});
weathergen.ui.wind_vector_defs = (function weathergen$ui$wind_vector_defs(){
return hoplon.svg.defs.call(null,(function (){var iter__4523__auto__ = (function weathergen$ui$wind_vector_defs_$_iter__41779(s__41780){
return (new cljs.core.LazySeq(null,(function (){
var s__41780__$1 = s__41780;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__41780__$1);
if(temp__5720__auto__){
var s__41780__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__41780__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__41780__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__41782 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__41781 = (0);
while(true){
if((i__41781 < size__4522__auto__)){
var speed = cljs.core._nth.call(null,c__4521__auto__,i__41781);
cljs.core.chunk_append.call(null,b__41782,hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),weathergen.ui.wind_vector_id.call(null,speed),weathergen.wind.barb.call(null,speed)));

var G__41783 = (i__41781 + (1));
i__41781 = G__41783;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41782),weathergen$ui$wind_vector_defs_$_iter__41779.call(null,cljs.core.chunk_rest.call(null,s__41780__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41782),null);
}
} else {
var speed = cljs.core.first.call(null,s__41780__$2);
return cljs.core.cons.call(null,hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),weathergen.ui.wind_vector_id.call(null,speed),weathergen.wind.barb.call(null,speed)),weathergen$ui$wind_vector_defs_$_iter__41779.call(null,cljs.core.rest.call(null,s__41780__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,cljs.core.range.call(null,(5),(weathergen.ui.max_wind_vector_speed + (1)),(5)));
})());
});
weathergen.ui.cloud_coverage_defs = (function weathergen$ui$cloud_coverage_defs(){
return hoplon.svg.defs.call(null,(function (){var iter__4523__auto__ = (function weathergen$ui$cloud_coverage_defs_$_iter__41784(s__41785){
return (new cljs.core.LazySeq(null,(function (){
var s__41785__$1 = s__41785;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__41785__$1);
if(temp__5720__auto__){
var xs__6277__auto__ = temp__5720__auto__;
var coverage = cljs.core.first.call(null,xs__6277__auto__);
var iterys__4519__auto__ = ((function (s__41785__$1,coverage,xs__6277__auto__,temp__5720__auto__){
return (function weathergen$ui$cloud_coverage_defs_$_iter__41784_$_iter__41786(s__41787){
return (new cljs.core.LazySeq(null,((function (s__41785__$1,coverage,xs__6277__auto__,temp__5720__auto__){
return (function (){
var s__41787__$1 = s__41787;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__41787__$1);
if(temp__5720__auto____$1){
var s__41787__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__41787__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__41787__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__41789 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__41788 = (0);
while(true){
if((i__41788 < size__4522__auto__)){
var towering_QMARK_ = cljs.core._nth.call(null,c__4521__auto__,i__41788);
cljs.core.chunk_append.call(null,b__41789,hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),weathergen.ui.cloud_coverage_id.call(null,coverage,towering_QMARK_),vmt.clouds.coverage_icon.call(null,coverage,towering_QMARK_)));

var G__41790 = (i__41788 + (1));
i__41788 = G__41790;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41789),weathergen$ui$cloud_coverage_defs_$_iter__41784_$_iter__41786.call(null,cljs.core.chunk_rest.call(null,s__41787__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41789),null);
}
} else {
var towering_QMARK_ = cljs.core.first.call(null,s__41787__$2);
return cljs.core.cons.call(null,hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),weathergen.ui.cloud_coverage_id.call(null,coverage,towering_QMARK_),vmt.clouds.coverage_icon.call(null,coverage,towering_QMARK_)),weathergen$ui$cloud_coverage_defs_$_iter__41784_$_iter__41786.call(null,cljs.core.rest.call(null,s__41787__$2)));
}
} else {
return null;
}
break;
}
});})(s__41785__$1,coverage,xs__6277__auto__,temp__5720__auto__))
,null,null));
});})(s__41785__$1,coverage,xs__6277__auto__,temp__5720__auto__))
;
var fs__4520__auto__ = cljs.core.seq.call(null,iterys__4519__auto__.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [true,false], null)));
if(fs__4520__auto__){
return cljs.core.concat.call(null,fs__4520__auto__,weathergen$ui$cloud_coverage_defs_$_iter__41784.call(null,cljs.core.rest.call(null,s__41785__$1)));
} else {
var G__41791 = cljs.core.rest.call(null,s__41785__$1);
s__41785__$1 = G__41791;
continue;
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,weathergen.model.cloud_coverages);
})());
});
weathergen.ui.bullseye_info_box = (function weathergen$ui$bullseye_info_box(){
var watched = javelin.core.formula.call(null,(function (mouse_location,map_zoom){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [mouse_location,map_zoom], null);
})).call(null,weathergen.ui.mouse_location,weathergen.ui.map_zoom);
var x = javelin.core.cell.call(null,(0));
var y = javelin.core.cell.call(null,(0));
var w = javelin.core.cell.call(null,(0));
var h = javelin.core.cell.call(null,(0));
var t = hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"3.5%",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"Source Code Pro",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),(100),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),"black",hoplon.svg.tspan.call(null,javelin.core.formula.call(null,((function (x,y,w,h,watched){
return (function (G__41795,G__41796,G__41794,G__41797){
return cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__41793 = G__41794;
var G__41793__$1 = (cljs.core.truth_((G__41793 == null))?null:G__41795.call(null,G__41796,G__41793));
if(cljs.core.truth_((G__41793__$1 == null))){
return null;
} else {
return G__41797.call(null,G__41793__$1);
}
})());
});})(x,y,w,h,watched))
).call(null,weathergen.coordinates.weather__GT_bullseye,weathergen.ui.mission,weathergen.ui.mouse_location,weathergen.ui.format_bullseye)));
var update_bbox__15859__auto__ = ((function (x,y,w,h,t,watched){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (x,y,w,h,t,watched){
return (function (){
var bb__15860__auto__ = t.getBBox();
if(cljs.core.truth_(bb__15860__auto__.x)){
cljs.core.reset_BANG_.call(null,x,bb__15860__auto__.x);

cljs.core.reset_BANG_.call(null,y,bb__15860__auto__.y);

cljs.core.reset_BANG_.call(null,w,bb__15860__auto__.width);

return cljs.core.reset_BANG_.call(null,h,bb__15860__auto__.height);
} else {
return null;
}
});})(x,y,w,h,t,watched))
);
});})(x,y,w,h,t,watched))
;
setTimeout(((function (x,y,w,h,t,update_bbox__15859__auto__,watched){
return (function (){
return update_bbox__15859__auto__.call(null);
});})(x,y,w,h,t,update_bbox__15859__auto__,watched))
,(0));

var temp__5720__auto___41812 = watched;
if(cljs.core.truth_(temp__5720__auto___41812)){
var w__15861__auto___41813 = temp__5720__auto___41812;
cljs.core.add_watch.call(null,w__15861__auto___41813,cljs.core.keyword.call(null,cljs.core.gensym.call(null)),((function (w__15861__auto___41813,temp__5720__auto___41812,x,y,w,h,t,update_bbox__15859__auto__,watched){
return (function (_,___$1,___$2,___$3){
return setTimeout(((function (w__15861__auto___41813,temp__5720__auto___41812,x,y,w,h,t,update_bbox__15859__auto__,watched){
return (function (){
return update_bbox__15859__auto__.call(null);
});})(w__15861__auto___41813,temp__5720__auto___41812,x,y,w,h,t,update_bbox__15859__auto__,watched))
,(0));
});})(w__15861__auto___41813,temp__5720__auto___41812,x,y,w,h,t,update_bbox__15859__auto__,watched))
);
} else {
}

return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"bullseye-info-box",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15859__auto__,watched){
return (function (G__41800,G__41798,G__41799){
return ((cljs.core.not.call(null,(G__41798 == null))) && (G__41799.call(null,G__41800)));
});})(x,y,w,h,t,update_bbox__15859__auto__,watched))
).call(null,weathergen.ui.suppress_bullseye_info_box_QMARK_,weathergen.ui.mouse_location,cljs.core.not),new cljs.core.Keyword("svg","transform","svg/transform",1381351328),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15859__auto__,watched){
return (function (mouse_location,map_zoom,map_size){
var map__41801 = mouse_location;
var map__41801__$1 = (((((!((map__41801 == null))))?(((((map__41801.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41801.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41801):map__41801);
var x__$1 = cljs.core.get.call(null,map__41801__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__41801__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var vec__41802 = map_size;
var width = cljs.core.nth.call(null,vec__41802,(0),null);
var height = cljs.core.nth.call(null,vec__41802,(1),null);
return weathergen.ui.common.svg_translate.call(null,(x__$1 + ((1000.0 / width) / map_zoom)),(y__$1 + ((1250.0 / height) / map_zoom)));
});})(x,y,w,h,t,update_bbox__15859__auto__,watched))
).call(null,weathergen.ui.mouse_location,weathergen.ui.map_zoom,weathergen.ui.map_size),hoplon.svg.g.call(null,new cljs.core.Keyword("svg","transform","svg/transform",1381351328),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15859__auto__,watched){
return (function (G__41806,G__41808,G__41807){
return G__41806.call(null,(G__41807 / G__41808));
});})(x,y,w,h,t,update_bbox__15859__auto__,watched))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_zoom,weathergen.ui.map_text_scale),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15859__auto__,watched){
return (function (G__41809){
return (G__41809 * -0.05);
});})(x,y,w,h,t,update_bbox__15859__auto__,watched))
).call(null,w),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15859__auto__,watched){
return (function (G__41810){
return (- (0.8 * G__41810));
});})(x,y,w,h,t,update_bbox__15859__auto__,watched))
).call(null,h),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15859__auto__,watched){
return (function (G__41811){
return (G__41811 * 1.1);
});})(x,y,w,h,t,update_bbox__15859__auto__,watched))
).call(null,w),new cljs.core.Keyword(null,"height","height",1025178622),h,new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"opacity","opacity",397153780),0.8),t));
});
/**
 * Returns a `bounds` with its west edge adjusted by `dx` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_west = (function weathergen$ui$adjust_west(bounds,starting_bounds,dx){
return cljs.core.assoc.call(null,cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"x","x",2099068185),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx)),new cljs.core.Keyword(null,"width","width",-384071477),(new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(starting_bounds) - dx));
});
/**
 * Returns a `bounds` with its east edge adjusted by `dx` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_east = (function weathergen$ui$adjust_east(bounds,starting_bounds,dx){
return cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"width","width",-384071477),(new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx));
});
/**
 * Returns a `bounds` with its north edge adjusted by `dy` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_north = (function weathergen$ui$adjust_north(bounds,starting_bounds,dy){
return cljs.core.assoc.call(null,cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"y","y",-1757859776),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy)),new cljs.core.Keyword(null,"height","height",1025178622),(new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(starting_bounds) - dy));
});
/**
 * Returns a `bounds` with its south edge adjusted by `dy` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_south = (function weathergen$ui$adjust_south(bounds,starting_bounds,dy){
return cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"height","height",1025178622),(new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy));
});
/**
 * Given `proposed` bounds, limit it to falling completely within
 *   an `nx` by `ny` rectangle. Otherwise return nil.
 */
weathergen.ui.restrict = (function weathergen$ui$restrict(nx,ny,proposed){
var map__41814 = proposed;
var map__41814__$1 = (((((!((map__41814 == null))))?(((((map__41814.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41814.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41814):map__41814);
var x = cljs.core.get.call(null,map__41814__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__41814__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__41814__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__41814__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var right = (x + width);
var bottom = (y + height);
if(((((0) <= x)) && (((0) <= y)) && ((right <= nx)) && ((bottom <= ny)) && ((width > (0))) && ((height > (0))))){
return proposed;
} else {
return null;
}
});
weathergen.ui.weather_overrides_overlay = (function weathergen$ui$weather_overrides_overlay(weather_params,register_drag_handler){
var indexed = javelin.core.formula.call(null,(function (G__41822,G__41820,G__41821){
return G__41820.call(null,G__41821,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(G__41822));
})).call(null,weather_params,cljs.core.map_indexed,cljs.core.vector);
var vec__41817 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weather_params));
var nx = cljs.core.nth.call(null,vec__41817,(0),null);
var ny = cljs.core.nth.call(null,vec__41817,(1),null);
return javelin.core.formula.call(null,((function (indexed,vec__41817,nx,ny){
return (function (indexed__$1){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"weather-overrides-overlay",(function (){var iter__4523__auto__ = ((function (indexed,vec__41817,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__41823(s__41824){
return (new cljs.core.LazySeq(null,((function (indexed,vec__41817,nx,ny){
return (function (){
var s__41824__$1 = s__41824;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__41824__$1);
if(temp__5720__auto__){
var s__41824__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__41824__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__41824__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__41826 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__41825 = (0);
while(true){
if((i__41825 < size__4522__auto__)){
var vec__41827 = cljs.core._nth.call(null,c__4521__auto__,i__41825);
var index = cljs.core.nth.call(null,vec__41827,(0),null);
var override = cljs.core.nth.call(null,vec__41827,(1),null);
var map__41830 = override;
var map__41830__$1 = (((((!((map__41830 == null))))?(((((map__41830.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41830.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41830):map__41830);
var location = cljs.core.get.call(null,map__41830__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__41830__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var falloff = cljs.core.get.call(null,map__41830__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var show_outline_QMARK_ = cljs.core.get.call(null,map__41830__$1,new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348));
var editing_QMARK_ = cljs.core.get.call(null,map__41830__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__41831 = location;
var map__41831__$1 = (((((!((map__41831 == null))))?(((((map__41831.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41831.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41831):map__41831);
var x = cljs.core.get.call(null,map__41831__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__41831__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.truth_((function (){var or__4131__auto__ = show_outline_QMARK_;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return editing_QMARK_;
}
})())){
cljs.core.chunk_append.call(null,b__41826,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.2 0.1"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(radius - 0.5),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__41825,s__41824__$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting = location;
return ((function (i__41825,s__41824__$1,starting,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p__41834,final_QMARK_){
var vec__41835 = p__41834;
var dx = cljs.core.nth.call(null,vec__41835,(0),null);
var dy = cljs.core.nth.call(null,vec__41835,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (i__41825,s__41824__$1,dx__$1,dy__$1,vec__41835,dx,dy,starting,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"location","location",1815599388)], null),((function (i__41825,s__41824__$1,dx__$1,dy__$1,vec__41835,dx,dy,starting,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (location__$1){
return cljs.core.assoc.call(null,location__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - (1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - (1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting) + dy__$1)));
});})(i__41825,s__41824__$1,dx__$1,dy__$1,vec__41835,dx,dy,starting,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__41825,s__41824__$1,dx__$1,dy__$1,vec__41835,dx,dy,starting,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});
;})(i__41825,s__41824__$1,starting,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
})());
});})(i__41825,s__41824__$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
),hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.1 0.2"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(falloff - 0.5)),(function (){var circle_edit = ((function (i__41825,s__41824__$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (rad,mutate){
var iter__4523__auto__ = ((function (i__41825,s__41824__$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__41823_$_iter__41838(s__41839){
return (new cljs.core.LazySeq(null,((function (i__41825,s__41824__$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (){
var s__41839__$1 = s__41839;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__41839__$1);
if(temp__5720__auto____$1){
var s__41839__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__41839__$2)){
var c__4521__auto____$1 = cljs.core.chunk_first.call(null,s__41839__$2);
var size__4522__auto____$1 = cljs.core.count.call(null,c__4521__auto____$1);
var b__41841 = cljs.core.chunk_buffer.call(null,size__4522__auto____$1);
if((function (){var i__41840 = (0);
while(true){
if((i__41840 < size__4522__auto____$1)){
var theta = cljs.core._nth.call(null,c__4521__auto____$1,i__41840);
cljs.core.chunk_append.call(null,b__41841,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[ly,lx,"-resize"].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__41840,i__41825,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto____$1,size__4522__auto____$1,b__41841,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (i__41840,i__41825,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto____$1,size__4522__auto____$1,b__41841,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p__41842,final_QMARK_){
var vec__41843 = p__41842;
var dx = cljs.core.nth.call(null,vec__41843,(0),null);
var dy = cljs.core.nth.call(null,vec__41843,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (i__41840,i__41825,s__41824__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__41843,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto____$1,size__4522__auto____$1,b__41841,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__41840,i__41825,s__41824__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__41843,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto____$1,size__4522__auto____$1,b__41841,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(i__41840,i__41825,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto____$1,size__4522__auto____$1,b__41841,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(i__41840,i__41825,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto____$1,size__4522__auto____$1,b__41841,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
})());

var G__41879 = (i__41840 + (1));
i__41840 = G__41879;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41841),weathergen$ui$weather_overrides_overlay_$_iter__41823_$_iter__41838.call(null,cljs.core.chunk_rest.call(null,s__41839__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41841),null);
}
} else {
var theta = cljs.core.first.call(null,s__41839__$2);
return cljs.core.cons.call(null,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[ly,lx,"-resize"].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__41825,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (i__41825,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p__41846,final_QMARK_){
var vec__41847 = p__41846;
var dx = cljs.core.nth.call(null,vec__41847,(0),null);
var dy = cljs.core.nth.call(null,vec__41847,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (i__41825,s__41824__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__41847,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__41825,s__41824__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__41847,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(i__41825,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(i__41825,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41839__$2,temp__5720__auto____$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
})(),weathergen$ui$weather_overrides_overlay_$_iter__41823_$_iter__41838.call(null,cljs.core.rest.call(null,s__41839__$2)));
}
} else {
return null;
}
break;
}
});})(i__41825,s__41824__$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
,null,null));
});})(i__41825,s__41824__$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
;
return iter__4523__auto__.call(null,cljs.core.range.call(null,(0),(360),(45)));
});})(i__41825,s__41824__$1,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
;
if(cljs.core.not.call(null,editing_QMARK_)){
return cljs.core.PersistentVector.EMPTY;
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [circle_edit.call(null,falloff,((function (i__41825,s__41824__$1,circle_edit,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (r){
return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index], null),((function (i__41825,s__41824__$1,circle_edit,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p__41850){
var map__41851 = p__41850;
var map__41851__$1 = (((((!((map__41851 == null))))?(((((map__41851.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41851.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41851):map__41851);
var override__$1 = map__41851__$1;
var falloff__$1 = cljs.core.get.call(null,map__41851__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var radius__$1 = cljs.core.get.call(null,map__41851__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
return cljs.core.assoc.call(null,override__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456),weathergen.math.clamp.call(null,(0),radius__$1,cljs.core.long$.call(null,r)));
});})(i__41825,s__41824__$1,circle_edit,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(i__41825,s__41824__$1,circle_edit,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
),circle_edit.call(null,radius,((function (i__41825,s__41824__$1,circle_edit,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (r){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"radius","radius",-2073122258)], null),(function (){var x__4219__auto__ = (1);
var y__4220__auto__ = cljs.core.long$.call(null,r);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})());

return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null),((function (i__41825,s__41824__$1,circle_edit,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p1__41816_SHARP_){
return weathergen.math.clamp.call(null,(0),cljs.core.long$.call(null,r),p1__41816_SHARP_);
});})(i__41825,s__41824__$1,circle_edit,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(i__41825,s__41824__$1,circle_edit,map__41830,map__41830__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41831,map__41831__$1,x,y,vec__41827,index,override,c__4521__auto__,size__4522__auto__,b__41826,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
)], null);
}
})()], null));

var G__41880 = (i__41825 + (1));
i__41825 = G__41880;
continue;
} else {
var G__41881 = (i__41825 + (1));
i__41825 = G__41881;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41826),weathergen$ui$weather_overrides_overlay_$_iter__41823.call(null,cljs.core.chunk_rest.call(null,s__41824__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41826),null);
}
} else {
var vec__41853 = cljs.core.first.call(null,s__41824__$2);
var index = cljs.core.nth.call(null,vec__41853,(0),null);
var override = cljs.core.nth.call(null,vec__41853,(1),null);
var map__41856 = override;
var map__41856__$1 = (((((!((map__41856 == null))))?(((((map__41856.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41856.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41856):map__41856);
var location = cljs.core.get.call(null,map__41856__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__41856__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var falloff = cljs.core.get.call(null,map__41856__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var show_outline_QMARK_ = cljs.core.get.call(null,map__41856__$1,new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348));
var editing_QMARK_ = cljs.core.get.call(null,map__41856__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__41857 = location;
var map__41857__$1 = (((((!((map__41857 == null))))?(((((map__41857.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41857.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41857):map__41857);
var x = cljs.core.get.call(null,map__41857__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__41857__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.truth_((function (){var or__4131__auto__ = show_outline_QMARK_;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return editing_QMARK_;
}
})())){
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.2 0.1"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(radius - 0.5),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__41824__$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting = location;
return ((function (s__41824__$1,starting,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p__41860,final_QMARK_){
var vec__41861 = p__41860;
var dx = cljs.core.nth.call(null,vec__41861,(0),null);
var dy = cljs.core.nth.call(null,vec__41861,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (s__41824__$1,dx__$1,dy__$1,vec__41861,dx,dy,starting,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"location","location",1815599388)], null),((function (s__41824__$1,dx__$1,dy__$1,vec__41861,dx,dy,starting,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (location__$1){
return cljs.core.assoc.call(null,location__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - (1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - (1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting) + dy__$1)));
});})(s__41824__$1,dx__$1,dy__$1,vec__41861,dx,dy,starting,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__41824__$1,dx__$1,dy__$1,vec__41861,dx,dy,starting,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});
;})(s__41824__$1,starting,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
})());
});})(s__41824__$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
),hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.1 0.2"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(falloff - 0.5)),(function (){var circle_edit = ((function (s__41824__$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (rad,mutate){
var iter__4523__auto__ = ((function (s__41824__$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__41823_$_iter__41864(s__41865){
return (new cljs.core.LazySeq(null,((function (s__41824__$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (){
var s__41865__$1 = s__41865;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__41865__$1);
if(temp__5720__auto____$1){
var s__41865__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__41865__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__41865__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__41867 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__41866 = (0);
while(true){
if((i__41866 < size__4522__auto__)){
var theta = cljs.core._nth.call(null,c__4521__auto__,i__41866);
cljs.core.chunk_append.call(null,b__41867,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[ly,lx,"-resize"].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__41866,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto__,size__4522__auto__,b__41867,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (i__41866,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto__,size__4522__auto__,b__41867,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p__41868,final_QMARK_){
var vec__41869 = p__41868;
var dx = cljs.core.nth.call(null,vec__41869,(0),null);
var dy = cljs.core.nth.call(null,vec__41869,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (i__41866,s__41824__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__41869,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto__,size__4522__auto__,b__41867,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__41866,s__41824__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__41869,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto__,size__4522__auto__,b__41867,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(i__41866,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto__,size__4522__auto__,b__41867,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(i__41866,s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__4521__auto__,size__4522__auto__,b__41867,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
})());

var G__41882 = (i__41866 + (1));
i__41866 = G__41882;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41867),weathergen$ui$weather_overrides_overlay_$_iter__41823_$_iter__41864.call(null,cljs.core.chunk_rest.call(null,s__41865__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__41867),null);
}
} else {
var theta = cljs.core.first.call(null,s__41865__$2);
return cljs.core.cons.call(null,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[ly,lx,"-resize"].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p__41872,final_QMARK_){
var vec__41873 = p__41872;
var dx = cljs.core.nth.call(null,vec__41873,(0),null);
var dy = cljs.core.nth.call(null,vec__41873,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (s__41824__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__41873,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__41824__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__41873,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(s__41824__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__41865__$2,temp__5720__auto____$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
})(),weathergen$ui$weather_overrides_overlay_$_iter__41823_$_iter__41864.call(null,cljs.core.rest.call(null,s__41865__$2)));
}
} else {
return null;
}
break;
}
});})(s__41824__$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
,null,null));
});})(s__41824__$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
;
return iter__4523__auto__.call(null,cljs.core.range.call(null,(0),(360),(45)));
});})(s__41824__$1,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
;
if(cljs.core.not.call(null,editing_QMARK_)){
return cljs.core.PersistentVector.EMPTY;
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [circle_edit.call(null,falloff,((function (s__41824__$1,circle_edit,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (r){
return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index], null),((function (s__41824__$1,circle_edit,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p__41876){
var map__41877 = p__41876;
var map__41877__$1 = (((((!((map__41877 == null))))?(((((map__41877.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41877.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41877):map__41877);
var override__$1 = map__41877__$1;
var falloff__$1 = cljs.core.get.call(null,map__41877__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var radius__$1 = cljs.core.get.call(null,map__41877__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
return cljs.core.assoc.call(null,override__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456),weathergen.math.clamp.call(null,(0),radius__$1,cljs.core.long$.call(null,r)));
});})(s__41824__$1,circle_edit,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(s__41824__$1,circle_edit,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
),circle_edit.call(null,radius,((function (s__41824__$1,circle_edit,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (r){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"radius","radius",-2073122258)], null),(function (){var x__4219__auto__ = (1);
var y__4220__auto__ = cljs.core.long$.call(null,r);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})());

return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null),((function (s__41824__$1,circle_edit,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny){
return (function (p1__41816_SHARP_){
return weathergen.math.clamp.call(null,(0),cljs.core.long$.call(null,r),p1__41816_SHARP_);
});})(s__41824__$1,circle_edit,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
);
});})(s__41824__$1,circle_edit,map__41856,map__41856__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__41857,map__41857__$1,x,y,vec__41853,index,override,s__41824__$2,temp__5720__auto__,indexed,vec__41817,nx,ny))
)], null);
}
})()], null),weathergen$ui$weather_overrides_overlay_$_iter__41823.call(null,cljs.core.rest.call(null,s__41824__$2)));
} else {
var G__41883 = cljs.core.rest.call(null,s__41824__$2);
s__41824__$1 = G__41883;
continue;
}
}
} else {
return null;
}
break;
}
});})(indexed,vec__41817,nx,ny))
,null,null));
});})(indexed,vec__41817,nx,ny))
;
return iter__4523__auto__.call(null,indexed__$1);
})());
});})(indexed,vec__41817,nx,ny))
).call(null,indexed);
});
weathergen.ui.flight_path__GT_path = (function weathergen$ui$flight_path__GT_path(size,path){
var G__41887 = path;
var vec__41888 = G__41887;
var seq__41889 = cljs.core.seq.call(null,vec__41888);
var first__41890 = cljs.core.first.call(null,seq__41889);
var seq__41889__$1 = cljs.core.next.call(null,seq__41889);
var point = first__41890;
var more = seq__41889__$1;
var landed_QMARK_ = false;
var s = null;
var G__41887__$1 = G__41887;
var landed_QMARK___$1 = landed_QMARK_;
var s__$1 = s;
while(true){
var vec__41901 = G__41887__$1;
var seq__41902 = cljs.core.seq.call(null,vec__41901);
var first__41903 = cljs.core.first.call(null,seq__41902);
var seq__41902__$1 = cljs.core.next.call(null,seq__41902);
var point__$1 = first__41903;
var more__$1 = seq__41902__$1;
var landed_QMARK___$2 = landed_QMARK___$1;
var s__$2 = s__$1;
var temp__5718__auto__ = point__$1;
if(cljs.core.truth_(temp__5718__auto__)){
var map__41904 = temp__5718__auto__;
var map__41904__$1 = (((((!((map__41904 == null))))?(((((map__41904.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41904.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41904):map__41904);
var coordinates = cljs.core.get.call(null,map__41904__$1,new cljs.core.Keyword("weathergen.dtc","coordinates","weathergen.dtc/coordinates",-1965136125));
var action = cljs.core.get.call(null,map__41904__$1,new cljs.core.Keyword("weathergen.dtc","action","weathergen.dtc/action",1537999145));
var map__41906 = coordinates;
var map__41906__$1 = (((((!((map__41906 == null))))?(((((map__41906.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41906.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41906):map__41906);
var x = cljs.core.get.call(null,map__41906__$1,new cljs.core.Keyword("weathergen.dtc","x","weathergen.dtc/x",-384550566));
var y = cljs.core.get.call(null,map__41906__$1,new cljs.core.Keyword("weathergen.dtc","y","weathergen.dtc/y",-474567375));
var vec__41907 = weathergen.coordinates.ffeet__GT_weather.call(null,size,x,y);
var gx = cljs.core.nth.call(null,vec__41907,(0),null);
var gy = cljs.core.nth.call(null,vec__41907,(1),null);
if(landed_QMARK___$2){
return s__$2;
} else {
var G__41911 = more__$1;
var G__41912 = ((landed_QMARK___$2) || (cljs.core._EQ_.call(null,action,new cljs.core.Keyword(null,"land","land",-1402569867))));
var G__41913 = [s__$2,(cljs.core.truth_(s__$2)?" ":null),(cljs.core.truth_(s__$2)?"L":"M"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%f,%f",gx,gy))].join('');
G__41887__$1 = G__41911;
landed_QMARK___$1 = G__41912;
s__$1 = G__41913;
continue;
}
} else {
return s__$2;
}
break;
}
});
weathergen.ui.line__GT_path = (function weathergen$ui$line__GT_path(size,line){
var G__41917 = line;
var vec__41918 = G__41917;
var seq__41919 = cljs.core.seq.call(null,vec__41918);
var first__41920 = cljs.core.first.call(null,seq__41919);
var seq__41919__$1 = cljs.core.next.call(null,seq__41919);
var point = first__41920;
var more = seq__41919__$1;
var s = null;
var G__41917__$1 = G__41917;
var s__$1 = s;
while(true){
var vec__41931 = G__41917__$1;
var seq__41932 = cljs.core.seq.call(null,vec__41931);
var first__41933 = cljs.core.first.call(null,seq__41932);
var seq__41932__$1 = cljs.core.next.call(null,seq__41932);
var point__$1 = first__41933;
var more__$1 = seq__41932__$1;
var s__$2 = s__$1;
var temp__5718__auto__ = point__$1;
if(cljs.core.truth_(temp__5718__auto__)){
var map__41934 = temp__5718__auto__;
var map__41934__$1 = (((((!((map__41934 == null))))?(((((map__41934.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41934.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41934):map__41934);
var coordinates = cljs.core.get.call(null,map__41934__$1,new cljs.core.Keyword("weathergen.dtc","coordinates","weathergen.dtc/coordinates",-1965136125));
var map__41936 = coordinates;
var map__41936__$1 = (((((!((map__41936 == null))))?(((((map__41936.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41936.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41936):map__41936);
var x = cljs.core.get.call(null,map__41936__$1,new cljs.core.Keyword("weathergen.dtc","x","weathergen.dtc/x",-384550566));
var y = cljs.core.get.call(null,map__41936__$1,new cljs.core.Keyword("weathergen.dtc","y","weathergen.dtc/y",-474567375));
var vec__41937 = weathergen.coordinates.ffeet__GT_weather.call(null,size,x,y);
var wx = cljs.core.nth.call(null,vec__41937,(0),null);
var wy = cljs.core.nth.call(null,vec__41937,(1),null);
var G__41941 = more__$1;
var G__41942 = [s__$2,(cljs.core.truth_(s__$2)?" ":null),(cljs.core.truth_(s__$2)?"L":"M"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%f,%f",wx,wy))].join('');
G__41917__$1 = G__41941;
s__$1 = G__41942;
continue;
} else {
return s__$2;
}
break;
}
});
weathergen.ui.airbase_info_id = (function weathergen$ui$airbase_info_id(airbase){
return ["airbase-info-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(airbase))].join('');
});
/**
 * Returns the color a status bar should be given the status of an
 *   airbase.
 */
weathergen.ui.airbase_status_color = (function weathergen$ui$airbase_status_color(status){
if(((75) < status)){
return "green";
} else {
if(((25) < status)){
return "orange";
} else {
return "red";

}
}
});
/**
 * Renders the airbase portion of the info overlay.
 */
weathergen.ui.airbase_info_overlay = (function weathergen$ui$airbase_info_overlay(mission,airbase){
var icon_scale = 0.05;
var coords = javelin.core.formula.call(null,((function (icon_scale){
return (function (mission__$1,airbase__$1){
return weathergen.coordinates.fgrid__GT_weather.call(null,mission__$1,new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(airbase__$1),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(airbase__$1));
});})(icon_scale))
).call(null,mission,airbase);
var x = javelin.core.formula.call(null,((function (icon_scale,coords){
return (function (coords__$1){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(coords__$1);
});})(icon_scale,coords))
).call(null,coords);
var y = javelin.core.formula.call(null,((function (icon_scale,coords,x){
return (function (coords__$1){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(coords__$1);
});})(icon_scale,coords,x))
).call(null,coords);
var label = javelin.core.formula.call(null,((function (icon_scale,coords,x,y){
return (function (airbase__$1){
return new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(icon_scale,coords,x,y))
).call(null,airbase);
var camp_id = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label){
return (function (airbase__$1){
return new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(icon_scale,coords,x,y,label))
).call(null,airbase);
var visible_QMARK_ = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id){
return (function (displayed_airbases,airbase__$1){
return displayed_airbases.call(null,airbase__$1);
});})(icon_scale,coords,x,y,label,camp_id))
).call(null,weathergen.ui.displayed_airbases,airbase);
var highlighted_QMARK_ = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_){
return (function (highlighted_airbase,airbase__$1){
return cljs.core._EQ_.call(null,highlighted_airbase,airbase__$1);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_))
).call(null,weathergen.ui.highlighted_airbase,airbase);
var font_size = "3.5%";
var color = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size){
return (function (mission__$1,airbase__$1){
return weathergen.ui.common.team_color.call(null,weathergen.falcon.files.mission.side.call(null,mission__$1,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(airbase__$1)),new cljs.core.Keyword(null,"light-text","light-text",-274885440));
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size))
).call(null,mission,airbase);
var text_stroke_width = 0.03;
var contrasting_color = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width){
return (function (color__$1){
return weathergen.ui.common.contrasting.call(null,color__$1);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width))
).call(null,color);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"airbase-info-overlay",(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41944,G__41943){
return G__41943.call(null,G__41944);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.airbase_info_id),new cljs.core.Keyword(null,"airbase","airbase",-369690299),label,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (x__$1,y__$1,map_zoom){
if(cljs.core.truth_((function (){var and__4120__auto__ = x__$1;
if(cljs.core.truth_(and__4120__auto__)){
return y__$1;
} else {
return and__4120__auto__;
}
})())){
return weathergen.ui.common.svg_xform_combine.call(null,weathergen.ui.common.svg_translate.call(null,x__$1,y__$1),weathergen.ui.common.svg_scale.call(null,(1.0 / map_zoom)));
} else {
return null;
}
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,x,y,weathergen.ui.map_zoom),(function (){var label_style = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41945){
return new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514).cljs$core$IFn$_invoke$arity$1(G__41945);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.map_display);
var label_spacing = 0.2;
var line_height = 0.75;
var status = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41946){
return new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(G__41946);
});})(label_style,label_spacing,line_height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase);
var dims = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (airbase__$1){
var image = new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(airbase__$1);
var map__41947 = image;
var map__41947__$1 = (((((!((map__41947 == null))))?(((((map__41947.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41947.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41947):map__41947);
var image_data = cljs.core.get.call(null,map__41947__$1,new cljs.core.Keyword(null,"image-data","image-data",-377483758));
var map__41948 = image_data;
var map__41948__$1 = (((((!((map__41948 == null))))?(((((map__41948.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__41948.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__41948):map__41948);
var size = cljs.core.get.call(null,map__41948__$1,new cljs.core.Keyword(null,"size","size",1098693007));
var center = cljs.core.get.call(null,map__41948__$1,new cljs.core.Keyword(null,"center","center",-748944368));
var vec__41949 = size;
var w = cljs.core.nth.call(null,vec__41949,(0),null);
var h = cljs.core.nth.call(null,vec__41949,(1),null);
var vec__41952 = center;
var cx = cljs.core.nth.call(null,vec__41952,(0),null);
var cy = cljs.core.nth.call(null,vec__41952,(1),null);
return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"x","x",2099068185),((cx - w) * icon_scale),new cljs.core.Keyword(null,"y","y",-1757859776),((- (h - cy)) * icon_scale),new cljs.core.Keyword(null,"w","w",354169001),(w * icon_scale),new cljs.core.Keyword(null,"h","h",1109658740),(h * icon_scale),new cljs.core.Keyword(null,"d","d",1972142424),(cy * icon_scale)], null);
});})(label_style,label_spacing,line_height,status,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase);
var show_airbase_status_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435)], null));
var show_airbase_squadrons_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954)], null));
var width = 1.0;
var height = 0.2;
var x__$1 = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41958,G__41957){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__41957) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__41957) - G__41958) / (2)));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,width,dims);
var y__$1 = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41960,G__41959){
return (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__41959) - ((2) * G__41960));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,height,dims);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"airbase-and-highlighter",(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"highlights",hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"moving highlight",new cljs.core.Keyword("svg","class","svg/class",-2030780416),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (highlighted_QMARK___$1){
if(cljs.core.truth_(highlighted_QMARK___$1)){
return weathergen.ui.common.collapse_class;
} else {
return null;
}
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,highlighted_QMARK_),new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"r","r",-471384190),(60),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"yellow",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),(2),new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"5, 5",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_scale.call(null,(0))),hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"static highlight",new cljs.core.Keyword("svg","class","svg/class",-2030780416),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (highlighted_QMARK___$1){
if(cljs.core.truth_(highlighted_QMARK___$1)){
return weathergen.ui.common.delayed_fade_out_class;
} else {
return null;
}
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,highlighted_QMARK_),new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"r","r",-471384190),2.5,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"none",new cljs.core.Keyword(null,"fill","fill",883462889),"yellow",new cljs.core.Keyword(null,"opacity","opacity",397153780),(0)));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__30287__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
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__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,highlighted_QMARK_);
})(),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"icon-and-info",new cljs.core.Keyword("svg","class","svg/class",-2030780416),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (highlighted_QMARK___$1){
if(cljs.core.truth_(highlighted_QMARK___$1)){
return weathergen.ui.common.pulse_class;
} else {
return null;
}
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,highlighted_QMARK_),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"status",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41961,G__41962){
return G__41961.call(null,G__41962);
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_icon_scale),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),"white"),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41963,G__41964){
return ((G__41963 * G__41964) / (100));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,width,status),new cljs.core.Keyword(null,"height","height",1025178622),height,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41965,G__41966){
return G__41965.call(null,G__41966);
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.airbase_status_color,status)));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__30287__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
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__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,show_airbase_status_QMARK_);
})(),(function (){var text_y_offset = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41967,G__41968,G__41969){
return (G__41967 + (G__41968 * (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__41969) + new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__41969))));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,label_spacing,weathergen.ui.map_icon_scale,dims);
var bbox_trigger = javelin.core.formula.call(null,((function (text_y_offset,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41970,G__41971,G__41972){
return cljs.core.PersistentHashSet.createAsIfByAssoc([G__41970,G__41972,G__41971]);
});})(text_y_offset,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.included_squadrons,text_y_offset,label_style);
var G__41973 = javelin.core.cell.call(null,(0));
var ty = javelin.core.cell.call(null,(0));
var tw = javelin.core.cell.call(null,(0));
var th = javelin.core.cell.call(null,(0));
var t = hoplon.svg.text.call(null,new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"3.5%",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"Source Code Pro",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),(100),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41975,G__41974){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__41974) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__41974) - G__41975) / (2)));
});})(G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tw,dims),new cljs.core.Keyword(null,"y","y",-1757859776),line_height,new cljs.core.Keyword(null,"stroke","stroke",1741823555),color,new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),color,hoplon.svg.tspan.call(null,label),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (airbase__$1,included_squadrons,label_style__$1){
if(cljs.core._EQ_.call(null,label_style__$1,new cljs.core.Keyword(null,"all","all",892129742))){
return cljs.core.map_indexed.call(null,cljs.core.vector,cljs.core.filter.call(null,included_squadrons,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1)));
} else {
return null;
}
});})(G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.included_squadrons,label_style),((function (G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (item__30277__auto__){
var vec__41976 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (indexed){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [indexed], null);
});})(G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,item__30277__auto__));
var indexed = cljs.core.nth.call(null,vec__41976,(0),null);
var vec__41985 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__41976,indexed,G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__41988){
var vec__41989 = p__41988;
var i = cljs.core.nth.call(null,vec__41989,(0),null);
var squadron = cljs.core.nth.call(null,vec__41989,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [i,squadron], null);
});})(vec__41976,indexed,G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,indexed));
var i = cljs.core.nth.call(null,vec__41985,(0),null);
var squadron = cljs.core.nth.call(null,vec__41985,(1),null);
return hoplon.svg.tspan.call(null,new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (vec__41985,i,squadron,vec__41976,indexed,G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41992,G__41993){
return ((G__41992 + (2)) * G__41993);
});})(vec__41985,i,squadron,vec__41976,indexed,G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,i,line_height),new cljs.core.Keyword(null,"text-anchor","text-anchor",585613696),"start",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (vec__41985,i,squadron,vec__41976,indexed,G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41994){
return (- (G__41994 / (2)));
});})(vec__41985,i,squadron,vec__41976,indexed,G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tw),new cljs.core.Keyword(null,"dx","dx",-381796732),"0.75em",javelin.core.formula.call(null,((function (vec__41985,i,squadron,vec__41976,indexed,G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41995,G__41996){
return G__41995.call(null,"%d %s",new cljs.core.Keyword(null,"quantity","quantity",-1929050694).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__41996)),new cljs.core.Keyword(null,"airframe","airframe",643222926).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__41996)));
});})(vec__41985,i,squadron,vec__41976,indexed,G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,goog.string.format,squadron));
});})(G__41973,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
));
var update_bbox__15859__auto__ = ((function (G__41973,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (G__41973,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
var bb__15860__auto__ = t.getBBox();
if(cljs.core.truth_(bb__15860__auto__.x)){
cljs.core.reset_BANG_.call(null,G__41973,bb__15860__auto__.x);

cljs.core.reset_BANG_.call(null,ty,bb__15860__auto__.y);

cljs.core.reset_BANG_.call(null,tw,bb__15860__auto__.width);

return cljs.core.reset_BANG_.call(null,th,bb__15860__auto__.height);
} else {
return null;
}
});})(G__41973,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
);
});})(G__41973,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
setTimeout(((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return update_bbox__15859__auto__.call(null);
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,(0));

var temp__5720__auto___42038 = bbox_trigger;
if(cljs.core.truth_(temp__5720__auto___42038)){
var w__15861__auto___42039 = temp__5720__auto___42038;
cljs.core.add_watch.call(null,w__15861__auto___42039,cljs.core.keyword.call(null,cljs.core.gensym.call(null)),((function (w__15861__auto___42039,temp__5720__auto___42038,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (_,___$1,___$2,___$3){
return setTimeout(((function (w__15861__auto___42039,temp__5720__auto___42038,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return update_bbox__15859__auto__.call(null);
});})(w__15861__auto___42039,temp__5720__auto___42038,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,(0));
});})(w__15861__auto___42039,temp__5720__auto___42038,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
);
} else {
}

return hoplon.svg.g.call(null,(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"label",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41997,G__41998){
return G__41997.call(null,(0),G__41998);
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_translate,text_y_offset),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__41999,G__42000){
return G__41999.call(null,G__42000);
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_text_scale),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
var padding = 0.1;
var tx = javelin.core.formula.call(null,((function (padding,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (dims__$1,tw__$1){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(dims__$1) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(dims__$1) - tw__$1) / (2)));
});})(padding,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims,tw);
var rx = javelin.core.formula.call(null,((function (padding,tx,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (tx__$1){
return (tx__$1 - padding);
});})(padding,tx,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tx);
var ry = javelin.core.formula.call(null,((function (padding,tx,rx,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (ty__$1){
return (ty__$1 - padding);
});})(padding,tx,rx,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,ty);
var rw = javelin.core.formula.call(null,((function (padding,tx,rx,ry,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (tw__$1){
return ((tw__$1 + padding) + padding);
});})(padding,tx,rx,ry,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tw);
var rh = javelin.core.formula.call(null,((function (padding,tx,rx,ry,rw,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (th__$1){
return ((th__$1 + padding) + padding);
});})(padding,tx,rx,ry,rw,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,th);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"background",hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),rx,new cljs.core.Keyword(null,"y","y",-1757859776),ry,new cljs.core.Keyword(null,"width","width",-384071477),rw,new cljs.core.Keyword(null,"height","height",1025178622),rh,new cljs.core.Keyword(null,"opacity","opacity",397153780),0.4,new cljs.core.Keyword(null,"fill","fill",883462889),contrasting_color,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"none"));
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__30287__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
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__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,weathergen.ui.map_show_text_background_QMARK_);
})(),t));
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__30287__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
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__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42001,G__42002){
return G__42001.call(null,G__42002,new cljs.core.Keyword(null,"nothing","nothing",-1022703296));
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,cljs.core.not_EQ_,label_style));
})(),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42003,G__42004){
return G__42003.call(null,G__42004);
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_icon_scale),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"squadron icons",new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_translate.call(null,0.5,(0)),(function (){var squadron_icon_scale = 0.6;
var squadrons = javelin.core.formula.call(null,((function (squadron_icon_scale,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (airbase__$1,included_squadrons){
return cljs.core.first.call(null,cljs.core.reduce.call(null,((function (squadron_icon_scale,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__42005,squadron){
var vec__42006 = p__42005;
var squadrons = cljs.core.nth.call(null,vec__42006,(0),null);
var cum_width = cljs.core.nth.call(null,vec__42006,(1),null);
var width__$1 = cljs.core.first.call(null,new cljs.core.Keyword(null,"size","size",1098693007).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"image-data","image-data",-377483758).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron))));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.conj.call(null,squadrons,cljs.core.assoc.call(null,squadron,new cljs.core.Keyword("weathergen.ui","x-offset","weathergen.ui/x-offset",666987585),cum_width)),((cum_width + ((width__$1 * icon_scale) * squadron_icon_scale)) + 0.1)], null);
});})(squadron_icon_scale,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.PersistentVector.EMPTY,(0)], null),cljs.core.filter.call(null,included_squadrons,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1))));
});})(squadron_icon_scale,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.included_squadrons);
return hoplon.core.loop_tpl_STAR_.call(null,squadrons,((function (squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (item__30277__auto__){
var vec__42009 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (squadron){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron], null);
});})(squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,item__30277__auto__));
var squadron = cljs.core.nth.call(null,vec__42009,(0),null);
var info = javelin.core.formula.call(null,((function (vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (squadron__$1){
var image = new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron__$1);
var map__42012 = image;
var map__42012__$1 = (((((!((map__42012 == null))))?(((((map__42012.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42012.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42012):map__42012);
var image_data = cljs.core.get.call(null,map__42012__$1,new cljs.core.Keyword(null,"image-data","image-data",-377483758));
var map__42013 = image_data;
var map__42013__$1 = (((((!((map__42013 == null))))?(((((map__42013.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42013.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42013):map__42013);
var size = cljs.core.get.call(null,map__42013__$1,new cljs.core.Keyword(null,"size","size",1098693007));
var vec__42014 = size;
var w = cljs.core.nth.call(null,vec__42014,(0),null);
var h = cljs.core.nth.call(null,vec__42014,(1),null);
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"w","w",354169001),((icon_scale * squadron_icon_scale) * w),new cljs.core.Keyword(null,"h","h",1109658740),((icon_scale * squadron_icon_scale) * h),new cljs.core.Keyword(null,"src","src",-1651076051),weathergen.ui.common.get_image.call(null,mission,image)], null);
});})(vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,squadron);
return hoplon.svg.image.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),javelin.core.formula.call(null,((function (info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42019,G__42021,G__42020){
return G__42019.call(null,"ab/y: %f, ab/h: %f, sq/h: %f",new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__42020),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__42020),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__42021));
});})(info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,goog.string.format,info,dims),new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,((function (info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42022){
return new cljs.core.Keyword(null,"src","src",-1651076051).cljs$core$IFn$_invoke$arity$1(G__42022);
});})(info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42024,G__42023){
return (new cljs.core.Keyword("weathergen.ui","x-offset","weathergen.ui/x-offset",666987585).cljs$core$IFn$_invoke$arity$1(G__42023) + (new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__42024) / (2)));
});})(info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims,squadron),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42026,G__42025){
return (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__42025) + (new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__42025) - new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__42026)));
});})(info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info,dims),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42027){
return new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__42027);
});})(info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42028){
return new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__42028);
});})(info,vec__42009,squadron,squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info));
});})(squadron_icon_scale,squadrons,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
);
})());
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__30287__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
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__,G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,show_airbase_squadrons_QMARK_);
})(),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"airbase icon",hoplon.svg.image.call(null,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42031,G__42029,G__42030){
return G__42029.call(null,G__42030,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(G__42031));
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.common.get_image,mission),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42032){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__42032);
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42033){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__42033);
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42034){
return new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__42034);
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42035){
return new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__42035);
});})(G__41973,ty,tw,th,t,update_bbox__15859__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims)))));
})()));
})());
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__30287__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
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__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__42036,G__42037){
var or__4131__auto__ = G__42036;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return G__42037;
}
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,visible_QMARK_,highlighted_QMARK_));
})());
});
weathergen.ui.airbases_info_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"section","section",-300141526),"airbase-info",(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[hoplon.core.loop_tpl_STAR_.call(null,weathergen.ui.all_airbases,(function (item__30277__auto__){
var vec__42040 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,(function (airbase){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [airbase], null);
})).call(null,item__30277__auto__));
var airbase = cljs.core.nth.call(null,vec__42040,(0),null);
return weathergen.ui.airbase_info_overlay.call(null,weathergen.ui.mission,airbase);
})),hoplon.svg.use.call(null,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,(function (G__42043,G__42044){
return G__42043.call(null,G__42044);
})).call(null,weathergen.ui.airbase_info_id,weathergen.ui.highlighted_airbase))],null)));
/**
 * Return true if the specified coordinates fall within the wind
 *   stability area.
 */
weathergen.ui.within_area_QMARK_ = (function weathergen$ui$within_area_QMARK_(area,cell){
var map__42045 = area;
var map__42045__$1 = (((((!((map__42045 == null))))?(((((map__42045.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42045.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42045):map__42045);
var bounds = cljs.core.get.call(null,map__42045__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var map__42046 = bounds;
var map__42046__$1 = (((((!((map__42046 == null))))?(((((map__42046.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42046.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42046):map__42046);
var x = cljs.core.get.call(null,map__42046__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__42046__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__42046__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__42046__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var left = x;
var top = y;
var right = (x + width);
var bottom = (y + height);
var map__42047 = cell;
var map__42047__$1 = (((((!((map__42047 == null))))?(((((map__42047.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42047.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42047):map__42047);
var x__$1 = cljs.core.get.call(null,map__42047__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__42047__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return (((((left <= x__$1)) && ((x__$1 <= right)))) && ((((top <= y__$1)) && ((y__$1 <= bottom)))));
});
/**
 * Returns true if the specified coordinates fall within the weather
 *   override.
 */
weathergen.ui.within_override_QMARK_ = (function weathergen$ui$within_override_QMARK_(override,cell){
var map__42051 = override;
var map__42051__$1 = (((((!((map__42051 == null))))?(((((map__42051.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42051.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42051):map__42051);
var location = cljs.core.get.call(null,map__42051__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__42051__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var map__42052 = location;
var map__42052__$1 = (((((!((map__42052 == null))))?(((((map__42052.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42052.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42052):map__42052);
var x = cljs.core.get.call(null,map__42052__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__42052__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var cx = x;
var cy = y;
var map__42053 = cell;
var map__42053__$1 = (((((!((map__42053 == null))))?(((((map__42053.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42053.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42053):map__42053);
var x__$1 = cljs.core.get.call(null,map__42053__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__42053__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var dx = (cx - x__$1);
var dy = (cy - y__$1);
return (((dx * dx) + (dy * dy)) < (radius * radius));
});
/**
 * Renders the UI for display of bullseye.
 */
weathergen.ui.bullseye_overlay = (function weathergen$ui$bullseye_overlay(mission){
var con__30287__auto__ = (new cljs.core.Delay((function (){
var stroke_width = 0.025;
var bw = javelin.core.formula.call(null,((function (stroke_width){
return (function (mission__$1){
var map__42057 = mission__$1;
var map__42057__$1 = (((((!((map__42057 == null))))?(((((map__42057.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42057.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42057):map__42057);
var campaign_info = cljs.core.get.call(null,map__42057__$1,new cljs.core.Keyword(null,"campaign-info","campaign-info",1158908966));
var map__42058 = campaign_info;
var map__42058__$1 = (((((!((map__42058 == null))))?(((((map__42058.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42058.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42058):map__42058);
var bx = cljs.core.get.call(null,map__42058__$1,new cljs.core.Keyword(null,"bullseye-x","bullseye-x",-1698783852));
var by = cljs.core.get.call(null,map__42058__$1,new cljs.core.Keyword(null,"bullseye-y","bullseye-y",904460818));
return weathergen.coordinates.fgrid__GT_weather.call(null,mission__$1,bx,by);
});})(stroke_width))
).call(null,mission);
var bx = javelin.core.formula.call(null,((function (stroke_width,bw){
return (function (G__42061){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__42061);
});})(stroke_width,bw))
).call(null,bw);
var by = javelin.core.formula.call(null,((function (stroke_width,bw,bx){
return (function (G__42062){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__42062);
});})(stroke_width,bw,bx))
).call(null,bw);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"debug","debug",-1608172596),"bullseye"], null),new cljs.core.Keyword("svg","transform","svg/transform",1381351328),javelin.core.formula.call(null,((function (stroke_width,bw,bx,by){
return (function (G__42063,G__42064,G__42065){
return G__42063.call(null,G__42064,G__42065);
});})(stroke_width,bw,bx,by))
).call(null,weathergen.ui.common.svg_translate,bx,by),(function (){var iter__4523__auto__ = ((function (stroke_width,bw,bx,by){
return (function weathergen$ui$bullseye_overlay_$_iter__42066(s__42067){
return (new cljs.core.LazySeq(null,((function (stroke_width,bw,bx,by){
return (function (){
var s__42067__$1 = s__42067;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42067__$1);
if(temp__5720__auto__){
var s__42067__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42067__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42067__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42069 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42068 = (0);
while(true){
if((i__42068 < size__4522__auto__)){
var r = cljs.core._nth.call(null,c__4521__auto__,i__42068);
cljs.core.chunk_append.call(null,b__42069,hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),javelin.core.formula.call(null,((function (i__42068,r,c__4521__auto__,size__4522__auto__,b__42069,s__42067__$2,temp__5720__auto__,stroke_width,bw,bx,by){
return (function (G__42072,G__42070,G__42071){
return G__42070.call(null,G__42071,G__42072);
});})(i__42068,r,c__4521__auto__,size__4522__auto__,b__42069,s__42067__$2,temp__5720__auto__,stroke_width,bw,bx,by))
).call(null,r,weathergen.coordinates.nm__GT_weather,mission)));

var G__42089 = (i__42068 + (1));
i__42068 = G__42089;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42069),weathergen$ui$bullseye_overlay_$_iter__42066.call(null,cljs.core.chunk_rest.call(null,s__42067__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42069),null);
}
} else {
var r = cljs.core.first.call(null,s__42067__$2);
return cljs.core.cons.call(null,hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),javelin.core.formula.call(null,((function (r,s__42067__$2,temp__5720__auto__,stroke_width,bw,bx,by){
return (function (G__42075,G__42073,G__42074){
return G__42073.call(null,G__42074,G__42075);
});})(r,s__42067__$2,temp__5720__auto__,stroke_width,bw,bx,by))
).call(null,r,weathergen.coordinates.nm__GT_weather,mission)),weathergen$ui$bullseye_overlay_$_iter__42066.call(null,cljs.core.rest.call(null,s__42067__$2)));
}
} else {
return null;
}
break;
}
});})(stroke_width,bw,bx,by))
,null,null));
});})(stroke_width,bw,bx,by))
;
return iter__4523__auto__.call(null,cljs.core.range.call(null,(30),(200),(30)));
})(),(function (){var iter__4523__auto__ = ((function (stroke_width,bw,bx,by){
return (function weathergen$ui$bullseye_overlay_$_iter__42076(s__42077){
return (new cljs.core.LazySeq(null,((function (stroke_width,bw,bx,by){
return (function (){
var s__42077__$1 = s__42077;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42077__$1);
if(temp__5720__auto__){
var s__42077__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42077__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42077__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42079 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42078 = (0);
while(true){
if((i__42078 < size__4522__auto__)){
var theta = cljs.core._nth.call(null,c__4521__auto__,i__42078);
cljs.core.chunk_append.call(null,b__42079,hoplon.svg.line.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_rotate.call(null,theta)], null),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"x1","x1",-1863922247),(0),new cljs.core.Keyword(null,"y1","y1",589123466),javelin.core.formula.call(null,((function (i__42078,theta,c__4521__auto__,size__4522__auto__,b__42079,s__42077__$2,temp__5720__auto__,stroke_width,bw,bx,by){
return (function (G__42080,G__42081){
return G__42080.call(null,G__42081,(-200));
});})(i__42078,theta,c__4521__auto__,size__4522__auto__,b__42079,s__42077__$2,temp__5720__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission),new cljs.core.Keyword(null,"x2","x2",-1362513475),(0),new cljs.core.Keyword(null,"y2","y2",-718691301),javelin.core.formula.call(null,((function (i__42078,theta,c__4521__auto__,size__4522__auto__,b__42079,s__42077__$2,temp__5720__auto__,stroke_width,bw,bx,by){
return (function (G__42082,G__42083){
return G__42082.call(null,G__42083,(200));
});})(i__42078,theta,c__4521__auto__,size__4522__auto__,b__42079,s__42077__$2,temp__5720__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission)));

var G__42090 = (i__42078 + (1));
i__42078 = G__42090;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42079),weathergen$ui$bullseye_overlay_$_iter__42076.call(null,cljs.core.chunk_rest.call(null,s__42077__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42079),null);
}
} else {
var theta = cljs.core.first.call(null,s__42077__$2);
return cljs.core.cons.call(null,hoplon.svg.line.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_rotate.call(null,theta)], null),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"x1","x1",-1863922247),(0),new cljs.core.Keyword(null,"y1","y1",589123466),javelin.core.formula.call(null,((function (theta,s__42077__$2,temp__5720__auto__,stroke_width,bw,bx,by){
return (function (G__42084,G__42085){
return G__42084.call(null,G__42085,(-200));
});})(theta,s__42077__$2,temp__5720__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission),new cljs.core.Keyword(null,"x2","x2",-1362513475),(0),new cljs.core.Keyword(null,"y2","y2",-718691301),javelin.core.formula.call(null,((function (theta,s__42077__$2,temp__5720__auto__,stroke_width,bw,bx,by){
return (function (G__42086,G__42087){
return G__42086.call(null,G__42087,(200));
});})(theta,s__42077__$2,temp__5720__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission)),weathergen$ui$bullseye_overlay_$_iter__42076.call(null,cljs.core.rest.call(null,s__42077__$2)));
}
} else {
return null;
}
break;
}
});})(stroke_width,bw,bx,by))
,null,null));
});})(stroke_width,bw,bx,by))
;
return iter__4523__auto__.call(null,cljs.core.range.call(null,(0),(180),(30)));
})());
}),null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__){
return (function (){
return null;
});})(con__30287__auto__))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__){
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__))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__){
return (function (G__42088){
return new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003).cljs$core$IFn$_invoke$arity$1(G__42088);
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__))
).call(null,weathergen.ui.map_display));
});
/**
 * Given a map pan as an x/y map, return a new map that doesn't permit showing areas outside the map.
 */
weathergen.ui.limit_pan = (function weathergen$ui$limit_pan(p__42091,zoom,p__42092){
var vec__42093 = p__42091;
var nx = cljs.core.nth.call(null,vec__42093,(0),null);
var ny = cljs.core.nth.call(null,vec__42093,(1),null);
var map__42096 = p__42092;
var map__42096__$1 = (((((!((map__42096 == null))))?(((((map__42096.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42096.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42096):map__42096);
var x = cljs.core.get.call(null,map__42096__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__42096__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = (nx / zoom);
var height = (ny / zoom);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - width),x),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - height),y)], null);
});
/**
 * Converts an x/y offset in pixels to an x/y offset in weatherspace units.
 */
weathergen.ui.pixels__GT_weather = (function weathergen$ui$pixels__GT_weather(p__42098){
var vec__42099 = p__42098;
var dx = cljs.core.nth.call(null,vec__42099,(0),null);
var dy = cljs.core.nth.call(null,vec__42099,(1),null);
var zoom = cljs.core.deref.call(null,weathergen.ui.map_zoom);
var vec__42102 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params));
var nx = cljs.core.nth.call(null,vec__42102,(0),null);
var ny = cljs.core.nth.call(null,vec__42102,(1),null);
var vec__42105 = cljs.core.deref.call(null,weathergen.ui.map_size);
var width = cljs.core.nth.call(null,vec__42105,(0),null);
var height = cljs.core.nth.call(null,vec__42105,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(((dx * nx) / width) / zoom),(((dy * ny) / height) / zoom)], null);
});
/**
 * Changes the map zoom by a factor of `amount`, centered on `[cx cy]`
 *   coordinates in weather space, which has dimensions `[nx ny]`.
 */
weathergen.ui.zoom_map_BANG_ = (function weathergen$ui$zoom_map_BANG_(p__42108,amount){
var vec__42109 = p__42108;
var cx = cljs.core.nth.call(null,vec__42109,(0),null);
var cy = cljs.core.nth.call(null,vec__42109,(1),null);
var vec__42112 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params));
var nx = cljs.core.nth.call(null,vec__42112,(0),null);
var ny = cljs.core.nth.call(null,vec__42112,(1),null);
var map__42115 = cljs.core.deref.call(null,weathergen.ui.map_pan);
var map__42115__$1 = (((((!((map__42115 == null))))?(((((map__42115.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42115.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42115):map__42115);
var px0 = cljs.core.get.call(null,map__42115__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var py0 = cljs.core.get.call(null,map__42115__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var z_SINGLEQUOTE_ = weathergen.math.clamp.call(null,weathergen.ui.zoom_min,weathergen.ui.zoom_max,(amount * cljs.core.deref.call(null,weathergen.ui.map_zoom)));
var dz = (z_SINGLEQUOTE_ / cljs.core.deref.call(null,weathergen.ui.map_zoom));
var px1 = (cx - ((cx - px0) / dz));
var py1 = (cy - ((cy - py0) / dz));
var px = ((px1 - px0) + px0);
var py = ((py1 - py0) + py0);
return javelin.core.dosync_STAR_.call(null,((function (vec__42112,nx,ny,map__42115,map__42115__$1,px0,py0,z_SINGLEQUOTE_,dz,px1,py1,px,py,vec__42109,cx,cy){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.map_zoom,z_SINGLEQUOTE_);

return cljs.core.reset_BANG_.call(null,weathergen.ui.map_pan,weathergen.ui.limit_pan.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [nx,ny], null),z_SINGLEQUOTE_,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),px,new cljs.core.Keyword(null,"y","y",-1757859776),py], null)));
});})(vec__42112,nx,ny,map__42115,map__42115__$1,px0,py0,z_SINGLEQUOTE_,dz,px1,py1,px,py,vec__42109,cx,cy))
);
});
/**
 * Return an overlay for a layer.
 */
weathergen.ui.layer_overlay = (function weathergen$ui$layer_overlay(var_args){
var args__4736__auto__ = [];
var len__4730__auto___42119 = arguments.length;
var i__4731__auto___42120 = (0);
while(true){
if((i__4731__auto___42120 < len__4730__auto___42119)){
args__4736__auto__.push((arguments[i__4731__auto___42120]));

var G__42121 = (i__4731__auto___42120 + (1));
i__4731__auto___42120 = G__42121;
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.layer_overlay.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4737__auto__);
});

weathergen.ui.layer_overlay.cljs$core$IFn$_invoke$arity$variadic = (function (overlay,args){
return cljs.core.apply.call(null,new cljs.core.Keyword(null,"overlay-fn","overlay-fn",1005125217).cljs$core$IFn$_invoke$arity$1(overlay),args);
});

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

/** @this {Function} */
weathergen.ui.layer_overlay.cljs$lang$applyTo = (function (seq42117){
var G__42118 = cljs.core.first.call(null,seq42117);
var seq42117__$1 = cljs.core.next.call(null,seq42117);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__42118,seq42117__$1);
});

/**
 * @param {...*} var_args
 */
weathergen.ui.grid = (function() { 
var weathergen$ui$grid__delegate = function (args__30233__auto__){
var vec__42124 = hoplon.core.parse_args.call(null,args__30233__auto__);
var map__42127 = cljs.core.nth.call(null,vec__42124,(0),null);
var map__42127__$1 = (((((!((map__42127 == null))))?(((((map__42127.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42127.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42127):map__42127);
var attrs = map__42127__$1;
var display_params = cljs.core.get.call(null,map__42127__$1,new cljs.core.Keyword(null,"display-params","display-params",573405707));
var selected_cell = cljs.core.get.call(null,map__42127__$1,new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443));
var weather_data = cljs.core.get.call(null,map__42127__$1,new cljs.core.Keyword(null,"weather-data","weather-data",-664219401));
var weather_overrides = cljs.core.get.call(null,map__42127__$1,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710));
var pressure_unit = cljs.core.get.call(null,map__42127__$1,new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243));
var computing = cljs.core.get.call(null,map__42127__$1,new cljs.core.Keyword(null,"computing","computing",-1002386157));
var nx = cljs.core.get.call(null,map__42127__$1,new cljs.core.Keyword(null,"nx","nx",-1996436366));
var ny = cljs.core.get.call(null,map__42127__$1,new cljs.core.Keyword(null,"ny","ny",1701791641));
var drag_handler = cljs.core.atom.call(null,null);
var drag_start = cljs.core.atom.call(null,null);
var register_drag_handler = ((function (drag_handler,drag_start,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (h){
return cljs.core.swap_BANG_.call(null,drag_handler,((function (drag_handler,drag_start,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p1__42122_SHARP_){
var or__4131__auto__ = p1__42122_SHARP_;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return h;
}
});})(drag_handler,drag_start,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
;
var doc_move = ((function (drag_handler,drag_start,register_drag_handler,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
var temp__5718__auto__ = cljs.core.deref.call(null,drag_handler);
if(cljs.core.truth_(temp__5718__auto__)){
var h = temp__5718__auto__;
var x = (e["pageX"]);
var y = (e["pageY"]);
var vec__42129 = cljs.core.deref.call(null,drag_start);
var sx = cljs.core.nth.call(null,vec__42129,(0),null);
var sy = cljs.core.nth.call(null,vec__42129,(1),null);
var dx = (x - sx);
var dy = (y - sy);
h.call(null,weathergen.ui.pixels__GT_weather.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dx,dy], null)),false);

return e.preventDefault();
} else {
return null;
}
});})(drag_handler,drag_start,register_drag_handler,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
;
var doc_up = ((function (drag_handler,drag_start,register_drag_handler,doc_move,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function weathergen$ui$grid_$_doc_up(e){
var temp__5720__auto___42315 = cljs.core.deref.call(null,drag_handler);
if(cljs.core.truth_(temp__5720__auto___42315)){
var h_42316 = temp__5720__auto___42315;
var x_42317 = (e["pageX"]);
var y_42318 = (e["pageY"]);
var vec__42132_42319 = cljs.core.deref.call(null,drag_start);
var sx_42320 = cljs.core.nth.call(null,vec__42132_42319,(0),null);
var sy_42321 = cljs.core.nth.call(null,vec__42132_42319,(1),null);
var dx_42322 = (x_42317 - sx_42320);
var dy_42323 = (y_42318 - sy_42321);
h_42316.call(null,weathergen.ui.pixels__GT_weather.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dx_42322,dy_42323], null)),true);
} else {
}

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

return cljs.core.reset_BANG_.call(null,drag_handler,null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
;
var _ = document.addEventListener("mousemove",doc_move);
var ___$1 = document.addEventListener("mouseup",doc_up);
var brightness_layer = hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"brightness-layer",new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),nx,new cljs.core.Keyword(null,"height","height",1025178622),ny,new cljs.core.Keyword(null,"fill","fill",883462889),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_display){
var brightness = new cljs.core.Keyword(null,"brightness","brightness",1067055820).cljs$core$IFn$_invoke$arity$1(map_display);
return cljs.core.apply.call(null,goog.string.format,"rgba(%d,%d,%d,%f)",(((0.5 <= brightness))?new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),((brightness - 0.5) / 0.5)], null):new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0),(0),((brightness - 0.5) / -0.5)], null)));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.map_display));
var primary_layer = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"primary-layer",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (display_params__$1){
return (!((new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(display_params__$1) == null)));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__42135){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"opacity","opacity",397153780),new cljs.core.Keyword(null,"opacity","opacity",397153780).cljs$core$IFn$_invoke$arity$1(G__42135)], null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params));
var wind_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"wind-overlay",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (display_params__$1){
return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params__$1),new cljs.core.Keyword(null,"wind","wind",-527553074));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params));
var coverage_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"coverage-overlay",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (display_params__$1){
return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params__$1),new cljs.core.Keyword(null,"cloud-cover","cloud-cover",1830614752));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params));
var text_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"text-overlay",new cljs.core.Keyword(null,"attr","attr",-604132353),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__42139,G__42138){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),["text-overlay ",(function (){var G__42137 = G__42138;
var G__42137__$1 = (cljs.core.truth_((G__42137 == null))?null:new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__42137));
if(cljs.core.truth_((G__42137__$1 == null))){
return null;
} else {
return G__42139.call(null,G__42137__$1);
}
})()].join('')], null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core.name,display_params),new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (display_params__$1){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"cloud-base","cloud-base",826793857),null,new cljs.core.Keyword(null,"cloud-size","cloud-size",-1568256381),null,new cljs.core.Keyword(null,"pressure","pressure",505343747),null,new cljs.core.Keyword(null,"type","type",1174270348),null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),null,new cljs.core.Keyword(null,"temperature","temperature",899018429),null], null), null).call(null,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params__$1));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params));
var selected_cell_overlay = (function (){var coords = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__42140){
return new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__42140);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,selected_cell);
var vec__42147 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__42150){
var vec__42151 = p__42150;
var x = cljs.core.nth.call(null,vec__42151,(0),null);
var y = cljs.core.nth.call(null,vec__42151,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null);
});})(coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,coords));
var x = cljs.core.nth.call(null,vec__42147,(0),null);
var y = cljs.core.nth.call(null,vec__42147,(1),null);
var con__30287__auto__ = (new cljs.core.Delay(((function (vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"selected-cell-overlay",new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,null);
});})(vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(1));
});})(vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return null;
});})(con__30287__auto__,vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
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__,vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (x__$1,y__$1){
var and__4120__auto__ = x__$1;
if(cljs.core.truth_(and__4120__auto__)){
return y__$1;
} else {
return and__4120__auto__;
}
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,vec__42147,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,x,y));
})();
var weather_overrides__$1 = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (weather_params){
return new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(weather_params);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.weather_params);
var effective_hover_cell = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (hover_cell,weather_overrides__$2){
if(cljs.core.truth_(cljs.core.some.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (override){
var and__4120__auto__ = weathergen.ui.within_override_QMARK_.call(null,override,hover_cell);
if(and__4120__auto__){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(override);
} else {
return and__4120__auto__;
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
,weather_overrides__$2))){
return null;
} else {
return hover_cell;
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.hover_cell,weather_overrides__$1);
var elem = hoplon.svg.svg.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"grid",(function (){var dims = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_size){
return cljs.core.map.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p1__42123_SHARP_){
return (p1__42123_SHARP_ - (7));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
,map_size);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.map_size);
return cljs.core.assoc.call(null,cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"display-params","display-params",573405707),new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443),new cljs.core.Keyword(null,"weather-data","weather-data",-664219401),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710)),new cljs.core.Keyword(null,"viewBox","viewBox",-469489477),javelin.core.formula.call(null,((function (dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_viewbox){
var map__42154 = map_viewbox;
var map__42154__$1 = (((((!((map__42154 == null))))?(((((map__42154.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42154.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42154):map__42154);
var x = cljs.core.get.call(null,map__42154__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__42154__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__42154__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__42154__$1,new cljs.core.Keyword(null,"height","height",1025178622));
return goog.string.format("%f %f %f %f",x,y,width,height);
});})(dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.map_viewbox),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__42156,G__42157){
return G__42156.call(null,G__42157);
});})(dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core.first,dims),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__42158,G__42159){
return G__42158.call(null,G__42159);
});})(dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core.second,dims),new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 2, ["xmlns:xlink","http://www.w3.org/1999/xlink","xmlns","http://www.w3.org/2000/svg"], null));
})(),new cljs.core.Keyword(null,"mousemove","mousemove",-1077794734),((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
return javelin.core.dosync_STAR_.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.suppress_bullseye_info_box_QMARK_,false);

return cljs.core.reset_BANG_.call(null,weathergen.ui.mouse_location,(function (){var vec__42160 = weathergen.ui.mouse_weather_coords.call(null,e);
var x = cljs.core.nth.call(null,vec__42160,(0),null);
var y = cljs.core.nth.call(null,vec__42160,(1),null);
if(((((((0) <= x)) && ((x <= nx)))) && (((((0) <= y)) && ((y <= ny)))))){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y], null);
} else {
return null;
}
})());
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"mouseleave","mouseleave",531566580),((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (___$2){
return javelin.core.dosync_STAR_.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.hover_cell,null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,drag_start,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(e["pageX"]),(e["pageY"])], null));

if(cljs.core.truth_(cljs.core.deref.call(null,drag_handler))){
return null;
} else {
var map__42163 = cljs.core.deref.call(null,weathergen.ui.map_pan);
var map__42163__$1 = (((((!((map__42163 == null))))?(((((map__42163.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42163.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42163):map__42163);
var px0 = cljs.core.get.call(null,map__42163__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var py0 = cljs.core.get.call(null,map__42163__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return register_drag_handler.call(null,((function (map__42163,map__42163__$1,px0,py0,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__42165,final_QMARK_){
var vec__42166 = p__42165;
var dx = cljs.core.nth.call(null,vec__42166,(0),null);
var dy = cljs.core.nth.call(null,vec__42166,(1),null);
var browser_zoom = window.devicePixelRatio;
return cljs.core.reset_BANG_.call(null,weathergen.ui.map_pan,weathergen.ui.limit_pan.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)),cljs.core.deref.call(null,weathergen.ui.map_zoom),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(px0 - dx),new cljs.core.Keyword(null,"y","y",-1757859776),(py0 - dy)], null)));
});})(map__42163,map__42163__$1,px0,py0,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
);
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"dragstart","dragstart",955864218),cljs.core.constantly.call(null,false),new cljs.core.PersistentVector(null, 16, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.ui.wind_vector_defs.call(null),weathergen.ui.cloud_coverage_defs.call(null),hoplon.svg.image.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"map-image",new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__42170,G__42169){
if(cljs.core.not.call(null,G__42169)){
return "images/kto.jpg";
} else {
return G__42170.call(null,G__42169,new cljs.core.Keyword(null,"map-image","map-image",-5560498).cljs$core$IFn$_invoke$arity$1(G__42169));
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.common.get_image,weathergen.ui.mission),new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),nx,new cljs.core.Keyword(null,"height","height",1025178622),ny),brightness_layer,primary_layer,weathergen.ui.bullseye_overlay.call(null,weathergen.ui.mission),wind_overlay,coverage_overlay,text_overlay,weathergen.ui.weather_overrides_overlay.call(null,weathergen.ui.weather_params,register_drag_handler),selected_cell_overlay,weathergen.ui.layer_overlay.call(null,weathergen.ui.acmi_layer),weathergen.ui.layer_overlay.call(null,weathergen.ui.annotations_layer,register_drag_handler),weathergen.ui.layer_overlay.call(null,weathergen.ui.flight_paths_layer),weathergen.ui.airbases_info_overlay,weathergen.ui.bullseye_info_box.call(null)], null));
goog.events.listen((new goog.events.MouseWheelHandler(elem)),goog.events.MouseWheelHandler.EventType.MOUSEWHEEL,((function (elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
e.preventDefault();

var amount = Math.pow(cljs.core.deref.call(null,weathergen.ui.zoom_speed),(e["deltaY"]));
return weathergen.ui.zoom_map_BANG_.call(null,weathergen.ui.mouse_weather_coords.call(null,e),amount);
});})(elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
);

hoplon.core.add_initfn_BANG_.call(null,((function (elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
var timer_name__15816__auto___42324 = "Initial create";
var ignore__15817__auto___42325 = console.time(timer_name__15816__auto___42324);
var result__15818__auto___42326 = (function (){
var frag_42327 = document.createDocumentFragment();
var seq__42171_42328 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__42176_42329 = null;
var count__42177_42330 = (0);
var i__42178_42331 = (0);
while(true){
if((i__42178_42331 < count__42177_42330)){
var x_42332 = cljs.core._nth.call(null,chunk__42176_42329,i__42178_42331);
var seq__42179_42333 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__42180_42334 = null;
var count__42181_42335 = (0);
var i__42182_42336 = (0);
while(true){
if((i__42182_42336 < count__42181_42335)){
var y_42337 = cljs.core._nth.call(null,chunk__42180_42334,i__42182_42336);
var r_42338 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__42193_42339 = r_42338;
G__42193_42339.setAttribute("id",["grid-primary-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42332),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42337)].join(''));

G__42193_42339.setAttribute("x",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42332));

G__42193_42339.setAttribute("y",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42337));

G__42193_42339.setAttribute("width","1");

G__42193_42339.setAttribute("height","1");

G__42193_42339.setAttribute("fill","none");

G__42193_42339.onclick = ((function (seq__42179_42333,chunk__42180_42334,count__42181_42335,i__42182_42336,seq__42171_42328,chunk__42176_42329,count__42177_42330,i__42178_42331,G__42193_42339,r_42338,y_42337,x_42332,frag_42327,timer_name__15816__auto___42324,ignore__15817__auto___42325,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_42332,y_42337], null)], null));
});})(seq__42179_42333,chunk__42180_42334,count__42181_42335,i__42182_42336,seq__42171_42328,chunk__42176_42329,count__42177_42330,i__42178_42331,G__42193_42339,r_42338,y_42337,x_42332,frag_42327,timer_name__15816__auto___42324,ignore__15817__auto___42325,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_42327,r_42338);


var G__42340 = seq__42179_42333;
var G__42341 = chunk__42180_42334;
var G__42342 = count__42181_42335;
var G__42343 = (i__42182_42336 + (1));
seq__42179_42333 = G__42340;
chunk__42180_42334 = G__42341;
count__42181_42335 = G__42342;
i__42182_42336 = G__42343;
continue;
} else {
var temp__5720__auto___42344 = cljs.core.seq.call(null,seq__42179_42333);
if(temp__5720__auto___42344){
var seq__42179_42345__$1 = temp__5720__auto___42344;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42179_42345__$1)){
var c__4550__auto___42346 = cljs.core.chunk_first.call(null,seq__42179_42345__$1);
var G__42347 = cljs.core.chunk_rest.call(null,seq__42179_42345__$1);
var G__42348 = c__4550__auto___42346;
var G__42349 = cljs.core.count.call(null,c__4550__auto___42346);
var G__42350 = (0);
seq__42179_42333 = G__42347;
chunk__42180_42334 = G__42348;
count__42181_42335 = G__42349;
i__42182_42336 = G__42350;
continue;
} else {
var y_42351 = cljs.core.first.call(null,seq__42179_42345__$1);
var r_42352 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__42194_42353 = r_42352;
G__42194_42353.setAttribute("id",["grid-primary-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42332),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42351)].join(''));

G__42194_42353.setAttribute("x",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42332));

G__42194_42353.setAttribute("y",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42351));

G__42194_42353.setAttribute("width","1");

G__42194_42353.setAttribute("height","1");

G__42194_42353.setAttribute("fill","none");

G__42194_42353.onclick = ((function (seq__42179_42333,chunk__42180_42334,count__42181_42335,i__42182_42336,seq__42171_42328,chunk__42176_42329,count__42177_42330,i__42178_42331,G__42194_42353,r_42352,y_42351,seq__42179_42345__$1,temp__5720__auto___42344,x_42332,frag_42327,timer_name__15816__auto___42324,ignore__15817__auto___42325,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_42332,y_42351], null)], null));
});})(seq__42179_42333,chunk__42180_42334,count__42181_42335,i__42182_42336,seq__42171_42328,chunk__42176_42329,count__42177_42330,i__42178_42331,G__42194_42353,r_42352,y_42351,seq__42179_42345__$1,temp__5720__auto___42344,x_42332,frag_42327,timer_name__15816__auto___42324,ignore__15817__auto___42325,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_42327,r_42352);


var G__42354 = cljs.core.next.call(null,seq__42179_42345__$1);
var G__42355 = null;
var G__42356 = (0);
var G__42357 = (0);
seq__42179_42333 = G__42354;
chunk__42180_42334 = G__42355;
count__42181_42335 = G__42356;
i__42182_42336 = G__42357;
continue;
}
} else {
}
}
break;
}

var G__42358 = seq__42171_42328;
var G__42359 = chunk__42176_42329;
var G__42360 = count__42177_42330;
var G__42361 = (i__42178_42331 + (1));
seq__42171_42328 = G__42358;
chunk__42176_42329 = G__42359;
count__42177_42330 = G__42360;
i__42178_42331 = G__42361;
continue;
} else {
var temp__5720__auto___42362 = cljs.core.seq.call(null,seq__42171_42328);
if(temp__5720__auto___42362){
var seq__42171_42363__$1 = temp__5720__auto___42362;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42171_42363__$1)){
var c__4550__auto___42364 = cljs.core.chunk_first.call(null,seq__42171_42363__$1);
var G__42365 = cljs.core.chunk_rest.call(null,seq__42171_42363__$1);
var G__42366 = c__4550__auto___42364;
var G__42367 = cljs.core.count.call(null,c__4550__auto___42364);
var G__42368 = (0);
seq__42171_42328 = G__42365;
chunk__42176_42329 = G__42366;
count__42177_42330 = G__42367;
i__42178_42331 = G__42368;
continue;
} else {
var x_42369 = cljs.core.first.call(null,seq__42171_42363__$1);
var seq__42172_42370 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__42173_42371 = null;
var count__42174_42372 = (0);
var i__42175_42373 = (0);
while(true){
if((i__42175_42373 < count__42174_42372)){
var y_42374 = cljs.core._nth.call(null,chunk__42173_42371,i__42175_42373);
var r_42375 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__42197_42376 = r_42375;
G__42197_42376.setAttribute("id",["grid-primary-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42369),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42374)].join(''));

G__42197_42376.setAttribute("x",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42369));

G__42197_42376.setAttribute("y",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42374));

G__42197_42376.setAttribute("width","1");

G__42197_42376.setAttribute("height","1");

G__42197_42376.setAttribute("fill","none");

G__42197_42376.onclick = ((function (seq__42172_42370,chunk__42173_42371,count__42174_42372,i__42175_42373,seq__42171_42328,chunk__42176_42329,count__42177_42330,i__42178_42331,G__42197_42376,r_42375,y_42374,x_42369,seq__42171_42363__$1,temp__5720__auto___42362,frag_42327,timer_name__15816__auto___42324,ignore__15817__auto___42325,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_42369,y_42374], null)], null));
});})(seq__42172_42370,chunk__42173_42371,count__42174_42372,i__42175_42373,seq__42171_42328,chunk__42176_42329,count__42177_42330,i__42178_42331,G__42197_42376,r_42375,y_42374,x_42369,seq__42171_42363__$1,temp__5720__auto___42362,frag_42327,timer_name__15816__auto___42324,ignore__15817__auto___42325,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_42327,r_42375);


var G__42377 = seq__42172_42370;
var G__42378 = chunk__42173_42371;
var G__42379 = count__42174_42372;
var G__42380 = (i__42175_42373 + (1));
seq__42172_42370 = G__42377;
chunk__42173_42371 = G__42378;
count__42174_42372 = G__42379;
i__42175_42373 = G__42380;
continue;
} else {
var temp__5720__auto___42381__$1 = cljs.core.seq.call(null,seq__42172_42370);
if(temp__5720__auto___42381__$1){
var seq__42172_42382__$1 = temp__5720__auto___42381__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42172_42382__$1)){
var c__4550__auto___42383 = cljs.core.chunk_first.call(null,seq__42172_42382__$1);
var G__42384 = cljs.core.chunk_rest.call(null,seq__42172_42382__$1);
var G__42385 = c__4550__auto___42383;
var G__42386 = cljs.core.count.call(null,c__4550__auto___42383);
var G__42387 = (0);
seq__42172_42370 = G__42384;
chunk__42173_42371 = G__42385;
count__42174_42372 = G__42386;
i__42175_42373 = G__42387;
continue;
} else {
var y_42388 = cljs.core.first.call(null,seq__42172_42382__$1);
var r_42389 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__42198_42390 = r_42389;
G__42198_42390.setAttribute("id",["grid-primary-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42369),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42388)].join(''));

G__42198_42390.setAttribute("x",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42369));

G__42198_42390.setAttribute("y",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42388));

G__42198_42390.setAttribute("width","1");

G__42198_42390.setAttribute("height","1");

G__42198_42390.setAttribute("fill","none");

G__42198_42390.onclick = ((function (seq__42172_42370,chunk__42173_42371,count__42174_42372,i__42175_42373,seq__42171_42328,chunk__42176_42329,count__42177_42330,i__42178_42331,G__42198_42390,r_42389,y_42388,seq__42172_42382__$1,temp__5720__auto___42381__$1,x_42369,seq__42171_42363__$1,temp__5720__auto___42362,frag_42327,timer_name__15816__auto___42324,ignore__15817__auto___42325,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_42369,y_42388], null)], null));
});})(seq__42172_42370,chunk__42173_42371,count__42174_42372,i__42175_42373,seq__42171_42328,chunk__42176_42329,count__42177_42330,i__42178_42331,G__42198_42390,r_42389,y_42388,seq__42172_42382__$1,temp__5720__auto___42381__$1,x_42369,seq__42171_42363__$1,temp__5720__auto___42362,frag_42327,timer_name__15816__auto___42324,ignore__15817__auto___42325,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_42327,r_42389);


var G__42391 = cljs.core.next.call(null,seq__42172_42382__$1);
var G__42392 = null;
var G__42393 = (0);
var G__42394 = (0);
seq__42172_42370 = G__42391;
chunk__42173_42371 = G__42392;
count__42174_42372 = G__42393;
i__42175_42373 = G__42394;
continue;
}
} else {
}
}
break;
}

var G__42395 = cljs.core.next.call(null,seq__42171_42363__$1);
var G__42396 = null;
var G__42397 = (0);
var G__42398 = (0);
seq__42171_42328 = G__42395;
chunk__42176_42329 = G__42396;
count__42177_42330 = G__42397;
i__42178_42331 = G__42398;
continue;
}
} else {
}
}
break;
}

goog.dom.appendChild(primary_layer,frag_42327);

var frag_42399 = document.createDocumentFragment();
var seq__42199_42400 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__42204_42401 = null;
var count__42205_42402 = (0);
var i__42206_42403 = (0);
while(true){
if((i__42206_42403 < count__42205_42402)){
var x_42404 = cljs.core._nth.call(null,chunk__42204_42401,i__42206_42403);
var seq__42207_42405 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__42208_42406 = null;
var count__42209_42407 = (0);
var i__42210_42408 = (0);
while(true){
if((i__42210_42408 < count__42209_42407)){
var y_42409 = cljs.core._nth.call(null,chunk__42208_42406,i__42210_42408);
var g_42410 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_42411 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__42231_42412 = g_42410;
G__42231_42412.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_42404 + 0.5),(y_42409 + 0.5)));


var G__42232_42413 = r_42411;
G__42232_42413.setAttribute("id",["grid-wind-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42404),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42409)].join(''));


goog.dom.appendChild(g_42410,r_42411);

goog.dom.appendChild(frag_42399,g_42410);


var G__42414 = seq__42207_42405;
var G__42415 = chunk__42208_42406;
var G__42416 = count__42209_42407;
var G__42417 = (i__42210_42408 + (1));
seq__42207_42405 = G__42414;
chunk__42208_42406 = G__42415;
count__42209_42407 = G__42416;
i__42210_42408 = G__42417;
continue;
} else {
var temp__5720__auto___42418 = cljs.core.seq.call(null,seq__42207_42405);
if(temp__5720__auto___42418){
var seq__42207_42419__$1 = temp__5720__auto___42418;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42207_42419__$1)){
var c__4550__auto___42420 = cljs.core.chunk_first.call(null,seq__42207_42419__$1);
var G__42421 = cljs.core.chunk_rest.call(null,seq__42207_42419__$1);
var G__42422 = c__4550__auto___42420;
var G__42423 = cljs.core.count.call(null,c__4550__auto___42420);
var G__42424 = (0);
seq__42207_42405 = G__42421;
chunk__42208_42406 = G__42422;
count__42209_42407 = G__42423;
i__42210_42408 = G__42424;
continue;
} else {
var y_42425 = cljs.core.first.call(null,seq__42207_42419__$1);
var g_42426 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_42427 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__42233_42428 = g_42426;
G__42233_42428.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_42404 + 0.5),(y_42425 + 0.5)));


var G__42234_42429 = r_42427;
G__42234_42429.setAttribute("id",["grid-wind-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42404),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42425)].join(''));


goog.dom.appendChild(g_42426,r_42427);

goog.dom.appendChild(frag_42399,g_42426);


var G__42430 = cljs.core.next.call(null,seq__42207_42419__$1);
var G__42431 = null;
var G__42432 = (0);
var G__42433 = (0);
seq__42207_42405 = G__42430;
chunk__42208_42406 = G__42431;
count__42209_42407 = G__42432;
i__42210_42408 = G__42433;
continue;
}
} else {
}
}
break;
}

var G__42434 = seq__42199_42400;
var G__42435 = chunk__42204_42401;
var G__42436 = count__42205_42402;
var G__42437 = (i__42206_42403 + (1));
seq__42199_42400 = G__42434;
chunk__42204_42401 = G__42435;
count__42205_42402 = G__42436;
i__42206_42403 = G__42437;
continue;
} else {
var temp__5720__auto___42438 = cljs.core.seq.call(null,seq__42199_42400);
if(temp__5720__auto___42438){
var seq__42199_42439__$1 = temp__5720__auto___42438;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42199_42439__$1)){
var c__4550__auto___42440 = cljs.core.chunk_first.call(null,seq__42199_42439__$1);
var G__42441 = cljs.core.chunk_rest.call(null,seq__42199_42439__$1);
var G__42442 = c__4550__auto___42440;
var G__42443 = cljs.core.count.call(null,c__4550__auto___42440);
var G__42444 = (0);
seq__42199_42400 = G__42441;
chunk__42204_42401 = G__42442;
count__42205_42402 = G__42443;
i__42206_42403 = G__42444;
continue;
} else {
var x_42445 = cljs.core.first.call(null,seq__42199_42439__$1);
var seq__42200_42446 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__42201_42447 = null;
var count__42202_42448 = (0);
var i__42203_42449 = (0);
while(true){
if((i__42203_42449 < count__42202_42448)){
var y_42450 = cljs.core._nth.call(null,chunk__42201_42447,i__42203_42449);
var g_42451 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_42452 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__42239_42453 = g_42451;
G__42239_42453.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_42445 + 0.5),(y_42450 + 0.5)));


var G__42240_42454 = r_42452;
G__42240_42454.setAttribute("id",["grid-wind-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42445),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42450)].join(''));


goog.dom.appendChild(g_42451,r_42452);

goog.dom.appendChild(frag_42399,g_42451);


var G__42455 = seq__42200_42446;
var G__42456 = chunk__42201_42447;
var G__42457 = count__42202_42448;
var G__42458 = (i__42203_42449 + (1));
seq__42200_42446 = G__42455;
chunk__42201_42447 = G__42456;
count__42202_42448 = G__42457;
i__42203_42449 = G__42458;
continue;
} else {
var temp__5720__auto___42459__$1 = cljs.core.seq.call(null,seq__42200_42446);
if(temp__5720__auto___42459__$1){
var seq__42200_42460__$1 = temp__5720__auto___42459__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42200_42460__$1)){
var c__4550__auto___42461 = cljs.core.chunk_first.call(null,seq__42200_42460__$1);
var G__42462 = cljs.core.chunk_rest.call(null,seq__42200_42460__$1);
var G__42463 = c__4550__auto___42461;
var G__42464 = cljs.core.count.call(null,c__4550__auto___42461);
var G__42465 = (0);
seq__42200_42446 = G__42462;
chunk__42201_42447 = G__42463;
count__42202_42448 = G__42464;
i__42203_42449 = G__42465;
continue;
} else {
var y_42466 = cljs.core.first.call(null,seq__42200_42460__$1);
var g_42467 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_42468 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__42241_42469 = g_42467;
G__42241_42469.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_42445 + 0.5),(y_42466 + 0.5)));


var G__42242_42470 = r_42468;
G__42242_42470.setAttribute("id",["grid-wind-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42445),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42466)].join(''));


goog.dom.appendChild(g_42467,r_42468);

goog.dom.appendChild(frag_42399,g_42467);


var G__42471 = cljs.core.next.call(null,seq__42200_42460__$1);
var G__42472 = null;
var G__42473 = (0);
var G__42474 = (0);
seq__42200_42446 = G__42471;
chunk__42201_42447 = G__42472;
count__42202_42448 = G__42473;
i__42203_42449 = G__42474;
continue;
}
} else {
}
}
break;
}

var G__42475 = cljs.core.next.call(null,seq__42199_42439__$1);
var G__42476 = null;
var G__42477 = (0);
var G__42478 = (0);
seq__42199_42400 = G__42475;
chunk__42204_42401 = G__42476;
count__42205_42402 = G__42477;
i__42206_42403 = G__42478;
continue;
}
} else {
}
}
break;
}

goog.dom.appendChild(wind_overlay,frag_42399);

var frag_42479 = document.createDocumentFragment();
var seq__42243_42480 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__42248_42481 = null;
var count__42249_42482 = (0);
var i__42250_42483 = (0);
while(true){
if((i__42250_42483 < count__42249_42482)){
var x_42484 = cljs.core._nth.call(null,chunk__42248_42481,i__42250_42483);
var seq__42251_42485 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__42252_42486 = null;
var count__42253_42487 = (0);
var i__42254_42488 = (0);
while(true){
if((i__42254_42488 < count__42253_42487)){
var y_42489 = cljs.core._nth.call(null,chunk__42252_42486,i__42254_42488);
var g_42490 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_42491 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__42275_42492 = g_42490;
G__42275_42492.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_42484 + 0.5),(y_42489 + 0.5)));


var G__42276_42493 = r_42491;
G__42276_42493.setAttribute("id",["cloud-coverage-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42484),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42489)].join(''));


goog.dom.appendChild(g_42490,r_42491);

goog.dom.appendChild(frag_42479,g_42490);


var G__42494 = seq__42251_42485;
var G__42495 = chunk__42252_42486;
var G__42496 = count__42253_42487;
var G__42497 = (i__42254_42488 + (1));
seq__42251_42485 = G__42494;
chunk__42252_42486 = G__42495;
count__42253_42487 = G__42496;
i__42254_42488 = G__42497;
continue;
} else {
var temp__5720__auto___42498 = cljs.core.seq.call(null,seq__42251_42485);
if(temp__5720__auto___42498){
var seq__42251_42499__$1 = temp__5720__auto___42498;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42251_42499__$1)){
var c__4550__auto___42500 = cljs.core.chunk_first.call(null,seq__42251_42499__$1);
var G__42501 = cljs.core.chunk_rest.call(null,seq__42251_42499__$1);
var G__42502 = c__4550__auto___42500;
var G__42503 = cljs.core.count.call(null,c__4550__auto___42500);
var G__42504 = (0);
seq__42251_42485 = G__42501;
chunk__42252_42486 = G__42502;
count__42253_42487 = G__42503;
i__42254_42488 = G__42504;
continue;
} else {
var y_42505 = cljs.core.first.call(null,seq__42251_42499__$1);
var g_42506 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_42507 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__42277_42508 = g_42506;
G__42277_42508.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_42484 + 0.5),(y_42505 + 0.5)));


var G__42278_42509 = r_42507;
G__42278_42509.setAttribute("id",["cloud-coverage-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42484),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42505)].join(''));


goog.dom.appendChild(g_42506,r_42507);

goog.dom.appendChild(frag_42479,g_42506);


var G__42510 = cljs.core.next.call(null,seq__42251_42499__$1);
var G__42511 = null;
var G__42512 = (0);
var G__42513 = (0);
seq__42251_42485 = G__42510;
chunk__42252_42486 = G__42511;
count__42253_42487 = G__42512;
i__42254_42488 = G__42513;
continue;
}
} else {
}
}
break;
}

var G__42514 = seq__42243_42480;
var G__42515 = chunk__42248_42481;
var G__42516 = count__42249_42482;
var G__42517 = (i__42250_42483 + (1));
seq__42243_42480 = G__42514;
chunk__42248_42481 = G__42515;
count__42249_42482 = G__42516;
i__42250_42483 = G__42517;
continue;
} else {
var temp__5720__auto___42518 = cljs.core.seq.call(null,seq__42243_42480);
if(temp__5720__auto___42518){
var seq__42243_42519__$1 = temp__5720__auto___42518;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42243_42519__$1)){
var c__4550__auto___42520 = cljs.core.chunk_first.call(null,seq__42243_42519__$1);
var G__42521 = cljs.core.chunk_rest.call(null,seq__42243_42519__$1);
var G__42522 = c__4550__auto___42520;
var G__42523 = cljs.core.count.call(null,c__4550__auto___42520);
var G__42524 = (0);
seq__42243_42480 = G__42521;
chunk__42248_42481 = G__42522;
count__42249_42482 = G__42523;
i__42250_42483 = G__42524;
continue;
} else {
var x_42525 = cljs.core.first.call(null,seq__42243_42519__$1);
var seq__42244_42526 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__42245_42527 = null;
var count__42246_42528 = (0);
var i__42247_42529 = (0);
while(true){
if((i__42247_42529 < count__42246_42528)){
var y_42530 = cljs.core._nth.call(null,chunk__42245_42527,i__42247_42529);
var g_42531 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_42532 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__42283_42533 = g_42531;
G__42283_42533.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_42525 + 0.5),(y_42530 + 0.5)));


var G__42284_42534 = r_42532;
G__42284_42534.setAttribute("id",["cloud-coverage-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42525),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42530)].join(''));


goog.dom.appendChild(g_42531,r_42532);

goog.dom.appendChild(frag_42479,g_42531);


var G__42535 = seq__42244_42526;
var G__42536 = chunk__42245_42527;
var G__42537 = count__42246_42528;
var G__42538 = (i__42247_42529 + (1));
seq__42244_42526 = G__42535;
chunk__42245_42527 = G__42536;
count__42246_42528 = G__42537;
i__42247_42529 = G__42538;
continue;
} else {
var temp__5720__auto___42539__$1 = cljs.core.seq.call(null,seq__42244_42526);
if(temp__5720__auto___42539__$1){
var seq__42244_42540__$1 = temp__5720__auto___42539__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42244_42540__$1)){
var c__4550__auto___42541 = cljs.core.chunk_first.call(null,seq__42244_42540__$1);
var G__42542 = cljs.core.chunk_rest.call(null,seq__42244_42540__$1);
var G__42543 = c__4550__auto___42541;
var G__42544 = cljs.core.count.call(null,c__4550__auto___42541);
var G__42545 = (0);
seq__42244_42526 = G__42542;
chunk__42245_42527 = G__42543;
count__42246_42528 = G__42544;
i__42247_42529 = G__42545;
continue;
} else {
var y_42546 = cljs.core.first.call(null,seq__42244_42540__$1);
var g_42547 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_42548 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__42285_42549 = g_42547;
G__42285_42549.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_42525 + 0.5),(y_42546 + 0.5)));


var G__42286_42550 = r_42548;
G__42286_42550.setAttribute("id",["cloud-coverage-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42525),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42546)].join(''));


goog.dom.appendChild(g_42547,r_42548);

goog.dom.appendChild(frag_42479,g_42547);


var G__42551 = cljs.core.next.call(null,seq__42244_42540__$1);
var G__42552 = null;
var G__42553 = (0);
var G__42554 = (0);
seq__42244_42526 = G__42551;
chunk__42245_42527 = G__42552;
count__42246_42528 = G__42553;
i__42247_42529 = G__42554;
continue;
}
} else {
}
}
break;
}

var G__42555 = cljs.core.next.call(null,seq__42243_42519__$1);
var G__42556 = null;
var G__42557 = (0);
var G__42558 = (0);
seq__42243_42480 = G__42555;
chunk__42248_42481 = G__42556;
count__42249_42482 = G__42557;
i__42250_42483 = G__42558;
continue;
}
} else {
}
}
break;
}

goog.dom.appendChild(coverage_overlay,frag_42479);

var frag = document.createDocumentFragment();
var scale = 0.03;
var seq__42287_42559 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__42292_42560 = null;
var count__42293_42561 = (0);
var i__42294_42562 = (0);
while(true){
if((i__42294_42562 < count__42293_42561)){
var x_42563 = cljs.core._nth.call(null,chunk__42292_42560,i__42294_42562);
var seq__42295_42564 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__42296_42565 = null;
var count__42297_42566 = (0);
var i__42298_42567 = (0);
while(true){
if((i__42298_42567 < count__42297_42566)){
var y_42568 = cljs.core._nth.call(null,chunk__42296_42565,i__42298_42567);
var t_42569 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__42309_42570 = t_42569;
G__42309_42570.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale))," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_42563 + 0.5) / scale),((y_42568 + 0.9) / scale)))].join(''));

G__42309_42570.setAttribute("id",["grid-text-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42563),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42568)].join(''));

G__42309_42570.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_42569);


var G__42571 = seq__42295_42564;
var G__42572 = chunk__42296_42565;
var G__42573 = count__42297_42566;
var G__42574 = (i__42298_42567 + (1));
seq__42295_42564 = G__42571;
chunk__42296_42565 = G__42572;
count__42297_42566 = G__42573;
i__42298_42567 = G__42574;
continue;
} else {
var temp__5720__auto___42575 = cljs.core.seq.call(null,seq__42295_42564);
if(temp__5720__auto___42575){
var seq__42295_42576__$1 = temp__5720__auto___42575;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42295_42576__$1)){
var c__4550__auto___42577 = cljs.core.chunk_first.call(null,seq__42295_42576__$1);
var G__42578 = cljs.core.chunk_rest.call(null,seq__42295_42576__$1);
var G__42579 = c__4550__auto___42577;
var G__42580 = cljs.core.count.call(null,c__4550__auto___42577);
var G__42581 = (0);
seq__42295_42564 = G__42578;
chunk__42296_42565 = G__42579;
count__42297_42566 = G__42580;
i__42298_42567 = G__42581;
continue;
} else {
var y_42582 = cljs.core.first.call(null,seq__42295_42576__$1);
var t_42583 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__42310_42584 = t_42583;
G__42310_42584.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale))," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_42563 + 0.5) / scale),((y_42582 + 0.9) / scale)))].join(''));

G__42310_42584.setAttribute("id",["grid-text-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42563),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42582)].join(''));

G__42310_42584.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_42583);


var G__42585 = cljs.core.next.call(null,seq__42295_42576__$1);
var G__42586 = null;
var G__42587 = (0);
var G__42588 = (0);
seq__42295_42564 = G__42585;
chunk__42296_42565 = G__42586;
count__42297_42566 = G__42587;
i__42298_42567 = G__42588;
continue;
}
} else {
}
}
break;
}

var G__42589 = seq__42287_42559;
var G__42590 = chunk__42292_42560;
var G__42591 = count__42293_42561;
var G__42592 = (i__42294_42562 + (1));
seq__42287_42559 = G__42589;
chunk__42292_42560 = G__42590;
count__42293_42561 = G__42591;
i__42294_42562 = G__42592;
continue;
} else {
var temp__5720__auto___42593 = cljs.core.seq.call(null,seq__42287_42559);
if(temp__5720__auto___42593){
var seq__42287_42594__$1 = temp__5720__auto___42593;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42287_42594__$1)){
var c__4550__auto___42595 = cljs.core.chunk_first.call(null,seq__42287_42594__$1);
var G__42596 = cljs.core.chunk_rest.call(null,seq__42287_42594__$1);
var G__42597 = c__4550__auto___42595;
var G__42598 = cljs.core.count.call(null,c__4550__auto___42595);
var G__42599 = (0);
seq__42287_42559 = G__42596;
chunk__42292_42560 = G__42597;
count__42293_42561 = G__42598;
i__42294_42562 = G__42599;
continue;
} else {
var x_42600 = cljs.core.first.call(null,seq__42287_42594__$1);
var seq__42288_42601 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__42289_42602 = null;
var count__42290_42603 = (0);
var i__42291_42604 = (0);
while(true){
if((i__42291_42604 < count__42290_42603)){
var y_42605 = cljs.core._nth.call(null,chunk__42289_42602,i__42291_42604);
var t_42606 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__42313_42607 = t_42606;
G__42313_42607.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale))," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_42600 + 0.5) / scale),((y_42605 + 0.9) / scale)))].join(''));

G__42313_42607.setAttribute("id",["grid-text-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42600),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42605)].join(''));

G__42313_42607.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_42606);


var G__42608 = seq__42288_42601;
var G__42609 = chunk__42289_42602;
var G__42610 = count__42290_42603;
var G__42611 = (i__42291_42604 + (1));
seq__42288_42601 = G__42608;
chunk__42289_42602 = G__42609;
count__42290_42603 = G__42610;
i__42291_42604 = G__42611;
continue;
} else {
var temp__5720__auto___42612__$1 = cljs.core.seq.call(null,seq__42288_42601);
if(temp__5720__auto___42612__$1){
var seq__42288_42613__$1 = temp__5720__auto___42612__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__42288_42613__$1)){
var c__4550__auto___42614 = cljs.core.chunk_first.call(null,seq__42288_42613__$1);
var G__42615 = cljs.core.chunk_rest.call(null,seq__42288_42613__$1);
var G__42616 = c__4550__auto___42614;
var G__42617 = cljs.core.count.call(null,c__4550__auto___42614);
var G__42618 = (0);
seq__42288_42601 = G__42615;
chunk__42289_42602 = G__42616;
count__42290_42603 = G__42617;
i__42291_42604 = G__42618;
continue;
} else {
var y_42619 = cljs.core.first.call(null,seq__42288_42613__$1);
var t_42620 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__42314_42621 = t_42620;
G__42314_42621.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale))," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_42600 + 0.5) / scale),((y_42619 + 0.9) / scale)))].join(''));

G__42314_42621.setAttribute("id",["grid-text-cell-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_42600),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_42619)].join(''));

G__42314_42621.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_42620);


var G__42622 = cljs.core.next.call(null,seq__42288_42613__$1);
var G__42623 = null;
var G__42624 = (0);
var G__42625 = (0);
seq__42288_42601 = G__42622;
chunk__42289_42602 = G__42623;
count__42290_42603 = G__42624;
i__42291_42604 = G__42625;
continue;
}
} else {
}
}
break;
}

var G__42626 = cljs.core.next.call(null,seq__42287_42594__$1);
var G__42627 = null;
var G__42628 = (0);
var G__42629 = (0);
seq__42287_42559 = G__42626;
chunk__42292_42560 = G__42627;
count__42293_42561 = G__42628;
i__42294_42562 = G__42629;
continue;
}
} else {
}
}
break;
}

return goog.dom.appendChild(text_overlay,frag);
})()
;
console.timeEnd(timer_name__15816__auto___42324);


var display_params_STAR_ = javelin.core.formula.call(null,((function (elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (display_params__$1){
return cljs.core.dissoc.call(null,display_params__$1,new cljs.core.Keyword(null,"opacity","opacity",397153780),new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"flight-paths","flight-paths",159519268),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541));
});})(elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params);
return javelin.core.formula.call(null,((function (display_params_STAR_,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny){
return (function (weather_data__$1,display_params_STAR___$1){
return weathergen.ui.update_grid.call(null,weather_data__$1,display_params_STAR___$1);
});})(display_params_STAR_,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weather_data,display_params_STAR_);
});})(elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,coverage_overlay,text_overlay,selected_cell_overlay,weather_overrides__$1,effective_hover_cell,vec__42124,map__42127,map__42127__$1,attrs,display_params,selected_cell,weather_data,weather_overrides,pressure_unit,computing,nx,ny))
);

return elem;
};
var weathergen$ui$grid = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__42630__i = 0, G__42630__a = new Array(arguments.length -  0);
while (G__42630__i < G__42630__a.length) {G__42630__a[G__42630__i] = arguments[G__42630__i + 0]; ++G__42630__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__42630__a,0,null);
} 
return weathergen$ui$grid__delegate.call(this,args__30233__auto__);};
weathergen$ui$grid.cljs$lang$maxFixedArity = 0;
weathergen$ui$grid.cljs$lang$applyTo = (function (arglist__42631){
var args__30233__auto__ = cljs.core.seq(arglist__42631);
return weathergen$ui$grid__delegate(args__30233__auto__);
});
weathergen$ui$grid.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$grid__delegate;
return weathergen$ui$grid;
})()
;
weathergen.ui.edit_field = (function weathergen$ui$edit_field(var_args){
var G__42635 = arguments.length;
switch (G__42635) {
case 2:
return weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return weathergen.ui.edit_field.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.edit_field.cljs$core$IFn$_invoke$arity$2 = (function (c,path){
return weathergen.ui.edit_field.call(null,c,path,cljs.core.PersistentArrayMap.EMPTY);
});

weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$3 = (function (c,path,opts){
var map__42636 = opts;
var map__42636__$1 = (((((!((map__42636 == null))))?(((((map__42636.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42636.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42636):map__42636);
var change_fn = cljs.core.get.call(null,map__42636__$1,new cljs.core.Keyword(null,"change-fn","change-fn",1566440825));
var input_attrs = cljs.core.get.call(null,map__42636__$1,new cljs.core.Keyword(null,"input-attrs","input-attrs",-38113667),cljs.core.PersistentArrayMap.EMPTY);
return hoplon.core.input.call(null,input_attrs,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (map__42636,map__42636__$1,change_fn,input_attrs){
return (function (G__42640,G__42639,G__42638){
return G__42638.call(null,G__42639,G__42640);
});})(map__42636,map__42636__$1,change_fn,input_attrs))
).call(null,path,c,cljs.core.get_in),new cljs.core.Keyword(null,"change","change",-1163046502),(cljs.core.truth_(change_fn)?((function (map__42636,map__42636__$1,change_fn,input_attrs){
return (function (p1__42632_SHARP_){
return change_fn.call(null,Number(cljs.core.deref.call(null,p1__42632_SHARP_)));
});})(map__42636,map__42636__$1,change_fn,input_attrs))
:((function (map__42636,map__42636__$1,change_fn,input_attrs){
return (function (p1__42633_SHARP_){
return cljs.core.swap_BANG_.call(null,c,cljs.core.assoc_in,path,Number(cljs.core.deref.call(null,p1__42633_SHARP_)));
});})(map__42636,map__42636__$1,change_fn,input_attrs))
));
});

weathergen.ui.edit_field.cljs$lang$maxFixedArity = 3;

/**
 * Renders an input that will edit a pressure value, in whatever units
 *   the cell `unit-c` indicates
 */
weathergen.ui.pressure_edit_field = (function weathergen$ui$pressure_edit_field(c,path,unit_c){
return hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,(function (c__$1,unit_c__$1){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,c__$1,path),unit_c__$1);
})).call(null,c,unit_c),new cljs.core.Keyword(null,"change","change",-1163046502),(function (p1__42642_SHARP_){
return cljs.core.swap_BANG_.call(null,c,cljs.core.assoc_in,path,weathergen.ui.convert_pressure.call(null,Number(cljs.core.deref.call(null,p1__42642_SHARP_)),cljs.core.deref.call(null,unit_c)));
}));
});
/**
 * Defines a time-edit box with against `path` into map cell `source`.
 * @param {...*} var_args
 */
weathergen.ui.time_entry = (function() { 
var weathergen$ui$time_entry__delegate = function (args__30233__auto__){
var vec__42644 = hoplon.core.parse_args.call(null,args__30233__auto__);
var attrs = cljs.core.nth.call(null,vec__42644,(0),null);
var _ = cljs.core.nth.call(null,vec__42644,(1),null);
var map__42647 = attrs;
var map__42647__$1 = (((((!((map__42647 == null))))?(((((map__42647.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42647.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42647):map__42647);
var path = cljs.core.get.call(null,map__42647__$1,new cljs.core.Keyword(null,"path","path",-188191168));
var source = cljs.core.get.call(null,map__42647__$1,new cljs.core.Keyword(null,"source","source",-433931539));
return weathergen.ui.common.time_edit.call(null,cljs.core.assoc.call(null,cljs.core.assoc.call(null,cljs.core.assoc.call(null,cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"path","path",-188191168)),new cljs.core.Keyword(null,"source","source",-433931539),javelin.core.formula.call(null,((function (map__42647,map__42647__$1,path,source,vec__42644,attrs,_){
return (function (source__$1){
return cljs.core.get_in.call(null,source__$1,path);
});})(map__42647,map__42647__$1,path,source,vec__42644,attrs,_))
).call(null,source)),new cljs.core.Keyword(null,"update","update",1045576396),((function (map__42647,map__42647__$1,path,source,vec__42644,attrs,_){
return (function (p1__42643_SHARP_){
return cljs.core.swap_BANG_.call(null,source,cljs.core.assoc_in,path,p1__42643_SHARP_);
});})(map__42647,map__42647__$1,path,source,vec__42644,attrs,_))
),new cljs.core.Keyword(null,"max-time","max-time",857408479),cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"max","max",61366548)], null))));
};
var weathergen$ui$time_entry = function (var_args){
var args__30233__auto__ = null;
if (arguments.length > 0) {
var G__42649__i = 0, G__42649__a = new Array(arguments.length -  0);
while (G__42649__i < G__42649__a.length) {G__42649__a[G__42649__i] = arguments[G__42649__i + 0]; ++G__42649__i;}
  args__30233__auto__ = new cljs.core.IndexedSeq(G__42649__a,0,null);
} 
return weathergen$ui$time_entry__delegate.call(this,args__30233__auto__);};
weathergen$ui$time_entry.cljs$lang$maxFixedArity = 0;
weathergen$ui$time_entry.cljs$lang$applyTo = (function (arglist__42650){
var args__30233__auto__ = cljs.core.seq(arglist__42650);
return weathergen$ui$time_entry__delegate(args__30233__auto__);
});
weathergen$ui$time_entry.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$time_entry__delegate;
return weathergen$ui$time_entry;
})()
;
/**
 * Returns UI for the 'button bar' that goes across the top of the
 *   map.
 */
weathergen.ui.button_bar = (function weathergen$ui$button_bar(){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-bar",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,(function (map_size){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,cljs.core.first.call(null,map_size)),new cljs.core.Keyword(null,"margin","margin",-995903681),"0 0 3px 0"], null);
})).call(null,weathergen.ui.map_size),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"legend","legend",-1027192245)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(5))], null),hoplon.core.span.call(null,"Map Legend")),(function (){var button_size = (18);
var map_center = ((function (button_size){
return (function (){
var map__42651 = cljs.core.deref.call(null,weathergen.ui.map_viewbox);
var map__42651__$1 = (((((!((map__42651 == null))))?(((((map__42651.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42651.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42651):map__42651);
var x = cljs.core.get.call(null,map__42651__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__42651__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__42651__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__42651__$1,new cljs.core.Keyword(null,"height","height",1025178622));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(x + (width / (2))),(y + (height / (2)))], null);
});})(button_size))
;
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(10))], null),weathergen.ui.common.inl.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (button_size,map_center){
return (function (){
return weathergen.ui.zoom_map_BANG_.call(null,map_center.call(null),1.1);
});})(button_size,map_center))
,hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"bottom"], null),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"src","src",-1651076051),"images/zoomin.svg",new cljs.core.Keyword(null,"title","title",636505583),"Zoom Map In")),weathergen.ui.common.inl.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (button_size,map_center){
return (function (){
return weathergen.ui.zoom_map_BANG_.call(null,map_center.call(null),(1.0 / 1.1));
});})(button_size,map_center))
,hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"bottom"], null),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"src","src",-1651076051),"images/zoomout.svg",new cljs.core.Keyword(null,"title","title",636505583),"Zoom Map Out")))));
})(),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"float","float",-1732389368),"right",new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(5),(32),(0),(0))], null),hoplon.core.span.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"mission-time","mission-time",-1235574900)], null),"Mission Time:")," ",javelin.core.formula.call(null,(function (mission){
var t = weathergen.falcon.files.mission.mission_time.call(null,mission);
if(cljs.core.truth_(t)){
return weathergen.ui.common.format_time.call(null,t);
} else {
return "--/----";
}
})).call(null,weathergen.ui.mission)),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(7))], null),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"weather-time","weather-time",-248525118)], null),"Weather Time:")," ",javelin.core.formula.call(null,(function (weather_data_params){
var t = new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(weather_data_params));
if(cljs.core.truth_(t)){
return weathergen.ui.common.format_time.call(null,t);
} else {
return "--/----";
}
})).call(null,weathergen.ui.weather_data_params))),javelin.core.formula.call(null,(function (computing){
if(cljs.core.not.call(null,computing)){
return cljs.core.PersistentVector.EMPTY;
} else {
return hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/spinner.gif",new cljs.core.Keyword(null,"width","width",-384071477),"24px",new cljs.core.Keyword(null,"height","height",1025178622),"24px",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"bottom",new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),"3px",new cljs.core.Keyword(null,"bottom","bottom",-1550509018),"0"], null));
}
})).call(null,weathergen.ui.computing));
});
/**
 * Lays out controls for a control section. `controls` is a sequence
 *   of [label selector opts] tuples, where `opts` is a map with
 *   keys :extra, :type, :help-base, :help-paths, :cell, or :ui.
 */
weathergen.ui.control_layout = (function weathergen$ui$control_layout(controls){
var field = (function() { 
var G__42667__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field",kids);
};
var G__42667 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__42668__i = 0, G__42668__a = new Array(arguments.length -  0);
while (G__42668__i < G__42668__a.length) {G__42668__a[G__42668__i] = arguments[G__42668__i + 0]; ++G__42668__i;}
  kids = new cljs.core.IndexedSeq(G__42668__a,0,null);
} 
return G__42667__delegate.call(this,kids);};
G__42667.cljs$lang$maxFixedArity = 0;
G__42667.cljs$lang$applyTo = (function (arglist__42669){
var kids = cljs.core.seq(arglist__42669);
return G__42667__delegate(kids);
});
G__42667.cljs$core$IFn$_invoke$arity$variadic = G__42667__delegate;
return G__42667;
})()
;
var field_help = ((function (field){
return (function() { 
var G__42670__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-help",kids);
};
var G__42670 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__42671__i = 0, G__42671__a = new Array(arguments.length -  0);
while (G__42671__i < G__42671__a.length) {G__42671__a[G__42671__i] = arguments[G__42671__i + 0]; ++G__42671__i;}
  kids = new cljs.core.IndexedSeq(G__42671__a,0,null);
} 
return G__42670__delegate.call(this,kids);};
G__42670.cljs$lang$maxFixedArity = 0;
G__42670.cljs$lang$applyTo = (function (arglist__42672){
var kids = cljs.core.seq(arglist__42672);
return G__42670__delegate(kids);
});
G__42670.cljs$core$IFn$_invoke$arity$variadic = G__42670__delegate;
return G__42670;
})()
;})(field))
;
var field_input = ((function (field,field_help){
return (function() { 
var G__42673__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-input",kids);
};
var G__42673 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__42674__i = 0, G__42674__a = new Array(arguments.length -  0);
while (G__42674__i < G__42674__a.length) {G__42674__a[G__42674__i] = arguments[G__42674__i + 0]; ++G__42674__i;}
  kids = new cljs.core.IndexedSeq(G__42674__a,0,null);
} 
return G__42673__delegate.call(this,kids);};
G__42673.cljs$lang$maxFixedArity = 0;
G__42673.cljs$lang$applyTo = (function (arglist__42675){
var kids = cljs.core.seq(arglist__42675);
return G__42673__delegate(kids);
});
G__42673.cljs$core$IFn$_invoke$arity$variadic = G__42673__delegate;
return G__42673;
})()
;})(field,field_help))
;
var field_label = ((function (field,field_help,field_input){
return (function() { 
var G__42676__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-label",kids);
};
var G__42676 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__42677__i = 0, G__42677__a = new Array(arguments.length -  0);
while (G__42677__i < G__42677__a.length) {G__42677__a[G__42677__i] = arguments[G__42677__i + 0]; ++G__42677__i;}
  kids = new cljs.core.IndexedSeq(G__42677__a,0,null);
} 
return G__42676__delegate.call(this,kids);};
G__42676.cljs$lang$maxFixedArity = 0;
G__42676.cljs$lang$applyTo = (function (arglist__42678){
var kids = cljs.core.seq(arglist__42678);
return G__42676__delegate(kids);
});
G__42676.cljs$core$IFn$_invoke$arity$variadic = G__42676__delegate;
return G__42676;
})()
;})(field,field_help,field_input))
;
var iter__4523__auto__ = ((function (field,field_help,field_input,field_label){
return (function weathergen$ui$control_layout_$_iter__42653(s__42654){
return (new cljs.core.LazySeq(null,((function (field,field_help,field_input,field_label){
return (function (){
var s__42654__$1 = s__42654;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42654__$1);
if(temp__5720__auto__){
var s__42654__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42654__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42654__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42656 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42655 = (0);
while(true){
if((i__42655 < size__4522__auto__)){
var vec__42657 = cljs.core._nth.call(null,c__4521__auto__,i__42655);
var label = cljs.core.nth.call(null,vec__42657,(0),null);
var selector = cljs.core.nth.call(null,vec__42657,(1),null);
var map__42660 = cljs.core.nth.call(null,vec__42657,(2),null);
var map__42660__$1 = (((((!((map__42660 == null))))?(((((map__42660.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42660.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42660):map__42660);
var opts = map__42660__$1;
var extra = cljs.core.get.call(null,map__42660__$1,new cljs.core.Keyword(null,"extra","extra",1612569067));
var type = cljs.core.get.call(null,map__42660__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var help_base = cljs.core.get.call(null,map__42660__$1,new cljs.core.Keyword(null,"help-base","help-base",-1618186240));
var help_path = cljs.core.get.call(null,map__42660__$1,new cljs.core.Keyword(null,"help-path","help-path",840478713));
var cell = cljs.core.get.call(null,map__42660__$1,new cljs.core.Keyword(null,"cell","cell",764245084));
var ui = cljs.core.get.call(null,map__42660__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var cell__$1 = (function (){var or__4131__auto__ = cell;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return weathergen.ui.weather_params;
}
})();
cljs.core.chunk_append.call(null,b__42656,field.call(null,field_label.call(null,weathergen.help.with_help.call(null,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__4131__auto__ = help_base;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return new cljs.core.Keyword(null,"weather-params","weather-params",-259271365);
}
})()], null),(function (){var or__4131__auto__ = help_path;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return selector;
}
})()),label)),field_input.call(null,(function (){var or__4131__auto__ = ui;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),type)){
return weathergen.ui.pressure_edit_field.call(null,cell__$1,selector,weathergen.ui.pressure_unit);
} else {
return weathergen.ui.edit_field.call(null,cell__$1,selector);
}
}
})(),(function (){var or__4131__auto__ = extra;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})())));

var G__42679 = (i__42655 + (1));
i__42655 = G__42679;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42656),weathergen$ui$control_layout_$_iter__42653.call(null,cljs.core.chunk_rest.call(null,s__42654__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42656),null);
}
} else {
var vec__42662 = cljs.core.first.call(null,s__42654__$2);
var label = cljs.core.nth.call(null,vec__42662,(0),null);
var selector = cljs.core.nth.call(null,vec__42662,(1),null);
var map__42665 = cljs.core.nth.call(null,vec__42662,(2),null);
var map__42665__$1 = (((((!((map__42665 == null))))?(((((map__42665.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42665.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42665):map__42665);
var opts = map__42665__$1;
var extra = cljs.core.get.call(null,map__42665__$1,new cljs.core.Keyword(null,"extra","extra",1612569067));
var type = cljs.core.get.call(null,map__42665__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var help_base = cljs.core.get.call(null,map__42665__$1,new cljs.core.Keyword(null,"help-base","help-base",-1618186240));
var help_path = cljs.core.get.call(null,map__42665__$1,new cljs.core.Keyword(null,"help-path","help-path",840478713));
var cell = cljs.core.get.call(null,map__42665__$1,new cljs.core.Keyword(null,"cell","cell",764245084));
var ui = cljs.core.get.call(null,map__42665__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var cell__$1 = (function (){var or__4131__auto__ = cell;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return weathergen.ui.weather_params;
}
})();
return cljs.core.cons.call(null,field.call(null,field_label.call(null,weathergen.help.with_help.call(null,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__4131__auto__ = help_base;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return new cljs.core.Keyword(null,"weather-params","weather-params",-259271365);
}
})()], null),(function (){var or__4131__auto__ = help_path;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return selector;
}
})()),label)),field_input.call(null,(function (){var or__4131__auto__ = ui;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),type)){
return weathergen.ui.pressure_edit_field.call(null,cell__$1,selector,weathergen.ui.pressure_unit);
} else {
return weathergen.ui.edit_field.call(null,cell__$1,selector);
}
}
})(),(function (){var or__4131__auto__ = extra;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})())),weathergen$ui$control_layout_$_iter__42653.call(null,cljs.core.rest.call(null,s__42654__$2)));
}
} else {
return null;
}
break;
}
});})(field,field_help,field_input,field_label))
,null,null));
});})(field,field_help,field_input,field_label))
;
return iter__4523__auto__.call(null,controls);
});
weathergen.ui.weather_display_controls = (function weathergen$ui$weather_display_controls(p__42681){
var map__42682 = p__42681;
var map__42682__$1 = (((((!((map__42682 == null))))?(((((map__42682.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42682.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42682):map__42682);
var prevent_map_change_QMARK_ = cljs.core.get.call(null,map__42682__$1,new cljs.core.Keyword(null,"prevent-map-change?","prevent-map-change?",1926330460));
var title = cljs.core.get.call(null,map__42682__$1,new cljs.core.Keyword(null,"title","title",636505583));
var field = ((function (map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__42688__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field",kids);
};
var G__42688 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__42689__i = 0, G__42689__a = new Array(arguments.length -  0);
while (G__42689__i < G__42689__a.length) {G__42689__a[G__42689__i] = arguments[G__42689__i + 0]; ++G__42689__i;}
  kids = new cljs.core.IndexedSeq(G__42689__a,0,null);
} 
return G__42688__delegate.call(this,kids);};
G__42688.cljs$lang$maxFixedArity = 0;
G__42688.cljs$lang$applyTo = (function (arglist__42690){
var kids = cljs.core.seq(arglist__42690);
return G__42688__delegate(kids);
});
G__42688.cljs$core$IFn$_invoke$arity$variadic = G__42688__delegate;
return G__42688;
})()
;})(map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
;
var field_help = ((function (field,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__42691__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-help",kids);
};
var G__42691 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__42692__i = 0, G__42692__a = new Array(arguments.length -  0);
while (G__42692__i < G__42692__a.length) {G__42692__a[G__42692__i] = arguments[G__42692__i + 0]; ++G__42692__i;}
  kids = new cljs.core.IndexedSeq(G__42692__a,0,null);
} 
return G__42691__delegate.call(this,kids);};
G__42691.cljs$lang$maxFixedArity = 0;
G__42691.cljs$lang$applyTo = (function (arglist__42693){
var kids = cljs.core.seq(arglist__42693);
return G__42691__delegate(kids);
});
G__42691.cljs$core$IFn$_invoke$arity$variadic = G__42691__delegate;
return G__42691;
})()
;})(field,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
;
var field_input = ((function (field,field_help,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__42694__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-input",kids);
};
var G__42694 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__42695__i = 0, G__42695__a = new Array(arguments.length -  0);
while (G__42695__i < G__42695__a.length) {G__42695__a[G__42695__i] = arguments[G__42695__i + 0]; ++G__42695__i;}
  kids = new cljs.core.IndexedSeq(G__42695__a,0,null);
} 
return G__42694__delegate.call(this,kids);};
G__42694.cljs$lang$maxFixedArity = 0;
G__42694.cljs$lang$applyTo = (function (arglist__42696){
var kids = cljs.core.seq(arglist__42696);
return G__42694__delegate(kids);
});
G__42694.cljs$core$IFn$_invoke$arity$variadic = G__42694__delegate;
return G__42694;
})()
;})(field,field_help,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
;
var field_label = ((function (field,field_help,field_input,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__42697__delegate = function (help_path,kids){
return weathergen.help.with_help.call(null,help_path,cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-label",kids));
};
var G__42697 = function (help_path,var_args){
var kids = null;
if (arguments.length > 1) {
var G__42698__i = 0, G__42698__a = new Array(arguments.length -  1);
while (G__42698__i < G__42698__a.length) {G__42698__a[G__42698__i] = arguments[G__42698__i + 1]; ++G__42698__i;}
  kids = new cljs.core.IndexedSeq(G__42698__a,0,null);
} 
return G__42697__delegate.call(this,help_path,kids);};
G__42697.cljs$lang$maxFixedArity = 1;
G__42697.cljs$lang$applyTo = (function (arglist__42699){
var help_path = cljs.core.first(arglist__42699);
var kids = cljs.core.rest(arglist__42699);
return G__42697__delegate(help_path,kids);
});
G__42697.cljs$core$IFn$_invoke$arity$variadic = G__42697__delegate;
return G__42697;
})()
;})(field,field_help,field_input,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
;
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),(function (){var or__4131__auto__ = title;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "Display Options";
}
})(),new cljs.core.Keyword(null,"id","id",-1388402092),"weather-display-controls-section",weathergen.ui.control_layout.call(null,(function (){var opts = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell","cell",764245084),weathergen.ui.display_params,new cljs.core.Keyword(null,"help-base","help-base",-1618186240),new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221)], null);
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Display",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"display","display",242065432)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"display","display",242065432)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1718410804),"None"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Weather Type",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"type","type",1174270348)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Pressure",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Temperature",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"temperature","temperature",899018429)], null)], null))], null))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Overlay",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"overlay","overlay",-139131598)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),(function (){var wind_QMARK_ = javelin.core.formula.call(null,((function (opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function (G__42684,G__42685){
return G__42684.call(null,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__42685),new cljs.core.Keyword(null,"wind","wind",-527553074));
});})(opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
).call(null,cljs.core._EQ_,weathergen.ui.display_params);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function (wind_QMARK___$1){
if(cljs.core.truth_(wind_QMARK___$1)){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(250))], null);
} else {
return null;
}
});})(wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
).call(null,wind_QMARK_),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function (wind_QMARK___$1){
if(cljs.core.truth_(wind_QMARK___$1)){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(40))], null);
} else {
return null;
}
});})(wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
).call(null,wind_QMARK_),new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"overlay","overlay",-139131598)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1718410804),"None"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Wind",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"wind","wind",-527553074)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Cloud Cover",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"cloud-cover","cloud-cover",1830614752)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Pressure",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Temperature",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"temperature","temperature",899018429)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Weather Type",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"type","type",1174270348)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Cloud Base",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"cloud-base","cloud-base",826793857)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Cloud Size",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"cloud-size","cloud-size",-1568256381)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Visibility",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"visibility","visibility",1338380893)], null)], null)),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),(7))], null),"at alt"),weathergen.ui.wind_alt_selector.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function (wind_QMARK___$1){
if(cljs.core.truth_(wind_QMARK___$1)){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(40))], null);
} else {
return null;
}
});})(wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
).call(null,wind_QMARK_))], null);
});})(wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function (){
return null;
});})(con__30287__auto__,wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
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__,wind_QMARK_,opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,wind_QMARK_);
})());
})()], null))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Pressure",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"InHg",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"inhg","inhg",-863180091)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Millibar",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"mbar","mbar",-1396360988)], null)], null))], null))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Opacity:",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"opacity","opacity",397153780)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.input.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"type","type",1174270348),"range",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),javelin.core.formula.call(null,((function (opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function (G__42686,G__42687){
return G__42686.call(null,(new cljs.core.Keyword(null,"opacity","opacity",397153780).cljs$core$IFn$_invoke$arity$1(G__42687) * (100)));
});})(opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
).call(null,cljs.core.long$,weathergen.ui.display_params),new cljs.core.Keyword(null,"input","input",556931961),((function (opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title){
return (function (p1__42680_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.display_params,cljs.core.assoc,new cljs.core.Keyword(null,"opacity","opacity",397153780),(cljs.core.deref.call(null,p1__42680_SHARP_) / 100.0));
});})(opts,field,field_help,field_input,field_label,map__42682,map__42682__$1,prevent_map_change_QMARK_,title))
], null))], null))], null)], null);
})()));
});
weathergen.ui.weather_parameters = (function weathergen$ui$weather_parameters(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Weather parameters",new cljs.core.Keyword(null,"id","id",-1388402092),"weather-params-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__42700,G__42701){
return G__42700.call(null,G__42701,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),weathergen.ui.control_layout.call(null,new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Seed",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"seed","seed",68613327)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap"], null),weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"seed","seed",68613327)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),"75px"], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc,new cljs.core.Keyword(null,"seed","seed",68613327),(cljs.core.rand_int.call(null,(5000)) + (100)));
}),"Random"))], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Min pressure",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Max pressure",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"max","max",61366548)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Pressure variation",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"variance","variance",1132010827)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Prevailing wind",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"prevailing-wind","prevailing-wind",-190580386),new cljs.core.Keyword(null,"heading","heading",-1312171873)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Weather heading",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"direction","direction",-633359395),new cljs.core.Keyword(null,"heading","heading",-1312171873)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell","cell",764245084),weathergen.ui.movement_params,new cljs.core.Keyword(null,"help-base","help-base",-1618186240),new cljs.core.Keyword(null,"movement-params","movement-params",293385966)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Weather speed",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"direction","direction",-633359395),new cljs.core.Keyword(null,"speed","speed",1257663751)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell","cell",764245084),weathergen.ui.movement_params,new cljs.core.Keyword(null,"help-base","help-base",-1618186240),new cljs.core.Keyword(null,"movement-params","movement-params",293385966)], null)], null)], null)));
});
weathergen.ui.weather_override_parameters = (function weathergen$ui$weather_override_parameters(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Weather override regions"),new cljs.core.Keyword(null,"id","id",-1388402092),"weather-override-params-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__42703,G__42704){
return G__42703.call(null,G__42704,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),(function (){var indexed_weather_overrides = javelin.core.formula.call(null,(function (weather_params){
return cljs.core.map_indexed.call(null,cljs.core.vector,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(weather_params));
})).call(null,weathergen.ui.weather_params);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-override-boxes",hoplon.core.loop_tpl_STAR_.call(null,indexed_weather_overrides,((function (indexed_weather_overrides){
return (function (item__30261__auto__){
var vec__42711 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (indexed_weather_overrides){
return (function (p__42714){
var vec__42715 = p__42714;
var index = cljs.core.nth.call(null,vec__42715,(0),null);
var override = cljs.core.nth.call(null,vec__42715,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [override,index], null);
});})(indexed_weather_overrides))
).call(null,item__30261__auto__));
var override = cljs.core.nth.call(null,vec__42711,(0),null);
var index = cljs.core.nth.call(null,vec__42711,(1),null);
var checkbox = ((function (vec__42711,override,index,indexed_weather_overrides){
return (function weathergen$ui$weather_override_parameters_$_checkbox(l,k,p__42718){
var map__42719 = p__42718;
var map__42719__$1 = (((((!((map__42719 == null))))?(((((map__42719.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42719.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42719):map__42719);
var change = cljs.core.get.call(null,map__42719__$1,new cljs.core.Keyword(null,"change","change",-1163046502));
var row_attrs = cljs.core.get.call(null,map__42719__$1,new cljs.core.Keyword(null,"row-attrs","row-attrs",2139633863));
return hoplon.core.tr.call(null,(function (){var or__4131__auto__ = row_attrs;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})(),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),hoplon.core.input.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),"25px"], null),new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (map__42719,map__42719__$1,change,row_attrs,vec__42711,override,index,indexed_weather_overrides){
return (function (G__42722,G__42721){
return G__42721.call(null,G__42722);
});})(map__42719,map__42719__$1,change,row_attrs,vec__42711,override,index,indexed_weather_overrides))
).call(null,override,k),new cljs.core.Keyword(null,"change","change",-1163046502),(function (){var or__4131__auto__ = change;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return ((function (or__4131__auto__,map__42719,map__42719__$1,change,row_attrs,vec__42711,override,index,indexed_weather_overrides){
return (function (___$1){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null),cljs.core.not);
});
;})(or__4131__auto__,map__42719,map__42719__$1,change,row_attrs,vec__42711,override,index,indexed_weather_overrides))
}
})()),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),k], null),hoplon.core.label.call(null,l))));
});})(vec__42711,override,index,indexed_weather_overrides))
;
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-overrides",hoplon.core.table.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"weather-override-params",hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"center","center",-748944368)], null),"Center X/Y")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"location","location",1815599388),new cljs.core.Keyword(null,"x","x",2099068185)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"input-attrs","input-attrs",-38113667),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px"], null)], null)], null)),weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"location","location",1815599388),new cljs.core.Keyword(null,"y","y",-1757859776)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"radius","radius",-2073122258)], null),"Radius")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"radius","radius",-2073122258)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null),"Falloff")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"strength","strength",-415606478)], null),"Strength")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"strength","strength",-415606478)], null)))))),(function (){var override__$1 = ((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (label,k,default$,ui){
var prior = javelin.core.cell.call(null,null);
var val = weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null));
var ui_STAR_ = ui.call(null,val);
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.common.checkbox.call(null,new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (G__42723){
return cljs.core.not.call(null,(G__42723 == null));
});})(prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,val),new cljs.core.Keyword(null,"change","change",-1163046502),((function (prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (v){
console.debug("change",label);

return javelin.core.dosync_STAR_.call(null,((function (prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
if(cljs.core.truth_(v)){
} else {
cljs.core.reset_BANG_.call(null,prior,cljs.core.deref.call(null,val));
}

return cljs.core.reset_BANG_.call(null,val,(cljs.core.truth_(v)?(function (){var or__4131__auto__ = cljs.core.deref.call(null,prior);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return default$;
}
})():null));
});})(prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides))
);
});})(prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides))
)),hoplon.core.td.call(null,["Override ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(label),"?"].join('')),hoplon.core.td.call(null,(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
return ui_STAR_;
});})(prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
return null;
});})(con__30287__auto__,prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides){
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__,prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (G__42724){
return cljs.core.not.call(null,(G__42724 == null));
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,prior,val,ui_STAR_,checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,val));
})()));
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
;
return hoplon.core.fieldset.call(null,hoplon.core.legend.call(null,"Weather Attributes"),hoplon.core.table.call(null,hoplon.core.tbody.call(null,override__$1.call(null,"type",new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"inclement","inclement",-550669382),((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (val){
return weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),val,new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Sunny",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"sunny","sunny",1448267778)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Fair",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"fair","fair",1684139423)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Poor",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"poor","poor",1462482211)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Inclement",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null)], null));
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
),override__$1.call(null,"temperature",new cljs.core.Keyword(null,"temperature","temperature",899018429),(22),((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (val){
return weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),val,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(-50),(50)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"\u00B0C (ft)",new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(55));
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
),override__$1.call(null,"visibility",new cljs.core.Keyword(null,"visibility","visibility",1338380893),(10),((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (val){
return weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),val,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.float_conformer.call(null,(0),(60)),new cljs.core.Keyword(null,"fmt","fmt",332300772),weathergen.ui.format_visibility,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"km",new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(55));
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
),override__$1.call(null,"cloud cover",new cljs.core.Keyword(null,"cloud-cover","cloud-cover",1830614752),new cljs.core.Keyword(null,"overcast","overcast",-2096313755),((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (val){
return weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),val,new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Few",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"few","few",941665998)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Scattered",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"scattered","scattered",-1263632526)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Broken",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"broken","broken",-1742446874)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Overcast",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"overcast","overcast",-2096313755)], null)], null));
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
)),override__$1.call(null,"cloud base",new cljs.core.Keyword(null,"cloud-base","cloud-base",826793857),(5000),((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (val){
return weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),val,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(0),(10000)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"altitude (ft)",new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(55));
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
),override__$1.call(null,"cloud size",new cljs.core.Keyword(null,"cloud-size","cloud-size",-1568256381),1.0,((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (val){
return weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),val,new cljs.core.Keyword(null,"fmt","fmt",332300772),((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (p1__42702_SHARP_){
if(cljs.core.truth_(p1__42702_SHARP_)){
return p1__42702_SHARP_.toFixed((2));
} else {
return "";
}
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.float_conformer.call(null,(0),5.0),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"0-5",new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(55));
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
),override__$1.call(null,"cloud towering",new cljs.core.Keyword(null,"towering?","towering?",2005070836),true,((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (val){
return weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),val,new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Towering",new cljs.core.Keyword(null,"value","value",305978217),true], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Not towering",new cljs.core.Keyword(null,"value","value",305978217),false], null)], null));
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
),override__$1.call(null,"wind direction",new cljs.core.Keyword(null,"wind-dir","wind-dir",-432221184),(90),((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (val){
return weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),val,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(0),(359)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"90",new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45));
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
),override__$1.call(null,"wind speed",new cljs.core.Keyword(null,"wind-speed","wind-speed",-815617496),(5),((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (val){
return weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),val,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(0),(200)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"20",new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45));
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
)),(function (){var wind_QMARK_ = javelin.core.formula.call(null,((function (override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (weather_params){
var map__42725 = cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index)], null));
var map__42725__$1 = (((((!((map__42725 == null))))?(((((map__42725.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42725.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42725):map__42725);
var wind_dir = cljs.core.get.call(null,map__42725__$1,new cljs.core.Keyword(null,"wind-dir","wind-dir",-432221184));
var wind_speed = cljs.core.get.call(null,map__42725__$1,new cljs.core.Keyword(null,"wind-speed","wind-speed",-815617496));
var or__4131__auto__ = wind_dir;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return wind_speed;
}
});})(override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,weathergen.ui.weather_params);
var alts = javelin.core.cell.call(null,new cljs.core.Keyword(null,"all","all",892129742));
var con__30287__auto__ = (new cljs.core.Delay(((function (wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
return hoplon.core.div.call(null,hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(7))], null),"Override winds at"),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),alts,new cljs.core.Keyword(null,"change","change",-1163046502),((function (wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (v){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"wind-alts","wind-alts",1257047776)], null),((cljs.core._EQ_.call(null,v,new cljs.core.Keyword(null,"all","all",892129742)))?weathergen.model.wind_alts:cljs.core.PersistentVector.EMPTY));
});})(wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
,new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"All Altitudes",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"all","all",892129742)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Selected Altitudes",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"some","some",-1951079573)], null)], null))),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
return hoplon.core.table.call(null,hoplon.core.tbody.call(null,(function (){var iter__4523__auto__ = ((function (wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function weathergen$ui$weather_override_parameters_$_iter__42727(s__42728){
return (new cljs.core.LazySeq(null,((function (wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
var s__42728__$1 = s__42728;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42728__$1);
if(temp__5720__auto__){
var s__42728__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42728__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42728__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42730 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42729 = (0);
while(true){
if((i__42729 < size__4522__auto__)){
var alt = cljs.core._nth.call(null,c__4521__auto__,i__42729);
cljs.core.chunk_append.call(null,b__42730,hoplon.core.tr.call(null,hoplon.core.td.call(null,(function (){var checked_QMARK_ = javelin.core.formula.call(null,((function (i__42729,alt,c__4521__auto__,size__4522__auto__,b__42730,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (weather_params){
return cljs.core.some.call(null,cljs.core.PersistentHashSet.createAsIfByAssoc([alt]),cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"wind-alts","wind-alts",1257047776)], null)));
});})(i__42729,alt,c__4521__auto__,size__4522__auto__,b__42730,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,weathergen.ui.weather_params);
return weathergen.ui.common.checkbox.call(null,new cljs.core.Keyword(null,"value","value",305978217),checked_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (i__42729,checked_QMARK_,alt,c__4521__auto__,size__4522__auto__,b__42730,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (v){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"wind-alts","wind-alts",1257047776)], null),((function (i__42729,checked_QMARK_,alt,c__4521__auto__,size__4522__auto__,b__42730,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (alts__$1){
if(cljs.core.truth_(v)){
return cljs.core.conj.call(null,alts__$1,alt);
} else {
return cljs.core.into.call(null,cljs.core.PersistentVector.EMPTY,cljs.core.remove.call(null,cljs.core.PersistentHashSet.createAsIfByAssoc([alt]),alts__$1));
}
});})(i__42729,checked_QMARK_,alt,c__4521__auto__,size__4522__auto__,b__42730,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
);
});})(i__42729,checked_QMARK_,alt,c__4521__auto__,size__4522__auto__,b__42730,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
);
})()),hoplon.core.td.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(alt),"ft"].join(''))));

var G__42747 = (i__42729 + (1));
i__42729 = G__42747;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42730),weathergen$ui$weather_override_parameters_$_iter__42727.call(null,cljs.core.chunk_rest.call(null,s__42728__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42730),null);
}
} else {
var alt = cljs.core.first.call(null,s__42728__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,(function (){var checked_QMARK_ = javelin.core.formula.call(null,((function (alt,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (weather_params){
return cljs.core.some.call(null,cljs.core.PersistentHashSet.createAsIfByAssoc([alt]),cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"wind-alts","wind-alts",1257047776)], null)));
});})(alt,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,weathergen.ui.weather_params);
return weathergen.ui.common.checkbox.call(null,new cljs.core.Keyword(null,"value","value",305978217),checked_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (checked_QMARK_,alt,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (v){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"wind-alts","wind-alts",1257047776)], null),((function (checked_QMARK_,alt,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (alts__$1){
if(cljs.core.truth_(v)){
return cljs.core.conj.call(null,alts__$1,alt);
} else {
return cljs.core.into.call(null,cljs.core.PersistentVector.EMPTY,cljs.core.remove.call(null,cljs.core.PersistentHashSet.createAsIfByAssoc([alt]),alts__$1));
}
});})(checked_QMARK_,alt,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
);
});})(checked_QMARK_,alt,s__42728__$2,temp__5720__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
);
})()),hoplon.core.td.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(alt),"ft"].join(''))),weathergen$ui$weather_override_parameters_$_iter__42727.call(null,cljs.core.rest.call(null,s__42728__$2)));
}
} else {
return null;
}
break;
}
});})(wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
,null,null));
});})(wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
;
return iter__4523__auto__.call(null,weathergen.model.wind_alts);
})()));
});})(wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
return null;
});})(con__30287__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
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__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (G__42732,G__42731){
return G__42731.call(null,G__42732,new cljs.core.Keyword(null,"all","all",892129742));
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,alts,cljs.core.not_EQ_));
})());
});})(wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
return null;
});})(con__30287__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides){
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__,wind_QMARK_,alts,override__$1,checkbox,vec__42711,override,index,indexed_weather_overrides))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,wind_QMARK_);
})());
})(),checkbox.call(null,"Show outline?",new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348),cljs.core.PersistentArrayMap.EMPTY),checkbox.call(null,"Fade in/out?",new cljs.core.Keyword(null,"animate?","animate?",-1559039739),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"change","change",-1163046502),((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (___$1){
return javelin.core.dosync_STAR_.call(null,((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"animate?","animate?",-1559039739)], null),cljs.core.not);

return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (weather_params){
if(cljs.core.truth_(cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"animate?","animate?",-1559039739)], null)))){
return weather_params;
} else {
return cljs.core.assoc_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"exclude-from-forecast?","exclude-from-forecast?",1182671640)], null),false);
}
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
);
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
);
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
], null)),(function (){var iter__4523__auto__ = ((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function weathergen$ui$weather_override_parameters_$_iter__42733(s__42734){
return (new cljs.core.LazySeq(null,((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
var s__42734__$1 = s__42734;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42734__$1);
if(temp__5720__auto__){
var s__42734__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42734__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42734__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42736 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42735 = (0);
while(true){
if((i__42735 < size__4522__auto__)){
var vec__42737 = cljs.core._nth.call(null,c__4521__auto__,i__42735);
var label = cljs.core.nth.call(null,vec__42737,(0),null);
var k = cljs.core.nth.call(null,vec__42737,(1),null);
cljs.core.chunk_append.call(null,b__42736,hoplon.core.tr.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (i__42735,vec__42737,label,k,c__4521__auto__,size__4522__auto__,b__42736,s__42734__$2,temp__5720__auto__,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (G__42740){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__42740);
});})(i__42735,vec__42737,label,k,c__4521__auto__,size__4522__auto__,b__42736,s__42734__$2,temp__5720__auto__,checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,override),hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),k], null),label)),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.weather_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null)))));

var G__42748 = (i__42735 + (1));
i__42735 = G__42748;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42736),weathergen$ui$weather_override_parameters_$_iter__42733.call(null,cljs.core.chunk_rest.call(null,s__42734__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42736),null);
}
} else {
var vec__42741 = cljs.core.first.call(null,s__42734__$2);
var label = cljs.core.nth.call(null,vec__42741,(0),null);
var k = cljs.core.nth.call(null,vec__42741,(1),null);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (vec__42741,label,k,s__42734__$2,temp__5720__auto__,checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (G__42744){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__42744);
});})(vec__42741,label,k,s__42734__$2,temp__5720__auto__,checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,override),hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),k], null),label)),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.weather_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null)))),weathergen$ui$weather_override_parameters_$_iter__42733.call(null,cljs.core.rest.call(null,s__42734__$2)));
}
} else {
return null;
}
break;
}
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
,null,null));
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
;
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Begin",new cljs.core.Keyword(null,"begin","begin",-319034319)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Peak",new cljs.core.Keyword(null,"peak","peak",389096055)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Taper",new cljs.core.Keyword(null,"taper","taper",1772067478)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["End",new cljs.core.Keyword(null,"end","end",-268185958)], null)], null));
})(),checkbox.call(null,"Exclude from forecast?",new cljs.core.Keyword(null,"exclude-from-forecast?","exclude-from-forecast?",1182671640),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"row-attrs","row-attrs",2139633863),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (G__42745){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__42745);
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,override)], null)], null)),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null),cljs.core.not);
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
,new cljs.core.Keyword(null,"title","title",636505583),"Edit",new cljs.core.Keyword(null,"src","src",-1651076051),"images/move.svg",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"height","height",1025178622),"16px",new cljs.core.Keyword(null,"latched?","latched?",2124907793),javelin.core.formula.call(null,((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (G__42746){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(G__42746);
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
).call(null,override)),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"float","float",-1732389368),"right"], null),new cljs.core.Keyword(null,"src","src",-1651076051),"images/trash.png",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"title","title",636505583),"Remove",new cljs.core.Keyword(null,"click","click",1912301393),((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),((function (checkbox,vec__42711,override,index,indexed_weather_overrides){
return (function (overrides){
return weathergen.ui.remove_nth.call(null,overrides,cljs.core.deref.call(null,index));
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
);
});})(checkbox,vec__42711,override,index,indexed_weather_overrides))
));
});})(indexed_weather_overrides))
));
})(),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,(function (wp){
return cljs.core.update.call(null,wp,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),(function (overrides){
return cljs.core.conj.call(null,overrides,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"wind-dir","wind-dir",-432221184),new cljs.core.Keyword(null,"editing?","editing?",1646440800),new cljs.core.Keyword(null,"wind-alts","wind-alts",1257047776),new cljs.core.Keyword(null,"cloud-cover","cloud-cover",1830614752),new cljs.core.Keyword(null,"cloud-base","cloud-base",826793857),new cljs.core.Keyword(null,"cloud-size","cloud-size",-1568256381),new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348),new cljs.core.Keyword(null,"wind-speed","wind-speed",-815617496),new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"radius","radius",-2073122258),new cljs.core.Keyword(null,"falloff","falloff",-1639069456),new cljs.core.Keyword(null,"begin","begin",-319034319),new cljs.core.Keyword(null,"strength","strength",-415606478),new cljs.core.Keyword(null,"towering?","towering?",2005070836),new cljs.core.Keyword(null,"taper","taper",1772067478),new cljs.core.Keyword(null,"peak","peak",389096055),new cljs.core.Keyword(null,"exclude-from-forecast?","exclude-from-forecast?",1182671640),new cljs.core.Keyword(null,"end","end",-268185958),new cljs.core.Keyword(null,"location","location",1815599388),new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.Keyword(null,"temperature","temperature",899018429)],[null,true,weathergen.model.wind_alts,null,null,null,true,null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),(8),(2),new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(1),null,weathergen.time.add_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(180)),weathergen.time.add_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(60)),false,weathergen.time.add_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(240)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(30),new cljs.core.Keyword(null,"y","y",-1757859776),(30)], null),null,null]));
}));
}));
}),"Add New"));
});
weathergen.ui.weather_type_configuration = (function weathergen$ui$weather_type_configuration(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-type-config","weather-type-config",-2069342501),new cljs.core.Keyword(null,"category","category",-593092832)], null),"Weather type configuration"),new cljs.core.Keyword(null,"id","id",-1388402092),"weather-type-configuration-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__42749,G__42750){
return G__42749.call(null,G__42750,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),hoplon.core.table.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"category-params",hoplon.core.thead.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null),hoplon.core.td.call(null,"<- Less More ->"))),hoplon.core.tbody.call(null,(function (){var iter__4523__auto__ = (function weathergen$ui$weather_type_configuration_$_iter__42751(s__42752){
return (new cljs.core.LazySeq(null,(function (){
var s__42752__$1 = s__42752;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42752__$1);
if(temp__5720__auto__){
var s__42752__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42752__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42752__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42754 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42753 = (0);
while(true){
if((i__42753 < size__4522__auto__)){
var category = cljs.core._nth.call(null,c__4521__auto__,i__42753);
cljs.core.chunk_append.call(null,b__42754,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),["weather-type ",cljs.core.name.call(null,category)].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, ["background-color",(function (){var vec__42755 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__42755,(0),null);
var g = cljs.core.nth.call(null,vec__42755,(1),null);
var b = cljs.core.nth.call(null,vec__42755,(2),null);
return ["rgb(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),")"].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var value = weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"weight","weight",-1262796205)], null));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,weathergen.ui.common.slider.call(null,new cljs.core.Keyword(null,"int?","int?",159198118),true,new cljs.core.Keyword(null,"min","min",444991522),(1),new cljs.core.Keyword(null,"max","max",61366548),(100),new cljs.core.Keyword(null,"ticks","ticks",-406190313),(3),new cljs.core.Keyword(null,"value","value",305978217),value,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(120),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null))),hoplon.core.td.call(null,weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(38),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block"], null),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(1),(100)),new cljs.core.Keyword(null,"source","source",-433931539),value))], null);
})()));

var G__42761 = (i__42753 + (1));
i__42753 = G__42761;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42754),weathergen$ui$weather_type_configuration_$_iter__42751.call(null,cljs.core.chunk_rest.call(null,s__42752__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42754),null);
}
} else {
var category = cljs.core.first.call(null,s__42752__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),["weather-type ",cljs.core.name.call(null,category)].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, ["background-color",(function (){var vec__42758 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__42758,(0),null);
var g = cljs.core.nth.call(null,vec__42758,(1),null);
var b = cljs.core.nth.call(null,vec__42758,(2),null);
return ["rgb(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),")"].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var value = weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"weight","weight",-1262796205)], null));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,weathergen.ui.common.slider.call(null,new cljs.core.Keyword(null,"int?","int?",159198118),true,new cljs.core.Keyword(null,"min","min",444991522),(1),new cljs.core.Keyword(null,"max","max",61366548),(100),new cljs.core.Keyword(null,"ticks","ticks",-406190313),(3),new cljs.core.Keyword(null,"value","value",305978217),value,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),(120),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null))),hoplon.core.td.call(null,weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(38),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block"], null),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(1),(100)),new cljs.core.Keyword(null,"source","source",-433931539),value))], null);
})()),weathergen$ui$weather_type_configuration_$_iter__42751.call(null,cljs.core.rest.call(null,s__42752__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
})())));
});
if((typeof weathergen !== 'undefined') && (typeof weathergen.ui !== 'undefined') && (typeof weathergen.ui.cloud_param_conformer !== 'undefined')){
} else {
weathergen.ui.cloud_param_conformer = (function (){var method_table__4613__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4614__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4615__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4616__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4617__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"weathergen.ui","cloud-param-conformer"),((function (method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__){
return (function (params,column,category){
return column;
});})(method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__4617__auto__,method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__));
})();
}
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"default","default",-1987822328),(function (params,column,category){
return weathergen.ui.common.int_conformer.call(null,(0),(99999));
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"visibility","visibility",1338380893),(function (params,column,category){
return weathergen.ui.common.float_conformer.call(null,(0),(60));
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),(function (params,column,category){
return (function (val_c){
var conformer = weathergen.ui.common.int_conformer.call(null,(0),(99999));
var conformed = conformer.call(null,val_c);
return javelin.core.formula.call(null,((function (conformer,conformed){
return (function (params__$1,conformed__$1){
var stratus_top = new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(params__$1);
if(cljs.core.not.call(null,new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return conformed__$1;
} else {
if(cljs.core.truth_((function (){var and__4120__auto__ = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null).call(null,category);
if(cljs.core.truth_(and__4120__auto__)){
return (stratus_top < new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1));
} else {
return and__4120__auto__;
}
})())){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),false,new cljs.core.Keyword(null,"message","message",-406056002),"Stratus base must be below stratus top.",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1)], null);
} else {
return conformed__$1;

}
}
});})(conformer,conformed))
).call(null,params,conformed);
});
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),(function (params,column,category){
return (function (val_c){
var ic = weathergen.ui.common.int_conformer.call(null,(0),(99999));
var conformed = ic.call(null,val_c);
return javelin.core.formula.call(null,((function (ic,conformed){
return (function (params__$1,conformed__$1){
var stratus_base = (function (){var x__4219__auto__ = cljs.core.get_in.call(null,params__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"poor","poor",1462482211)], null));
var y__4220__auto__ = cljs.core.get_in.call(null,params__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})();
if(cljs.core.not.call(null,new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return conformed__$1;
} else {
if(cljs.core.truth_((function (){var and__4120__auto__ = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null).call(null,category);
if(cljs.core.truth_(and__4120__auto__)){
return (new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1) < stratus_base);
} else {
return and__4120__auto__;
}
})())){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),false,new cljs.core.Keyword(null,"message","message",-406056002),"Stratus base must be below stratus top.",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1)], null);
} else {
return conformed__$1;

}
}
});})(ic,conformed))
).call(null,params,conformed);
});
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),(function (params,column,category){
return (function (val_c){
var ic = weathergen.ui.common.int_conformer.call(null,(0),(99999));
var conformed = ic.call(null,val_c);
return javelin.core.formula.call(null,((function (ic,conformed){
return (function (params__$1,conformed__$1){
var stratus_top = (cljs.core.truth_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category))?cljs.core.get_in.call(null,params__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null)):new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(params__$1));
if(cljs.core.not.call(null,new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return conformed__$1;
} else {
if(((stratus_top - (1000)) < new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),false,new cljs.core.Keyword(null,"message","message",-406056002),"Cumulus base must be at least 1000 feet below stratus top.",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1)], null);
} else {
return conformed__$1;

}
}
});})(ic,conformed))
).call(null,params,conformed);
});
}));
weathergen.ui.atmosphere_controls = (function weathergen$ui$atmosphere_controls(opts){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Atmosphere"),new cljs.core.Keyword(null,"id","id",-1388402092),cljs.core.gensym.call(null),new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__42770,G__42771){
return G__42770.call(null,G__42771,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),hoplon.core.div.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__42772,G__42773){
return G__42772.call(null,G__42773,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"buttons","buttons",-1953831197)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (_){
return javelin.core.dosync_STAR_.call(null,(function (){
var rand_atm_42908 = weathergen.ui.random_atmosphere_params.call(null);
var new_weather_42909 = weathergen.util.deep_merge_with.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params),((function (rand_atm_42908){
return (function (a,b){
return b;
});})(rand_atm_42908))
,rand_atm_42908);
cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,((function (rand_atm_42908,new_weather_42909){
return (function (p1__42762_SHARP_){
return weathergen.util.deep_merge_with.call(null,((function (rand_atm_42908,new_weather_42909){
return (function (a,b){
return b;
});})(rand_atm_42908,new_weather_42909))
,p1__42762_SHARP_,rand_atm_42908);
});})(rand_atm_42908,new_weather_42909))
);

return cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,weathergen.ui.random_cloud_params.call(null));
}));
}),"Randomize Clouds & Vis"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,(function (p1__42763_SHARP_){
return weathergen.util.deep_merge_with.call(null,(function (a,b){
return b;
}),p1__42763_SHARP_,weathergen.ui.random_wind_params.call(null));
}));
}),"Randomize Wind"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,(function (p1__42764_SHARP_){
return weathergen.util.deep_merge_with.call(null,(function (a,b){
return b;
}),p1__42764_SHARP_,weathergen.ui.random_temp_params.call(null));
}));
}),"Randomize Temperature"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return javelin.core.dosync_STAR_.call(null,(function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.weather_params,weathergen.ui.default_weather_params);

return cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,weathergen.ui.default_cloud_params);
}));
}),"Reset to Defaults"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return weathergen.ui.save_twx.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)));
}),"Save .TWX")),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"high","high",2027297808),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"High Clouds"),(function (){var category_style = (function (category){
var vec__42774 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__42774,(0),null);
var g = cljs.core.nth.call(null,vec__42774,(1),null);
var b = cljs.core.nth.call(null,vec__42774,(2),null);
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),["rgb(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),")"].join('')], null);
});
return hoplon.core.table.call(null,hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.span.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-type sunny",new cljs.core.Keyword(null,"css","css",1135045163),category_style.call(null,new cljs.core.Keyword(null,"sunny","sunny",1448267778)),"Sunny"),"/",hoplon.core.span.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-type fair",new cljs.core.Keyword(null,"css","css",1135045163),category_style.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423)),"Fair")], null)),hoplon.core.td.call(null,weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-z-fair","stratus-z-fair",2031975528)], null)),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(0),(60000)),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"altitude (ft)",new cljs.core.Keyword(null,"width","width",-384071477),(55)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.span.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-type poor",new cljs.core.Keyword(null,"css","css",1135045163),category_style.call(null,new cljs.core.Keyword(null,"poor","poor",1462482211)),"Poor"),"/",hoplon.core.span.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-type inclement",new cljs.core.Keyword(null,"css","css",1135045163),category_style.call(null,new cljs.core.Keyword(null,"inclement","inclement",-550669382)),"Inclement")], null)),hoplon.core.td.call(null,weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-z-inclement","stratus-z-inclement",1983411333)], null)),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(0),(60000)),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"altitude (ft)",new cljs.core.Keyword(null,"width","width",-384071477),(55))))));
})()),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"low","low",-1601362409),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Low Clouds"),hoplon.core.table.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"border-collapse","border-collapse",919100239),"collapse"], null),hoplon.core.thead.call(null,(function (){var border_style = (function (borders){
if(cljs.core.truth_(borders)){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),cljs.core.apply.call(null,weathergen.ui.common.px,borders),new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black"], null);
} else {
return null;
}
});
var header = ((function (border_style){
return (function() { 
var G__42910__delegate = function (colspan,path,words,p__42777){
var vec__42778 = p__42777;
var background = cljs.core.nth.call(null,vec__42778,(0),null);
var borders = cljs.core.nth.call(null,vec__42778,(1),null);
return hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),colspan,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background","background",-863952629),background], null),border_style.call(null,borders)),cljs.core.map.call(null,((function (vec__42778,background,borders,border_style){
return (function (p1__42765_SHARP_){
return hoplon.core.div.call(null,weathergen.help.with_help.call(null,path,p1__42765_SHARP_));
});})(vec__42778,background,borders,border_style))
,words));
};
var G__42910 = function (colspan,path,words,var_args){
var p__42777 = null;
if (arguments.length > 3) {
var G__42911__i = 0, G__42911__a = new Array(arguments.length -  3);
while (G__42911__i < G__42911__a.length) {G__42911__a[G__42911__i] = arguments[G__42911__i + 3]; ++G__42911__i;}
  p__42777 = new cljs.core.IndexedSeq(G__42911__a,0,null);
} 
return G__42910__delegate.call(this,colspan,path,words,p__42777);};
G__42910.cljs$lang$maxFixedArity = 3;
G__42910.cljs$lang$applyTo = (function (arglist__42912){
var colspan = cljs.core.first(arglist__42912);
arglist__42912 = cljs.core.next(arglist__42912);
var path = cljs.core.first(arglist__42912);
arglist__42912 = cljs.core.next(arglist__42912);
var words = cljs.core.first(arglist__42912);
var p__42777 = cljs.core.rest(arglist__42912);
return G__42910__delegate(colspan,path,words,p__42777);
});
G__42910.cljs$core$IFn$_invoke$arity$variadic = G__42910__delegate;
return G__42910;
})()
;})(border_style))
;
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.tr.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.td.call(null),header.call(null,(2),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"low","low",-1601362409),new cljs.core.Keyword(null,"base","base",185279322)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Base"], null),"#f2f2f2",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null)),header.call(null,(2),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"low","low",-1601362409),new cljs.core.Keyword(null,"size","size",1098693007)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Size"], null),"lightgray",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null)),header.call(null,(2),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"low","low",-1601362409),new cljs.core.Keyword(null,"coverage","coverage",1606292651)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Coverage"], null),"#f2f2f2",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null)),header.call(null,(1),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"low","low",-1601362409),new cljs.core.Keyword(null,"towering","towering",-44547353)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Towering?"], null),"lightgray",new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1),(1),(0),(1)], null))),hoplon.core.tr.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.td.call(null),(function (){var cell = ((function (border_style,header){
return (function (type,subtype){
var G__42781 = type;
var G__42781__$1 = (((G__42781 instanceof cljs.core.Keyword))?G__42781.fqn:null);
switch (G__42781__$1) {
case "from":
return hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"background","background",-863952629),"lightgray",new cljs.core.Keyword(null,"border-width","border-width",-1512605390),weathergen.ui.common.px.call(null,(1)),new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black"], null),((cljs.core._EQ_.call(null,subtype,new cljs.core.Keyword(null,"coverage","coverage",1606292651)))?new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null):null)),"From");

break;
case "to":
return hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"background","background",-863952629),"#bdbdbd",new cljs.core.Keyword(null,"border-width","border-width",-1512605390),weathergen.ui.common.px.call(null,(1)),new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black"], null),((cljs.core._EQ_.call(null,subtype,new cljs.core.Keyword(null,"coverage","coverage",1606292651)))?new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null):null)),"To");

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42781__$1)].join('')));

}
});})(border_style,header))
;
return new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [cell.call(null,new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"base","base",185279322)),cell.call(null,new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"base","base",185279322)),cell.call(null,new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"size","size",1098693007)),cell.call(null,new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"size","size",1098693007)),cell.call(null,new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"coverage","coverage",1606292651)),cell.call(null,new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"coverage","coverage",1606292651))], null);
})(),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"background","background",-863952629),"lightgray",new cljs.core.Keyword(null,"border-width","border-width",-1512605390),weathergen.ui.common.px.call(null,(0),(1),(1),(1)),new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid"], null)))], null);
})()),hoplon.core.tbody.call(null,(function (){var iter__4523__auto__ = (function weathergen$ui$atmosphere_controls_$_iter__42782(s__42783){
return (new cljs.core.LazySeq(null,(function (){
var s__42783__$1 = s__42783;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42783__$1);
if(temp__5720__auto__){
var s__42783__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42783__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42783__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42785 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42784 = (0);
while(true){
if((i__42784 < size__4522__auto__)){
var category = cljs.core._nth.call(null,c__4521__auto__,i__42784);
cljs.core.chunk_append.call(null,b__42785,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),["weather-type ",cljs.core.name.call(null,category)].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__42786 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__42786,(0),null);
var g = cljs.core.nth.call(null,vec__42786,(1),null);
var b = cljs.core.nth.call(null,vec__42786,(2),null);
return ["rgb(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),")"].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__4523__auto__ = ((function (i__42784,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__){
return (function weathergen$ui$atmosphere_controls_$_iter__42782_$_iter__42789(s__42790){
return (new cljs.core.LazySeq(null,((function (i__42784,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__){
return (function (){
var s__42790__$1 = s__42790;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__42790__$1);
if(temp__5720__auto____$1){
var s__42790__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42790__$2)){
var c__4521__auto____$1 = cljs.core.chunk_first.call(null,s__42790__$2);
var size__4522__auto____$1 = cljs.core.count.call(null,c__4521__auto____$1);
var b__42792 = cljs.core.chunk_buffer.call(null,size__4522__auto____$1);
if((function (){var i__42791 = (0);
while(true){
if((i__42791 < size__4522__auto____$1)){
var vec__42793 = cljs.core._nth.call(null,c__4521__auto____$1,i__42791);
var a = cljs.core.nth.call(null,vec__42793,(0),null);
var b = cljs.core.nth.call(null,vec__42793,(1),null);
var c = cljs.core.nth.call(null,vec__42793,(2),null);
var path = vec__42793;
cljs.core.chunk_append.call(null,b__42792,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?(function (){var order = new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"few","few",941665998),(1),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),(5),new cljs.core.Keyword(null,"broken","broken",-1742446874),(9),new cljs.core.Keyword(null,"overcast","overcast",-2096313755),(13)], null);
var v = weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path));
hoplon.core.do_watch.call(null,v,((function (i__42791,i__42784,order,v,vec__42793,a,b,c,path,c__4521__auto____$1,size__4522__auto____$1,b__42792,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__){
return (function (_,new_val){
var other_path = cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),cljs.core.butlast.call(null,path),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"from","from",1815293044)], null),c)], null));
var comparison = ((cljs.core._EQ_.call(null,c,new cljs.core.Keyword(null,"to","to",192099007)))?cljs.core._LT_:cljs.core._GT_);
if(cljs.core.truth_(comparison.call(null,order.call(null,new_val),order.call(null,cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params),other_path))))){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in,other_path,new_val);
} else {
return null;
}
});})(i__42791,i__42784,order,v,vec__42793,a,b,c,path,c__4521__auto____$1,size__4522__auto____$1,b__42792,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__))
);

return weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"choices","choices",1385611597),(function (){var G__42796 = category;
var G__42796__$1 = (((G__42796 instanceof cljs.core.Keyword))?G__42796.fqn:null);
switch (G__42796__$1) {
case "fair":
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"few","few",941665998),new cljs.core.Keyword(null,"label","label",1718410804),"FEW"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"label","label",1718410804),"SCT"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"broken","broken",-1742446874),new cljs.core.Keyword(null,"label","label",1718410804),"BKN"], null)], null);

break;
case "poor":
case "inclement":
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"label","label",1718410804),"SCT"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"broken","broken",-1742446874),new cljs.core.Keyword(null,"label","label",1718410804),"BKN"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"overcast","overcast",-2096313755),new cljs.core.Keyword(null,"label","label",1718410804),"OVC"], null)], null);

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42796__$1)].join('')));

}
})());
})():((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"towering","towering",-44547353),b))?weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"choices","choices",1385611597),cljs.core.mapv.call(null,((function (i__42791,i__42784,vec__42793,a,b,c,path,c__4521__auto____$1,size__4522__auto____$1,b__42792,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__){
return (function (p__42797){
var vec__42798 = p__42797;
var k = cljs.core.nth.call(null,vec__42798,(0),null);
var l = cljs.core.nth.call(null,vec__42798,(1),null);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),cljs.core.get_in.call(null,weathergen.ui.towering_thresholds,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [category,k], null)),new cljs.core.Keyword(null,"label","label",1718410804),l], null);
});})(i__42791,i__42784,vec__42793,a,b,c,path,c__4521__auto____$1,size__4522__auto____$1,b__42792,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__))
,weathergen.ui.towering_threshold_names)):weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"size","size",1098693007)))?((function (i__42791,i__42784,vec__42793,a,b,c,path,c__4521__auto____$1,size__4522__auto____$1,b__42792,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__){
return (function (p1__42766_SHARP_){
return p1__42766_SHARP_.toFixed((2));
});})(i__42791,i__42784,vec__42793,a,b,c,path,c__4521__auto____$1,size__4522__auto____$1,b__42792,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__))
:cljs.core.str
)),new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.float_conformer.call(null,(0),(60)):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"size","size",1098693007),b))?weathergen.ui.common.float_conformer.call(null,(0),5.0):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?weathergen.ui.common.int_conformer.call(null,(function (){var G__42801 = category;
var G__42801__$1 = (((G__42801 instanceof cljs.core.Keyword))?G__42801.fqn:null);
switch (G__42801__$1) {
case "fair":
return (0);

break;
case "poor":
return (5);

break;
case "inclement":
return (5);

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42801__$1)].join('')));

}
})(),(9)):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"base","base",185279322),b))?weathergen.ui.common.int_conformer.call(null,(0),(10000)):weathergen.ui.common.int_conformer.call(null,(0),(60000))
)))),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?"0.1-60":((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"coverage","coverage",1606292651)))?"0-9":((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"size","size",1098693007)))?"0-5":"altitude (ft)"
))),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"size","size",1098693007),b))?(55):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?(45):(55)
)))
)))));

var G__42916 = (i__42791 + (1));
i__42791 = G__42916;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42792),weathergen$ui$atmosphere_controls_$_iter__42782_$_iter__42789.call(null,cljs.core.chunk_rest.call(null,s__42790__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42792),null);
}
} else {
var vec__42802 = cljs.core.first.call(null,s__42790__$2);
var a = cljs.core.nth.call(null,vec__42802,(0),null);
var b = cljs.core.nth.call(null,vec__42802,(1),null);
var c = cljs.core.nth.call(null,vec__42802,(2),null);
var path = vec__42802;
return cljs.core.cons.call(null,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?(function (){var order = new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"few","few",941665998),(1),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),(5),new cljs.core.Keyword(null,"broken","broken",-1742446874),(9),new cljs.core.Keyword(null,"overcast","overcast",-2096313755),(13)], null);
var v = weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path));
hoplon.core.do_watch.call(null,v,((function (i__42784,order,v,vec__42802,a,b,c,path,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__){
return (function (_,new_val){
var other_path = cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),cljs.core.butlast.call(null,path),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"from","from",1815293044)], null),c)], null));
var comparison = ((cljs.core._EQ_.call(null,c,new cljs.core.Keyword(null,"to","to",192099007)))?cljs.core._LT_:cljs.core._GT_);
if(cljs.core.truth_(comparison.call(null,order.call(null,new_val),order.call(null,cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params),other_path))))){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in,other_path,new_val);
} else {
return null;
}
});})(i__42784,order,v,vec__42802,a,b,c,path,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__))
);

return weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"choices","choices",1385611597),(function (){var G__42805 = category;
var G__42805__$1 = (((G__42805 instanceof cljs.core.Keyword))?G__42805.fqn:null);
switch (G__42805__$1) {
case "fair":
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"few","few",941665998),new cljs.core.Keyword(null,"label","label",1718410804),"FEW"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"label","label",1718410804),"SCT"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"broken","broken",-1742446874),new cljs.core.Keyword(null,"label","label",1718410804),"BKN"], null)], null);

break;
case "poor":
case "inclement":
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"label","label",1718410804),"SCT"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"broken","broken",-1742446874),new cljs.core.Keyword(null,"label","label",1718410804),"BKN"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"overcast","overcast",-2096313755),new cljs.core.Keyword(null,"label","label",1718410804),"OVC"], null)], null);

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42805__$1)].join('')));

}
})());
})():((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"towering","towering",-44547353),b))?weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"choices","choices",1385611597),cljs.core.mapv.call(null,((function (i__42784,vec__42802,a,b,c,path,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__){
return (function (p__42806){
var vec__42807 = p__42806;
var k = cljs.core.nth.call(null,vec__42807,(0),null);
var l = cljs.core.nth.call(null,vec__42807,(1),null);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),cljs.core.get_in.call(null,weathergen.ui.towering_thresholds,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [category,k], null)),new cljs.core.Keyword(null,"label","label",1718410804),l], null);
});})(i__42784,vec__42802,a,b,c,path,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__))
,weathergen.ui.towering_threshold_names)):weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"size","size",1098693007)))?((function (i__42784,vec__42802,a,b,c,path,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__){
return (function (p1__42766_SHARP_){
return p1__42766_SHARP_.toFixed((2));
});})(i__42784,vec__42802,a,b,c,path,s__42790__$2,temp__5720__auto____$1,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__))
:cljs.core.str
)),new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.float_conformer.call(null,(0),(60)):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"size","size",1098693007),b))?weathergen.ui.common.float_conformer.call(null,(0),5.0):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?weathergen.ui.common.int_conformer.call(null,(function (){var G__42810 = category;
var G__42810__$1 = (((G__42810 instanceof cljs.core.Keyword))?G__42810.fqn:null);
switch (G__42810__$1) {
case "fair":
return (0);

break;
case "poor":
return (5);

break;
case "inclement":
return (5);

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42810__$1)].join('')));

}
})(),(9)):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"base","base",185279322),b))?weathergen.ui.common.int_conformer.call(null,(0),(10000)):weathergen.ui.common.int_conformer.call(null,(0),(60000))
)))),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?"0.1-60":((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"coverage","coverage",1606292651)))?"0-9":((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"size","size",1098693007)))?"0-5":"altitude (ft)"
))),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"size","size",1098693007),b))?(55):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?(45):(55)
)))
)))),weathergen$ui$atmosphere_controls_$_iter__42782_$_iter__42789.call(null,cljs.core.rest.call(null,s__42790__$2)));
}
} else {
return null;
}
break;
}
});})(i__42784,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__))
,null,null));
});})(i__42784,category,c__4521__auto__,size__4522__auto__,b__42785,s__42783__$2,temp__5720__auto__))
;
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.Keyword(null,"from","from",1815293044)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.Keyword(null,"to","to",192099007)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.Keyword(null,"from","from",1815293044)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.Keyword(null,"to","to",192099007)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.Keyword(null,"from","from",1815293044)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.Keyword(null,"to","to",192099007)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"towering","towering",-44547353)], null)], null));
})()));

var G__42919 = (i__42784 + (1));
i__42784 = G__42919;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42785),weathergen$ui$atmosphere_controls_$_iter__42782.call(null,cljs.core.chunk_rest.call(null,s__42783__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42785),null);
}
} else {
var category = cljs.core.first.call(null,s__42783__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),["weather-type ",cljs.core.name.call(null,category)].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__42811 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__42811,(0),null);
var g = cljs.core.nth.call(null,vec__42811,(1),null);
var b = cljs.core.nth.call(null,vec__42811,(2),null);
return ["rgb(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),")"].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__4523__auto__ = ((function (category,s__42783__$2,temp__5720__auto__){
return (function weathergen$ui$atmosphere_controls_$_iter__42782_$_iter__42814(s__42815){
return (new cljs.core.LazySeq(null,((function (category,s__42783__$2,temp__5720__auto__){
return (function (){
var s__42815__$1 = s__42815;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__42815__$1);
if(temp__5720__auto____$1){
var s__42815__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42815__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42815__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42817 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42816 = (0);
while(true){
if((i__42816 < size__4522__auto__)){
var vec__42818 = cljs.core._nth.call(null,c__4521__auto__,i__42816);
var a = cljs.core.nth.call(null,vec__42818,(0),null);
var b = cljs.core.nth.call(null,vec__42818,(1),null);
var c = cljs.core.nth.call(null,vec__42818,(2),null);
var path = vec__42818;
cljs.core.chunk_append.call(null,b__42817,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?(function (){var order = new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"few","few",941665998),(1),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),(5),new cljs.core.Keyword(null,"broken","broken",-1742446874),(9),new cljs.core.Keyword(null,"overcast","overcast",-2096313755),(13)], null);
var v = weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path));
hoplon.core.do_watch.call(null,v,((function (i__42816,order,v,vec__42818,a,b,c,path,c__4521__auto__,size__4522__auto__,b__42817,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__){
return (function (_,new_val){
var other_path = cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),cljs.core.butlast.call(null,path),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"from","from",1815293044)], null),c)], null));
var comparison = ((cljs.core._EQ_.call(null,c,new cljs.core.Keyword(null,"to","to",192099007)))?cljs.core._LT_:cljs.core._GT_);
if(cljs.core.truth_(comparison.call(null,order.call(null,new_val),order.call(null,cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params),other_path))))){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in,other_path,new_val);
} else {
return null;
}
});})(i__42816,order,v,vec__42818,a,b,c,path,c__4521__auto__,size__4522__auto__,b__42817,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__))
);

return weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"choices","choices",1385611597),(function (){var G__42821 = category;
var G__42821__$1 = (((G__42821 instanceof cljs.core.Keyword))?G__42821.fqn:null);
switch (G__42821__$1) {
case "fair":
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"few","few",941665998),new cljs.core.Keyword(null,"label","label",1718410804),"FEW"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"label","label",1718410804),"SCT"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"broken","broken",-1742446874),new cljs.core.Keyword(null,"label","label",1718410804),"BKN"], null)], null);

break;
case "poor":
case "inclement":
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"label","label",1718410804),"SCT"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"broken","broken",-1742446874),new cljs.core.Keyword(null,"label","label",1718410804),"BKN"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"overcast","overcast",-2096313755),new cljs.core.Keyword(null,"label","label",1718410804),"OVC"], null)], null);

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42821__$1)].join('')));

}
})());
})():((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"towering","towering",-44547353),b))?weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"choices","choices",1385611597),cljs.core.mapv.call(null,((function (i__42816,vec__42818,a,b,c,path,c__4521__auto__,size__4522__auto__,b__42817,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__){
return (function (p__42822){
var vec__42823 = p__42822;
var k = cljs.core.nth.call(null,vec__42823,(0),null);
var l = cljs.core.nth.call(null,vec__42823,(1),null);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),cljs.core.get_in.call(null,weathergen.ui.towering_thresholds,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [category,k], null)),new cljs.core.Keyword(null,"label","label",1718410804),l], null);
});})(i__42816,vec__42818,a,b,c,path,c__4521__auto__,size__4522__auto__,b__42817,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__))
,weathergen.ui.towering_threshold_names)):weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"size","size",1098693007)))?((function (i__42816,vec__42818,a,b,c,path,c__4521__auto__,size__4522__auto__,b__42817,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__){
return (function (p1__42766_SHARP_){
return p1__42766_SHARP_.toFixed((2));
});})(i__42816,vec__42818,a,b,c,path,c__4521__auto__,size__4522__auto__,b__42817,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__))
:cljs.core.str
)),new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.float_conformer.call(null,(0),(60)):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"size","size",1098693007),b))?weathergen.ui.common.float_conformer.call(null,(0),5.0):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?weathergen.ui.common.int_conformer.call(null,(function (){var G__42826 = category;
var G__42826__$1 = (((G__42826 instanceof cljs.core.Keyword))?G__42826.fqn:null);
switch (G__42826__$1) {
case "fair":
return (0);

break;
case "poor":
return (5);

break;
case "inclement":
return (5);

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42826__$1)].join('')));

}
})(),(9)):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"base","base",185279322),b))?weathergen.ui.common.int_conformer.call(null,(0),(10000)):weathergen.ui.common.int_conformer.call(null,(0),(60000))
)))),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?"0.1-60":((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"coverage","coverage",1606292651)))?"0-9":((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"size","size",1098693007)))?"0-5":"altitude (ft)"
))),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"size","size",1098693007),b))?(55):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?(45):(55)
)))
)))));

var G__42922 = (i__42816 + (1));
i__42816 = G__42922;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42817),weathergen$ui$atmosphere_controls_$_iter__42782_$_iter__42814.call(null,cljs.core.chunk_rest.call(null,s__42815__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42817),null);
}
} else {
var vec__42827 = cljs.core.first.call(null,s__42815__$2);
var a = cljs.core.nth.call(null,vec__42827,(0),null);
var b = cljs.core.nth.call(null,vec__42827,(1),null);
var c = cljs.core.nth.call(null,vec__42827,(2),null);
var path = vec__42827;
return cljs.core.cons.call(null,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?(function (){var order = new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"few","few",941665998),(1),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),(5),new cljs.core.Keyword(null,"broken","broken",-1742446874),(9),new cljs.core.Keyword(null,"overcast","overcast",-2096313755),(13)], null);
var v = weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path));
hoplon.core.do_watch.call(null,v,((function (order,v,vec__42827,a,b,c,path,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__){
return (function (_,new_val){
var other_path = cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),cljs.core.butlast.call(null,path),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.Keyword(null,"from","from",1815293044)], null),c)], null));
var comparison = ((cljs.core._EQ_.call(null,c,new cljs.core.Keyword(null,"to","to",192099007)))?cljs.core._LT_:cljs.core._GT_);
if(cljs.core.truth_(comparison.call(null,order.call(null,new_val),order.call(null,cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params),other_path))))){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in,other_path,new_val);
} else {
return null;
}
});})(order,v,vec__42827,a,b,c,path,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__))
);

return weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"choices","choices",1385611597),(function (){var G__42830 = category;
var G__42830__$1 = (((G__42830 instanceof cljs.core.Keyword))?G__42830.fqn:null);
switch (G__42830__$1) {
case "fair":
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"few","few",941665998),new cljs.core.Keyword(null,"label","label",1718410804),"FEW"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"label","label",1718410804),"SCT"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"broken","broken",-1742446874),new cljs.core.Keyword(null,"label","label",1718410804),"BKN"], null)], null);

break;
case "poor":
case "inclement":
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"scattered","scattered",-1263632526),new cljs.core.Keyword(null,"label","label",1718410804),"SCT"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"broken","broken",-1742446874),new cljs.core.Keyword(null,"label","label",1718410804),"BKN"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"overcast","overcast",-2096313755),new cljs.core.Keyword(null,"label","label",1718410804),"OVC"], null)], null);

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42830__$1)].join('')));

}
})());
})():((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"towering","towering",-44547353),b))?weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"choices","choices",1385611597),cljs.core.mapv.call(null,((function (vec__42827,a,b,c,path,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__){
return (function (p__42831){
var vec__42832 = p__42831;
var k = cljs.core.nth.call(null,vec__42832,(0),null);
var l = cljs.core.nth.call(null,vec__42832,(1),null);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),cljs.core.get_in.call(null,weathergen.ui.towering_thresholds,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [category,k], null)),new cljs.core.Keyword(null,"label","label",1718410804),l], null);
});})(vec__42827,a,b,c,path,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__))
,weathergen.ui.towering_threshold_names)):weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"size","size",1098693007)))?((function (vec__42827,a,b,c,path,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__){
return (function (p1__42766_SHARP_){
return p1__42766_SHARP_.toFixed((2));
});})(vec__42827,a,b,c,path,s__42815__$2,temp__5720__auto____$1,category,s__42783__$2,temp__5720__auto__))
:cljs.core.str
)),new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.float_conformer.call(null,(0),(60)):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"size","size",1098693007),b))?weathergen.ui.common.float_conformer.call(null,(0),5.0):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?weathergen.ui.common.int_conformer.call(null,(function (){var G__42835 = category;
var G__42835__$1 = (((G__42835 instanceof cljs.core.Keyword))?G__42835.fqn:null);
switch (G__42835__$1) {
case "fair":
return (0);

break;
case "poor":
return (5);

break;
case "inclement":
return (5);

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42835__$1)].join('')));

}
})(),(9)):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"base","base",185279322),b))?weathergen.ui.common.int_conformer.call(null,(0),(10000)):weathergen.ui.common.int_conformer.call(null,(0),(60000))
)))),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?"0.1-60":((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"coverage","coverage",1606292651)))?"0-9":((cljs.core._EQ_.call(null,b,new cljs.core.Keyword(null,"size","size",1098693007)))?"0-5":"altitude (ft)"
))),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"size","size",1098693007),b))?(55):((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"coverage","coverage",1606292651),b))?(45):(55)
)))
)))),weathergen$ui$atmosphere_controls_$_iter__42782_$_iter__42814.call(null,cljs.core.rest.call(null,s__42815__$2)));
}
} else {
return null;
}
break;
}
});})(category,s__42783__$2,temp__5720__auto__))
,null,null));
});})(category,s__42783__$2,temp__5720__auto__))
;
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.Keyword(null,"from","from",1815293044)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"base","base",185279322),new cljs.core.Keyword(null,"to","to",192099007)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.Keyword(null,"from","from",1815293044)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"size","size",1098693007),new cljs.core.Keyword(null,"to","to",192099007)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.Keyword(null,"from","from",1815293044)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"coverage","coverage",1606292651),new cljs.core.Keyword(null,"to","to",192099007)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"low-clouds","low-clouds",-702988471),new cljs.core.Keyword(null,"towering","towering",-44547353)], null)], null));
})()),weathergen$ui$atmosphere_controls_$_iter__42782.call(null,cljs.core.rest.call(null,s__42783__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
})()))),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility-and-contrails","visibility-and-contrails",-856658633),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Visibility and Contrails"),hoplon.core.table.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"border-collapse","border-collapse",919100239),"collapse"], null),hoplon.core.thead.call(null,(function (){var border_style = (function (borders){
if(cljs.core.truth_(borders)){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),cljs.core.apply.call(null,weathergen.ui.common.px,borders),new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black"], null);
} else {
return null;
}
});
var header = ((function (border_style){
return (function() { 
var G__42925__delegate = function (colspan,path,words,p__42836){
var vec__42837 = p__42836;
var background = cljs.core.nth.call(null,vec__42837,(0),null);
var borders = cljs.core.nth.call(null,vec__42837,(1),null);
return hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),colspan,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background","background",-863952629),background], null),border_style.call(null,borders)),cljs.core.map.call(null,((function (vec__42837,background,borders,border_style){
return (function (p1__42767_SHARP_){
return hoplon.core.div.call(null,weathergen.help.with_help.call(null,path,p1__42767_SHARP_));
});})(vec__42837,background,borders,border_style))
,words));
};
var G__42925 = function (colspan,path,words,var_args){
var p__42836 = null;
if (arguments.length > 3) {
var G__42926__i = 0, G__42926__a = new Array(arguments.length -  3);
while (G__42926__i < G__42926__a.length) {G__42926__a[G__42926__i] = arguments[G__42926__i + 3]; ++G__42926__i;}
  p__42836 = new cljs.core.IndexedSeq(G__42926__a,0,null);
} 
return G__42925__delegate.call(this,colspan,path,words,p__42836);};
G__42925.cljs$lang$maxFixedArity = 3;
G__42925.cljs$lang$applyTo = (function (arglist__42927){
var colspan = cljs.core.first(arglist__42927);
arglist__42927 = cljs.core.next(arglist__42927);
var path = cljs.core.first(arglist__42927);
arglist__42927 = cljs.core.next(arglist__42927);
var words = cljs.core.first(arglist__42927);
var p__42836 = cljs.core.rest(arglist__42927);
return G__42925__delegate(colspan,path,words,p__42836);
});
G__42925.cljs$core$IFn$_invoke$arity$variadic = G__42925__delegate;
return G__42925;
})()
;})(border_style))
;
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.tr.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.td.call(null),header.call(null,(2),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"visibility","visibility",1338380893)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Visibility"], null),null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1),(1),(0),(1)], null)),header.call(null,(1),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"contrails","contrails",1430581743)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Contrails"], null),null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1),(1),(0),(1)], null))),hoplon.core.tr.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.td.call(null),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background","background",-863952629),"lightgrey"], null),border_style.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null))),"From"),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background","background",-863952629),"#bdbdbd"], null),border_style.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null))),"To"),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),border_style.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(1),(1),(1)], null))))], null);
})()),hoplon.core.tbody.call(null,(function (){var iter__4523__auto__ = (function weathergen$ui$atmosphere_controls_$_iter__42840(s__42841){
return (new cljs.core.LazySeq(null,(function (){
var s__42841__$1 = s__42841;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42841__$1);
if(temp__5720__auto__){
var s__42841__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42841__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42841__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42843 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42842 = (0);
while(true){
if((i__42842 < size__4522__auto__)){
var category = cljs.core._nth.call(null,c__4521__auto__,i__42842);
cljs.core.chunk_append.call(null,b__42843,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),["weather-type ",cljs.core.name.call(null,category)].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__42844 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__42844,(0),null);
var g = cljs.core.nth.call(null,vec__42844,(1),null);
var b = cljs.core.nth.call(null,vec__42844,(2),null);
return ["rgb(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),")"].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__4523__auto__ = ((function (i__42842,category,c__4521__auto__,size__4522__auto__,b__42843,s__42841__$2,temp__5720__auto__){
return (function weathergen$ui$atmosphere_controls_$_iter__42840_$_iter__42847(s__42848){
return (new cljs.core.LazySeq(null,((function (i__42842,category,c__4521__auto__,size__4522__auto__,b__42843,s__42841__$2,temp__5720__auto__){
return (function (){
var s__42848__$1 = s__42848;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__42848__$1);
if(temp__5720__auto____$1){
var s__42848__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42848__$2)){
var c__4521__auto____$1 = cljs.core.chunk_first.call(null,s__42848__$2);
var size__4522__auto____$1 = cljs.core.count.call(null,c__4521__auto____$1);
var b__42850 = cljs.core.chunk_buffer.call(null,size__4522__auto____$1);
if((function (){var i__42849 = (0);
while(true){
if((i__42849 < size__4522__auto____$1)){
var vec__42851 = cljs.core._nth.call(null,c__4521__auto____$1,i__42849);
var a = cljs.core.nth.call(null,vec__42851,(0),null);
var b = cljs.core.nth.call(null,vec__42851,(1),null);
var c = cljs.core.nth.call(null,vec__42851,(2),null);
var path = vec__42851;
cljs.core.chunk_append.call(null,b__42850,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"contrails","contrails",1430581743)))?weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"contrails","contrails",1430581743),category], null)):weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path))
),new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str
),new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.float_conformer.call(null,(0),(60)):weathergen.ui.common.int_conformer.call(null,(0),(60000))
),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?"0.1-30":"altitude (ft)"
),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)
)))));

var G__42928 = (i__42849 + (1));
i__42849 = G__42928;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42850),weathergen$ui$atmosphere_controls_$_iter__42840_$_iter__42847.call(null,cljs.core.chunk_rest.call(null,s__42848__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42850),null);
}
} else {
var vec__42854 = cljs.core.first.call(null,s__42848__$2);
var a = cljs.core.nth.call(null,vec__42854,(0),null);
var b = cljs.core.nth.call(null,vec__42854,(1),null);
var c = cljs.core.nth.call(null,vec__42854,(2),null);
var path = vec__42854;
return cljs.core.cons.call(null,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"contrails","contrails",1430581743)))?weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"contrails","contrails",1430581743),category], null)):weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path))
),new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str
),new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.float_conformer.call(null,(0),(60)):weathergen.ui.common.int_conformer.call(null,(0),(60000))
),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?"0.1-30":"altitude (ft)"
),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)
)))),weathergen$ui$atmosphere_controls_$_iter__42840_$_iter__42847.call(null,cljs.core.rest.call(null,s__42848__$2)));
}
} else {
return null;
}
break;
}
});})(i__42842,category,c__4521__auto__,size__4522__auto__,b__42843,s__42841__$2,temp__5720__auto__))
,null,null));
});})(i__42842,category,c__4521__auto__,size__4522__auto__,b__42843,s__42841__$2,temp__5720__auto__))
;
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.Keyword(null,"from","from",1815293044)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.Keyword(null,"to","to",192099007)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"contrails","contrails",1430581743)], null)], null));
})()));

var G__42929 = (i__42842 + (1));
i__42842 = G__42929;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42843),weathergen$ui$atmosphere_controls_$_iter__42840.call(null,cljs.core.chunk_rest.call(null,s__42841__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42843),null);
}
} else {
var category = cljs.core.first.call(null,s__42841__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),["weather-type ",cljs.core.name.call(null,category)].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__42857 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__42857,(0),null);
var g = cljs.core.nth.call(null,vec__42857,(1),null);
var b = cljs.core.nth.call(null,vec__42857,(2),null);
return ["rgb(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),")"].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__4523__auto__ = ((function (category,s__42841__$2,temp__5720__auto__){
return (function weathergen$ui$atmosphere_controls_$_iter__42840_$_iter__42860(s__42861){
return (new cljs.core.LazySeq(null,((function (category,s__42841__$2,temp__5720__auto__){
return (function (){
var s__42861__$1 = s__42861;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__42861__$1);
if(temp__5720__auto____$1){
var s__42861__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42861__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42861__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42863 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42862 = (0);
while(true){
if((i__42862 < size__4522__auto__)){
var vec__42864 = cljs.core._nth.call(null,c__4521__auto__,i__42862);
var a = cljs.core.nth.call(null,vec__42864,(0),null);
var b = cljs.core.nth.call(null,vec__42864,(1),null);
var c = cljs.core.nth.call(null,vec__42864,(2),null);
var path = vec__42864;
cljs.core.chunk_append.call(null,b__42863,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"contrails","contrails",1430581743)))?weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"contrails","contrails",1430581743),category], null)):weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path))
),new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str
),new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.float_conformer.call(null,(0),(60)):weathergen.ui.common.int_conformer.call(null,(0),(60000))
),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?"0.1-30":"altitude (ft)"
),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)
)))));

var G__42930 = (i__42862 + (1));
i__42862 = G__42930;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42863),weathergen$ui$atmosphere_controls_$_iter__42840_$_iter__42860.call(null,cljs.core.chunk_rest.call(null,s__42861__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42863),null);
}
} else {
var vec__42867 = cljs.core.first.call(null,s__42861__$2);
var a = cljs.core.nth.call(null,vec__42867,(0),null);
var b = cljs.core.nth.call(null,vec__42867,(1),null);
var c = cljs.core.nth.call(null,vec__42867,(2),null);
var path = vec__42867;
return cljs.core.cons.call(null,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"contrails","contrails",1430581743)))?weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"contrails","contrails",1430581743),category], null)):weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path))
),new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str
),new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.float_conformer.call(null,(0),(60)):weathergen.ui.common.int_conformer.call(null,(0),(60000))
),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?"0.1-30":"altitude (ft)"
),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)
)))),weathergen$ui$atmosphere_controls_$_iter__42840_$_iter__42860.call(null,cljs.core.rest.call(null,s__42861__$2)));
}
} else {
return null;
}
break;
}
});})(category,s__42841__$2,temp__5720__auto__))
,null,null));
});})(category,s__42841__$2,temp__5720__auto__))
;
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.Keyword(null,"from","from",1815293044)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.Keyword(null,"to","to",192099007)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"contrails","contrails",1430581743)], null)], null));
})()),weathergen$ui$atmosphere_controls_$_iter__42840.call(null,cljs.core.rest.call(null,s__42841__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
})()))),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ground-wind-and-temp","ground-wind-and-temp",804263880),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Ground Wind and Temperature"),hoplon.core.table.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"border-collapse","border-collapse",919100239),"collapse"], null),hoplon.core.thead.call(null,(function (){var border_style = (function (borders){
if(cljs.core.truth_(borders)){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),cljs.core.apply.call(null,weathergen.ui.common.px,borders),new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black"], null);
} else {
return null;
}
});
var header = ((function (border_style){
return (function() { 
var G__42931__delegate = function (colspan,path,words,p__42870){
var vec__42871 = p__42870;
var background = cljs.core.nth.call(null,vec__42871,(0),null);
var borders = cljs.core.nth.call(null,vec__42871,(1),null);
return hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),colspan,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background","background",-863952629),background], null),border_style.call(null,borders)),cljs.core.map.call(null,((function (vec__42871,background,borders,border_style){
return (function (p1__42768_SHARP_){
return hoplon.core.div.call(null,weathergen.help.with_help.call(null,path,p1__42768_SHARP_));
});})(vec__42871,background,borders,border_style))
,words));
};
var G__42931 = function (colspan,path,words,var_args){
var p__42870 = null;
if (arguments.length > 3) {
var G__42932__i = 0, G__42932__a = new Array(arguments.length -  3);
while (G__42932__i < G__42932__a.length) {G__42932__a[G__42932__i] = arguments[G__42932__i + 3]; ++G__42932__i;}
  p__42870 = new cljs.core.IndexedSeq(G__42932__a,0,null);
} 
return G__42931__delegate.call(this,colspan,path,words,p__42870);};
G__42931.cljs$lang$maxFixedArity = 3;
G__42931.cljs$lang$applyTo = (function (arglist__42933){
var colspan = cljs.core.first(arglist__42933);
arglist__42933 = cljs.core.next(arglist__42933);
var path = cljs.core.first(arglist__42933);
arglist__42933 = cljs.core.next(arglist__42933);
var words = cljs.core.first(arglist__42933);
var p__42870 = cljs.core.rest(arglist__42933);
return G__42931__delegate(colspan,path,words,p__42870);
});
G__42931.cljs$core$IFn$_invoke$arity$variadic = G__42931__delegate;
return G__42931;
})()
;})(border_style))
;
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.tr.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.td.call(null),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(3),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"border","border",1444987323),"1px solid black"], null),"Wind"),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(3),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"border","border",1444987323),"1px solid black"], null),"Temperature")),hoplon.core.tr.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.td.call(null),header.call(null,(1),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Min"], null),"lightgray",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null)),header.call(null,(1),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Mean"], null),"#f2f2f2",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null)),header.call(null,(1),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Max"], null),"#bdbdbd",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null)),header.call(null,(1),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Min"], null),"lightgray",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null)),header.call(null,(1),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Mean"], null),"#f2f2f2",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null)),header.call(null,(1),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Max"], null),"#bdbdbd",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null)))], null);
})()),hoplon.core.tbody.call(null,(function (){var iter__4523__auto__ = (function weathergen$ui$atmosphere_controls_$_iter__42874(s__42875){
return (new cljs.core.LazySeq(null,(function (){
var s__42875__$1 = s__42875;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42875__$1);
if(temp__5720__auto__){
var s__42875__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42875__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42875__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42877 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42876 = (0);
while(true){
if((i__42876 < size__4522__auto__)){
var category = cljs.core._nth.call(null,c__4521__auto__,i__42876);
cljs.core.chunk_append.call(null,b__42877,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),["weather-type ",cljs.core.name.call(null,category)].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__42878 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__42878,(0),null);
var g = cljs.core.nth.call(null,vec__42878,(1),null);
var b = cljs.core.nth.call(null,vec__42878,(2),null);
return ["rgb(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),")"].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__4523__auto__ = ((function (i__42876,category,c__4521__auto__,size__4522__auto__,b__42877,s__42875__$2,temp__5720__auto__){
return (function weathergen$ui$atmosphere_controls_$_iter__42874_$_iter__42881(s__42882){
return (new cljs.core.LazySeq(null,((function (i__42876,category,c__4521__auto__,size__4522__auto__,b__42877,s__42875__$2,temp__5720__auto__){
return (function (){
var s__42882__$1 = s__42882;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__42882__$1);
if(temp__5720__auto____$1){
var s__42882__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42882__$2)){
var c__4521__auto____$1 = cljs.core.chunk_first.call(null,s__42882__$2);
var size__4522__auto____$1 = cljs.core.count.call(null,c__4521__auto____$1);
var b__42884 = cljs.core.chunk_buffer.call(null,size__4522__auto____$1);
if((function (){var i__42883 = (0);
while(true){
if((i__42883 < size__4522__auto____$1)){
var vec__42885 = cljs.core._nth.call(null,c__4521__auto____$1,i__42883);
var a = cljs.core.nth.call(null,vec__42885,(0),null);
var b = cljs.core.nth.call(null,vec__42885,(1),null);
var path = vec__42885;
cljs.core.chunk_append.call(null,b__42884,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"wind","wind",-527553074)))?weathergen.ui.common.int_conformer.call(null,(0),(100)):weathergen.ui.common.int_conformer.call(null,(-50),(50))),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45)))));

var G__42934 = (i__42883 + (1));
i__42883 = G__42934;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42884),weathergen$ui$atmosphere_controls_$_iter__42874_$_iter__42881.call(null,cljs.core.chunk_rest.call(null,s__42882__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42884),null);
}
} else {
var vec__42888 = cljs.core.first.call(null,s__42882__$2);
var a = cljs.core.nth.call(null,vec__42888,(0),null);
var b = cljs.core.nth.call(null,vec__42888,(1),null);
var path = vec__42888;
return cljs.core.cons.call(null,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"wind","wind",-527553074)))?weathergen.ui.common.int_conformer.call(null,(0),(100)):weathergen.ui.common.int_conformer.call(null,(-50),(50))),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45)))),weathergen$ui$atmosphere_controls_$_iter__42874_$_iter__42881.call(null,cljs.core.rest.call(null,s__42882__$2)));
}
} else {
return null;
}
break;
}
});})(i__42876,category,c__4521__auto__,size__4522__auto__,b__42877,s__42875__$2,temp__5720__auto__))
,null,null));
});})(i__42876,category,c__4521__auto__,size__4522__auto__,b__42877,s__42875__$2,temp__5720__auto__))
;
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"mean","mean",-1359234715)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"max","max",61366548)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.Keyword(null,"mean","mean",-1359234715)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.Keyword(null,"max","max",61366548)], null)], null));
})()));

var G__42935 = (i__42876 + (1));
i__42876 = G__42935;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42877),weathergen$ui$atmosphere_controls_$_iter__42874.call(null,cljs.core.chunk_rest.call(null,s__42875__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42877),null);
}
} else {
var category = cljs.core.first.call(null,s__42875__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),["weather-type ",cljs.core.name.call(null,category)].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__42891 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__42891,(0),null);
var g = cljs.core.nth.call(null,vec__42891,(1),null);
var b = cljs.core.nth.call(null,vec__42891,(2),null);
return ["rgb(",cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),")"].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__4523__auto__ = ((function (category,s__42875__$2,temp__5720__auto__){
return (function weathergen$ui$atmosphere_controls_$_iter__42874_$_iter__42894(s__42895){
return (new cljs.core.LazySeq(null,((function (category,s__42875__$2,temp__5720__auto__){
return (function (){
var s__42895__$1 = s__42895;
while(true){
var temp__5720__auto____$1 = cljs.core.seq.call(null,s__42895__$1);
if(temp__5720__auto____$1){
var s__42895__$2 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42895__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42895__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42897 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42896 = (0);
while(true){
if((i__42896 < size__4522__auto__)){
var vec__42898 = cljs.core._nth.call(null,c__4521__auto__,i__42896);
var a = cljs.core.nth.call(null,vec__42898,(0),null);
var b = cljs.core.nth.call(null,vec__42898,(1),null);
var path = vec__42898;
cljs.core.chunk_append.call(null,b__42897,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"wind","wind",-527553074)))?weathergen.ui.common.int_conformer.call(null,(0),(100)):weathergen.ui.common.int_conformer.call(null,(-50),(50))),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45)))));

var G__42936 = (i__42896 + (1));
i__42896 = G__42936;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42897),weathergen$ui$atmosphere_controls_$_iter__42874_$_iter__42894.call(null,cljs.core.chunk_rest.call(null,s__42895__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42897),null);
}
} else {
var vec__42901 = cljs.core.first.call(null,s__42895__$2);
var a = cljs.core.nth.call(null,vec__42901,(0),null);
var b = cljs.core.nth.call(null,vec__42901,(1),null);
var path = vec__42901;
return cljs.core.cons.call(null,hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category], null),path)),new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"conform","conform",1846236460),((cljs.core._EQ_.call(null,a,new cljs.core.Keyword(null,"wind","wind",-527553074)))?weathergen.ui.common.int_conformer.call(null,(0),(100)):weathergen.ui.common.int_conformer.call(null,(-50),(50))),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45)))),weathergen$ui$atmosphere_controls_$_iter__42874_$_iter__42894.call(null,cljs.core.rest.call(null,s__42895__$2)));
}
} else {
return null;
}
break;
}
});})(category,s__42875__$2,temp__5720__auto__))
,null,null));
});})(category,s__42875__$2,temp__5720__auto__))
;
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"mean","mean",-1359234715)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"max","max",61366548)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.Keyword(null,"mean","mean",-1359234715)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.Keyword(null,"max","max",61366548)], null)], null));
})()),weathergen$ui$atmosphere_controls_$_iter__42874.call(null,cljs.core.rest.call(null,s__42875__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
})()))),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Winds Aloft"),(function (){var alts = new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [(3000),(6000),(9000),(12000),(18000),(24000),(30000),(40000),(50000)], null);
return hoplon.core.table.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"border-collapse","border-collapse",919100239),"collapse"], null),hoplon.core.thead.call(null,hoplon.core.tr.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.td.call(null),hoplon.core.td.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,"colspan","colspan",-1512420934),(2),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),new cljs.core.Keyword(null,"speed","speed",1257663751)], null),"Speed adj")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-width","border-width",-1512605390),weathergen.ui.common.px.call(null,(1),(1),(0),(1))], null),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),new cljs.core.Keyword(null,"heading-bias","heading-bias",1073504173)], null),"Heading"))),hoplon.core.tr.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.td.call(null,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),"right",new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(55)),"Altitude")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"background","background",-863952629),"lightgrey",new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px black"], null),"From"),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"background","background",-863952629),"#bdbdbd",new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px black"], null),"To"),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-width","border-width",-1512605390),weathergen.ui.common.px.call(null,(0),(1),(1),(1))], null),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),new cljs.core.Keyword(null,"heading-bias","heading-bias",1073504173)], null),"Adj")))),hoplon.core.tbody.call(null,(function (){var iter__4523__auto__ = ((function (alts){
return (function weathergen$ui$atmosphere_controls_$_iter__42904(s__42905){
return (new cljs.core.LazySeq(null,((function (alts){
return (function (){
var s__42905__$1 = s__42905;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__42905__$1);
if(temp__5720__auto__){
var s__42905__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__42905__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__42905__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__42907 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__42906 = (0);
while(true){
if((i__42906 < size__4522__auto__)){
var alt = cljs.core._nth.call(null,c__4521__auto__,i__42906);
cljs.core.chunk_append.call(null,b__42907,hoplon.core.tr.call(null,hoplon.core.td.call(null,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),"right",new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(alt)," ft"].join(''))),hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),alt,new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.Keyword(null,"from","from",1815293044)], null)),new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(-100),(100)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45)))),hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),alt,new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.Keyword(null,"to","to",192099007)], null)),new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(-100),(100)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45)))),hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),alt,new cljs.core.Keyword(null,"bias","bias",-315297926)], null)),new cljs.core.Keyword(null,"fmt","fmt",332300772),((function (i__42906,alt,c__4521__auto__,size__4522__auto__,b__42907,s__42905__$2,temp__5720__auto__,alts){
return (function (p1__42769_SHARP_){
return p1__42769_SHARP_.toFixed((2));
});})(i__42906,alt,c__4521__auto__,size__4522__auto__,b__42907,s__42905__$2,temp__5720__auto__,alts))
,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.float_conformer.call(null,(0),(1)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(55))))));

var G__42937 = (i__42906 + (1));
i__42906 = G__42937;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42907),weathergen$ui$atmosphere_controls_$_iter__42904.call(null,cljs.core.chunk_rest.call(null,s__42905__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__42907),null);
}
} else {
var alt = cljs.core.first.call(null,s__42905__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,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),"right",new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(alt)," ft"].join(''))),hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),alt,new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.Keyword(null,"from","from",1815293044)], null)),new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(-100),(100)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45)))),hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),alt,new cljs.core.Keyword(null,"speed","speed",1257663751),new cljs.core.Keyword(null,"to","to",192099007)], null)),new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(-100),(100)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(45)))),hoplon.core.td.call(null,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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(2))], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"winds-aloft","winds-aloft",83956399),alt,new cljs.core.Keyword(null,"bias","bias",-315297926)], null)),new cljs.core.Keyword(null,"fmt","fmt",332300772),((function (alt,s__42905__$2,temp__5720__auto__,alts){
return (function (p1__42769_SHARP_){
return p1__42769_SHARP_.toFixed((2));
});})(alt,s__42905__$2,temp__5720__auto__,alts))
,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.float_conformer.call(null,(0),(1)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(10),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),(55))))),weathergen$ui$atmosphere_controls_$_iter__42904.call(null,cljs.core.rest.call(null,s__42905__$2)));
}
} else {
return null;
}
break;
}
});})(alts))
,null,null));
});})(alts))
;
return iter__4523__auto__.call(null,alts);
})()));
})()));
});
weathergen.ui.advanced_controls = (function weathergen$ui$advanced_controls(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"advanced-params-section",new cljs.core.Keyword(null,"title","title",636505583),"Advanced configuration",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__42938,G__42939){
return G__42938.call(null,G__42939,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),weathergen.ui.control_layout.call(null,new cljs.core.PersistentVector(null, 10, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["X Offset",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),(0)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"help-path","help-path",840478713),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),new cljs.core.Keyword(null,"x","x",2099068185)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Y Offset",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),(1)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"help-path","help-path",840478713),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),new cljs.core.Keyword(null,"y","y",-1757859776)], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["T Offset",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"offset","offset",296498311)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Evolution",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"evolution","evolution",944820557)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Wind uniformity",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-uniformity","wind-uniformity",827531801)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Temp uniformity",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp-uniformity","temp-uniformity",836756864)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Warp strength",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"turbulence","turbulence",-915506410),new cljs.core.Keyword(null,"power","power",-937852079)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Crossfade",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"crossfade","crossfade",-118506406)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Zoom",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"feature-size","feature-size",-878734864)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Pressure speed",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"speed","speed",1257663751)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(55),new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"speed","speed",1257663751)], null)),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.int_conformer.call(null,(0),(10000)))], null)], null)], null)));
});
weathergen.ui.step_controls = (function weathergen$ui$step_controls(_){
var mission_time = javelin.core.formula.call(null,(function (G__42941,G__42942){
return G__42941.call(null,G__42942);
})).call(null,weathergen.falcon.files.mission.mission_time,weathergen.ui.mission);
var max_time = javelin.core.formula.call(null,((function (mission_time){
return (function (G__42944,G__42943){
return G__42943.call(null,new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(G__42944)));
});})(mission_time))
).call(null,weathergen.ui.weather_params,weathergen.time.campaign_time__GT_minutes);
var weather_time = javelin.core.formula.call(null,((function (mission_time,max_time){
return (function (G__42946,G__42945){
return G__42945.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(G__42946)));
});})(mission_time,max_time))
).call(null,weathergen.ui.weather_params,weathergen.time.campaign_time__GT_minutes);
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"time-location-params",new cljs.core.Keyword(null,"title","title",636505583),"Time controls",hoplon.core.table.call(null,hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"falcon-time","falcon-time",34959931)], null),"Falcon time: ")),hoplon.core.td.call(null,javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (G__42948,G__42947){
return G__42947.call(null,G__42948);
});})(mission_time,max_time,weather_time))
).call(null,mission_time,weathergen.ui.common.format_time)),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
return weathergen.ui.jump_to_time_STAR_.call(null,cljs.core.deref.call(null,mission_time));
});})(mission_time,max_time,weather_time))
,"Jump to"))),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (mission_time,max_time,weather_time){
return (function (){
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"browse-time","browse-time",832671504)], null),"Time")),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.weather_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)], null))));
});})(mission_time,max_time,weather_time))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,mission_time,max_time,weather_time){
return (function (){
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"displayed-time","displayed-time",141846012)], null),"Time")),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.time_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"displayed","displayed",-436192586)], null))),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.jump_to_time,"Jump to"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (con__30287__auto__,mission_time,max_time,weather_time){
return (function (G__42949,G__42950){
return G__42949.call(null,G__42950,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(con__30287__auto__,mission_time,max_time,weather_time))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.set_time,"Set to")));
});})(con__30287__auto__,mission_time,max_time,weather_time))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,mission_time,max_time,weather_time){
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__,mission_time,max_time,weather_time))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,mission_time,max_time,weather_time){
return (function (G__42951,G__42952){
return G__42951.call(null,G__42952,new cljs.core.Keyword(null,"browse","browse",2070502601));
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,mission_time,max_time,weather_time))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})(),hoplon.core.tr.call(null,cljs.core.map.call(null,hoplon.core.td,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"step","step",1288888124)], null),"Step interval"),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(50),new cljs.core.Keyword(null,"source","source",-433931539),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (G__42953){
return new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(G__42953);
});})(mission_time,max_time,weather_time))
).call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.conform_positive_integer,new cljs.core.Keyword(null,"update","update",1045576396),((function (mission_time,max_time,weather_time){
return (function (p1__42940_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.movement_params,cljs.core.assoc,new cljs.core.Keyword(null,"step","step",1288888124),p1__42940_SHARP_);
});})(mission_time,max_time,weather_time))
,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"e.g. 60",new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str)], null))))),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Step back in time",new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
return weathergen.ui.move.call(null,(-1));
});})(mission_time,max_time,weather_time))
,"<< Step Back"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"title","title",636505583),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (G__42954){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(G__42954))){
return "Stop weather animation";
} else {
return "Animate weather";
}
});})(mission_time,max_time,weather_time))
).call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(cljs.core.swap_BANG_.call(null,weathergen.ui.movement_params,cljs.core.update,new cljs.core.Keyword(null,"looping?","looping?",78344245),cljs.core.not)))){
return weathergen.ui.recompute.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params));
} else {
return null;
}
});})(mission_time,max_time,weather_time))
,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (movement_params){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(movement_params))){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"border","border",1444987323),"5px solid black",new cljs.core.Keyword(null,"transform","transform",1381301764),"",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"2px"], null);
} else {
return new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"border-bottom","border-bottom",2110948415),"",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"transform","transform",1381301764),"rotate(-90deg)"], null);
}
});})(mission_time,max_time,weather_time))
).call(null,weathergen.ui.movement_params),"")),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (max_time__$1,weather_time__$1,display_mode){
return ((cljs.core._EQ_.call(null,display_mode,new cljs.core.Keyword(null,"edit","edit",-1641834166))) || ((weather_time__$1 < max_time__$1)));
});})(mission_time,max_time,weather_time))
).call(null,max_time,weather_time,weathergen.ui.display_mode),new cljs.core.Keyword(null,"title","title",636505583),"Step forward in time",new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
return weathergen.ui.move.call(null,(1));
});})(mission_time,max_time,weather_time))
,"Step Forward >>"));
});
weathergen.ui.mission_weather_load_status = javelin.core.cell.call(null,null);
weathergen.ui.load_mission_weather = (function weathergen$ui$load_mission_weather(){
return weathergen.ui.load_fmaps.call(null);
});
weathergen.ui.initialize_generated_weather = (function weathergen$ui$initialize_generated_weather(){
return null;
});
weathergen.ui.weather_source_controls = (function weathergen$ui$weather_source_controls(opts){
var source = weathergen.ui.common.path_lens.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"source","source",-433931539)], null));
hoplon.core.do_watch.call(null,source,((function (source){
return (function (_,source__$1){
var G__42955 = source__$1;
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"mission","mission",1740288522),G__42955)){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"not-loaded","not-loaded",666902159),new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.fmap_load_state)))){
return weathergen.ui.load_mission_weather.call(null);
} else {
return null;
}
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"generated","generated",-1130228243),G__42955)){
return weathergen.ui.initialize_generated_weather.call(null);
} else {
if(cljs.core._EQ_.call(null,null,G__42955)){
return null;
} else {
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__42955)].join('')));

}
}
}
});})(source))
);

return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (source){
return (function (G__42956,G__42957){
return G__42956.call(null,G__42957,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(source))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"id","id",-1388402092),"weather-source-controls",new cljs.core.Keyword(null,"title","title",636505583),"Weather Source",weathergen.ui.common.radio_group.call(null,new cljs.core.Keyword(null,"value","value",305978217),source,new cljs.core.Keyword(null,"choices","choices",1385611597),javelin.core.formula.call(null,((function (source){
return (function (fmap_load_state){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"No Weather",new cljs.core.Keyword(null,"value","value",305978217),null], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),["Mission Weather",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__42959 = new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(fmap_load_state);
var G__42959__$1 = (((G__42959 instanceof cljs.core.Keyword))?G__42959.fqn:null);
switch (G__42959__$1) {
case "loading":
return [" Loading: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"maps-loaded","maps-loaded",-320462859).cljs$core$IFn$_invoke$arity$1(fmap_load_state))," loaded of ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"maps-to-load","maps-to-load",-73197204).cljs$core$IFn$_invoke$arity$1(fmap_load_state)),""].join('');

break;
case "loaded":
return weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__42959,G__42959__$1,source){
return (function (_){
return new cljs.core.Keyword(null,"todo","todo",-1046442570);
});})(G__42959,G__42959__$1,source))
,"Reload");

break;
default:
return "";

}
})())].join(''),new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"mission","mission",1740288522)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1718410804),"Generated Weather",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"generated","generated",-1130228243),new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),true], null)], null);
});})(source))
).call(null,weathergen.ui.fmap_load_state)));
});
weathergen.ui.serialization_controls = (function weathergen$ui$serialization_controls(_){
var inline = (function() { 
var G__42969__delegate = function (css,contents){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"5px"], null),css),contents);
};
var G__42969 = function (css,var_args){
var contents = null;
if (arguments.length > 1) {
var G__42970__i = 0, G__42970__a = new Array(arguments.length -  1);
while (G__42970__i < G__42970__a.length) {G__42970__a[G__42970__i] = arguments[G__42970__i + 1]; ++G__42970__i;}
  contents = new cljs.core.IndexedSeq(G__42970__a,0,null);
} 
return G__42969__delegate.call(this,css,contents);};
G__42969.cljs$lang$maxFixedArity = 1;
G__42969.cljs$lang$applyTo = (function (arglist__42971){
var css = cljs.core.first(arglist__42971);
var contents = cljs.core.rest(arglist__42971);
return G__42969__delegate(css,contents);
});
G__42969.cljs$core$IFn$_invoke$arity$variadic = G__42969__delegate;
return G__42969;
})()
;
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (inline){
return (function (G__42962,G__42963){
return G__42962.call(null,G__42963,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(inline))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"id","id",-1388402092),"load-save-controls",new cljs.core.Keyword(null,"title","title",636505583),"Load/save",((cljs.core.not.call(null,weathergen.ui.safari_QMARK_))?cljs.core.PersistentVector.EMPTY:(function (){var p_STAR_ = ((function (inline){
return (function() { 
var G__42972__delegate = function (rest__42961_SHARP_){
return hoplon.core.p.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null),rest__42961_SHARP_);
};
var G__42972 = function (var_args){
var rest__42961_SHARP_ = null;
if (arguments.length > 0) {
var G__42973__i = 0, G__42973__a = new Array(arguments.length -  0);
while (G__42973__i < G__42973__a.length) {G__42973__a[G__42973__i] = arguments[G__42973__i + 0]; ++G__42973__i;}
  rest__42961_SHARP_ = new cljs.core.IndexedSeq(G__42973__a,0,null);
} 
return G__42972__delegate.call(this,rest__42961_SHARP_);};
G__42972.cljs$lang$maxFixedArity = 0;
G__42972.cljs$lang$applyTo = (function (arglist__42974){
var rest__42961_SHARP_ = cljs.core.seq(arglist__42974);
return G__42972__delegate(rest__42961_SHARP_);
});
G__42972.cljs$core$IFn$_invoke$arity$variadic = G__42972__delegate;
return G__42972;
})()
;})(inline))
;
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,"font-size","font-size",-1847940346),"80%"], null),p_STAR_.call(null,"Due to a bug in Safari, settings files will open in a new\n        tab Use the browser's File->Save As to save the file. Be sure\n        to select 'Page Source' for the format. "),p_STAR_.call(null,"Due to the same bug, all other files will download with\n        name 'Unknown'. For these, once downloaded rename it with the\n        appropriate extension: .fmap for FMAPs, .twx for TWX files,\n        and .zip for weather packages."),p_STAR_.call(null,"Better still, don't use Safari. This application works\n        best in Chrome, but has also been tested in Firefox and\n        Internet Explorer."));
})()),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"save-single-files","save-single-files",-947469927)], null),"Load/Save individual files"),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),"row",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (inline){
return (function (){
return weathergen.ui.save_fmap.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params),cljs.core.deref.call(null,weathergen.ui.movement_params),cljs.core.deref.call(null,weathergen.ui.cloud_params),cljs.core.deref.call(null,weathergen.ui.weather_data));
});})(inline))
,"Save Current as FMAP")),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (inline){
return (function (){
return weathergen.ui.save_twx.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)));
});})(inline))
,"Save .TWX")),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.save_weather_settings,"Save Weather Settings")),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.load_weather_settings,"Load Weather Settings")))),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (inline){
return (function (G__42964){
return cljs.core.not.call(null,(G__42964 == null));
});})(inline))
).call(null,weathergen.ui.mission),new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Save mission weather files"),(function (){var row = ((function (inline){
return (function() { 
var G__42975__delegate = function (label,help_path,edit,more){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),"row",new cljs.core.Keyword(null,"margin","margin",-995903681),"0 2px 3px 2px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap",new cljs.core.Keyword(null,"width","width",-384071477),"50px",new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"3px"], null),weathergen.help.with_help.call(null,help_path,label)),edit,more);
};
var G__42975 = function (label,help_path,edit,var_args){
var more = null;
if (arguments.length > 3) {
var G__42976__i = 0, G__42976__a = new Array(arguments.length -  3);
while (G__42976__i < G__42976__a.length) {G__42976__a[G__42976__i] = arguments[G__42976__i + 3]; ++G__42976__i;}
  more = new cljs.core.IndexedSeq(G__42976__a,0,null);
} 
return G__42975__delegate.call(this,label,help_path,edit,more);};
G__42975.cljs$lang$maxFixedArity = 3;
G__42975.cljs$lang$applyTo = (function (arglist__42977){
var label = cljs.core.first(arglist__42977);
arglist__42977 = cljs.core.next(arglist__42977);
var help_path = cljs.core.first(arglist__42977);
arglist__42977 = cljs.core.next(arglist__42977);
var edit = cljs.core.first(arglist__42977);
var more = cljs.core.rest(arglist__42977);
return G__42975__delegate(label,help_path,edit,more);
});
G__42975.cljs$core$IFn$_invoke$arity$variadic = G__42975__delegate;
return G__42975;
})()
;})(inline))
;
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [row.call(null,"Mission:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"mission-name","mission-name",1479736582)], null),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (row,inline){
return (function (G__42965){
var or__4131__auto__ = new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(G__42965);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "No Mission Loaded";
}
});})(row,inline))
).call(null,weathergen.ui.mission))),row.call(null,"From:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null),weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.display_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"14px"], null),new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (row,inline){
return (function (G__42966){
return cljs.core.not.call(null,(G__42966 == null));
});})(row,inline))
).call(null,weathergen.ui.mission),new cljs.core.Keyword(null,"click","click",1912301393),((function (row,inline){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.display_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null),weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission)));
});})(row,inline))
,"Set to mission time")),row.call(null,"To:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"to","to",192099007)], null),weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.display_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"to","to",192099007)], null))),row.call(null,"Step:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"step","step",1288888124)], null),weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(32),new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"step","step",1288888124)], null)),new cljs.core.Keyword(null,"conform","conform",1846236460),((function (row,inline){
return (function (s){
return javelin.core.formula.call(null,((function (row,inline){
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 ((60) <= s__$1);
} 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 or equal to 60. Values below 60 may cause problems in BMS."),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
});})(row,inline))
).call(null,s);
});})(row,inline))
,new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"60")),(function (){var progress = javelin.core.cell.call(null,null);
var cancelling_QMARK_ = javelin.core.cell.call(null,false);
var save_file = javelin.core.cell.call(null,null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (progress__$1,cancelling_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"width","width",-384071477),"115px",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center",new cljs.core.Keyword(null,"background","background",-863952629),((((cljs.core.not.call(null,cancelling_QMARK___$1)) && ((!((progress__$1 == null))))))?(function (){var pct = cljs.core.long$.call(null,((100) * progress__$1));
return goog.string.format("linear-gradient(to right, lightblue, lightblue %f%%, white %f%%)",pct,pct);
})():null)], null);
});})(progress,cancelling_QMARK_,save_file,row,inline))
).call(null,progress,cancelling_QMARK_),new cljs.core.Keyword(null,"click","click",1912301393),((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
if(cljs.core.truth_(cljs.core.deref.call(null,progress))){
return javelin.core.dosync_STAR_.call(null,((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return cljs.core.reset_BANG_.call(null,cancelling_QMARK_,true);
});})(progress,cancelling_QMARK_,save_file,row,inline))
);
} else {
cljs.core.reset_BANG_.call(null,cancelling_QMARK_,false);

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

return weathergen.ui.save_weather_files.call(null,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"mission-name","mission-name",1479736582),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),new cljs.core.Keyword(null,"nx","nx",-1996436366),new cljs.core.Keyword(null,"save-file","save-file",-250442926),new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"campaign-dir","campaign-dir",-1278307883),new cljs.core.Keyword(null,"weather-direction","weather-direction",-1789808873),new cljs.core.Keyword(null,"cancel","cancel",-1964088360),new cljs.core.Keyword(null,"ny","ny",1701791641),new cljs.core.Keyword(null,"progress","progress",244323547),new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),new cljs.core.Keyword(null,"step","step",1288888124),new cljs.core.Keyword(null,"to","to",192099007)],[new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)),cljs.core.deref.call(null,weathergen.ui.movement_params),cljs.core.deref.call(null,weathergen.ui.cloud_params),cljs.core.first.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))),save_file,cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null)),weathergen.falcon.files.mission.campaign_dir.call(null,cljs.core.deref.call(null,weathergen.ui.mission)),new cljs.core.Keyword(null,"direction","direction",-633359395).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)),cancelling_QMARK_,cljs.core.second.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))),progress,cljs.core.deref.call(null,weathergen.ui.weather_params),cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"step","step",1288888124)], null)),cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"to","to",192099007)], null))]));
}
});})(progress,cancelling_QMARK_,save_file,row,inline))
,javelin.core.formula.call(null,((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (progress__$1,cancelling_QMARK___$1){
if(cljs.core.truth_((function (){var and__4120__auto__ = progress__$1;
if(cljs.core.truth_(and__4120__auto__)){
return cancelling_QMARK___$1;
} else {
return and__4120__auto__;
}
})())){
return "Cancelling...";
} else {
if(cljs.core.truth_(progress__$1)){
return "Cancel";
} else {
return "Save Weather Files";

}
}
});})(progress,cancelling_QMARK_,save_file,row,inline))
).call(null,progress,cancelling_QMARK_)),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"5px"], null),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"5px"], null),"Saving"),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%"], null),save_file));
});})(progress,cancelling_QMARK_,save_file,row,inline))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return null;
});})(con__30287__auto__,progress,cancelling_QMARK_,save_file,row,inline))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,progress,cancelling_QMARK_,save_file,row,inline){
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__,progress,cancelling_QMARK_,save_file,row,inline))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (G__42967,G__42968){
var and__4120__auto__ = G__42967;
if(cljs.core.truth_(and__4120__auto__)){
return G__42968;
} else {
return and__4120__auto__;
}
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,progress,cancelling_QMARK_,save_file,row,inline))
).call(null,progress,save_file));
})()], null);
})()], null);
})()));
});
weathergen.ui.debug_info = (function weathergen$ui$debug_info(){
return null;
});
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"viewBox","viewBox",-469489477),(function (elem,_,value){
if(cljs.core._EQ_.call(null,false,value)){
return elem.removeAttribute("viewBox");
} else {
return elem.setAttribute("viewBox",value);
}
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),(function (elem,_,value){
if(cljs.core._EQ_.call(null,false,value)){
return elem.removeAttributeNS("http://www.w3.org/1999/xlink","href");
} else {
return elem.setAttributeNS("http://www.w3.org/1999/xlink","href",value);
}
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"preserveAspectRatio","preserveAspectRatio",1832131817),(function (elem,_,value){
if(cljs.core._EQ_.call(null,false,value)){
return elem.removeAttribute("preserveAspectRatio");
} else {
return elem.setAttribute("preserveAspectRatio",value);
}
}));
weathergen.ui.test_section = (function weathergen$ui$test_section(p__42978){
var map__42979 = p__42978;
var map__42979__$1 = (((((!((map__42979 == null))))?(((((map__42979.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__42979.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__42979):map__42979);
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Test",weathergen.ui.tabs.tabs.call(null,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.cell.call(null,new cljs.core.Keyword(null,"one","one",935007904)),new cljs.core.Keyword(null,"tabs","tabs",-779855354),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Version",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"one","one",935007904),new cljs.core.Keyword(null,"ui","ui",-469653645),"test"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"App Path",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"two","two",627606869),new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.div.call(null,weathergen.ui.electron.remote.app.getAppPath())], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Three",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"three","three",-1651831795),new cljs.core.Keyword(null,"ui","ui",-469653645),(function (){var choice = javelin.core.cell.call(null,new cljs.core.Keyword(null,"a","a",-2123407586));
return hoplon.core.div.call(null,weathergen.ui.common.radio_group.call(null,new cljs.core.Keyword(null,"value","value",305978217),choice,new cljs.core.Keyword(null,"choices","choices",1385611597),javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.Keyword(null,"label","label",1718410804),"a"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"b","b",1482224470),new cljs.core.Keyword(null,"label","label",1718410804),"b"], null)], null))),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (choice,map__42979,map__42979__$1){
return (function (G__42982,G__42981){
return ["value: ",G__42981.call(null,G__42982)].join('');
});})(choice,map__42979,map__42979__$1))
).call(null,choice,cljs.core.pr_str)));
})()], null)], null)));
});
/**
 * Given mission and airbase cells, return a formula cell with the
 *   squadron for that airbase in the canonical order.
 */
weathergen.ui.airbase_squadrons = (function weathergen$ui$airbase_squadrons(mission,airbase){
return javelin.core.formula.call(null,(function (mission__$1,airbase__$1){
return cljs.core.sort_by.call(null,cljs.core.juxt.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","squadron-type","weathergen.falcon.files.mission/squadron-type",1124226793),new cljs.core.Keyword(null,"name","name",1843675177)),new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1));
})).call(null,mission,airbase);
});
/**
 * Returns a control section that affects how airbases display on the
 *   map.
 */
weathergen.ui.airbase_display_controls = (function weathergen$ui$airbase_display_controls(title){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),title),(function (){var map_airbase_label_style = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514)], null));
return hoplon.core.div.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"airbase-labels","airbase-labels",580409100)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null),hoplon.core.label.call(null,"Airbase labels:")),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),map_airbase_label_style,new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Airbase name only",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"name-only","name-only",-124386571)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Airbase name and squadrons",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"all","all",892129742)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"No label",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"nothing","nothing",-1022703296)], null)], null)));
})(),(function (){var map_airbase_show_status_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435)], null));
return hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),map_airbase_show_status_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (map_airbase_show_status_QMARK_){
return (function (){
return cljs.core.swap_BANG_.call(null,map_airbase_show_status_QMARK_,cljs.core.not);
});})(map_airbase_show_status_QMARK_))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435)], null),hoplon.core.label.call(null,"Show airbase status?")));
})(),(function (){var map_airbase_show_squadrons_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954)], null));
return hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),map_airbase_show_squadrons_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (map_airbase_show_squadrons_QMARK_){
return (function (){
return cljs.core.swap_BANG_.call(null,map_airbase_show_squadrons_QMARK_,cljs.core.not);
});})(map_airbase_show_squadrons_QMARK_))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954)], null),hoplon.core.label.call(null,"Show airbase squadrons?")));
})());
});
weathergen.ui.air_forces_section = (function weathergen$ui$air_forces_section(_){
var expand_state = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"expand-through-level","expand-through-level",-1840001384),(1)], null));
var row = ((function (expand_state){
return (function() { 
var G__43036__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"row",args);
};
var G__43036 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__43037__i = 0, G__43037__a = new Array(arguments.length -  0);
while (G__43037__i < G__43037__a.length) {G__43037__a[G__43037__i] = arguments[G__43037__i + 0]; ++G__43037__i;}
  args = new cljs.core.IndexedSeq(G__43037__a,0,null);
} 
return G__43036__delegate.call(this,args);};
G__43036.cljs$lang$maxFixedArity = 0;
G__43036.cljs$lang$applyTo = (function (arglist__43038){
var args = cljs.core.seq(arglist__43038);
return G__43036__delegate(args);
});
G__43036.cljs$core$IFn$_invoke$arity$variadic = G__43036__delegate;
return G__43036;
})()
;})(expand_state))
;
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var G__42989 = (new cljs.core.Delay(((function (expand_state,row){
return (function (){
return "No mission loaded";
});})(expand_state,row))
,null));
var G__42990 = (new cljs.core.Delay(((function (G__42989,expand_state,row){
return (function (){
return "No airbases present in the mission.";
});})(G__42989,expand_state,row))
,null));
var G__42991 = (new cljs.core.Delay(((function (G__42989,G__42990,expand_state,row){
return (function (){
return weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.row","div.row",133678515),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button","button",1456579943),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px"], null)], null)], null),weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"airbase-filtering","airbase-filtering",-1721186951)], null),"Airbase Filtering"),row.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.hide_empty_airbases_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.hide_empty_airbases_QMARK_,cljs.core.not);
});})(G__42989,G__42990,expand_state,row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"hide-no-squadron-airbases","hide-no-squadron-airbases",-1359048131)], null),hoplon.core.label.call(null,"Hide airbases with no squadrons"))),row.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.hide_inoperable_airbases_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.hide_inoperable_airbases_QMARK_,cljs.core.not);
});})(G__42989,G__42990,expand_state,row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"hide-zero-status-airbases","hide-zero-status-airbases",1840033965)], null),hoplon.core.label.call(null,"Hide airbases at 0% status")))),weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"squadron-types","squadron-types",1890788688)], null),"Squadron Types"),row.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,cljs.core.deref.call(null,weathergen.ui.all_squadron_types));
});})(G__42989,G__42990,expand_state,row))
,"Check all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,cljs.core.PersistentHashSet.EMPTY);
});})(G__42989,G__42990,expand_state,row))
,"Uncheck all"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"squadron-type-buttons","squadron-type-buttons",-151353966)], null))),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-wrap","flex-wrap",455413707),"wrap",new cljs.core.Keyword(null,"max-width","max-width",-1939924051),weathergen.ui.common.px.call(null,(275))], null),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (G__42989,G__42990,expand_state,row){
return (function (G__42992,G__42993){
return G__42992.call(null,G__42993);
});})(G__42989,G__42990,expand_state,row))
).call(null,cljs.core.sort,weathergen.ui.all_squadron_types),((function (G__42989,G__42990,expand_state,row){
return (function (item__30277__auto__){
var vec__42994 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (G__42989,G__42990,expand_state,row){
return (function (squadron_type){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron_type], null);
});})(G__42989,G__42990,expand_state,row))
).call(null,item__30277__auto__));
var squadron_type = cljs.core.nth.call(null,vec__42994,(0),null);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(75)),new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap"], null),(function (){var val = javelin.core.formula.call(null,((function (vec__42994,squadron_type,G__42989,G__42990,expand_state,row){
return (function (G__42997,G__42999,G__42998){
return G__42997.call(null,G__42998,G__42999);
});})(vec__42994,squadron_type,G__42989,G__42990,expand_state,row))
).call(null,cljs.core.contains_QMARK_,squadron_type,weathergen.ui.included_squadron_types);
return hoplon.core.input.call(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__42994,squadron_type,G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.included_squadron_types,(cljs.core.truth_(cljs.core.deref.call(null,val))?cljs.core.disj:cljs.core.conj),cljs.core.deref.call(null,squadron_type));
});})(val,vec__42994,squadron_type,G__42989,G__42990,expand_state,row))
);
})(),hoplon.core.label.call(null,squadron_type));
});})(G__42989,G__42990,expand_state,row))
))),weathergen.ui.airbase_display_controls.call(null,"Display Options"),weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"airbases-and-squadrons","airbases-and-squadrons",396705313)], null),"Airbases and Squadrons"),row.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,expand_state,new cljs.core.Keyword(null,"all-expanded","all-expanded",1437674225));
});})(G__42989,G__42990,expand_state,row))
,"Expand all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,expand_state,new cljs.core.Keyword(null,"all-collapsed","all-collapsed",437702622));
});})(G__42989,G__42990,expand_state,row))
,"Collapse all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,expand_state,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"expand-through-level","expand-through-level",-1840001384),(1)], null));
});})(G__42989,G__42990,expand_state,row))
,"Collapse to airbases"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"tree-collapse-buttons","tree-collapse-buttons",-1065929796)], null))),row.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.deref.call(null,weathergen.ui.listed_airbases));
});})(G__42989,G__42990,expand_state,row))
,"Show all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.PersistentHashSet.EMPTY);
});})(G__42989,G__42990,expand_state,row))
,"Hide all"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"airbase-selection-buttons","airbase-selection-buttons",-991641834)], null))),row.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"overflow","overflow",2058931880),"scroll",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%",new cljs.core.Keyword(null,"background","background",-863952629),"white",new cljs.core.Keyword(null,"border","border",1444987323),"inset 1px lightgray"], null),(function (){var by_side = javelin.core.formula.call(null,((function (G__42989,G__42990,expand_state,row){
return (function (mission,all_airbases){
return cljs.core.group_by.call(null,((function (G__42989,G__42990,expand_state,row){
return (function (airbase){
return weathergen.falcon.files.mission.side.call(null,mission,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(airbase));
});})(G__42989,G__42990,expand_state,row))
,all_airbases);
});})(G__42989,G__42990,expand_state,row))
).call(null,weathergen.ui.mission,weathergen.ui.all_airbases);
var sorted = javelin.core.formula.call(null,((function (by_side,G__42989,G__42990,expand_state,row){
return (function (mission,by_side__$1){
var timer_name__15816__auto__ = "Updating air forces tree";
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = (function (){var iter__4523__auto__ = ((function (timer_name__15816__auto__,ignore__15817__auto__,by_side,G__42989,G__42990,expand_state,row){
return (function weathergen$ui$air_forces_section_$_iter__43000(s__43001){
return (new cljs.core.LazySeq(null,((function (timer_name__15816__auto__,ignore__15817__auto__,by_side,G__42989,G__42990,expand_state,row){
return (function (){
var s__43001__$1 = s__43001;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__43001__$1);
if(temp__5720__auto__){
var s__43001__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__43001__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__43001__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__43003 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__43002 = (0);
while(true){
if((i__43002 < size__4522__auto__)){
var side = cljs.core._nth.call(null,c__4521__auto__,i__43002);
var airbases = cljs.core.get.call(null,by_side__$1,side);
if((cljs.core.count.call(null,airbases) > (0))){
cljs.core.chunk_append.call(null,b__43003,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [side,airbases], null));

var G__43039 = (i__43002 + (1));
i__43002 = G__43039;
continue;
} else {
var G__43040 = (i__43002 + (1));
i__43002 = G__43040;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43003),weathergen$ui$air_forces_section_$_iter__43000.call(null,cljs.core.chunk_rest.call(null,s__43001__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43003),null);
}
} else {
var side = cljs.core.first.call(null,s__43001__$2);
var airbases = cljs.core.get.call(null,by_side__$1,side);
if((cljs.core.count.call(null,airbases) > (0))){
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [side,airbases], null),weathergen$ui$air_forces_section_$_iter__43000.call(null,cljs.core.rest.call(null,s__43001__$2)));
} else {
var G__43041 = cljs.core.rest.call(null,s__43001__$2);
s__43001__$1 = G__43041;
continue;
}
}
} else {
return null;
}
break;
}
});})(timer_name__15816__auto__,ignore__15817__auto__,by_side,G__42989,G__42990,expand_state,row))
,null,null));
});})(timer_name__15816__auto__,ignore__15817__auto__,by_side,G__42989,G__42990,expand_state,row))
;
return iter__4523__auto__.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
})();
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
});})(by_side,G__42989,G__42990,expand_state,row))
).call(null,weathergen.ui.mission,by_side);
return weathergen.ui.trees.tree.call(null,expand_state,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (expanded_QMARK_,item){
var vec__43010 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (p__43013){
var vec__43014 = p__43013;
var side = cljs.core.nth.call(null,vec__43014,(0),null);
var airbases = cljs.core.nth.call(null,vec__43014,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [airbases,side], null);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,item));
var airbases = cljs.core.nth.call(null,vec__43010,(0),null);
var side = cljs.core.nth.call(null,vec__43010,(1),null);
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (vec__43010,airbases,side,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (G__43017,G__43018){
return G__43017.call(null,"air-forces-side-%d",G__43018);
});})(vec__43010,airbases,side,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,goog.string.format,side),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__43010,airbases,side,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (side__$1){
return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"height","height",1025178622),"20px",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"4px",new cljs.core.Keyword(null,"color","color",1011675173),weathergen.ui.common.team_color.call(null,side__$1,new cljs.core.Keyword(null,"dark-text","dark-text",814777253))], null);
});})(vec__43010,airbases,side,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,side),javelin.core.formula.call(null,((function (vec__43010,airbases,side,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (mission,side__$1){
return 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__$1);
});})(vec__43010,airbases,side,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,weathergen.ui.mission,side));
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
,new cljs.core.Keyword(null,"children","children",-940561982),((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (item){
return javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (item__$1,mission){
var vec__43019 = item__$1;
var side = cljs.core.nth.call(null,vec__43019,(0),null);
var airbases = cljs.core.nth.call(null,vec__43019,(1),null);
return cljs.core.sort_by.call(null,((function (vec__43019,side,airbases,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (airbase){
return weathergen.falcon.files.mission.objective_name.call(null,mission,airbase);
});})(vec__43019,side,airbases,by_side,sorted,G__42989,G__42990,expand_state,row))
,airbases);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,item,weathergen.ui.mission);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"attrs","attrs",-2090668713),((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (airbase){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (airbase__$1,listed_airbases){
return listed_airbases.call(null,airbase__$1);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,airbase,weathergen.ui.listed_airbases)], null);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
,new cljs.core.Keyword(null,"children","children",-940561982),((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (airbase){
return javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (airbase__$1){
return cljs.core.sort_by.call(null,cljs.core.juxt.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","squadron-type","weathergen.falcon.files.mission/squadron-type",1124226793),new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975)),new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1));
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,airbase);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (expanded_QMARK_,airbase){
var ab_name = javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (airbase__$1){
return new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,airbase);
var status = javelin.core.formula.call(null,((function (ab_name,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (airbase__$1){
return new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(ab_name,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,airbase);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (G__43023,G__43022){
return G__43022.call(null,"air-forces-airbase-%d",new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(G__43023));
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,airbase,goog.string.format),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (expanded_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"height","height",1025178622),"20px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"4px",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null);
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,expanded_QMARK_),new cljs.core.Keyword(null,"click","click",1912301393),((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (){
cljs.core.swap_BANG_.call(null,weathergen.ui.checked_airbases,weathergen.util.toggle_set_membership,cljs.core.deref.call(null,airbase));

return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,cljs.core.deref.call(null,weathergen.ui.checked_airbases).call(null,cljs.core.deref.call(null,airbase)));
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
);
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
,new cljs.core.Keyword(null,"mouseenter","mouseenter",-1792413560),((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,cljs.core.deref.call(null,airbase));
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
,new cljs.core.Keyword(null,"mouseleave","mouseleave",531566580),((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,null);
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"7px"], null),new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (airbase__$1,checked_airbases){
return checked_airbases.call(null,airbase__$1);
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,airbase,weathergen.ui.checked_airbases)),(function (){var width = (25);
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,width),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (width,ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (mission,airbase__$1){
return weathergen.ui.common.get_image.call(null,mission,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(airbase__$1));
});})(width,ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,weathergen.ui.mission,airbase),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"max-width","max-width",-1939924051),weathergen.ui.common.px.call(null,width),new cljs.core.Keyword(null,"max-height","max-height",-612563804),weathergen.ui.common.px.call(null,width),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null)));
})(),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (status__$1){
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(25)),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(8)),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),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,"border","border",1444987323),"solid 1px black",new cljs.core.Keyword(null,"background","background",-863952629),(function (){var color = weathergen.ui.airbase_status_color.call(null,status__$1);
return goog.string.format("linear-gradient(to right, %s, %s %f%%, white %f%%)",color,color,status__$1,status__$1);
})()], null);
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,status)),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (airbase__$1,highlighted_airbase){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"color","color",1011675173),weathergen.ui.common.team_color.call(null,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(airbase__$1),new cljs.core.Keyword(null,"dark-text","dark-text",814777253)),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"10px",new cljs.core.Keyword(null,"background","background",-863952629),((cljs.core._EQ_.call(null,airbase__$1,highlighted_airbase))?"lightgoldenrodyellow":null)], null);
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,airbase,weathergen.ui.highlighted_airbase),ab_name),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"5px"], null),hoplon.core.loop_tpl_STAR_.call(null,weathergen.ui.airbase_squadrons.call(null,weathergen.ui.mission,airbase),((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (item__30277__auto__){
var vec__43024 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (squadron){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron], null);
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,item__30277__auto__));
var squadron = cljs.core.nth.call(null,vec__43024,(0),null);
return hoplon.core.img.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (vec__43024,squadron,ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (squadron__$1,included_squadrons){
return included_squadrons.call(null,squadron__$1);
});})(vec__43024,squadron,ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,squadron,weathergen.ui.included_squadrons),new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (vec__43024,squadron,ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (mission,squadron__$1){
return weathergen.ui.common.get_image.call(null,mission,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron__$1));
});})(vec__43024,squadron,ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,weathergen.ui.mission,squadron),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(20)),new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null));
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
)),hoplon.core.div.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),expanded_QMARK_,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(22)),new cljs.core.Keyword(null,"font-style","font-style",-773672352),"italic",new cljs.core.Keyword(null,"color","color",1011675173),"gray"], null),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (status__$1){
return goog.string.format("Status: %d%%",status__$1);
});})(ab_name,status,by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,status)));
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"attrs","attrs",-2090668713),((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (squadron){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (squadron__$1,included_squadrons){
return included_squadrons.call(null,squadron__$1);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,squadron,weathergen.ui.included_squadrons)], null);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (expanded_QMARK_,squadron){
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (G__43027,G__43028){
return G__43027.call(null,"air-forces-squadron-%d",new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(G__43028));
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,goog.string.format,squadron),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),"35px",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (mission,squadron__$1){
return weathergen.ui.common.get_image.call(null,mission,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron__$1));
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,weathergen.ui.mission,squadron))),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"padding","padding",1660304693),"2px 4px 0 5px",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"7px"], null),javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (G__43029){
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"quantity","quantity",-1929050694).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__43029)));
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,squadron)),weathergen.ui.common.inl.call(null,javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (G__43030){
return new cljs.core.Keyword(null,"airframe","airframe",643222926).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__43030));
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,squadron))),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (by_side,sorted,G__42989,G__42990,expand_state,row){
return (function (G__43031){
return new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__43031);
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
).call(null,squadron))));
});})(by_side,sorted,G__42989,G__42990,expand_state,row))
], null)], null),sorted);
})())));
});})(G__42989,G__42990,expand_state,row))
,null));
var tpl__30305__auto__ = ((function (G__42989,G__42990,G__42991,expand_state,row){
return (function (G__42986,G__42987,G__42988){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(G__42986)?G__42989:(cljs.core.truth_(G__42987)?G__42990:(cljs.core.truth_(G__42988)?G__42991:null)));
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(G__42989,G__42990,G__42991,expand_state,row))
;
return javelin.core.formula.call(null,tpl__30305__auto__).call(null,javelin.core.formula.call(null,((function (G__42989,G__42990,G__42991,tpl__30305__auto__,expand_state,row){
return (function (G__43033,G__43032){
return G__43032.call(null,G__43033);
});})(G__42989,G__42990,G__42991,tpl__30305__auto__,expand_state,row))
).call(null,weathergen.ui.mission,cljs.core.not),javelin.core.formula.call(null,((function (G__42989,G__42990,G__42991,tpl__30305__auto__,expand_state,row){
return (function (G__43035,G__43034){
return (G__43034.call(null,G__43035) === (0));
});})(G__42989,G__42990,G__42991,tpl__30305__auto__,expand_state,row))
).call(null,weathergen.ui.all_airbases,cljs.core.count),new cljs.core.Keyword(null,"else","else",-1508377146));
})()], null);
});
weathergen.ui.order_of_battle_section = (function weathergen$ui$order_of_battle_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Order of Battle",(function (){var con__30287__auto__ = (new cljs.core.Delay((function (){
return "No mission loaded";
}),null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__){
return (function (){
var side_type_units = javelin.core.formula.call(null,((function (con__30287__auto__){
return (function (G__43047,G__43046,G__43044,G__43048,G__43045){
return G__43044.call(null,((function (con__30287__auto__){
return (function (m,side,units){
return G__43045.call(null,m,side,G__43046.call(null,new cljs.core.Keyword(null,"type","type",1174270348),units));
});})(con__30287__auto__))
,cljs.core.PersistentArrayMap.EMPTY,G__43046.call(null,((function (con__30287__auto__){
return (function (p1__43042_SHARP_){
return G__43047.call(null,G__43048,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(p1__43042_SHARP_));
});})(con__30287__auto__))
,new cljs.core.Keyword(null,"units","units",-533089095).cljs$core$IFn$_invoke$arity$1(G__43048)));
});})(con__30287__auto__))
).call(null,weathergen.falcon.files.mission.side,cljs.core.group_by,cljs.core.reduce_kv,weathergen.ui.mission,cljs.core.assoc);
var search_text = javelin.core.cell.call(null,"");
return hoplon.core.div.call(null,hoplon.core.span.call(null,"Search:"),hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),search_text,new cljs.core.Keyword(null,"change","change",-1163046502),((function (side_type_units,search_text,con__30287__auto__){
return (function (p1__43043_SHARP_){
return cljs.core.reset_BANG_.call(null,search_text,cljs.core.deref.call(null,p1__43043_SHARP_));
});})(side_type_units,search_text,con__30287__auto__))
),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,side_type_units,((function (side_type_units,search_text,con__30287__auto__){
return (function (item__30277__auto__){
var vec__43055 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (side_type_units,search_text,con__30287__auto__){
return (function (p__43058){
var vec__43059 = p__43058;
var side = cljs.core.nth.call(null,vec__43059,(0),null);
var type_units = cljs.core.nth.call(null,vec__43059,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [type_units,side], null);
});})(side_type_units,search_text,con__30287__auto__))
).call(null,item__30277__auto__));
var type_units = cljs.core.nth.call(null,vec__43055,(0),null);
var side = cljs.core.nth.call(null,vec__43055,(1),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__){
return (function (G__43063,G__43064,G__43065,G__43062){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),G__43062.call(null,G__43063,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"team","team",1355747699),new cljs.core.Keyword(null,"dark-text","dark-text",814777253),G__43064.call(null,G__43065)], null))], null);
});})(vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__))
).call(null,weathergen.ui.common.colors,weathergen.falcon.files.mission.team_color,side,cljs.core.get_in),javelin.core.formula.call(null,((function (vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__){
return (function (G__43066,G__43067,G__43068){
return G__43066.call(null,G__43067,G__43068);
});})(vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__))
).call(null,weathergen.falcon.files.mission.team_name,weathergen.ui.mission,side)),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,type_units,((function (vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__){
return (function (item__30277__auto____$1){
var vec__43075 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__){
return (function (p__43078){
var vec__43079 = p__43078;
var type = cljs.core.nth.call(null,vec__43079,(0),null);
var units = cljs.core.nth.call(null,vec__43079,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [units,type], null);
});})(vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__))
).call(null,item__30277__auto____$1));
var units = cljs.core.nth.call(null,vec__43075,(0),null);
var type = cljs.core.nth.call(null,vec__43075,(1),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,javelin.core.formula.call(null,((function (vec__43075,units,type,vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__){
return (function (G__43082,G__43083){
return G__43082.call(null,G__43083);
});})(vec__43075,units,type,vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__))
).call(null,cljs.core.name,type)),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,units,((function (vec__43075,units,type,vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__){
return (function (item__30277__auto____$2){
var vec__43084 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__43075,units,type,vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__){
return (function (unit){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [unit], null);
});})(vec__43075,units,type,vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__))
).call(null,item__30277__auto____$2));
var unit = cljs.core.nth.call(null,vec__43084,(0),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,javelin.core.formula.call(null,((function (vec__43084,unit,vec__43075,units,type,vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__){
return (function (G__43087){
return new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__43087);
});})(vec__43084,unit,vec__43075,units,type,vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__))
).call(null,unit)));
});})(vec__43075,units,type,vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__))
)));
});})(vec__43055,type_units,side,side_type_units,search_text,con__30287__auto__))
)));
});})(side_type_units,search_text,con__30287__auto__))
)));
});})(con__30287__auto__))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__){
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__))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__){
return (function (G__43089,G__43088){
return G__43088.call(null,G__43089);
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__))
).call(null,weathergen.ui.mission,cljs.core.not));
})());
});
/**
 * Returns UI for the mission info section.
 */
weathergen.ui.mission_info_section = (function weathergen$ui$mission_info_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Mission Info",hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px"], null),(function (){var con__30287__auto__ = (new cljs.core.Delay((function (){
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,"padding","padding",1660304693),"3px"], null),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-decoration","text-decoration",1836813207),"underline",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"110%"], null),"Loaded mission"),hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),"Theater: "),javelin.core.formula.call(null,(function (G__43091,G__43090){
return G__43090.call(null,G__43091);
})).call(null,weathergen.ui.mission,weathergen.falcon.files.mission.theaterdef_name)),hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),"Mission: "),javelin.core.formula.call(null,(function (G__43092){
return new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(G__43092);
})).call(null,weathergen.ui.mission)),hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),"Falcon Time: "),javelin.core.formula.call(null,(function (G__43094,G__43095,G__43093){
return G__43093.call(null,G__43094.call(null,G__43095));
})).call(null,weathergen.falcon.files.mission.mission_time,weathergen.ui.mission,weathergen.ui.common.format_time)));
}),null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"110%",new cljs.core.Keyword(null,"font-style","font-style",-773672352),"italic"], null),"No mission loaded.");
});})(con__30287__auto__))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__){
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__))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,weathergen.ui.mission);
})()));
});
/**
 * Returns UI for the save briefing section.
 */
weathergen.ui.save_briefing_section = (function weathergen$ui$save_briefing_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"save-briefing","save-briefing",-1540800301)], null),"Save Mission Briefing"),(function (){var G__43096 = (new cljs.core.Delay((function (){
return hoplon.core.div.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return weathergen.ui.save_briefing.call(null,new cljs.core.Keyword(null,"install-id","install-id",-1310868737).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"original-briefing","original-briefing",1522332068).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission))),cljs.core.deref.call(null,weathergen.ui.visible_sides));
}),"Save Briefing (.vmtb)"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"save-briefing-from-briefing","save-briefing-from-briefing",1357034776)], null)));
}),null));
var G__43097 = (new cljs.core.Delay(((function (G__43096){
return (function (){
var only_install = javelin.core.formula.call(null,((function (G__43096){
return (function (mission){
if(cljs.core._EQ_.call(null,cljs.core.count.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission)),(1))){
return cljs.core.first.call(null,cljs.core.keys.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission)));
} else {
return null;
}
});})(G__43096))
).call(null,weathergen.ui.mission);
var selected_install = javelin.core.cell.call(null,null);
var install_to_save = javelin.core.formula.call(null,((function (only_install,selected_install,G__43096){
return (function (only_install__$1,selected_install__$1){
var or__4131__auto__ = only_install__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return selected_install__$1;
}
});})(only_install,selected_install,G__43096))
).call(null,only_install,selected_install);
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,"padding","padding",1660304693),"5px"], null),hoplon.core.div.call(null,(function (){var G__43101 = (new cljs.core.Delay(((function (only_install,selected_install,install_to_save,G__43096){
return (function (){
return hoplon.core.div.call(null,hoplon.core.span.call(null,"Briefing will be saved for installation: "),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%"], null),javelin.core.formula.call(null,((function (only_install,selected_install,install_to_save,G__43096){
return (function (G__43105,G__43104,G__43106){
return G__43104.call(null,G__43105.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__43106)));
});})(only_install,selected_install,install_to_save,G__43096))
).call(null,cljs.core.first,cljs.core.key,weathergen.ui.mission)));
});})(only_install,selected_install,install_to_save,G__43096))
,null));
var G__43102 = (new cljs.core.Delay(((function (G__43101,only_install,selected_install,install_to_save,G__43096){
return (function (){
return "Cannot find a matching installation of Falcon BMS for this mission.";
});})(G__43101,only_install,selected_install,install_to_save,G__43096))
,null));
var G__43103 = (new cljs.core.Delay(((function (G__43101,G__43102,only_install,selected_install,install_to_save,G__43096){
return (function (){
return hoplon.core.div.call(null,hoplon.core.div.call(null,hoplon.core.span.call(null,"Multiple installed copies of Falcon BMS point at the mission directory, "),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"110%"], null),javelin.core.formula.call(null,((function (G__43101,G__43102,only_install,selected_install,install_to_save,G__43096){
return (function (mission){
return cljs.core.val.call(null,cljs.core.first.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission)));
});})(G__43101,G__43102,only_install,selected_install,install_to_save,G__43096))
).call(null,weathergen.ui.mission)),hoplon.core.span.call(null,". Select which installation this mission is for. (If unsure, choose 'Falcon BMS 4.34'.)")),weathergen.ui.common.radio_group.call(null,new cljs.core.Keyword(null,"value","value",305978217),selected_install,new cljs.core.Keyword(null,"choices","choices",1385611597),javelin.core.formula.call(null,((function (G__43101,G__43102,only_install,selected_install,install_to_save,G__43096){
return (function (mission){
var iter__4523__auto__ = ((function (G__43101,G__43102,only_install,selected_install,install_to_save,G__43096){
return (function weathergen$ui$save_briefing_section_$_iter__43107(s__43108){
return (new cljs.core.LazySeq(null,((function (G__43101,G__43102,only_install,selected_install,install_to_save,G__43096){
return (function (){
var s__43108__$1 = s__43108;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__43108__$1);
if(temp__5720__auto__){
var s__43108__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__43108__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__43108__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__43110 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__43109 = (0);
while(true){
if((i__43109 < size__4522__auto__)){
var vec__43111 = cljs.core._nth.call(null,c__4521__auto__,i__43109);
var install_name = cljs.core.nth.call(null,vec__43111,(0),null);
var install_path = cljs.core.nth.call(null,vec__43111,(1),null);
cljs.core.chunk_append.call(null,b__43110,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),install_name,new cljs.core.Keyword(null,"label","label",1718410804),weathergen.ui.common.inl.call(null,install_name)], null));

var G__43123 = (i__43109 + (1));
i__43109 = G__43123;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43110),weathergen$ui$save_briefing_section_$_iter__43107.call(null,cljs.core.chunk_rest.call(null,s__43108__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43110),null);
}
} else {
var vec__43114 = cljs.core.first.call(null,s__43108__$2);
var install_name = cljs.core.nth.call(null,vec__43114,(0),null);
var install_path = cljs.core.nth.call(null,vec__43114,(1),null);
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),install_name,new cljs.core.Keyword(null,"label","label",1718410804),weathergen.ui.common.inl.call(null,install_name)], null),weathergen$ui$save_briefing_section_$_iter__43107.call(null,cljs.core.rest.call(null,s__43108__$2)));
}
} else {
return null;
}
break;
}
});})(G__43101,G__43102,only_install,selected_install,install_to_save,G__43096))
,null,null));
});})(G__43101,G__43102,only_install,selected_install,install_to_save,G__43096))
;
return iter__4523__auto__.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission));
});})(G__43101,G__43102,only_install,selected_install,install_to_save,G__43096))
).call(null,weathergen.ui.mission)));
});})(G__43101,G__43102,only_install,selected_install,install_to_save,G__43096))
,null));
var tpl__30305__auto__ = ((function (G__43101,G__43102,G__43103,only_install,selected_install,install_to_save,G__43096){
return (function (G__43098,G__43099,G__43100){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(G__43098)?G__43101:(cljs.core.truth_(G__43099)?G__43102:(cljs.core.truth_(G__43100)?G__43103:null)));
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(G__43101,G__43102,G__43103,only_install,selected_install,install_to_save,G__43096))
;
return javelin.core.formula.call(null,tpl__30305__auto__).call(null,only_install,javelin.core.formula.call(null,((function (G__43101,G__43102,G__43103,tpl__30305__auto__,only_install,selected_install,install_to_save,G__43096){
return (function (G__43118,G__43117){
return (G__43117.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__43118)) === (0));
});})(G__43101,G__43102,G__43103,tpl__30305__auto__,only_install,selected_install,install_to_save,G__43096))
).call(null,weathergen.ui.mission,cljs.core.count),new cljs.core.Keyword(null,"else","else",-1508377146));
})()),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border","border",1444987323),"1px solid black",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"10px",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"10px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"background","background",-863952629),"black",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"5px",new cljs.core.Keyword(null,"padding","padding",1660304693),"2px"], null),"Visibility"),weathergen.ui.common.side_selector.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"0 0 5px 5px"], null),new cljs.core.Keyword(null,"mission","mission",1740288522),weathergen.ui.mission,new cljs.core.Keyword(null,"selected-sides","selected-sides",-922979619),weathergen.ui.visible_sides)),(function (){var disabled_QMARK_ = javelin.core.formula.call(null,((function (only_install,selected_install,install_to_save,G__43096){
return (function (G__43120,G__43119){
return G__43119.call(null,G__43120);
});})(only_install,selected_install,install_to_save,G__43096))
).call(null,install_to_save,cljs.core.not);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),disabled_QMARK_,new cljs.core.Keyword(null,"click","click",1912301393),((function (disabled_QMARK_,only_install,selected_install,install_to_save,G__43096){
return (function (){
return weathergen.ui.save_briefing.call(null,cljs.core.deref.call(null,install_to_save),cljs.core.deref.call(null,weathergen.ui.visible_sides));
});})(disabled_QMARK_,only_install,selected_install,install_to_save,G__43096))
,"Save Briefing (.vmtb)"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"save-briefing","save-briefing",-1540800301)], null))], null);
})());
});})(G__43096))
,null));
var tpl__30316__auto__ = ((function (G__43096,G__43097){
return (function (expr__30317__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (function (){var G__43122 = expr__30317__auto__;
var G__43122__$1 = (((G__43122 instanceof cljs.core.Keyword))?G__43122.fqn:null);
switch (G__43122__$1) {
case "briefing":
return G__43096;

break;
default:
return G__43097;

}
})();
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(G__43096,G__43097))
;
return javelin.core.formula.call(null,tpl__30316__auto__).call(null,weathergen.ui.display_mode);
})());
});
/**
 * Returns UI for the briefing notes section
 */
weathergen.ui.briefing_notes_section = (function weathergen$ui$briefing_notes_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),javelin.core.formula.call(null,(function (display_mode){
return weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"briefing-notes","briefing-notes",-1524193117),display_mode], null),"Briefing Notes");
})).call(null,weathergen.ui.display_mode),hoplon.core.div.call(null,hoplon.core.textarea.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(110)),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(100))], null),new cljs.core.Keyword(null,"rows","rows",850049680),(10),new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.briefing_notes,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"Enter briefing notes here",new cljs.core.Keyword(null,"change","change",-1163046502),(function (p1__43125_SHARP_){
return cljs.core.reset_BANG_.call(null,weathergen.ui.briefing_notes,cljs.core.deref.call(null,p1__43125_SHARP_));
}))));
});
/**
 * Controls for how the map is displayed.
 */
weathergen.ui.map_controls_section = (function weathergen$ui$map_controls_section(_){
return hoplon.core.div.call(null,weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"general","general",380803686)], null),"General Display Options"),(function (){var slider_row = (function (p__43126){
var map__43127 = p__43126;
var map__43127__$1 = (((((!((map__43127 == null))))?(((((map__43127.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__43127.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__43127):map__43127);
var label = cljs.core.get.call(null,map__43127__$1,new cljs.core.Keyword(null,"label","label",1718410804));
var key = cljs.core.get.call(null,map__43127__$1,new cljs.core.Keyword(null,"key","key",-1516042587));
var init = cljs.core.get.call(null,map__43127__$1,new cljs.core.Keyword(null,"init","init",-1875481434));
var min = cljs.core.get.call(null,map__43127__$1,new cljs.core.Keyword(null,"min","min",444991522));
var max = cljs.core.get.call(null,map__43127__$1,new cljs.core.Keyword(null,"max","max",61366548));
return hoplon.core.tr.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),key], null),hoplon.core.td.call(null,label)),hoplon.core.td.call(null,weathergen.ui.common.slider.call(null,new cljs.core.Keyword(null,"min","min",444991522),min,new cljs.core.Keyword(null,"max","max",61366548),max,new cljs.core.Keyword(null,"ticks","ticks",-406190313),(5),new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [key], null)))),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (map__43127,map__43127__$1,label,key,init,min,max){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.assoc,key,init);
});})(map__43127,map__43127__$1,label,key,init,min,max))
,"Reset"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),cljs.core.keyword.call(null,["reset-",cljs.core.name.call(null,key)].join(''))], null))));
});
return hoplon.core.div.call(null,hoplon.core.table.call(null,slider_row.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),"Brightness:",new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Keyword(null,"brightness","brightness",1067055820),new cljs.core.Keyword(null,"init","init",-1875481434),0.5,new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"max","max",61366548),1.0], null)),slider_row.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),"Text size:",new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Keyword(null,"text-size","text-size",-945618309),new cljs.core.Keyword(null,"init","init",-1875481434),(0),new cljs.core.Keyword(null,"min","min",444991522),-1.0,new cljs.core.Keyword(null,"max","max",61366548),1.0], null)),slider_row.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),"Icon size:",new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Keyword(null,"icon-size","icon-size",414161352),new cljs.core.Keyword(null,"init","init",-1875481434),(0),new cljs.core.Keyword(null,"min","min",444991522),-1.0,new cljs.core.Keyword(null,"max","max",61366548),1.0], null))),hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (slider_row){
return (function (G__43129){
return new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124).cljs$core$IFn$_invoke$arity$1(G__43129);
});})(slider_row))
).call(null,weathergen.ui.map_display),new cljs.core.Keyword(null,"change","change",-1163046502),((function (slider_row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.update,new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124),cljs.core.not);
});})(slider_row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124)], null),hoplon.core.label.call(null,"Display text with contrasting background"))),hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (slider_row){
return (function (G__43130){
return new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003).cljs$core$IFn$_invoke$arity$1(G__43130);
});})(slider_row))
).call(null,weathergen.ui.map_display),new cljs.core.Keyword(null,"change","change",-1163046502),((function (slider_row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.update,new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003),cljs.core.not);
});})(slider_row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003)], null),hoplon.core.label.call(null,"Show bullseye"))));
})()),weathergen.ui.airbase_display_controls.call(null,"Airbase Display Options"),(function (){var flight_path_display_controls = new cljs.core.Keyword(null,"map-display-controls-fn","map-display-controls-fn",1472969543).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer);
return flight_path_display_controls.call(null,"Flight Path Display Options");
})());
});
/**
 * Given an SVG element, recursively turn all its image sources into data URLs.
 */
weathergen.ui.dataize_images_BANG_ = (function weathergen$ui$dataize_images_BANG_(elem){
if(cljs.core._EQ_.call(null,"image",elem.tagName)){
var href_43136 = elem.getAttributeNS("http://www.w3.org/1999/xlink","href");
var temp__5720__auto___43137 = (function (){var G__43131 = href_43136;
var G__43131__$1 = (((G__43131 == null))?null:weathergen.filesystem.file_buffer.call(null,G__43131));
if((G__43131__$1 == null)){
return null;
} else {
return G__43131__$1.toString("base64");
}
})();
if(cljs.core.truth_(temp__5720__auto___43137)){
var b64_43138 = temp__5720__auto___43137;
elem.setAttributeNS("http://www.w3.org/1999/xlink","href",["data:image/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.filesystem.extension.call(null,href_43136)),";base64,",cljs.core.str.cljs$core$IFn$_invoke$arity$1(b64_43138)].join(''));
} else {
}
} else {
}

var seq__43132_43139 = cljs.core.seq.call(null,cljs.core.array_seq.call(null,elem.childNodes));
var chunk__43133_43140 = null;
var count__43134_43141 = (0);
var i__43135_43142 = (0);
while(true){
if((i__43135_43142 < count__43134_43141)){
var child_43143 = cljs.core._nth.call(null,chunk__43133_43140,i__43135_43142);
weathergen.ui.dataize_images_BANG_.call(null,child_43143);


var G__43144 = seq__43132_43139;
var G__43145 = chunk__43133_43140;
var G__43146 = count__43134_43141;
var G__43147 = (i__43135_43142 + (1));
seq__43132_43139 = G__43144;
chunk__43133_43140 = G__43145;
count__43134_43141 = G__43146;
i__43135_43142 = G__43147;
continue;
} else {
var temp__5720__auto___43148 = cljs.core.seq.call(null,seq__43132_43139);
if(temp__5720__auto___43148){
var seq__43132_43149__$1 = temp__5720__auto___43148;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__43132_43149__$1)){
var c__4550__auto___43150 = cljs.core.chunk_first.call(null,seq__43132_43149__$1);
var G__43151 = cljs.core.chunk_rest.call(null,seq__43132_43149__$1);
var G__43152 = c__4550__auto___43150;
var G__43153 = cljs.core.count.call(null,c__4550__auto___43150);
var G__43154 = (0);
seq__43132_43139 = G__43151;
chunk__43133_43140 = G__43152;
count__43134_43141 = G__43153;
i__43135_43142 = G__43154;
continue;
} else {
var child_43155 = cljs.core.first.call(null,seq__43132_43149__$1);
weathergen.ui.dataize_images_BANG_.call(null,child_43155);


var G__43156 = cljs.core.next.call(null,seq__43132_43149__$1);
var G__43157 = null;
var G__43158 = (0);
var G__43159 = (0);
seq__43132_43139 = G__43156;
chunk__43133_43140 = G__43157;
count__43134_43141 = G__43158;
i__43135_43142 = G__43159;
continue;
}
} else {
}
}
break;
}

return elem;
});
/**
 * Given an SVG element `svg`, asynchronously return a blob (via
 *   callback `cb`) of PNG data with size `w` by `h`.
 */
weathergen.ui.svg_png_data = (function weathergen$ui$svg_png_data(svg,p__43160,cb){
var vec__43161 = p__43160;
var w = cljs.core.nth.call(null,vec__43161,(0),null);
var h = cljs.core.nth.call(null,vec__43161,(1),null);
var data = encodeURIComponent(weathergen.ui.dataize_images_BANG_.call(null,svg.cloneNode(true)).outerHTML);
var src = ["data:image/svg+xml;utf8,",cljs.core.str.cljs$core$IFn$_invoke$arity$1(data)].join('');
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
var img = (new Image());
canvas.width = w;

canvas.height = h;

img.onload = ((function (data,src,canvas,ctx,img,vec__43161,w,h){
return (function (){
ctx.drawImage(img,(0),(0),w,h);

return canvas.toBlob(cb);
});})(data,src,canvas,ctx,img,vec__43161,w,h))
;

return img.src = src;
});
/**
 * UI for saving the map as a PNG.
 */
weathergen.ui.map_image_save_controls = (function weathergen$ui$map_image_save_controls(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"save-image","save-image",-2127892773)], null),"Save Map Image"),(function (){var size = javelin.core.cell.call(null,new cljs.core.Keyword(null,"medium","medium",-1864319384));
var custom_size = javelin.core.cell.call(null,(1000));
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,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(3))], null),weathergen.ui.common.radio_group.call(null,new cljs.core.Keyword(null,"value","value",305978217),size,new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"small","small",2133478704),new cljs.core.Keyword(null,"label","label",1718410804),"Small (250x250)"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"medium","medium",-1864319384),new cljs.core.Keyword(null,"label","label",1718410804),"Medium (500x500)"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"large","large",-196820544),new cljs.core.Keyword(null,"label","label",1718410804),"Large (1000x1000)"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"x-large","x-large",-671747671),new cljs.core.Keyword(null,"label","label",1718410804),"Very Large (2000x2000)"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"xx-large","xx-large",-1819762011),new cljs.core.Keyword(null,"label","label",1718410804),"Extremely Large (4000x4000)"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"custom","custom",340151948),new cljs.core.Keyword(null,"label","label",1718410804),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block"], null),"Custom: ",weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block"], null),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.conform_positive_integer,new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"source","source",-433931539),custom_size,new cljs.core.Keyword(null,"width","width",-384071477),(50),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"Size in pixels"),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(7))], null),"x",javelin.core.formula.call(null,((function (size,custom_size){
return (function (G__43164){
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__43164);
});})(size,custom_size))
).call(null,custom_size)))], null)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (size,custom_size){
return (function (){
var dim = cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"small","small",2133478704),(250),new cljs.core.Keyword(null,"medium","medium",-1864319384),(500),new cljs.core.Keyword(null,"large","large",-196820544),(1000),new cljs.core.Keyword(null,"x-large","x-large",-671747671),(2000),new cljs.core.Keyword(null,"xx-large","xx-large",-1819762011),(4000),new cljs.core.Keyword(null,"custom","custom",340151948),cljs.core.deref.call(null,custom_size)], null),cljs.core.deref.call(null,size));
return weathergen.ui.svg_png_data.call(null,document.getElementById("grid"),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dim,dim], null),((function (dim,size,custom_size){
return (function (data){
return weathergen.ui.common.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"title","title",636505583),"Save Map Image",new cljs.core.Keyword(null,"data","data",-232669377),data,new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"PNG Image",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [".png"], null)], null)], null),new cljs.core.Keyword(null,"default-path","default-path",-1046856029),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)))),"-map.png"].join('')], null));
});})(dim,size,custom_size))
);
});})(size,custom_size))
,"Save Map as PNG Image"));
})());
});
weathergen.ui.damage_computer_section = (function weathergen$ui$damage_computer_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tools","tools",-1241731990),new cljs.core.Keyword(null,"damage-computer","damage-computer",-125971244)], null),"Damage computer"),(function (){var selected_objective = javelin.core.cell.call(null,null);
var selected_weapon = javelin.core.cell.call(null,null);
var selection_mode = javelin.core.cell.call(null,new cljs.core.Keyword(null,"by-weapon","by-weapon",243500844));
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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null),weathergen.ui.common.inl.call(null,weathergen.ui.common.inl.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null)], null),"Objective:"),weathergen.ui.common.inl.call(null,weathergen.ui.select.select3.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(150),new cljs.core.Keyword(null,"data","data",-232669377),javelin.core.formula.call(null,((function (selected_objective,selected_weapon,selection_mode){
return (function (mission){
return cljs.core.sort_by.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975),new cljs.core.Keyword("weathergen.falcon.files.mission","objectives","weathergen.falcon.files.mission/objectives",410009507).cljs$core$IFn$_invoke$arity$1(mission));
});})(selected_objective,selected_weapon,selection_mode))
).call(null,weathergen.ui.mission),new cljs.core.Keyword(null,"value","value",305978217),selected_objective,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"Select an objective",new cljs.core.Keyword(null,"key-fn","key-fn",-636154479),new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"search-fn","search-fn",-646637945),new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975),new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (selected_objective,selected_weapon,selection_mode){
return (function (objective){
return hoplon.core.div.call(null,javelin.core.formula.call(null,((function (selected_objective,selected_weapon,selection_mode){
return (function (G__43165){
return new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975).cljs$core$IFn$_invoke$arity$1(G__43165);
});})(selected_objective,selected_weapon,selection_mode))
).call(null,objective));
});})(selected_objective,selected_weapon,selection_mode))
))),weathergen.ui.common.inl.call(null,weathergen.ui.common.inl.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(7)),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null)], null),"Weapon:"),weathergen.ui.common.inl.call(null,weathergen.ui.select.select3.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(150),new cljs.core.Keyword(null,"data","data",-232669377),javelin.core.formula.call(null,((function (selected_objective,selected_weapon,selection_mode){
return (function (mission){
return cljs.core.sort_by.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975),cljs.core.filter.call(null,((function (selected_objective,selected_weapon,selection_mode){
return (function (weapon){
var swd = new cljs.core.Keyword("weathergen.falcon.files.mission","sim-weapon-data","weathergen.falcon.files.mission/sim-weapon-data",-1214423648).cljs$core$IFn$_invoke$arity$1(weapon);
var class$ = new cljs.core.Keyword(null,"sms-weapon-class","sms-weapon-class",-1204089300).cljs$core$IFn$_invoke$arity$1(swd);
var domain = new cljs.core.Keyword(null,"sms-weapon-domain","sms-weapon-domain",170252511).cljs$core$IFn$_invoke$arity$1(swd);
return (!(((weathergen.falcon.constants.wdGround & domain) === (0))));
});})(selected_objective,selected_weapon,selection_mode))
,new cljs.core.Keyword("weathergen.falcon.files.mission","weapons","weathergen.falcon.files.mission/weapons",-176268464).cljs$core$IFn$_invoke$arity$1(mission)));
});})(selected_objective,selected_weapon,selection_mode))
).call(null,weathergen.ui.mission),new cljs.core.Keyword(null,"key-fn","key-fn",-636154479),new cljs.core.Keyword(null,"index","index",-1531685915),new cljs.core.Keyword(null,"value","value",305978217),selected_weapon,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"Select a weapon",new cljs.core.Keyword(null,"search-fn","search-fn",-646637945),new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975),new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (selected_objective,selected_weapon,selection_mode){
return (function (weapon){
return hoplon.core.div.call(null,javelin.core.formula.call(null,((function (selected_objective,selected_weapon,selection_mode){
return (function (G__43166){
return new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975).cljs$core$IFn$_invoke$arity$1(G__43166);
});})(selected_objective,selected_weapon,selection_mode))
).call(null,weapon));
});})(selected_objective,selected_weapon,selection_mode))
))),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (selected_objective,selected_weapon,selection_mode){
return (function (){
return hoplon.core.div.call(null,hoplon.core.div.call(null,weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5))], null),"Damage Type:"),weathergen.ui.common.inl.call(null,javelin.core.formula.call(null,((function (selected_objective,selected_weapon,selection_mode){
return (function (selected_weapon__$1){
return cljs.core.get.call(null,cljs.core.PersistentHashMap.fromArrays([weathergen.falcon.constants.ChemicalDam,weathergen.falcon.constants.OtherDam,weathergen.falcon.constants.NoDamage,weathergen.falcon.constants.HeaveDam,weathergen.falcon.constants.PenetrationDam,weathergen.falcon.constants.IncendairyDam,weathergen.falcon.constants.KineticDam,weathergen.falcon.constants.HighExplosiveDam,weathergen.falcon.constants.ProximityDam,weathergen.falcon.constants.NuclearDam,weathergen.falcon.constants.HydrostaticDam],["Chemical","Other","None","Heave","Penetration","Incendiary","Kinetic","HE","Proximity","Nuclear","Hydrostatic"]),new cljs.core.Keyword(null,"damage-type","damage-type",898770578).cljs$core$IFn$_invoke$arity$1(selected_weapon__$1),"Unknown");
});})(selected_objective,selected_weapon,selection_mode))
).call(null,selected_weapon))));
});})(selected_objective,selected_weapon,selection_mode))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,selected_objective,selected_weapon,selection_mode){
return (function (){
return null;
});})(con__30287__auto__,selected_objective,selected_weapon,selection_mode))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,selected_objective,selected_weapon,selection_mode){
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__,selected_objective,selected_weapon,selection_mode))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,selected_weapon);
})(),(function (){var hit_data = javelin.core.formula.call(null,((function (selected_objective,selected_weapon,selection_mode){
return (function (mission,selected_objective__$1,selected_weapon__$1){
if(cljs.core.truth_((function (){var and__4120__auto__ = selected_objective__$1;
if(cljs.core.truth_(and__4120__auto__)){
return selected_weapon__$1;
} else {
return and__4120__auto__;
}
})())){
return weathergen.damage.required_hits.call(null,mission,selected_objective__$1,selected_weapon__$1);
} else {
return null;
}
});})(selected_objective,selected_weapon,selection_mode))
).call(null,weathergen.ui.mission,selected_objective,selected_weapon);
var col = ((function (hit_data,selected_objective,selected_weapon,selection_mode){
return (function (title,key){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),title,new cljs.core.Keyword(null,"sort-key","sort-key",1285844623),key,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (hit_data,selected_objective,selected_weapon,selection_mode){
return (function (item,___$1){
return javelin.core.formula.call(null,((function (hit_data,selected_objective,selected_weapon,selection_mode){
return (function (G__43167,G__43169,G__43168){
return G__43167.call(null,G__43168,G__43169);
});})(hit_data,selected_objective,selected_weapon,selection_mode))
).call(null,cljs.core.get,key,item);
});})(hit_data,selected_objective,selected_weapon,selection_mode))
], null);
});})(hit_data,selected_objective,selected_weapon,selection_mode))
;
var con__30287__auto__ = (new cljs.core.Delay(((function (hit_data,col,selected_objective,selected_weapon,selection_mode){
return (function (){
return weathergen.ui.grids.table_grid.call(null,new cljs.core.Keyword(null,"data","data",-232669377),hit_data,new cljs.core.Keyword(null,"initial-sort","initial-sort",1434529715),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"feature-value","feature-value",-369211338),new cljs.core.Keyword(null,"descending","descending",-24766135)], null),new cljs.core.Keyword(null,"key-fn","key-fn",-636154479),cljs.core.identity,new cljs.core.Keyword(null,"row-attrs","row-attrs",2139633863),((function (hit_data,col,selected_objective,selected_weapon,selection_mode){
return (function (___$1){
return cljs.core.PersistentArrayMap.EMPTY;
});})(hit_data,col,selected_objective,selected_weapon,selection_mode))
,new cljs.core.Keyword(null,"when-empty","when-empty",-1825107890),"No results available",new cljs.core.Keyword(null,"fixed-columns","fixed-columns",-1793374858),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"movable-columns","movable-columns",-1079893862),javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"index","index",-1531685915),new cljs.core.Keyword(null,"feature-name","feature-name",676033148),new cljs.core.Keyword(null,"feature-value","feature-value",-369211338),new cljs.core.Keyword(null,"hits-required","hits-required",-766872875)], null)),new cljs.core.Keyword(null,"hidden-columns","hidden-columns",-1045524800),javelin.core.cell.call(null,cljs.core.PersistentHashSet.EMPTY),new cljs.core.Keyword(null,"columns","columns",1998437288),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"index","index",-1531685915),col.call(null,"#",new cljs.core.Keyword(null,"index","index",-1531685915)),new cljs.core.Keyword(null,"feature-name","feature-name",676033148),col.call(null,"Name",new cljs.core.Keyword(null,"feature-name","feature-name",676033148)),new cljs.core.Keyword(null,"feature-value","feature-value",-369211338),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Value",new cljs.core.Keyword(null,"sort-key","sort-key",1285844623),((function (hit_data,col,selected_objective,selected_weapon,selection_mode){
return (function (item){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"feature-value","feature-value",-369211338).cljs$core$IFn$_invoke$arity$1(item),(- new cljs.core.Keyword(null,"index","index",-1531685915).cljs$core$IFn$_invoke$arity$1(item))], null);
});})(hit_data,col,selected_objective,selected_weapon,selection_mode))
,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (hit_data,col,selected_objective,selected_weapon,selection_mode){
return (function (item,___$1){
return javelin.core.formula.call(null,((function (hit_data,col,selected_objective,selected_weapon,selection_mode){
return (function (item__$1,___$2){
var value = new cljs.core.Keyword(null,"feature-value","feature-value",-369211338).cljs$core$IFn$_invoke$arity$1(item__$1);
if((value === (0))){
return "";
} else {
var pred__43170 = cljs.core._GT_;
var expr__43171 = value;
if(cljs.core.truth_(pred__43170.call(null,(10),expr__43171))){
return "Very Low";
} else {
if(cljs.core.truth_(pred__43170.call(null,(25),expr__43171))){
return "Low";
} else {
if(cljs.core.truth_(pred__43170.call(null,(40),expr__43171))){
return "Medium";
} else {
if(cljs.core.truth_(pred__43170.call(null,(50),expr__43171))){
return "High";
} else {
return "Very High";
}
}
}
}
}
});})(hit_data,col,selected_objective,selected_weapon,selection_mode))
).call(null,item,___$1);
});})(hit_data,col,selected_objective,selected_weapon,selection_mode))
], null),new cljs.core.Keyword(null,"hits-required","hits-required",-766872875),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Hits Required",new cljs.core.Keyword(null,"sort-key","sort-key",1285844623),new cljs.core.Keyword(null,"hits-required","hits-required",-766872875),new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (hit_data,col,selected_objective,selected_weapon,selection_mode){
return (function (item,___$1){
return javelin.core.formula.call(null,((function (hit_data,col,selected_objective,selected_weapon,selection_mode){
return (function (item__$1){
var req = new cljs.core.Keyword(null,"hits-required","hits-required",-766872875).cljs$core$IFn$_invoke$arity$1(item__$1);
if((req == null)){
return "";
} else {
if(cljs.core.truth_(isNaN(req))){
return "";
} else {
if(cljs.core.not.call(null,isFinite(req))){
return "\u221E";
} else {
var fuzz = 0.25;
var lower = Math.ceil((function (){var x__4219__auto__ = (1);
var y__4220__auto__ = (req * (1.0 - fuzz));
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})());
var upper = Math.ceil((function (){var x__4219__auto__ = (1);
var y__4220__auto__ = (req * (1.0 + fuzz));
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})());
if(cljs.core._EQ_.call(null,lower,upper)){
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(lower);
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(lower),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(upper)].join('');
}

}
}
}
});})(hit_data,col,selected_objective,selected_weapon,selection_mode))
).call(null,item);
});})(hit_data,col,selected_objective,selected_weapon,selection_mode))
], null)], null));
});})(hit_data,col,selected_objective,selected_weapon,selection_mode))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,hit_data,col,selected_objective,selected_weapon,selection_mode){
return (function (){
return null;
});})(con__30287__auto__,hit_data,col,selected_objective,selected_weapon,selection_mode))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,hit_data,col,selected_objective,selected_weapon,selection_mode){
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__,hit_data,col,selected_objective,selected_weapon,selection_mode))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,hit_data);
})());
})());
});
/**
 * Given a key like comes back from `csv-ize`, turn it into something a
 *   little less Clojure-centric.
 */
weathergen.ui.make_friendly_export_key = (function weathergen$ui$make_friendly_export_key(k){
if(typeof k === 'string'){
return k;
} else {
if(cljs.core.vector_QMARK_.call(null,k)){
return cljs.core.apply.call(null,cljs.core.str,cljs.core.interpose.call(null,".",cljs.core.mapv.call(null,weathergen.ui.make_friendly_export_key,k)));
} else {
if((k instanceof cljs.core.Keyword)){
var ns = cljs.core.namespace.call(null,k);
return [((cljs.core._EQ_.call(null,ns,cljs.core.namespace.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","foo","weathergen.falcon.files.mission/foo",-1344451130))))?"vmt":ns),(cljs.core.truth_(ns)?"/":null),cljs.core.name.call(null,k)].join('');
} else {
return null;
}
}
}
});
weathergen.ui.export_database = (function weathergen$ui$export_database(mission){
var basename = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"theater","theater",258922071).cljs$core$IFn$_invoke$arity$1(mission))),"-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(mission))].join('');
var temp__5720__auto__ = weathergen.ui.common.get_path_for_load.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"title","title",636505583),"Select directory for export",new cljs.core.Keyword(null,"mode","mode",654403691),new cljs.core.Keyword(null,"directory","directory",-58912409)], null));
if(cljs.core.truth_(temp__5720__auto__)){
var dir = temp__5720__auto__;
var seq__43173 = cljs.core.seq.call(null,new cljs.core.PersistentVector(null, 18, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"campaign-info","campaign-info",1158908966),new cljs.core.Keyword(null,"map","map",1371690461)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"class-table","class-table",207400992),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"events","events",1792552201),new cljs.core.Keyword(null,"not-yet-implemented","not-yet-implemented",354832030)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"feature-class-data","feature-class-data",-794349644),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"feature-entry-data","feature-entry-data",-87481893),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"objective-class-data","objective-class-data",-2036255156),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"objective-deltas","objective-deltas",710518611),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"objectives","objectives",933939509),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"persistent-objects","persistent-objects",137656263),new cljs.core.Keyword(null,"not-yet-implemented","not-yet-implemented",354832030)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pilots","pilots",353525853),new cljs.core.Keyword(null,"not-yet-implemented","not-yet-implemented",354832030)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"point-header-data","point-header-data",2108405911),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ppt-data","ppt-data",-1749164693),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"primary-objectives","primary-objectives",-2010039039),new cljs.core.Keyword(null,"not-yet-implemented","not-yet-implemented",354832030)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"teams","teams",1677714510),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"unit-class-data","unit-class-data",2122324209),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"units","units",-533089095),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"vehicle-class-data","vehicle-class-data",1666024339),new cljs.core.Keyword(null,"vector","vector",1902966158)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weapon-class-data","weapon-class-data",-1828241433),new cljs.core.Keyword(null,"vector","vector",1902966158)], null)], null));
var chunk__43174 = null;
var count__43175 = (0);
var i__43176 = (0);
while(true){
if((i__43176 < count__43175)){
var vec__43189 = cljs.core._nth.call(null,chunk__43174,i__43176);
var k = cljs.core.nth.call(null,vec__43189,(0),null);
var type = cljs.core.nth.call(null,vec__43189,(1),null);
var raw_43201 = cljs.core.get.call(null,mission,k);
var data_43202 = (function (){var pred__43192 = cljs.core._EQ_;
var expr__43193 = type;
if(cljs.core.truth_(pred__43192.call(null,new cljs.core.Keyword(null,"map","map",1371690461),expr__43193))){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [raw_43201], null);
} else {
if(cljs.core.truth_(pred__43192.call(null,new cljs.core.Keyword(null,"vector","vector",1902966158),expr__43193))){
return raw_43201;
} else {
if(cljs.core.truth_(pred__43192.call(null,new cljs.core.Keyword(null,"not-yet-implemented","not-yet-implemented",354832030),expr__43193))){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"todo","todo",-1046442570),"Not yet implemented"], null)], null);
} else {
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__43193)].join('')));
}
}
}
})();
weathergen.filesystem.save_data.call(null,weathergen.filesystem.path_combine.call(null,dir,[basename,"-",cljs.core.name.call(null,k),".csv"].join('')),weathergen.util.csv_ize.call(null,data_43202,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key-remap","key-remap",-767728308),weathergen.ui.make_friendly_export_key], null)));


var G__43203 = seq__43173;
var G__43204 = chunk__43174;
var G__43205 = count__43175;
var G__43206 = (i__43176 + (1));
seq__43173 = G__43203;
chunk__43174 = G__43204;
count__43175 = G__43205;
i__43176 = G__43206;
continue;
} else {
var temp__5720__auto____$1 = cljs.core.seq.call(null,seq__43173);
if(temp__5720__auto____$1){
var seq__43173__$1 = temp__5720__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__43173__$1)){
var c__4550__auto__ = cljs.core.chunk_first.call(null,seq__43173__$1);
var G__43207 = cljs.core.chunk_rest.call(null,seq__43173__$1);
var G__43208 = c__4550__auto__;
var G__43209 = cljs.core.count.call(null,c__4550__auto__);
var G__43210 = (0);
seq__43173 = G__43207;
chunk__43174 = G__43208;
count__43175 = G__43209;
i__43176 = G__43210;
continue;
} else {
var vec__43195 = cljs.core.first.call(null,seq__43173__$1);
var k = cljs.core.nth.call(null,vec__43195,(0),null);
var type = cljs.core.nth.call(null,vec__43195,(1),null);
var raw_43211 = cljs.core.get.call(null,mission,k);
var data_43212 = (function (){var pred__43198 = cljs.core._EQ_;
var expr__43199 = type;
if(cljs.core.truth_(pred__43198.call(null,new cljs.core.Keyword(null,"map","map",1371690461),expr__43199))){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [raw_43211], null);
} else {
if(cljs.core.truth_(pred__43198.call(null,new cljs.core.Keyword(null,"vector","vector",1902966158),expr__43199))){
return raw_43211;
} else {
if(cljs.core.truth_(pred__43198.call(null,new cljs.core.Keyword(null,"not-yet-implemented","not-yet-implemented",354832030),expr__43199))){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"todo","todo",-1046442570),"Not yet implemented"], null)], null);
} else {
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__43199)].join('')));
}
}
}
})();
weathergen.filesystem.save_data.call(null,weathergen.filesystem.path_combine.call(null,dir,[basename,"-",cljs.core.name.call(null,k),".csv"].join('')),weathergen.util.csv_ize.call(null,data_43212,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"key-remap","key-remap",-767728308),weathergen.ui.make_friendly_export_key], null)));


var G__43213 = cljs.core.next.call(null,seq__43173__$1);
var G__43214 = null;
var G__43215 = (0);
var G__43216 = (0);
seq__43173 = G__43213;
chunk__43174 = G__43214;
count__43175 = G__43215;
i__43176 = G__43216;
continue;
}
} else {
return null;
}
}
break;
}
} else {
return null;
}
});
weathergen.ui.database_export_section = (function weathergen$ui$database_export_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tools","tools",-1241731990),new cljs.core.Keyword(null,"database-export","database-export",729454487)], null),"Mission Database Export"),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","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return weathergen.ui.export_database.call(null,cljs.core.deref.call(null,weathergen.ui.mission));
}),"Export")));
});
var BrowserWindow_43219 = weathergen.ui.electron.remote.BrowserWindow;
weathergen.ui.hidden_tools_tab = ((function (BrowserWindow_43219){
return (function weathergen$ui$hidden_tools_tab(){
return hoplon.core.div.call(null,(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (BrowserWindow_43219){
return (function (){
return weathergen.ui.database_export_section.call(null,cljs.core.PersistentArrayMap.EMPTY);
});})(BrowserWindow_43219))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,BrowserWindow_43219){
return (function (){
return null;
});})(con__30287__auto__,BrowserWindow_43219))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,BrowserWindow_43219){
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__,BrowserWindow_43219))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,BrowserWindow_43219){
return (function (G__43217,G__43218){
return G__43217.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166),G__43218);
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,BrowserWindow_43219))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})(),weathergen.ui.damage_computer_section.call(null,cljs.core.PersistentArrayMap.EMPTY),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (BrowserWindow_43219){
return (function (_){
return BrowserWindow_43219.getFocusedWindow().webContents.openDevTools();
});})(BrowserWindow_43219))
,"Open Debug Console"));
});})(BrowserWindow_43219))
;
weathergen.ui.head = (function weathergen$ui$head(){
return hoplon.core.head.call(null,hoplon.core.title.call(null,javelin.core.formula.call(null,(function (mission,display_mode){
if(cljs.core.not.call(null,mission)){
return "Virtual Mission Tools";
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.falcon.files.mission.theaterdef_name.call(null,mission))," - ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(mission)),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"briefing","briefing",-176308969),display_mode))?".vmtb":null)].join('');
}
})).call(null,weathergen.ui.mission,weathergen.ui.display_mode)),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"lib/jquery-minicolors/jquery.minicolors.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"title","title",636505583),"main",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.script.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"lib/jquery-minicolors/jquery.minicolors.min.js",new cljs.core.Keyword(null,"type","type",1174270348),"text/javascript"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"lib/bgrins-spectrum-98454b5/spectrum.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.script.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"lib/bgrins-spectrum-98454b5/spectrum.js",new cljs.core.Keyword(null,"type","type",1174270348),"text/javascript"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"select2.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"style.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"title","title",636505583),"main",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"fonts/open-sans-condensed/open-sans-condensed.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"fonts/share-tech-mono/share-tech-mono.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"fonts/source-code-pro/source-code-pro.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.style.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text/css",garden.core.css.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"fieldset","fieldset",-1949770816),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"10px"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [garden.selectors.input.call(null,garden.selectors.attr_EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"range","range",1639692286))),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px"], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,".info-grid",".info-grid",1372988462),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"border-collapse","border-collapse",919100239),"collapse",new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"thead","thead",-291875296),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"background","background",-863952629),"lightgray",new cljs.core.Keyword(null,"border-bottom","border-bottom",2110948415),"1px solid black"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tr","tr",-1424774646),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [garden.selectors._AMPERSAND_.call(null,garden.selectors.nth_child.call(null,new cljs.core.Keyword(null,"even","even",-275845692))),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background","background",-863952629),"#F2F0E0"], null)], null)], null)], null))));
});
weathergen.ui.message_display = (function weathergen$ui$message_display(){
return javelin.core.formula.call(null,(function (messages){
var iter__4523__auto__ = (function weathergen$ui$message_display_$_iter__43220(s__43221){
return (new cljs.core.LazySeq(null,(function (){
var s__43221__$1 = s__43221;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__43221__$1);
if(temp__5720__auto__){
var s__43221__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__43221__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__43221__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__43223 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__43222 = (0);
while(true){
if((i__43222 < size__4522__auto__)){
var message = cljs.core._nth.call(null,c__4521__auto__,i__43222);
cljs.core.chunk_append.call(null,b__43223,(function (){var visible_QMARK_ = javelin.core.cell.call(null,true);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"fade-toggle","fade-toggle",-1468421852),visible_QMARK_,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"border","border",1444987323),"double",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black",new cljs.core.Keyword(null,"background","background",-863952629),"#945594",new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(0),(3))], null),weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"#ebff00"], null)], null),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),weathergen.ui.common.px.call(null,(10))], null),message),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"color","color",1011675173),"#ff6b6b",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(150)),new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"top","top",-1856271961),weathergen.ui.common.px.call(null,(-8)),new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (i__43222,visible_QMARK_,message,c__4521__auto__,size__4522__auto__,b__43223,s__43221__$2,temp__5720__auto__){
return (function (){
return cljs.core.reset_BANG_.call(null,visible_QMARK_,false);
});})(i__43222,visible_QMARK_,message,c__4521__auto__,size__4522__auto__,b__43223,s__43221__$2,temp__5720__auto__))
,"\u00D7"));
})());

var G__43224 = (i__43222 + (1));
i__43222 = G__43224;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43223),weathergen$ui$message_display_$_iter__43220.call(null,cljs.core.chunk_rest.call(null,s__43221__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43223),null);
}
} else {
var message = cljs.core.first.call(null,s__43221__$2);
return cljs.core.cons.call(null,(function (){var visible_QMARK_ = javelin.core.cell.call(null,true);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"fade-toggle","fade-toggle",-1468421852),visible_QMARK_,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"border","border",1444987323),"double",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black",new cljs.core.Keyword(null,"background","background",-863952629),"#945594",new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(0),(3))], null),weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"#ebff00"], null)], null),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),weathergen.ui.common.px.call(null,(10))], null),message),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"color","color",1011675173),"#ff6b6b",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(150)),new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"top","top",-1856271961),weathergen.ui.common.px.call(null,(-8)),new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (visible_QMARK_,message,s__43221__$2,temp__5720__auto__){
return (function (){
return cljs.core.reset_BANG_.call(null,visible_QMARK_,false);
});})(visible_QMARK_,message,s__43221__$2,temp__5720__auto__))
,"\u00D7"));
})(),weathergen$ui$message_display_$_iter__43220.call(null,cljs.core.rest.call(null,s__43221__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,messages);
})).call(null,weathergen.ui.messages);
});
/**
 * Returns UI that renders the titlebar.
 */
weathergen.ui.titlebar = (function weathergen$ui$titlebar(){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"titlebar",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,(function (titlebar_fullsize_QMARK_){
return new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"background","background",-863952629),"black",new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(4),(13)),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(2)),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(cljs.core.truth_(titlebar_fullsize_QMARK_)?(64):(27))),new cljs.core.Keyword(null,"position","position",-2011731912),"relative"], null);
})).call(null,weathergen.ui.titlebar_fullsize_QMARK_),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"titlebar-contents",hoplon.core.a.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"left","left",-399115937),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"top","top",-1856271961),weathergen.ui.common.px.call(null,(-5))], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.titlebar_fullsize_QMARK_,cljs.core.not);
}),weathergen.ui.common.css_triangle.call(null,new cljs.core.Keyword(null,"rotation","rotation",-1728051644),javelin.core.formula.call(null,(function (G__43225){
if(cljs.core.truth_(G__43225)){
return (0);
} else {
return (-90);
}
})).call(null,weathergen.ui.titlebar_fullsize_QMARK_),new cljs.core.Keyword(null,"size","size",1098693007),(6),new cljs.core.Keyword(null,"color","color",1011675173),"#888")),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"left-words",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,(function (titlebar_fullsize_QMARK_){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),(cljs.core.truth_(titlebar_fullsize_QMARK_)?weathergen.ui.common.px.call(null,(14)):null),new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),(cljs.core.truth_(titlebar_fullsize_QMARK_)?null:weathergen.ui.common.px.call(null,(7)))], null);
})).call(null,weathergen.ui.titlebar_fullsize_QMARK_),hoplon.core.span.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"title",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,(function (titlebar_fullsize_QMARK_){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),weathergen.ui.common.px.call(null,(16)),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(cljs.core.truth_(titlebar_fullsize_QMARK_)?(200):(125)))], null);
})).call(null,weathergen.ui.titlebar_fullsize_QMARK_),"Virtual Mission Tools"),hoplon.core.span.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"version",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),weathergen.ui.common.px.call(null,(10))], null),(function (){var map__43226 = weathergen.ui.build_info;
var map__43226__$1 = (((((!((map__43226 == null))))?(((((map__43226.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__43226.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__43226):map__43226);
var VERSION = cljs.core.get.call(null,map__43226__$1,"VERSION");
var CHANNEL = cljs.core.get.call(null,map__43226__$1,"CHANNEL");
return ["(",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4131__auto__ = VERSION;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "dev-build";
}
})()),(cljs.core.truth_((function (){var and__4120__auto__ = CHANNEL;
if(cljs.core.truth_(and__4120__auto__)){
return cljs.core.not_EQ_.call(null,CHANNEL,"stable");
} else {
return and__4120__auto__;
}
})())?["@",cljs.core.str.cljs$core$IFn$_invoke$arity$1(CHANNEL)].join(''):null),")"].join('');
})()),hoplon.core.span.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"byline",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),weathergen.ui.common.px.call(null,(5))], null),"by",weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block"], null),new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),weathergen.ui.common.px.call(null,(5))], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:link","a:link",-504615780),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"white"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:visited","a:visited",-737262631),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"white"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:hover","a:hover",-1474674872),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"lightblue"], null)], null)], null),weathergen.ui.common.external_link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"http://www.440thvfw.com/memberlist.php?mode=viewprofile&u=52","Tyrant")))),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"right-words",weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"helpstring",new cljs.core.Keyword(null,"garden","garden",-1966516149),javelin.core.formula.call(null,(function (titlebar_fullsize_QMARK_){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(cljs.core.truth_(titlebar_fullsize_QMARK_)?(100):(54))),new cljs.core.Keyword(null,"bottom","bottom",-1550509018),weathergen.ui.common.px.call(null,(7))], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.ems.call(null,0.2)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:visited","a:visited",-737262631),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"white"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:hover","a:hover",-1474674872),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"lightblue"], null)], null)], null);
})).call(null,weathergen.ui.titlebar_fullsize_QMARK_),hoplon.core.span.call(null,"Help? Bug? Feature request? Click",weathergen.ui.common.external_link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"https://www.bmsforum.org/forum/showthread.php?31611-Release-Tyrant-s-Virtual-Mission-Tools-(VMT)&p=441129#post441129","here"),".")),weathergen.ui.common.external_link.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(20)),new cljs.core.Keyword(null,"top","top",-1856271961),weathergen.ui.common.px.call(null,(7))], null),new cljs.core.Keyword(null,"href","href",-793805698),"http://www.440thvfw.com",hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,(function (titlebar_fullsize_QMARK_){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(cljs.core.truth_(titlebar_fullsize_QMARK_)?(64):(24)))], null);
})).call(null,weathergen.ui.titlebar_fullsize_QMARK_),new cljs.core.Keyword(null,"title","title",636505583),"440th Virtual Fighter Wing",new cljs.core.Keyword(null,"src","src",-1651076051),"images/440th-logo-64.png")))));
});
/**
 * Return controls for a layer.
 */
weathergen.ui.layer_controls = (function weathergen$ui$layer_controls(var_args){
var args__4736__auto__ = [];
var len__4730__auto___43230 = arguments.length;
var i__4731__auto___43231 = (0);
while(true){
if((i__4731__auto___43231 < len__4730__auto___43230)){
args__4736__auto__.push((arguments[i__4731__auto___43231]));

var G__43232 = (i__4731__auto___43231 + (1));
i__4731__auto___43231 = G__43232;
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.layer_controls.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4737__auto__);
});

weathergen.ui.layer_controls.cljs$core$IFn$_invoke$arity$variadic = (function (layer,args){
var ctor = new cljs.core.Keyword(null,"controls-fn","controls-fn",-807620277).cljs$core$IFn$_invoke$arity$1(layer);
return cljs.core.apply.call(null,ctor,args);
});

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

/** @this {Function} */
weathergen.ui.layer_controls.cljs$lang$applyTo = (function (seq43228){
var G__43229 = cljs.core.first.call(null,seq43228);
var seq43228__$1 = cljs.core.next.call(null,seq43228);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__43229,seq43228__$1);
});

weathergen.ui.section_ctor = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"mission-info-section","mission-info-section",1401749344),new cljs.core.Keyword(null,"weather-source-controls","weather-source-controls",-1615133854),new cljs.core.Keyword(null,"map-image-save-controls","map-image-save-controls",-702527229),new cljs.core.Keyword(null,"weather-override-parameters","weather-override-parameters",491414981),new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221),new cljs.core.Keyword(null,"forecast-section","forecast-section",-1278731643),new cljs.core.Keyword(null,"air-forces-section","air-forces-section",-222064121),new cljs.core.Keyword(null,"briefing-notes-section","briefing-notes-section",1870993417),new cljs.core.Keyword(null,"annotation-controls","annotation-controls",-1755737750),new cljs.core.Keyword(null,"atmosphere-controls","atmosphere-controls",-1058305013),new cljs.core.Keyword(null,"advanced-controls","advanced-controls",-278238996),new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"acmi-controls","acmi-controls",287056051),new cljs.core.Keyword(null,"weather-parameters","weather-parameters",-1852076459),new cljs.core.Keyword(null,"save-briefing-section","save-briefing-section",143974425),new cljs.core.Keyword(null,"oob-section","oob-section",1786899258),new cljs.core.Keyword(null,"map-controls-section","map-controls-section",684229466),new cljs.core.Keyword(null,"test-section","test-section",-945916038),new cljs.core.Keyword(null,"weather-type-configuration","weather-type-configuration",-358032997),new cljs.core.Keyword(null,"step-controls","step-controls",-854420677),new cljs.core.Keyword(null,"flights-section","flights-section",1247077532)],[weathergen.ui.mission_info_section,weathergen.ui.weather_source_controls,weathergen.ui.map_image_save_controls,weathergen.ui.weather_override_parameters,weathergen.ui.weather_display_controls,weathergen.ui.forecast_section,weathergen.ui.air_forces_section,weathergen.ui.briefing_notes_section,(function (opts){
return weathergen.ui.layer_controls.call(null,weathergen.ui.annotations_layer);
}),weathergen.ui.atmosphere_controls,weathergen.ui.advanced_controls,weathergen.ui.serialization_controls,(function (opts){
return weathergen.ui.layer_controls.call(null,weathergen.ui.acmi_layer);
}),weathergen.ui.weather_parameters,weathergen.ui.save_briefing_section,weathergen.ui.order_of_battle_section,weathergen.ui.map_controls_section,weathergen.ui.test_section,weathergen.ui.weather_type_configuration,weathergen.ui.step_controls,(function (opts){
return weathergen.ui.layer_controls.call(null,weathergen.ui.flight_paths_layer,new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120).cljs$core$IFn$_invoke$arity$1(opts));
})]);
if((typeof weathergen !== 'undefined') && (typeof weathergen.ui !== 'undefined') && (typeof weathergen.ui.tab_formatter !== 'undefined')){
} else {
weathergen.ui.tab_formatter = (function (){var method_table__4613__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4614__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4615__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4616__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4617__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"weathergen.ui","tab-formatter"),((function (method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__){
return (function (item,id,opts){
return cljs.core.first.call(null,id);
});})(method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__4617__auto__,method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__));
})();
}
if((typeof weathergen !== 'undefined') && (typeof weathergen.ui !== 'undefined') && (typeof weathergen.ui.title_formatter !== 'undefined')){
} else {
weathergen.ui.title_formatter = (function (){var method_table__4613__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4614__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4615__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4616__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4617__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"weathergen.ui","title-formatter"),((function (method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__){
return (function (item,id,selected_QMARK_,opts){
return cljs.core.first.call(null,id);
});})(method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__4617__auto__,method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__));
})();
}
cljs.core._add_method.call(null,weathergen.ui.tab_formatter,null,(function (item,_,opts){
return hoplon.core.div.call(null,(function (){var iter__4523__auto__ = (function weathergen$ui$iter__43233(s__43234){
return (new cljs.core.LazySeq(null,(function (){
var s__43234__$1 = s__43234;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__43234__$1);
if(temp__5720__auto__){
var s__43234__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__43234__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__43234__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__43236 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__43235 = (0);
while(true){
if((i__43235 < size__4522__auto__)){
var vec__43237 = cljs.core._nth.call(null,c__4521__auto__,i__43235);
var section = cljs.core.nth.call(null,vec__43237,(0),null);
var options = cljs.core.nth.call(null,vec__43237,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
cljs.core.chunk_append.call(null,b__43236,(function (){var timer_name__15816__auto__ = ["Rendering ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = ctor.call(null,cljs.core.merge.call(null,options,opts));
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
})());

var G__43243 = (i__43235 + (1));
i__43235 = G__43243;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43236),weathergen$ui$iter__43233.call(null,cljs.core.chunk_rest.call(null,s__43234__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43236),null);
}
} else {
var vec__43240 = cljs.core.first.call(null,s__43234__$2);
var section = cljs.core.nth.call(null,vec__43240,(0),null);
var options = cljs.core.nth.call(null,vec__43240,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
return cljs.core.cons.call(null,(function (){var timer_name__15816__auto__ = ["Rendering ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15817__auto__ = console.time(timer_name__15816__auto__);
var result__15818__auto__ = ctor.call(null,cljs.core.merge.call(null,options,opts));
console.timeEnd(timer_name__15816__auto__);

return result__15818__auto__;
})(),weathergen$ui$iter__43233.call(null,cljs.core.rest.call(null,s__43234__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4523__auto__.call(null,cljs.core.partition.call(null,(2),new cljs.core.Keyword(null,"sections","sections",-886710106).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,item)))));
})());
}));
cljs.core._add_method.call(null,weathergen.ui.title_formatter,null,(function (item,_,___$1,___$2){
return new cljs.core.Keyword(null,"title","title",636505583).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,item)));
}));
cljs.core._add_method.call(null,weathergen.ui.tab_formatter,new cljs.core.Keyword(null,"tools","tools",-1241731990),(function (_,___$1,___$2){
return weathergen.ui.hidden_tools_tab.call(null);
}));
cljs.core._add_method.call(null,weathergen.ui.title_formatter,new cljs.core.Keyword(null,"tools","tools",-1241731990),(function (_,___$1,___$2,___$3){
return "Tools";
}));
cljs.core._add_method.call(null,weathergen.ui.tab_formatter,new cljs.core.Keyword(null,"flights","flights",-1637719124),(function (item,_,___$1){
var body_fn = new cljs.core.Keyword(null,"tab-body-fn","tab-body-fn",-2145852517).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer);
return body_fn.call(null,javelin.core.formula.call(null,((function (body_fn){
return (function (G__43244){
return new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(G__43244);
});})(body_fn))
).call(null,item));
}));
cljs.core._add_method.call(null,weathergen.ui.title_formatter,new cljs.core.Keyword(null,"flights","flights",-1637719124),(function (item,p__43245,selected_QMARK_,_){
var vec__43246 = p__43245;
var ___$1 = cljs.core.nth.call(null,vec__43246,(0),null);
var id = cljs.core.nth.call(null,vec__43246,(1),null);
var title_fn = new cljs.core.Keyword(null,"tab-title-fn","tab-title-fn",-242851006).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer);
return title_fn.call(null,javelin.core.formula.call(null,((function (title_fn,vec__43246,___$1,id){
return (function (G__43249){
return new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(G__43249);
});})(title_fn,vec__43246,___$1,id))
).call(null,item),selected_QMARK_);
}));
/**
 * Emits an app page. `section-infos` is a seq of maps, one for each
 *   tab, with keys `:title`, `:id`, and `:sections`. The sections are a
 *   seq of keys into `section-ctor` and the parameters for that
 *   section.
 */
weathergen.ui.weather_page = (function weathergen$ui$weather_page(section_infos){
return hoplon.core.html.call(null,weathergen.ui.head.call(null),hoplon.core.body.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),"8px"], null)], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"app",weathergen.ui.titlebar.call(null),weathergen.ui.message_display.call(null),(function (){var right_width = weathergen.ui.controls_min_width;
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (right_width){
return (function (titlebar_height,p__43251){
var vec__43252 = p__43251;
var window_width = cljs.core.nth.call(null,vec__43252,(0),null);
var window_height = cljs.core.nth.call(null,vec__43252,(1),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),"row",new cljs.core.Keyword(null,"overflow","overflow",2058931880),"hidden",new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,((window_height - titlebar_height) - (26)))], null);
});})(right_width))
).call(null,weathergen.ui.titlebar_height,weathergen.ui.window_size),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"left-column",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"overflow","overflow",2058931880),"auto",new cljs.core.Keyword(null,"height","height",1025178622),"auto"], null),weathergen.ui.button_bar.call(null),weathergen.ui.grid.call(null,new cljs.core.Keyword(null,"display-params","display-params",573405707),weathergen.ui.display_params,new cljs.core.Keyword(null,"weather-data","weather-data",-664219401),weathergen.ui.weather_data,new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443),weathergen.ui.selected_cell,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),weathergen.ui.weather_overrides,new cljs.core.Keyword(null,"computing","computing",-1002386157),weathergen.ui.computing,new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243),weathergen.ui.pressure_unit,new cljs.core.Keyword(null,"nx","nx",-1996436366),cljs.core.first.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))),new cljs.core.Keyword(null,"ny","ny",1701791641),cljs.core.second.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))))),(function (){var right_column = hoplon.core.div.call(null);
return right_column.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"right-column",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"display","display",242065432),"block",new cljs.core.Keyword(null,"align-content","align-content",-990200349),"flex-start",new cljs.core.Keyword(null,"flex-wrap","flex-wrap",455413707),"wrap",new cljs.core.Keyword(null,"flex-grow","flex-grow",1865160747),(1),new cljs.core.Keyword(null,"min-width","min-width",1926193728),[cljs.core.str.cljs$core$IFn$_invoke$arity$1((right_width - (20))),"px"].join(''),new cljs.core.Keyword(null,"width","width",-384071477),(0),new cljs.core.Keyword(null,"overflow","overflow",2058931880),"auto",new cljs.core.Keyword(null,"height","height",1025178622),"auto"], null),(function (){var first_tab = new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,section_infos));
var selected_tab = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,first_tab], null));
var flight_tabs = new cljs.core.Keyword(null,"tabs","tabs",-779855354).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer);
return weathergen.ui.tabs.tabs2.call(null,new cljs.core.Keyword(null,"tab-background","tab-background",-2049748774),"#FDFFD9",new cljs.core.Keyword(null,"value","value",305978217),selected_tab,new cljs.core.Keyword(null,"data","data",-232669377),javelin.core.formula.call(null,((function (flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function (tools_visible_QMARK_,flight_tabs__$1){
var vec__43255 = cljs.core.split_with.call(null,((function (flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function (p1__43250_SHARP_){
return cljs.core.not_EQ_.call(null,new cljs.core.Keyword(null,"flights","flights",-1637719124),new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(p1__43250_SHARP_));
});})(flight_tabs,first_tab,selected_tab,right_column,right_width))
,section_infos);
var before = cljs.core.nth.call(null,vec__43255,(0),null);
var vec__43258 = cljs.core.nth.call(null,vec__43255,(1),null);
var seq__43259 = cljs.core.seq.call(null,vec__43258);
var first__43260 = cljs.core.first.call(null,seq__43259);
var seq__43259__$1 = cljs.core.next.call(null,seq__43259);
var flight = first__43260;
var after = seq__43259__$1;
return cljs.core.concat.call(null,(function (){var iter__4523__auto__ = ((function (vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function weathergen$ui$weather_page_$_iter__43261(s__43262){
return (new cljs.core.LazySeq(null,((function (vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function (){
var s__43262__$1 = s__43262;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__43262__$1);
if(temp__5720__auto__){
var s__43262__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__43262__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__43262__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__43264 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__43263 = (0);
while(true){
if((i__43263 < size__4522__auto__)){
var map__43265 = cljs.core._nth.call(null,c__4521__auto__,i__43263);
var map__43265__$1 = (((((!((map__43265 == null))))?(((((map__43265.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__43265.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__43265):map__43265);
var data = map__43265__$1;
var id = cljs.core.get.call(null,map__43265__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
cljs.core.chunk_append.call(null,b__43264,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,id], null),new cljs.core.Keyword(null,"data","data",-232669377),data], null));

var G__43285 = (i__43263 + (1));
i__43263 = G__43285;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43264),weathergen$ui$weather_page_$_iter__43261.call(null,cljs.core.chunk_rest.call(null,s__43262__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43264),null);
}
} else {
var map__43267 = cljs.core.first.call(null,s__43262__$2);
var map__43267__$1 = (((((!((map__43267 == null))))?(((((map__43267.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__43267.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__43267):map__43267);
var data = map__43267__$1;
var id = cljs.core.get.call(null,map__43267__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,id], null),new cljs.core.Keyword(null,"data","data",-232669377),data], null),weathergen$ui$weather_page_$_iter__43261.call(null,cljs.core.rest.call(null,s__43262__$2)));
}
} else {
return null;
}
break;
}
});})(vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width))
,null,null));
});})(vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width))
;
return iter__4523__auto__.call(null,cljs.core.concat.call(null,before,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [flight], null)));
})(),(function (){var iter__4523__auto__ = ((function (vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function weathergen$ui$weather_page_$_iter__43269(s__43270){
return (new cljs.core.LazySeq(null,((function (vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function (){
var s__43270__$1 = s__43270;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__43270__$1);
if(temp__5720__auto__){
var s__43270__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__43270__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__43270__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__43272 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__43271 = (0);
while(true){
if((i__43271 < size__4522__auto__)){
var map__43273 = cljs.core._nth.call(null,c__4521__auto__,i__43271);
var map__43273__$1 = (((((!((map__43273 == null))))?(((((map__43273.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__43273.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__43273):map__43273);
var data = map__43273__$1;
var id = cljs.core.get.call(null,map__43273__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
cljs.core.chunk_append.call(null,b__43272,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"flights","flights",-1637719124),id], null),new cljs.core.Keyword(null,"data","data",-232669377),data], null));

var G__43286 = (i__43271 + (1));
i__43271 = G__43286;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43272),weathergen$ui$weather_page_$_iter__43269.call(null,cljs.core.chunk_rest.call(null,s__43270__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43272),null);
}
} else {
var map__43275 = cljs.core.first.call(null,s__43270__$2);
var map__43275__$1 = (((((!((map__43275 == null))))?(((((map__43275.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__43275.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__43275):map__43275);
var data = map__43275__$1;
var id = cljs.core.get.call(null,map__43275__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"flights","flights",-1637719124),id], null),new cljs.core.Keyword(null,"data","data",-232669377),data], null),weathergen$ui$weather_page_$_iter__43269.call(null,cljs.core.rest.call(null,s__43270__$2)));
}
} else {
return null;
}
break;
}
});})(vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width))
,null,null));
});})(vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width))
;
return iter__4523__auto__.call(null,flight_tabs__$1);
})(),(function (){var iter__4523__auto__ = ((function (vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function weathergen$ui$weather_page_$_iter__43277(s__43278){
return (new cljs.core.LazySeq(null,((function (vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function (){
var s__43278__$1 = s__43278;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__43278__$1);
if(temp__5720__auto__){
var s__43278__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__43278__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__43278__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__43280 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__43279 = (0);
while(true){
if((i__43279 < size__4522__auto__)){
var map__43281 = cljs.core._nth.call(null,c__4521__auto__,i__43279);
var map__43281__$1 = (((((!((map__43281 == null))))?(((((map__43281.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__43281.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__43281):map__43281);
var data = map__43281__$1;
var id = cljs.core.get.call(null,map__43281__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
cljs.core.chunk_append.call(null,b__43280,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,id], null),new cljs.core.Keyword(null,"data","data",-232669377),data], null));

var G__43287 = (i__43279 + (1));
i__43279 = G__43287;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43280),weathergen$ui$weather_page_$_iter__43277.call(null,cljs.core.chunk_rest.call(null,s__43278__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__43280),null);
}
} else {
var map__43283 = cljs.core.first.call(null,s__43278__$2);
var map__43283__$1 = (((((!((map__43283 == null))))?(((((map__43283.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__43283.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__43283):map__43283);
var data = map__43283__$1;
var id = cljs.core.get.call(null,map__43283__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,id], null),new cljs.core.Keyword(null,"data","data",-232669377),data], null),weathergen$ui$weather_page_$_iter__43277.call(null,cljs.core.rest.call(null,s__43278__$2)));
}
} else {
return null;
}
break;
}
});})(vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width))
,null,null));
});})(vec__43255,before,vec__43258,seq__43259,first__43260,seq__43259__$1,flight,after,flight_tabs,first_tab,selected_tab,right_column,right_width))
;
return iter__4523__auto__.call(null,after);
})(),(cljs.core.truth_(tools_visible_QMARK_)?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tools","tools",-1241731990),new cljs.core.Keyword(null,"tools","tools",-1241731990)], null)], null)], null):null));
});})(flight_tabs,first_tab,selected_tab,right_column,right_width))
).call(null,weathergen.ui.tools_visible_QMARK_,flight_tabs),new cljs.core.Keyword(null,"key-fn","key-fn",-636154479),new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function (item,id){
return weathergen.ui.tab_formatter.call(null,item,id,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column], null));
});})(flight_tabs,first_tab,selected_tab,right_column,right_width))
,new cljs.core.Keyword(null,"title-formatter","title-formatter",1874480681),((function (flight_tabs,first_tab,selected_tab,right_column,right_width){
return (function (item,id,selected_QMARK_){
return weathergen.ui.title_formatter.call(null,item,id,selected_QMARK_,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column], null));
});})(flight_tabs,first_tab,selected_tab,right_column,right_width))
);
})());
})());
})()),weathergen.ui.debug_info.call(null)));
});
/**
 * Handles registering events on nodes when they are inserted into the DOM.
 */
weathergen.ui.on_STAR_ = (function weathergen$ui$on_STAR_(elem,event,callback){
return weathergen.ui.common.when_dom_STAR_.call(null,elem,(function (){
return jQuery(elem).on(cljs.core.name.call(null,event),callback);
}));
});
cljs.core._add_method.call(null,hoplon.core.on_BANG_,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),(function (elem,event,callback){
return weathergen.ui.on_STAR_.call(null,elem,event,callback);
}));
cljs.core._add_method.call(null,hoplon.core.on_BANG_,new cljs.core.Keyword("html","*","html/*",-1283138243),(function (elem,event,callback){
return weathergen.ui.on_STAR_.call(null,elem,event,callback);
}));
