goog.provide('cljs.repl');
cljs.repl.print_doc = (function cljs$repl$print_doc(p__18167){
var map__18168 = p__18167;
var map__18168__$1 = cljs.core.__destructure_map(map__18168);
var m = map__18168__$1;
var n = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18168__$1,new cljs.core.Keyword(null,"ns","ns",441598760));
var nm = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18168__$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__5002__auto__ = new cljs.core.Keyword(null,"spec","spec",347520401).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__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__18179_18682 = cljs.core.seq(new cljs.core.Keyword(null,"forms","forms",2045992350).cljs$core$IFn$_invoke$arity$1(m));
var chunk__18180_18683 = null;
var count__18181_18684 = (0);
var i__18182_18685 = (0);
while(true){
if((i__18182_18685 < count__18181_18684)){
var f_18689 = chunk__18180_18683.cljs$core$IIndexed$_nth$arity$2(null,i__18182_18685);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["  ",f_18689], 0));


var G__18690 = seq__18179_18682;
var G__18691 = chunk__18180_18683;
var G__18692 = count__18181_18684;
var G__18693 = (i__18182_18685 + (1));
seq__18179_18682 = G__18690;
chunk__18180_18683 = G__18691;
count__18181_18684 = G__18692;
i__18182_18685 = G__18693;
continue;
} else {
var temp__5804__auto___18694 = cljs.core.seq(seq__18179_18682);
if(temp__5804__auto___18694){
var seq__18179_18695__$1 = temp__5804__auto___18694;
if(cljs.core.chunked_seq_QMARK_(seq__18179_18695__$1)){
var c__5525__auto___18696 = cljs.core.chunk_first(seq__18179_18695__$1);
var G__18697 = cljs.core.chunk_rest(seq__18179_18695__$1);
var G__18698 = c__5525__auto___18696;
var G__18699 = cljs.core.count(c__5525__auto___18696);
var G__18700 = (0);
seq__18179_18682 = G__18697;
chunk__18180_18683 = G__18698;
count__18181_18684 = G__18699;
i__18182_18685 = G__18700;
continue;
} else {
var f_18702 = cljs.core.first(seq__18179_18695__$1);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["  ",f_18702], 0));


var G__18703 = cljs.core.next(seq__18179_18695__$1);
var G__18704 = null;
var G__18705 = (0);
var G__18706 = (0);
seq__18179_18682 = G__18703;
chunk__18180_18683 = G__18704;
count__18181_18684 = G__18705;
i__18182_18685 = G__18706;
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_18707 = new cljs.core.Keyword(null,"arglists","arglists",1661989754).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_((function (){var or__5002__auto__ = new cljs.core.Keyword(null,"macro","macro",-867863404).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__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_18707], 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_18707)))?cljs.core.second(arglists_18707):arglists_18707)], 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__18222_18711 = cljs.core.seq(new cljs.core.Keyword(null,"methods","methods",453930866).cljs$core$IFn$_invoke$arity$1(m));
var chunk__18224_18712 = null;
var count__18226_18713 = (0);
var i__18227_18714 = (0);
while(true){
if((i__18227_18714 < count__18226_18713)){
var vec__18247_18715 = chunk__18224_18712.cljs$core$IIndexed$_nth$arity$2(null,i__18227_18714);
var name_18716 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18247_18715,(0),null);
var map__18250_18717 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18247_18715,(1),null);
var map__18250_18718__$1 = cljs.core.__destructure_map(map__18250_18717);
var doc_18719 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18250_18718__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_18720 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18250_18718__$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_18716], 0));

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

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


var G__18722 = seq__18222_18711;
var G__18723 = chunk__18224_18712;
var G__18724 = count__18226_18713;
var G__18725 = (i__18227_18714 + (1));
seq__18222_18711 = G__18722;
chunk__18224_18712 = G__18723;
count__18226_18713 = G__18724;
i__18227_18714 = G__18725;
continue;
} else {
var temp__5804__auto___18726 = cljs.core.seq(seq__18222_18711);
if(temp__5804__auto___18726){
var seq__18222_18727__$1 = temp__5804__auto___18726;
if(cljs.core.chunked_seq_QMARK_(seq__18222_18727__$1)){
var c__5525__auto___18728 = cljs.core.chunk_first(seq__18222_18727__$1);
var G__18729 = cljs.core.chunk_rest(seq__18222_18727__$1);
var G__18730 = c__5525__auto___18728;
var G__18731 = cljs.core.count(c__5525__auto___18728);
var G__18732 = (0);
seq__18222_18711 = G__18729;
chunk__18224_18712 = G__18730;
count__18226_18713 = G__18731;
i__18227_18714 = G__18732;
continue;
} else {
var vec__18276_18733 = cljs.core.first(seq__18222_18727__$1);
var name_18734 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18276_18733,(0),null);
var map__18279_18735 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18276_18733,(1),null);
var map__18279_18736__$1 = cljs.core.__destructure_map(map__18279_18735);
var doc_18737 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18279_18736__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_18738 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18279_18736__$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_18734], 0));

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

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


var G__18739 = cljs.core.next(seq__18222_18727__$1);
var G__18740 = null;
var G__18741 = (0);
var G__18742 = (0);
seq__18222_18711 = G__18739;
chunk__18224_18712 = G__18740;
count__18226_18713 = G__18741;
i__18227_18714 = G__18742;
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__18308 = 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__18309 = null;
var count__18310 = (0);
var i__18311 = (0);
while(true){
if((i__18311 < count__18310)){
var role = chunk__18309.cljs$core$IIndexed$_nth$arity$2(null,i__18311);
var temp__5804__auto___18746__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5804__auto___18746__$1)){
var spec_18747 = temp__5804__auto___18746__$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_18747)], 0));
} else {
}


var G__18748 = seq__18308;
var G__18749 = chunk__18309;
var G__18750 = count__18310;
var G__18751 = (i__18311 + (1));
seq__18308 = G__18748;
chunk__18309 = G__18749;
count__18310 = G__18750;
i__18311 = G__18751;
continue;
} else {
var temp__5804__auto____$1 = cljs.core.seq(seq__18308);
if(temp__5804__auto____$1){
var seq__18308__$1 = temp__5804__auto____$1;
if(cljs.core.chunked_seq_QMARK_(seq__18308__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__18308__$1);
var G__18752 = cljs.core.chunk_rest(seq__18308__$1);
var G__18753 = c__5525__auto__;
var G__18754 = cljs.core.count(c__5525__auto__);
var G__18755 = (0);
seq__18308 = G__18752;
chunk__18309 = G__18753;
count__18310 = G__18754;
i__18311 = G__18755;
continue;
} else {
var role = cljs.core.first(seq__18308__$1);
var temp__5804__auto___18756__$2 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5804__auto___18756__$2)){
var spec_18757 = temp__5804__auto___18756__$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_18757)], 0));
} else {
}


var G__18758 = cljs.core.next(seq__18308__$1);
var G__18759 = null;
var G__18760 = (0);
var G__18761 = (0);
seq__18308 = G__18758;
chunk__18309 = G__18759;
count__18310 = G__18760;
i__18311 = G__18761;
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__18425 = datafied_throwable;
var map__18425__$1 = cljs.core.__destructure_map(map__18425);
var via = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18425__$1,new cljs.core.Keyword(null,"via","via",-1904457336));
var trace = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18425__$1,new cljs.core.Keyword(null,"trace","trace",-1082747415));
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__18425__$1,new cljs.core.Keyword(null,"phase","phase",575722892),new cljs.core.Keyword(null,"execution","execution",253283524));
var map__18427 = cljs.core.last(via);
var map__18427__$1 = cljs.core.__destructure_map(map__18427);
var type = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18427__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var message = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18427__$1,new cljs.core.Keyword(null,"message","message",-406056002));
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18427__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var map__18428 = data;
var map__18428__$1 = cljs.core.__destructure_map(map__18428);
var problems = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18428__$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__18428__$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__18428__$1,new cljs.core.Keyword("cljs.spec.test.alpha","caller","cljs.spec.test.alpha/caller",-398302390));
var map__18429 = new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.first(via));
var map__18429__$1 = cljs.core.__destructure_map(map__18429);
var top_data = map__18429__$1;
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18429__$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__18433 = phase;
var G__18433__$1 = (((G__18433 instanceof cljs.core.Keyword))?G__18433.fqn:null);
switch (G__18433__$1) {
case "read-source":
var map__18450 = data;
var map__18450__$1 = cljs.core.__destructure_map(map__18450);
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18450__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18450__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var G__18470 = 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__18470__$1 = (cljs.core.truth_(source)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18470,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),source):G__18470);
var G__18470__$2 = (cljs.core.truth_((function (){var fexpr__18473 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__18473.cljs$core$IFn$_invoke$arity$1 ? fexpr__18473.cljs$core$IFn$_invoke$arity$1(source) : fexpr__18473.call(null,source));
})())?cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(G__18470__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397)):G__18470__$1);
if(cljs.core.truth_(message)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18470__$2,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message);
} else {
return G__18470__$2;
}

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

break;
case "read-eval-result":
case "print-eval-result":
var vec__18496 = cljs.core.first(trace);
var source__$1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18496,(0),null);
var method = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18496,(1),null);
var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18496,(2),null);
var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18496,(3),null);
var G__18501 = top_data;
var G__18501__$1 = (cljs.core.truth_(line)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18501,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471),line):G__18501);
var G__18501__$2 = (cljs.core.truth_(file)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18501__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),file):G__18501__$1);
var G__18501__$3 = (cljs.core.truth_((function (){var and__5000__auto__ = source__$1;
if(cljs.core.truth_(and__5000__auto__)){
return method;
} else {
return and__5000__auto__;
}
})())?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18501__$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__18501__$2);
var G__18501__$4 = (cljs.core.truth_(type)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18501__$3,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type):G__18501__$3);
if(cljs.core.truth_(message)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18501__$4,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message);
} else {
return G__18501__$4;
}

break;
case "execution":
var vec__18508 = cljs.core.first(trace);
var source__$1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18508,(0),null);
var method = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18508,(1),null);
var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18508,(2),null);
var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__18508,(3),null);
var file__$1 = cljs.core.first(cljs.core.remove.cljs$core$IFn$_invoke$arity$2((function (p1__18421_SHARP_){
var or__5002__auto__ = (p1__18421_SHARP_ == null);
if(or__5002__auto__){
return or__5002__auto__;
} else {
var fexpr__18513 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__18513.cljs$core$IFn$_invoke$arity$1 ? fexpr__18513.cljs$core$IFn$_invoke$arity$1(p1__18421_SHARP_) : fexpr__18513.call(null,p1__18421_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__5002__auto__ = new cljs.core.Keyword(null,"line","line",212345235).cljs$core$IFn$_invoke$arity$1(caller);
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return line;
}
})();
var G__18519 = new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type], null);
var G__18519__$1 = (cljs.core.truth_(err_line)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18519,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471),err_line):G__18519);
var G__18519__$2 = (cljs.core.truth_(message)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18519__$1,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message):G__18519__$1);
var G__18519__$3 = (cljs.core.truth_((function (){var or__5002__auto__ = fn;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
var and__5000__auto__ = source__$1;
if(cljs.core.truth_(and__5000__auto__)){
return method;
} else {
return and__5000__auto__;
}
}
})())?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18519__$2,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994),(function (){var or__5002__auto__ = fn;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return (new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[source__$1,method],null));
}
})()):G__18519__$2);
var G__18519__$4 = (cljs.core.truth_(file__$1)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18519__$3,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),file__$1):G__18519__$3);
if(cljs.core.truth_(problems)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__18519__$4,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595),data);
} else {
return G__18519__$4;
}

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__18433__$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__18543){
var map__18544 = p__18543;
var map__18544__$1 = cljs.core.__destructure_map(map__18544);
var triage_data = map__18544__$1;
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18544__$1,new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358));
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18544__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397));
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18544__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18544__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var symbol = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18544__$1,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994));
var class$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18544__$1,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890));
var cause = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18544__$1,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742));
var spec = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__18544__$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__5002__auto__ = source;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return "<cljs repl>";
}
})()),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__5002__auto__ = line;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__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__5002__auto__ = class$;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__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__18592 = phase;
var G__18592__$1 = (((G__18592 instanceof cljs.core.Keyword))?G__18592.fqn:null);
switch (G__18592__$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__18605 = "Syntax error macroexpanding %sat (%s).\n%s";
var G__18606 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__18607 = loc;
var G__18608 = (cljs.core.truth_(spec)?(function (){var sb__5647__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__18609_18788 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__18610_18789 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__18611_18790 = true;
var _STAR_print_fn_STAR__temp_val__18612_18791 = (function (x__5648__auto__){
return sb__5647__auto__.append(x__5648__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__18611_18790);

(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__18612_18791);

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__18539_SHARP_){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(p1__18539_SHARP_,new cljs.core.Keyword(null,"in","in",-1531184865));
}),probs);
}))
);
}finally {(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__18610_18789);

(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__18609_18788);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__5647__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__18605,G__18606,G__18607,G__18608) : format.call(null,G__18605,G__18606,G__18607,G__18608));

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

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

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

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__18643 = "Execution error - invalid arguments to %s at (%s).\n%s";
var G__18644 = symbol;
var G__18645 = loc;
var G__18646 = (function (){var sb__5647__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__18648_18801 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__18649_18802 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__18650_18803 = true;
var _STAR_print_fn_STAR__temp_val__18651_18804 = (function (x__5648__auto__){
return sb__5647__auto__.append(x__5648__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__18650_18803);

(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__18651_18804);

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__18541_SHARP_){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(p1__18541_SHARP_,new cljs.core.Keyword(null,"in","in",-1531184865));
}),probs);
}))
);
}finally {(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__18649_18802);

(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__18648_18801);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__5647__auto__);
})();
return (format.cljs$core$IFn$_invoke$arity$4 ? format.cljs$core$IFn$_invoke$arity$4(G__18643,G__18644,G__18645,G__18646) : format.call(null,G__18643,G__18644,G__18645,G__18646));
} else {
var G__18660 = "Execution error%s at %s(%s).\n%s\n";
var G__18661 = cause_type;
var G__18662 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__18663 = loc;
var G__18664 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__18660,G__18661,G__18662,G__18663,G__18664) : format.call(null,G__18660,G__18661,G__18662,G__18663,G__18664));
}

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__18592__$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
