import "./cljs_env.js";
goog.provide('cljs.repl');
cljs.repl.print_doc = (function cljs$repl$print_doc(p__79336){
var map__79337 = p__79336;
var map__79337__$1 = cljs.core.__destructure_map(map__79337);
var m = map__79337__$1;
var n = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79337__$1,new cljs.core.Keyword(null,"ns","ns",441598760));
var nm = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79337__$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__4223__auto__ = new cljs.core.Keyword(null,"spec","spec",347520401).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return [(function (){var temp__5753__auto__ = new cljs.core.Keyword(null,"ns","ns",441598760).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(temp__5753__auto__)){
var ns = temp__5753__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__79341_79547 = cljs.core.seq(new cljs.core.Keyword(null,"forms","forms",2045992350).cljs$core$IFn$_invoke$arity$1(m));
var chunk__79342_79548 = null;
var count__79343_79549 = (0);
var i__79344_79550 = (0);
while(true){
if((i__79344_79550 < count__79343_79549)){
var f_79551 = chunk__79342_79548.cljs$core$IIndexed$_nth$arity$2(null,i__79344_79550);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["  ",f_79551], 0));


var G__79552 = seq__79341_79547;
var G__79553 = chunk__79342_79548;
var G__79554 = count__79343_79549;
var G__79555 = (i__79344_79550 + (1));
seq__79341_79547 = G__79552;
chunk__79342_79548 = G__79553;
count__79343_79549 = G__79554;
i__79344_79550 = G__79555;
continue;
} else {
var temp__5753__auto___79556 = cljs.core.seq(seq__79341_79547);
if(temp__5753__auto___79556){
var seq__79341_79557__$1 = temp__5753__auto___79556;
if(cljs.core.chunked_seq_QMARK_(seq__79341_79557__$1)){
var c__4649__auto___79558 = cljs.core.chunk_first(seq__79341_79557__$1);
var G__79559 = cljs.core.chunk_rest(seq__79341_79557__$1);
var G__79560 = c__4649__auto___79558;
var G__79561 = cljs.core.count(c__4649__auto___79558);
var G__79562 = (0);
seq__79341_79547 = G__79559;
chunk__79342_79548 = G__79560;
count__79343_79549 = G__79561;
i__79344_79550 = G__79562;
continue;
} else {
var f_79563 = cljs.core.first(seq__79341_79557__$1);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["  ",f_79563], 0));


var G__79564 = cljs.core.next(seq__79341_79557__$1);
var G__79565 = null;
var G__79566 = (0);
var G__79567 = (0);
seq__79341_79547 = G__79564;
chunk__79342_79548 = G__79565;
count__79343_79549 = G__79566;
i__79344_79550 = G__79567;
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_79568 = new cljs.core.Keyword(null,"arglists","arglists",1661989754).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_((function (){var or__4223__auto__ = new cljs.core.Keyword(null,"macro","macro",-867863404).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__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_79568], 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_79568)))?cljs.core.second(arglists_79568):arglists_79568)], 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__79348_79569 = cljs.core.seq(new cljs.core.Keyword(null,"methods","methods",453930866).cljs$core$IFn$_invoke$arity$1(m));
var chunk__79349_79570 = null;
var count__79350_79571 = (0);
var i__79351_79572 = (0);
while(true){
if((i__79351_79572 < count__79350_79571)){
var vec__79361_79573 = chunk__79349_79570.cljs$core$IIndexed$_nth$arity$2(null,i__79351_79572);
var name_79574 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__79361_79573,(0),null);
var map__79364_79575 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__79361_79573,(1),null);
var map__79364_79576__$1 = cljs.core.__destructure_map(map__79364_79575);
var doc_79577 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79364_79576__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_79578 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79364_79576__$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_79574], 0));

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

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


var G__79579 = seq__79348_79569;
var G__79580 = chunk__79349_79570;
var G__79581 = count__79350_79571;
var G__79582 = (i__79351_79572 + (1));
seq__79348_79569 = G__79579;
chunk__79349_79570 = G__79580;
count__79350_79571 = G__79581;
i__79351_79572 = G__79582;
continue;
} else {
var temp__5753__auto___79583 = cljs.core.seq(seq__79348_79569);
if(temp__5753__auto___79583){
var seq__79348_79584__$1 = temp__5753__auto___79583;
if(cljs.core.chunked_seq_QMARK_(seq__79348_79584__$1)){
var c__4649__auto___79585 = cljs.core.chunk_first(seq__79348_79584__$1);
var G__79586 = cljs.core.chunk_rest(seq__79348_79584__$1);
var G__79587 = c__4649__auto___79585;
var G__79588 = cljs.core.count(c__4649__auto___79585);
var G__79589 = (0);
seq__79348_79569 = G__79586;
chunk__79349_79570 = G__79587;
count__79350_79571 = G__79588;
i__79351_79572 = G__79589;
continue;
} else {
var vec__79367_79590 = cljs.core.first(seq__79348_79584__$1);
var name_79591 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__79367_79590,(0),null);
var map__79370_79592 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__79367_79590,(1),null);
var map__79370_79593__$1 = cljs.core.__destructure_map(map__79370_79592);
var doc_79594 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79370_79593__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_79595 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79370_79593__$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_79591], 0));

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

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


var G__79596 = cljs.core.next(seq__79348_79584__$1);
var G__79597 = null;
var G__79598 = (0);
var G__79599 = (0);
seq__79348_79569 = G__79596;
chunk__79349_79570 = G__79597;
count__79350_79571 = G__79598;
i__79351_79572 = G__79599;
continue;
}
} else {
}
}
break;
}
} else {
}

if(cljs.core.truth_(n)){
var temp__5753__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__5753__auto__)){
var fnspec = temp__5753__auto__;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Spec"], 0));

var seq__79371 = 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__79372 = null;
var count__79373 = (0);
var i__79374 = (0);
while(true){
if((i__79374 < count__79373)){
var role = chunk__79372.cljs$core$IIndexed$_nth$arity$2(null,i__79374);
var temp__5753__auto___79600__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5753__auto___79600__$1)){
var spec_79601 = temp__5753__auto___79600__$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_79601)], 0));
} else {
}


var G__79602 = seq__79371;
var G__79603 = chunk__79372;
var G__79604 = count__79373;
var G__79605 = (i__79374 + (1));
seq__79371 = G__79602;
chunk__79372 = G__79603;
count__79373 = G__79604;
i__79374 = G__79605;
continue;
} else {
var temp__5753__auto____$1 = cljs.core.seq(seq__79371);
if(temp__5753__auto____$1){
var seq__79371__$1 = temp__5753__auto____$1;
if(cljs.core.chunked_seq_QMARK_(seq__79371__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__79371__$1);
var G__79607 = cljs.core.chunk_rest(seq__79371__$1);
var G__79608 = c__4649__auto__;
var G__79609 = cljs.core.count(c__4649__auto__);
var G__79610 = (0);
seq__79371 = G__79607;
chunk__79372 = G__79608;
count__79373 = G__79609;
i__79374 = G__79610;
continue;
} else {
var role = cljs.core.first(seq__79371__$1);
var temp__5753__auto___79611__$2 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5753__auto___79611__$2)){
var spec_79612 = temp__5753__auto___79611__$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_79612)], 0));
} else {
}


var G__79613 = cljs.core.next(seq__79371__$1);
var G__79614 = null;
var G__79615 = (0);
var G__79616 = (0);
seq__79371 = G__79613;
chunk__79372 = G__79614;
count__79373 = G__79615;
i__79374 = G__79616;
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){
var base = (function (t){
return cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1174270348),(((t instanceof cljs.core.ExceptionInfo))?new cljs.core.Symbol("cljs.core","ExceptionInfo","cljs.core/ExceptionInfo",701839050,null):(((t instanceof Error))?cljs.core.symbol.cljs$core$IFn$_invoke$arity$2("js",t.name):null
))], null),(function (){var temp__5753__auto__ = cljs.core.ex_message(t);
if(cljs.core.truth_(temp__5753__auto__)){
var msg = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"message","message",-406056002),msg], null);
} else {
return null;
}
})(),(function (){var temp__5753__auto__ = cljs.core.ex_data(t);
if(cljs.core.truth_(temp__5753__auto__)){
var ed = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"data","data",-232669377),ed], null);
} else {
return null;
}
})()], 0));
});
var via = (function (){var via = cljs.core.PersistentVector.EMPTY;
var t = o;
while(true){
if(cljs.core.truth_(t)){
var G__79617 = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(via,t);
var G__79618 = cljs.core.ex_cause(t);
via = G__79617;
t = G__79618;
continue;
} else {
return via;
}
break;
}
})();
var root = cljs.core.peek(via);
return cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"via","via",-1904457336),cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$2(base,via)),new cljs.core.Keyword(null,"trace","trace",-1082747415),null], null),(function (){var temp__5753__auto__ = cljs.core.ex_message(root);
if(cljs.core.truth_(temp__5753__auto__)){
var root_msg = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cause","cause",231901252),root_msg], null);
} else {
return null;
}
})(),(function (){var temp__5753__auto__ = cljs.core.ex_data(root);
if(cljs.core.truth_(temp__5753__auto__)){
var data = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"data","data",-232669377),data], null);
} else {
return null;
}
})(),(function (){var temp__5753__auto__ = new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358).cljs$core$IFn$_invoke$arity$1(cljs.core.ex_data(o));
if(cljs.core.truth_(temp__5753__auto__)){
var phase = temp__5753__auto__;
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"phase","phase",575722892),phase], null);
} else {
return null;
}
})()], 0));
});
/**
 * 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__79473 = datafied_throwable;
var map__79473__$1 = cljs.core.__destructure_map(map__79473);
var via = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79473__$1,new cljs.core.Keyword(null,"via","via",-1904457336));
var trace = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79473__$1,new cljs.core.Keyword(null,"trace","trace",-1082747415));
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__79473__$1,new cljs.core.Keyword(null,"phase","phase",575722892),new cljs.core.Keyword(null,"execution","execution",253283524));
var map__79474 = cljs.core.last(via);
var map__79474__$1 = cljs.core.__destructure_map(map__79474);
var type = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79474__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var message = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79474__$1,new cljs.core.Keyword(null,"message","message",-406056002));
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79474__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var map__79475 = data;
var map__79475__$1 = cljs.core.__destructure_map(map__79475);
var problems = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79475__$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__79475__$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__79475__$1,new cljs.core.Keyword("cljs.spec.test.alpha","caller","cljs.spec.test.alpha/caller",-398302390));
var map__79476 = new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.first(via));
var map__79476__$1 = cljs.core.__destructure_map(map__79476);
var top_data = map__79476__$1;
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79476__$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__79478 = phase;
var G__79478__$1 = (((G__79478 instanceof cljs.core.Keyword))?G__79478.fqn:null);
switch (G__79478__$1) {
case "read-source":
var map__79479 = data;
var map__79479__$1 = cljs.core.__destructure_map(map__79479);
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79479__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79479__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var G__79480 = 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__79480__$1 = (cljs.core.truth_(source)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__79480,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),source):G__79480);
var G__79480__$2 = (cljs.core.truth_((function (){var fexpr__79481 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__79481.cljs$core$IFn$_invoke$arity$1 ? fexpr__79481.cljs$core$IFn$_invoke$arity$1(source) : fexpr__79481.call(null,source));
})())?cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(G__79480__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397)):G__79480__$1);
if(cljs.core.truth_(message)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__79480__$2,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message);
} else {
return G__79480__$2;
}

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

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

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

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__79478__$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__79499){
var map__79500 = p__79499;
var map__79500__$1 = cljs.core.__destructure_map(map__79500);
var triage_data = map__79500__$1;
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79500__$1,new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358));
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79500__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397));
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79500__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79500__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var symbol = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79500__$1,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994));
var class$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79500__$1,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890));
var cause = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79500__$1,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742));
var spec = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__79500__$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__4223__auto__ = source;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return "<cljs repl>";
}
})()),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4223__auto__ = line;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__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__4223__auto__ = class$;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__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__79505 = phase;
var G__79505__$1 = (((G__79505 instanceof cljs.core.Keyword))?G__79505.fqn:null);
switch (G__79505__$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__79506 = "Syntax error macroexpanding %sat (%s).\n%s";
var G__79507 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__79508 = loc;
var G__79509 = (cljs.core.truth_(spec)?(function (){var sb__4760__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__79514_79632 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__79515_79633 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__79516_79634 = true;
var _STAR_print_fn_STAR__temp_val__79517_79635 = (function (x__4761__auto__){
return sb__4760__auto__.append(x__4761__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__79516_79634);

(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__79517_79635);

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

(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__79514_79632);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__4760__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__79506,G__79507,G__79508,G__79509) : format.call(null,G__79506,G__79507,G__79508,G__79509));

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

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

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

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__79533 = "Execution error - invalid arguments to %s at (%s).\n%s";
var G__79534 = symbol;
var G__79535 = loc;
var G__79536 = (function (){var sb__4760__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__79537_79640 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__79538_79641 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__79539_79642 = true;
var _STAR_print_fn_STAR__temp_val__79540_79643 = (function (x__4761__auto__){
return sb__4760__auto__.append(x__4761__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__79539_79642);

(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__79540_79643);

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

(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__79537_79640);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__4760__auto__);
})();
return (format.cljs$core$IFn$_invoke$arity$4 ? format.cljs$core$IFn$_invoke$arity$4(G__79533,G__79534,G__79535,G__79536) : format.call(null,G__79533,G__79534,G__79535,G__79536));
} else {
var G__79541 = "Execution error%s at %s(%s).\n%s\n";
var G__79542 = cause_type;
var G__79543 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__79544 = loc;
var G__79545 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__79541,G__79542,G__79543,G__79544,G__79545) : format.call(null,G__79541,G__79542,G__79543,G__79544,G__79545));
}

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