goog.provide('cljs.repl');
cljs.repl.print_doc = (function cljs$repl$print_doc(p__37790){
var map__37792 = p__37790;
var map__37792__$1 = cljs.core.__destructure_map(map__37792);
var m = map__37792__$1;
var n = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__37792__$1,new cljs.core.Keyword(null,"ns","ns",441598760));
var nm = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__37792__$1,new cljs.core.Keyword(null,"name","name",1843675177));
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["-------------------------"], 0));

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([(function (){var or__5025__auto__ = new cljs.core.Keyword(null,"spec","spec",347520401).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return [(function (){var temp__5804__auto__ = new cljs.core.Keyword(null,"ns","ns",441598760).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(temp__5804__auto__)){
var ns = temp__5804__auto__;
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(ns),"/"].join('');
} else {
return null;
}
})(),cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(m))].join('');
}
})()], 0));

if(cljs.core.truth_(new cljs.core.Keyword(null,"protocol","protocol",652470118).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Protocol"], 0));
} else {
}

if(cljs.core.truth_(new cljs.core.Keyword(null,"forms","forms",2045992350).cljs$core$IFn$_invoke$arity$1(m))){
var seq__37809_38179 = cljs.core.seq(new cljs.core.Keyword(null,"forms","forms",2045992350).cljs$core$IFn$_invoke$arity$1(m));
var chunk__37810_38180 = null;
var count__37811_38181 = (0);
var i__37812_38182 = (0);
while(true){
if((i__37812_38182 < count__37811_38181)){
var f_38183 = chunk__37810_38180.cljs$core$IIndexed$_nth$arity$2(null,i__37812_38182);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["  ",f_38183], 0));


var G__38184 = seq__37809_38179;
var G__38185 = chunk__37810_38180;
var G__38186 = count__37811_38181;
var G__38187 = (i__37812_38182 + (1));
seq__37809_38179 = G__38184;
chunk__37810_38180 = G__38185;
count__37811_38181 = G__38186;
i__37812_38182 = G__38187;
continue;
} else {
var temp__5804__auto___38190 = cljs.core.seq(seq__37809_38179);
if(temp__5804__auto___38190){
var seq__37809_38192__$1 = temp__5804__auto___38190;
if(cljs.core.chunked_seq_QMARK_(seq__37809_38192__$1)){
var c__5548__auto___38193 = cljs.core.chunk_first(seq__37809_38192__$1);
var G__38194 = cljs.core.chunk_rest(seq__37809_38192__$1);
var G__38195 = c__5548__auto___38193;
var G__38196 = cljs.core.count(c__5548__auto___38193);
var G__38197 = (0);
seq__37809_38179 = G__38194;
chunk__37810_38180 = G__38195;
count__37811_38181 = G__38196;
i__37812_38182 = G__38197;
continue;
} else {
var f_38198 = cljs.core.first(seq__37809_38192__$1);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["  ",f_38198], 0));


var G__38199 = cljs.core.next(seq__37809_38192__$1);
var G__38200 = null;
var G__38201 = (0);
var G__38202 = (0);
seq__37809_38179 = G__38199;
chunk__37810_38180 = G__38200;
count__37811_38181 = G__38201;
i__37812_38182 = G__38202;
continue;
}
} else {
}
}
break;
}
} else {
if(cljs.core.truth_(new cljs.core.Keyword(null,"arglists","arglists",1661989754).cljs$core$IFn$_invoke$arity$1(m))){
var arglists_38204 = new cljs.core.Keyword(null,"arglists","arglists",1661989754).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_((function (){var or__5025__auto__ = new cljs.core.Keyword(null,"macro","macro",-867863404).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return new cljs.core.Keyword(null,"repl-special-function","repl-special-function",1262603725).cljs$core$IFn$_invoke$arity$1(m);
}
})())){
cljs.core.prn.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([arglists_38204], 0));
} else {
cljs.core.prn.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Symbol(null,"quote","quote",1377916282,null),cljs.core.first(arglists_38204)))?cljs.core.second(arglists_38204):arglists_38204)], 0));
}
} else {
}
}

if(cljs.core.truth_(new cljs.core.Keyword(null,"special-form","special-form",-1326536374).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Special Form"], 0));

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",new cljs.core.Keyword(null,"doc","doc",1913296891).cljs$core$IFn$_invoke$arity$1(m)], 0));

if(cljs.core.contains_QMARK_(m,new cljs.core.Keyword(null,"url","url",276297046))){
if(cljs.core.truth_(new cljs.core.Keyword(null,"url","url",276297046).cljs$core$IFn$_invoke$arity$1(m))){
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n  Please see http://clojure.org/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"url","url",276297046).cljs$core$IFn$_invoke$arity$1(m))].join('')], 0));
} else {
return null;
}
} else {
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n  Please see http://clojure.org/special_forms#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(m))].join('')], 0));
}
} else {
if(cljs.core.truth_(new cljs.core.Keyword(null,"macro","macro",-867863404).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Macro"], 0));
} else {
}

if(cljs.core.truth_(new cljs.core.Keyword(null,"spec","spec",347520401).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Spec"], 0));
} else {
}

if(cljs.core.truth_(new cljs.core.Keyword(null,"repl-special-function","repl-special-function",1262603725).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["REPL Special Function"], 0));
} else {
}

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",new cljs.core.Keyword(null,"doc","doc",1913296891).cljs$core$IFn$_invoke$arity$1(m)], 0));

if(cljs.core.truth_(new cljs.core.Keyword(null,"protocol","protocol",652470118).cljs$core$IFn$_invoke$arity$1(m))){
var seq__37841_38211 = cljs.core.seq(new cljs.core.Keyword(null,"methods","methods",453930866).cljs$core$IFn$_invoke$arity$1(m));
var chunk__37842_38212 = null;
var count__37843_38213 = (0);
var i__37844_38214 = (0);
while(true){
if((i__37844_38214 < count__37843_38213)){
var vec__37864_38220 = chunk__37842_38212.cljs$core$IIndexed$_nth$arity$2(null,i__37844_38214);
var name_38221 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__37864_38220,(0),null);
var map__37867_38222 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__37864_38220,(1),null);
var map__37867_38223__$1 = cljs.core.__destructure_map(map__37867_38222);
var doc_38224 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__37867_38223__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_38225 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__37867_38223__$1,new cljs.core.Keyword(null,"arglists","arglists",1661989754));
cljs.core.println();

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",name_38221], 0));

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",arglists_38225], 0));

if(cljs.core.truth_(doc_38224)){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",doc_38224], 0));
} else {
}


var G__38227 = seq__37841_38211;
var G__38228 = chunk__37842_38212;
var G__38229 = count__37843_38213;
var G__38230 = (i__37844_38214 + (1));
seq__37841_38211 = G__38227;
chunk__37842_38212 = G__38228;
count__37843_38213 = G__38229;
i__37844_38214 = G__38230;
continue;
} else {
var temp__5804__auto___38231 = cljs.core.seq(seq__37841_38211);
if(temp__5804__auto___38231){
var seq__37841_38233__$1 = temp__5804__auto___38231;
if(cljs.core.chunked_seq_QMARK_(seq__37841_38233__$1)){
var c__5548__auto___38235 = cljs.core.chunk_first(seq__37841_38233__$1);
var G__38236 = cljs.core.chunk_rest(seq__37841_38233__$1);
var G__38237 = c__5548__auto___38235;
var G__38238 = cljs.core.count(c__5548__auto___38235);
var G__38239 = (0);
seq__37841_38211 = G__38236;
chunk__37842_38212 = G__38237;
count__37843_38213 = G__38238;
i__37844_38214 = G__38239;
continue;
} else {
var vec__37875_38240 = cljs.core.first(seq__37841_38233__$1);
var name_38241 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__37875_38240,(0),null);
var map__37878_38242 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__37875_38240,(1),null);
var map__37878_38243__$1 = cljs.core.__destructure_map(map__37878_38242);
var doc_38244 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__37878_38243__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_38245 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__37878_38243__$1,new cljs.core.Keyword(null,"arglists","arglists",1661989754));
cljs.core.println();

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",name_38241], 0));

cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",arglists_38245], 0));

if(cljs.core.truth_(doc_38244)){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",doc_38244], 0));
} else {
}


var G__38248 = cljs.core.next(seq__37841_38233__$1);
var G__38249 = null;
var G__38250 = (0);
var G__38251 = (0);
seq__37841_38211 = G__38248;
chunk__37842_38212 = G__38249;
count__37843_38213 = G__38250;
i__37844_38214 = G__38251;
continue;
}
} else {
}
}
break;
}
} else {
}

if(cljs.core.truth_(n)){
var temp__5804__auto__ = cljs.spec.alpha.get_spec(cljs.core.symbol.cljs$core$IFn$_invoke$arity$2(cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.ns_name(n)),cljs.core.name(nm)));
if(cljs.core.truth_(temp__5804__auto__)){
var fnspec = temp__5804__auto__;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Spec"], 0));

var seq__37897 = cljs.core.seq(new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Keyword(null,"fn","fn",-1175266204)], null));
var chunk__37899 = null;
var count__37900 = (0);
var i__37902 = (0);
while(true){
if((i__37902 < count__37900)){
var role = chunk__37899.cljs$core$IIndexed$_nth$arity$2(null,i__37902);
var temp__5804__auto___38254__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5804__auto___38254__$1)){
var spec_38257 = temp__5804__auto___38254__$1;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n ",cljs.core.name(role),":"].join(''),cljs.spec.alpha.describe(spec_38257)], 0));
} else {
}


var G__38258 = seq__37897;
var G__38260 = chunk__37899;
var G__38261 = count__37900;
var G__38263 = (i__37902 + (1));
seq__37897 = G__38258;
chunk__37899 = G__38260;
count__37900 = G__38261;
i__37902 = G__38263;
continue;
} else {
var temp__5804__auto____$1 = cljs.core.seq(seq__37897);
if(temp__5804__auto____$1){
var seq__37897__$1 = temp__5804__auto____$1;
if(cljs.core.chunked_seq_QMARK_(seq__37897__$1)){
var c__5548__auto__ = cljs.core.chunk_first(seq__37897__$1);
var G__38269 = cljs.core.chunk_rest(seq__37897__$1);
var G__38270 = c__5548__auto__;
var G__38271 = cljs.core.count(c__5548__auto__);
var G__38272 = (0);
seq__37897 = G__38269;
chunk__37899 = G__38270;
count__37900 = G__38271;
i__37902 = G__38272;
continue;
} else {
var role = cljs.core.first(seq__37897__$1);
var temp__5804__auto___38273__$2 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5804__auto___38273__$2)){
var spec_38276 = temp__5804__auto___38273__$2;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n ",cljs.core.name(role),":"].join(''),cljs.spec.alpha.describe(spec_38276)], 0));
} else {
}


var G__38278 = cljs.core.next(seq__37897__$1);
var G__38279 = null;
var G__38280 = (0);
var G__38281 = (0);
seq__37897 = G__38278;
chunk__37899 = G__38279;
count__37900 = G__38280;
i__37902 = G__38281;
continue;
}
} else {
return null;
}
}
break;
}
} else {
return null;
}
} else {
return null;
}
}
});
/**
 * Constructs a data representation for a Error with keys:
 *  :cause - root cause message
 *  :phase - error phase
 *  :via - cause chain, with cause keys:
 *           :type - exception class symbol
 *           :message - exception message
 *           :data - ex-data
 *           :at - top stack element
 *  :trace - root cause stack elements
 */
cljs.repl.Error__GT_map = (function cljs$repl$Error__GT_map(o){
return cljs.core.Throwable__GT_map(o);
});
/**
 * Returns an analysis of the phase, error, cause, and location of an error that occurred
 *   based on Throwable data, as returned by Throwable->map. All attributes other than phase
 *   are optional:
 *  :clojure.error/phase - keyword phase indicator, one of:
 *    :read-source :compile-syntax-check :compilation :macro-syntax-check :macroexpansion
 *    :execution :read-eval-result :print-eval-result
 *  :clojure.error/source - file name (no path)
 *  :clojure.error/line - integer line number
 *  :clojure.error/column - integer column number
 *  :clojure.error/symbol - symbol being expanded/compiled/invoked
 *  :clojure.error/class - cause exception class symbol
 *  :clojure.error/cause - cause exception message
 *  :clojure.error/spec - explain-data for spec error
 */
cljs.repl.ex_triage = (function cljs$repl$ex_triage(datafied_throwable){
var map__38024 = datafied_throwable;
var map__38024__$1 = cljs.core.__destructure_map(map__38024);
var via = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38024__$1,new cljs.core.Keyword(null,"via","via",-1904457336));
var trace = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38024__$1,new cljs.core.Keyword(null,"trace","trace",-1082747415));
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__38024__$1,new cljs.core.Keyword(null,"phase","phase",575722892),new cljs.core.Keyword(null,"execution","execution",253283524));
var map__38026 = cljs.core.last(via);
var map__38026__$1 = cljs.core.__destructure_map(map__38026);
var type = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38026__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var message = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38026__$1,new cljs.core.Keyword(null,"message","message",-406056002));
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38026__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var map__38027 = data;
var map__38027__$1 = cljs.core.__destructure_map(map__38027);
var problems = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38027__$1,new cljs.core.Keyword("cljs.spec.alpha","problems","cljs.spec.alpha/problems",447400814));
var fn = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38027__$1,new cljs.core.Keyword("cljs.spec.alpha","fn","cljs.spec.alpha/fn",408600443));
var caller = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38027__$1,new cljs.core.Keyword("cljs.spec.test.alpha","caller","cljs.spec.test.alpha/caller",-398302390));
var map__38028 = new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.first(via));
var map__38028__$1 = cljs.core.__destructure_map(map__38028);
var top_data = map__38028__$1;
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38028__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397));
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3((function (){var G__38036 = phase;
var G__38036__$1 = (((G__38036 instanceof cljs.core.Keyword))?G__38036.fqn:null);
switch (G__38036__$1) {
case "read-source":
var map__38039 = data;
var map__38039__$1 = cljs.core.__destructure_map(map__38039);
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38039__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38039__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var G__38041 = cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.second(via)),top_data], 0));
var G__38041__$1 = (cljs.core.truth_(source)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38041,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),source):G__38041);
var G__38041__$2 = (cljs.core.truth_((function (){var fexpr__38044 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__38044.cljs$core$IFn$_invoke$arity$1 ? fexpr__38044.cljs$core$IFn$_invoke$arity$1(source) : fexpr__38044.call(null,source));
})())?cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(G__38041__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397)):G__38041__$1);
if(cljs.core.truth_(message)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38041__$2,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message);
} else {
return G__38041__$2;
}

break;
case "compile-syntax-check":
case "compilation":
case "macro-syntax-check":
case "macroexpansion":
var G__38047 = top_data;
var G__38047__$1 = (cljs.core.truth_(source)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38047,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),source):G__38047);
var G__38047__$2 = (cljs.core.truth_((function (){var fexpr__38050 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__38050.cljs$core$IFn$_invoke$arity$1 ? fexpr__38050.cljs$core$IFn$_invoke$arity$1(source) : fexpr__38050.call(null,source));
})())?cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(G__38047__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397)):G__38047__$1);
var G__38047__$3 = (cljs.core.truth_(type)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38047__$2,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type):G__38047__$2);
var G__38047__$4 = (cljs.core.truth_(message)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38047__$3,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message):G__38047__$3);
if(cljs.core.truth_(problems)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38047__$4,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595),data);
} else {
return G__38047__$4;
}

break;
case "read-eval-result":
case "print-eval-result":
var vec__38054 = cljs.core.first(trace);
var source__$1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__38054,(0),null);
var method = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__38054,(1),null);
var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__38054,(2),null);
var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__38054,(3),null);
var G__38061 = top_data;
var G__38061__$1 = (cljs.core.truth_(line)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38061,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471),line):G__38061);
var G__38061__$2 = (cljs.core.truth_(file)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38061__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),file):G__38061__$1);
var G__38061__$3 = (cljs.core.truth_((function (){var and__5023__auto__ = source__$1;
if(cljs.core.truth_(and__5023__auto__)){
return method;
} else {
return and__5023__auto__;
}
})())?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38061__$2,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[source__$1,method],null))):G__38061__$2);
var G__38061__$4 = (cljs.core.truth_(type)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38061__$3,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type):G__38061__$3);
if(cljs.core.truth_(message)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38061__$4,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message);
} else {
return G__38061__$4;
}

break;
case "execution":
var vec__38070 = cljs.core.first(trace);
var source__$1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__38070,(0),null);
var method = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__38070,(1),null);
var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__38070,(2),null);
var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__38070,(3),null);
var file__$1 = cljs.core.first(cljs.core.remove.cljs$core$IFn$_invoke$arity$2((function (p1__38020_SHARP_){
var or__5025__auto__ = (p1__38020_SHARP_ == null);
if(or__5025__auto__){
return or__5025__auto__;
} else {
var fexpr__38075 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__38075.cljs$core$IFn$_invoke$arity$1 ? fexpr__38075.cljs$core$IFn$_invoke$arity$1(p1__38020_SHARP_) : fexpr__38075.call(null,p1__38020_SHARP_));
}
}),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"file","file",-1269645878).cljs$core$IFn$_invoke$arity$1(caller),file], null)));
var err_line = (function (){var or__5025__auto__ = new cljs.core.Keyword(null,"line","line",212345235).cljs$core$IFn$_invoke$arity$1(caller);
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return line;
}
})();
var G__38080 = new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type], null);
var G__38080__$1 = (cljs.core.truth_(err_line)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38080,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471),err_line):G__38080);
var G__38080__$2 = (cljs.core.truth_(message)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38080__$1,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message):G__38080__$1);
var G__38080__$3 = (cljs.core.truth_((function (){var or__5025__auto__ = fn;
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
var and__5023__auto__ = source__$1;
if(cljs.core.truth_(and__5023__auto__)){
return method;
} else {
return and__5023__auto__;
}
}
})())?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38080__$2,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994),(function (){var or__5025__auto__ = fn;
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return (new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[source__$1,method],null));
}
})()):G__38080__$2);
var G__38080__$4 = (cljs.core.truth_(file__$1)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38080__$3,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),file__$1):G__38080__$3);
if(cljs.core.truth_(problems)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__38080__$4,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595),data);
} else {
return G__38080__$4;
}

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

}
})(),new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358),phase);
});
/**
 * Returns a string from exception data, as produced by ex-triage.
 *   The first line summarizes the exception phase and location.
 *   The subsequent lines describe the cause.
 */
cljs.repl.ex_str = (function cljs$repl$ex_str(p__38103){
var map__38105 = p__38103;
var map__38105__$1 = cljs.core.__destructure_map(map__38105);
var triage_data = map__38105__$1;
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38105__$1,new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358));
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38105__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397));
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38105__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38105__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var symbol = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38105__$1,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994));
var class$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38105__$1,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890));
var cause = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38105__$1,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742));
var spec = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__38105__$1,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595));
var loc = [cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__5025__auto__ = source;
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return "<cljs repl>";
}
})()),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__5025__auto__ = line;
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return (1);
}
})()),(cljs.core.truth_(column)?[":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column)].join(''):"")].join('');
var class_name = cljs.core.name((function (){var or__5025__auto__ = class$;
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return "";
}
})());
var simple_class = class_name;
var cause_type = ((cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["RuntimeException",null,"Exception",null], null), null),simple_class))?"":[" (",simple_class,")"].join(''));
var format = goog.string.format;
var G__38115 = phase;
var G__38115__$1 = (((G__38115 instanceof cljs.core.Keyword))?G__38115.fqn:null);
switch (G__38115__$1) {
case "read-source":
return (format.cljs$core$IFn$_invoke$arity$3 ? format.cljs$core$IFn$_invoke$arity$3("Syntax error reading source at (%s).\n%s\n",loc,cause) : format.call(null,"Syntax error reading source at (%s).\n%s\n",loc,cause));

break;
case "macro-syntax-check":
var G__38116 = "Syntax error macroexpanding %sat (%s).\n%s";
var G__38117 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__38118 = loc;
var G__38119 = (cljs.core.truth_(spec)?(function (){var sb__5670__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__38120_38339 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__38121_38340 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__38122_38341 = true;
var _STAR_print_fn_STAR__temp_val__38123_38342 = (function (x__5671__auto__){
return sb__5670__auto__.append(x__5671__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__38122_38341);

(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__38123_38342);

try{cljs.spec.alpha.explain_out(cljs.core.update.cljs$core$IFn$_invoke$arity$3(spec,new cljs.core.Keyword("cljs.spec.alpha","problems","cljs.spec.alpha/problems",447400814),(function (probs){
return cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__38097_SHARP_){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(p1__38097_SHARP_,new cljs.core.Keyword(null,"in","in",-1531184865));
}),probs);
}))
);
}finally {(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__38121_38340);

(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__38120_38339);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__5670__auto__);
})():(format.cljs$core$IFn$_invoke$arity$2 ? format.cljs$core$IFn$_invoke$arity$2("%s\n",cause) : format.call(null,"%s\n",cause)));
return (format.cljs$core$IFn$_invoke$arity$4 ? format.cljs$core$IFn$_invoke$arity$4(G__38116,G__38117,G__38118,G__38119) : format.call(null,G__38116,G__38117,G__38118,G__38119));

break;
case "macroexpansion":
var G__38125 = "Unexpected error%s macroexpanding %sat (%s).\n%s\n";
var G__38126 = cause_type;
var G__38127 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__38128 = loc;
var G__38129 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__38125,G__38126,G__38127,G__38128,G__38129) : format.call(null,G__38125,G__38126,G__38127,G__38128,G__38129));

break;
case "compile-syntax-check":
var G__38130 = "Syntax error%s compiling %sat (%s).\n%s\n";
var G__38131 = cause_type;
var G__38132 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__38133 = loc;
var G__38134 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__38130,G__38131,G__38132,G__38133,G__38134) : format.call(null,G__38130,G__38131,G__38132,G__38133,G__38134));

break;
case "compilation":
var G__38135 = "Unexpected error%s compiling %sat (%s).\n%s\n";
var G__38136 = cause_type;
var G__38137 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__38138 = loc;
var G__38139 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__38135,G__38136,G__38137,G__38138,G__38139) : format.call(null,G__38135,G__38136,G__38137,G__38138,G__38139));

break;
case "read-eval-result":
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5("Error reading eval result%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause) : format.call(null,"Error reading eval result%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause));

break;
case "print-eval-result":
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5("Error printing return value%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause) : format.call(null,"Error printing return value%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause));

break;
case "execution":
if(cljs.core.truth_(spec)){
var G__38140 = "Execution error - invalid arguments to %s at (%s).\n%s";
var G__38141 = symbol;
var G__38142 = loc;
var G__38143 = (function (){var sb__5670__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__38144_38358 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__38145_38359 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__38146_38360 = true;
var _STAR_print_fn_STAR__temp_val__38147_38361 = (function (x__5671__auto__){
return sb__5670__auto__.append(x__5671__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__38146_38360);

(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__38147_38361);

try{cljs.spec.alpha.explain_out(cljs.core.update.cljs$core$IFn$_invoke$arity$3(spec,new cljs.core.Keyword("cljs.spec.alpha","problems","cljs.spec.alpha/problems",447400814),(function (probs){
return cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__38098_SHARP_){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(p1__38098_SHARP_,new cljs.core.Keyword(null,"in","in",-1531184865));
}),probs);
}))
);
}finally {(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__38145_38359);

(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__38144_38358);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__5670__auto__);
})();
return (format.cljs$core$IFn$_invoke$arity$4 ? format.cljs$core$IFn$_invoke$arity$4(G__38140,G__38141,G__38142,G__38143) : format.call(null,G__38140,G__38141,G__38142,G__38143));
} else {
var G__38152 = "Execution error%s at %s(%s).\n%s\n";
var G__38153 = cause_type;
var G__38154 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__38155 = loc;
var G__38156 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__38152,G__38153,G__38154,G__38155,G__38156) : format.call(null,G__38152,G__38153,G__38154,G__38155,G__38156));
}

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

}
});
cljs.repl.error__GT_str = (function cljs$repl$error__GT_str(error){
return cljs.repl.ex_str(cljs.repl.ex_triage(cljs.repl.Error__GT_map(error)));
});

//# sourceMappingURL=cljs.repl.js.map
