import "./cljs_env.js";
goog.provide('shadow.cljs.devtools.client.browser');
shadow.cljs.devtools.client.browser.devtools_msg = (function shadow$cljs$devtools$client$browser$devtools_msg(var_args){
var args__4835__auto__ = [];
var len__4829__auto___80482 = arguments.length;
var i__4830__auto___80483 = (0);
while(true){
if((i__4830__auto___80483 < len__4829__auto___80482)){
args__4835__auto__.push((arguments[i__4830__auto___80483]));

var G__80484 = (i__4830__auto___80483 + (1));
i__4830__auto___80483 = G__80484;
continue;
} else {
}
break;
}

var argseq__4836__auto__ = ((((1) < args__4835__auto__.length))?(new cljs.core.IndexedSeq(args__4835__auto__.slice((1)),(0),null)):null);
return shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4836__auto__);
});

(shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic = (function (msg,args){
if(shadow.cljs.devtools.client.env.log){
if(cljs.core.seq(shadow.cljs.devtools.client.env.log_style)){
return console.log.apply(console,cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(cljs.core.into.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [["%cshadow-cljs: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg)].join(''),shadow.cljs.devtools.client.env.log_style], null),args)));
} else {
return console.log.apply(console,cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(cljs.core.into.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [["shadow-cljs: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg)].join('')], null),args)));
}
} else {
return null;
}
}));

(shadow.cljs.devtools.client.browser.devtools_msg.cljs$lang$maxFixedArity = (1));

/** @this {Function} */
(shadow.cljs.devtools.client.browser.devtools_msg.cljs$lang$applyTo = (function (seq80071){
var G__80072 = cljs.core.first(seq80071);
var seq80071__$1 = cljs.core.next(seq80071);
var self__4816__auto__ = this;
return self__4816__auto__.cljs$core$IFn$_invoke$arity$variadic(G__80072,seq80071__$1);
}));

shadow.cljs.devtools.client.browser.script_eval = (function shadow$cljs$devtools$client$browser$script_eval(code){
return goog.globalEval(code);
});
shadow.cljs.devtools.client.browser.do_js_load = (function shadow$cljs$devtools$client$browser$do_js_load(sources){
var seq__80078 = cljs.core.seq(sources);
var chunk__80079 = null;
var count__80080 = (0);
var i__80081 = (0);
while(true){
if((i__80081 < count__80080)){
var map__80108 = chunk__80079.cljs$core$IIndexed$_nth$arity$2(null,i__80081);
var map__80108__$1 = cljs.core.__destructure_map(map__80108);
var src = map__80108__$1;
var resource_id = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80108__$1,new cljs.core.Keyword(null,"resource-id","resource-id",-1308422582));
var output_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80108__$1,new cljs.core.Keyword(null,"output-name","output-name",-1769107767));
var resource_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80108__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
var js = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80108__$1,new cljs.core.Keyword(null,"js","js",1768080579));
$CLJS.SHADOW_ENV.setLoaded(output_name);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load JS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([resource_name], 0));

shadow.cljs.devtools.client.env.before_load_src(src);

try{shadow.cljs.devtools.client.browser.script_eval([cljs.core.str.cljs$core$IFn$_invoke$arity$1(js),"\n//# sourceURL=",cljs.core.str.cljs$core$IFn$_invoke$arity$1($CLJS.SHADOW_ENV.scriptBase),cljs.core.str.cljs$core$IFn$_invoke$arity$1(output_name)].join(''));
}catch (e80109){var e_80495 = e80109;
if(shadow.cljs.devtools.client.env.log){
console.error(["Failed to load ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name)].join(''),e_80495);
} else {
}

throw (new Error(["Failed to load ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name),": ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(e_80495.message)].join('')));
}

var G__80498 = seq__80078;
var G__80499 = chunk__80079;
var G__80500 = count__80080;
var G__80501 = (i__80081 + (1));
seq__80078 = G__80498;
chunk__80079 = G__80499;
count__80080 = G__80500;
i__80081 = G__80501;
continue;
} else {
var temp__5753__auto__ = cljs.core.seq(seq__80078);
if(temp__5753__auto__){
var seq__80078__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__80078__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__80078__$1);
var G__80502 = cljs.core.chunk_rest(seq__80078__$1);
var G__80503 = c__4649__auto__;
var G__80504 = cljs.core.count(c__4649__auto__);
var G__80505 = (0);
seq__80078 = G__80502;
chunk__80079 = G__80503;
count__80080 = G__80504;
i__80081 = G__80505;
continue;
} else {
var map__80110 = cljs.core.first(seq__80078__$1);
var map__80110__$1 = cljs.core.__destructure_map(map__80110);
var src = map__80110__$1;
var resource_id = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80110__$1,new cljs.core.Keyword(null,"resource-id","resource-id",-1308422582));
var output_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80110__$1,new cljs.core.Keyword(null,"output-name","output-name",-1769107767));
var resource_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80110__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
var js = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80110__$1,new cljs.core.Keyword(null,"js","js",1768080579));
$CLJS.SHADOW_ENV.setLoaded(output_name);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load JS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([resource_name], 0));

shadow.cljs.devtools.client.env.before_load_src(src);

try{shadow.cljs.devtools.client.browser.script_eval([cljs.core.str.cljs$core$IFn$_invoke$arity$1(js),"\n//# sourceURL=",cljs.core.str.cljs$core$IFn$_invoke$arity$1($CLJS.SHADOW_ENV.scriptBase),cljs.core.str.cljs$core$IFn$_invoke$arity$1(output_name)].join(''));
}catch (e80111){var e_80506 = e80111;
if(shadow.cljs.devtools.client.env.log){
console.error(["Failed to load ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name)].join(''),e_80506);
} else {
}

throw (new Error(["Failed to load ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name),": ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(e_80506.message)].join('')));
}

var G__80507 = cljs.core.next(seq__80078__$1);
var G__80508 = null;
var G__80509 = (0);
var G__80510 = (0);
seq__80078 = G__80507;
chunk__80079 = G__80508;
count__80080 = G__80509;
i__80081 = G__80510;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.cljs.devtools.client.browser.do_js_reload = (function shadow$cljs$devtools$client$browser$do_js_reload(msg,sources,complete_fn,failure_fn){
return shadow.cljs.devtools.client.env.do_js_reload.cljs$core$IFn$_invoke$arity$4(cljs.core.assoc.cljs$core$IFn$_invoke$arity$variadic(msg,new cljs.core.Keyword(null,"log-missing-fn","log-missing-fn",732676765),(function (fn_sym){
return null;
}),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"log-call-async","log-call-async",183826192),(function (fn_sym){
return shadow.cljs.devtools.client.browser.devtools_msg(["call async ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(fn_sym)].join(''));
}),new cljs.core.Keyword(null,"log-call","log-call",412404391),(function (fn_sym){
return shadow.cljs.devtools.client.browser.devtools_msg(["call ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(fn_sym)].join(''));
})], 0)),(function (){
return shadow.cljs.devtools.client.browser.do_js_load(sources);
}),complete_fn,failure_fn);
});
/**
 * when (require '["some-str" :as x]) is done at the REPL we need to manually call the shadow.js.require for it
 * since the file only adds the shadow$provide. only need to do this for shadow-js.
 */
shadow.cljs.devtools.client.browser.do_js_requires = (function shadow$cljs$devtools$client$browser$do_js_requires(js_requires){
var seq__80113 = cljs.core.seq(js_requires);
var chunk__80114 = null;
var count__80115 = (0);
var i__80116 = (0);
while(true){
if((i__80116 < count__80115)){
var js_ns = chunk__80114.cljs$core$IIndexed$_nth$arity$2(null,i__80116);
var require_str_80511 = ["var ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(js_ns)," = shadow.js.require(\"",cljs.core.str.cljs$core$IFn$_invoke$arity$1(js_ns),"\");"].join('');
shadow.cljs.devtools.client.browser.script_eval(require_str_80511);


var G__80512 = seq__80113;
var G__80513 = chunk__80114;
var G__80514 = count__80115;
var G__80515 = (i__80116 + (1));
seq__80113 = G__80512;
chunk__80114 = G__80513;
count__80115 = G__80514;
i__80116 = G__80515;
continue;
} else {
var temp__5753__auto__ = cljs.core.seq(seq__80113);
if(temp__5753__auto__){
var seq__80113__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__80113__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__80113__$1);
var G__80516 = cljs.core.chunk_rest(seq__80113__$1);
var G__80517 = c__4649__auto__;
var G__80518 = cljs.core.count(c__4649__auto__);
var G__80519 = (0);
seq__80113 = G__80516;
chunk__80114 = G__80517;
count__80115 = G__80518;
i__80116 = G__80519;
continue;
} else {
var js_ns = cljs.core.first(seq__80113__$1);
var require_str_80520 = ["var ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(js_ns)," = shadow.js.require(\"",cljs.core.str.cljs$core$IFn$_invoke$arity$1(js_ns),"\");"].join('');
shadow.cljs.devtools.client.browser.script_eval(require_str_80520);


var G__80521 = cljs.core.next(seq__80113__$1);
var G__80522 = null;
var G__80523 = (0);
var G__80524 = (0);
seq__80113 = G__80521;
chunk__80114 = G__80522;
count__80115 = G__80523;
i__80116 = G__80524;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.cljs.devtools.client.browser.handle_build_complete = (function shadow$cljs$devtools$client$browser$handle_build_complete(runtime,p__80135){
var map__80137 = p__80135;
var map__80137__$1 = cljs.core.__destructure_map(map__80137);
var msg = map__80137__$1;
var info = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80137__$1,new cljs.core.Keyword(null,"info","info",-317069002));
var reload_info = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80137__$1,new cljs.core.Keyword(null,"reload-info","reload-info",1648088086));
var warnings = cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY,cljs.core.distinct.cljs$core$IFn$_invoke$arity$1((function (){var iter__4622__auto__ = (function shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__80140(s__80141){
return (new cljs.core.LazySeq(null,(function (){
var s__80141__$1 = s__80141;
while(true){
var temp__5753__auto__ = cljs.core.seq(s__80141__$1);
if(temp__5753__auto__){
var xs__6308__auto__ = temp__5753__auto__;
var map__80149 = cljs.core.first(xs__6308__auto__);
var map__80149__$1 = cljs.core.__destructure_map(map__80149);
var src = map__80149__$1;
var resource_name = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80149__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
var warnings = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80149__$1,new cljs.core.Keyword(null,"warnings","warnings",-735437651));
if(cljs.core.not(new cljs.core.Keyword(null,"from-jar","from-jar",1050932827).cljs$core$IFn$_invoke$arity$1(src))){
var iterys__4618__auto__ = ((function (s__80141__$1,map__80149,map__80149__$1,src,resource_name,warnings,xs__6308__auto__,temp__5753__auto__,map__80137,map__80137__$1,msg,info,reload_info){
return (function shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__80140_$_iter__80142(s__80143){
return (new cljs.core.LazySeq(null,((function (s__80141__$1,map__80149,map__80149__$1,src,resource_name,warnings,xs__6308__auto__,temp__5753__auto__,map__80137,map__80137__$1,msg,info,reload_info){
return (function (){
var s__80143__$1 = s__80143;
while(true){
var temp__5753__auto____$1 = cljs.core.seq(s__80143__$1);
if(temp__5753__auto____$1){
var s__80143__$2 = temp__5753__auto____$1;
if(cljs.core.chunked_seq_QMARK_(s__80143__$2)){
var c__4620__auto__ = cljs.core.chunk_first(s__80143__$2);
var size__4621__auto__ = cljs.core.count(c__4620__auto__);
var b__80145 = cljs.core.chunk_buffer(size__4621__auto__);
if((function (){var i__80144 = (0);
while(true){
if((i__80144 < size__4621__auto__)){
var warning = cljs.core._nth(c__4620__auto__,i__80144);
cljs.core.chunk_append(b__80145,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(warning,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100),resource_name));

var G__80525 = (i__80144 + (1));
i__80144 = G__80525;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons(cljs.core.chunk(b__80145),shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__80140_$_iter__80142(cljs.core.chunk_rest(s__80143__$2)));
} else {
return cljs.core.chunk_cons(cljs.core.chunk(b__80145),null);
}
} else {
var warning = cljs.core.first(s__80143__$2);
return cljs.core.cons(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(warning,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100),resource_name),shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__80140_$_iter__80142(cljs.core.rest(s__80143__$2)));
}
} else {
return null;
}
break;
}
});})(s__80141__$1,map__80149,map__80149__$1,src,resource_name,warnings,xs__6308__auto__,temp__5753__auto__,map__80137,map__80137__$1,msg,info,reload_info))
,null,null));
});})(s__80141__$1,map__80149,map__80149__$1,src,resource_name,warnings,xs__6308__auto__,temp__5753__auto__,map__80137,map__80137__$1,msg,info,reload_info))
;
var fs__4619__auto__ = cljs.core.seq(iterys__4618__auto__(warnings));
if(fs__4619__auto__){
return cljs.core.concat.cljs$core$IFn$_invoke$arity$2(fs__4619__auto__,shadow$cljs$devtools$client$browser$handle_build_complete_$_iter__80140(cljs.core.rest(s__80141__$1)));
} else {
var G__80526 = cljs.core.rest(s__80141__$1);
s__80141__$1 = G__80526;
continue;
}
} else {
var G__80527 = cljs.core.rest(s__80141__$1);
s__80141__$1 = G__80527;
continue;
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__4622__auto__(new cljs.core.Keyword(null,"sources","sources",-321166424).cljs$core$IFn$_invoke$arity$1(info));
})()));
if(shadow.cljs.devtools.client.env.log){
var seq__80161_80528 = cljs.core.seq(warnings);
var chunk__80162_80529 = null;
var count__80163_80530 = (0);
var i__80164_80531 = (0);
while(true){
if((i__80164_80531 < count__80163_80530)){
var map__80167_80532 = chunk__80162_80529.cljs$core$IIndexed$_nth$arity$2(null,i__80164_80531);
var map__80167_80533__$1 = cljs.core.__destructure_map(map__80167_80532);
var w_80534 = map__80167_80533__$1;
var msg_80535__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80167_80533__$1,new cljs.core.Keyword(null,"msg","msg",-1386103444));
var line_80536 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80167_80533__$1,new cljs.core.Keyword(null,"line","line",212345235));
var column_80537 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80167_80533__$1,new cljs.core.Keyword(null,"column","column",2078222095));
var resource_name_80538 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80167_80533__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
console.warn(["BUILD-WARNING in ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name_80538)," at [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line_80536),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column_80537),"]\n\t",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg_80535__$1)].join(''));


var G__80539 = seq__80161_80528;
var G__80540 = chunk__80162_80529;
var G__80541 = count__80163_80530;
var G__80542 = (i__80164_80531 + (1));
seq__80161_80528 = G__80539;
chunk__80162_80529 = G__80540;
count__80163_80530 = G__80541;
i__80164_80531 = G__80542;
continue;
} else {
var temp__5753__auto___80543 = cljs.core.seq(seq__80161_80528);
if(temp__5753__auto___80543){
var seq__80161_80544__$1 = temp__5753__auto___80543;
if(cljs.core.chunked_seq_QMARK_(seq__80161_80544__$1)){
var c__4649__auto___80545 = cljs.core.chunk_first(seq__80161_80544__$1);
var G__80546 = cljs.core.chunk_rest(seq__80161_80544__$1);
var G__80547 = c__4649__auto___80545;
var G__80548 = cljs.core.count(c__4649__auto___80545);
var G__80549 = (0);
seq__80161_80528 = G__80546;
chunk__80162_80529 = G__80547;
count__80163_80530 = G__80548;
i__80164_80531 = G__80549;
continue;
} else {
var map__80168_80550 = cljs.core.first(seq__80161_80544__$1);
var map__80168_80551__$1 = cljs.core.__destructure_map(map__80168_80550);
var w_80552 = map__80168_80551__$1;
var msg_80553__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80168_80551__$1,new cljs.core.Keyword(null,"msg","msg",-1386103444));
var line_80554 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80168_80551__$1,new cljs.core.Keyword(null,"line","line",212345235));
var column_80555 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80168_80551__$1,new cljs.core.Keyword(null,"column","column",2078222095));
var resource_name_80556 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80168_80551__$1,new cljs.core.Keyword(null,"resource-name","resource-name",2001617100));
console.warn(["BUILD-WARNING in ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(resource_name_80556)," at [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(line_80554),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column_80555),"]\n\t",cljs.core.str.cljs$core$IFn$_invoke$arity$1(msg_80553__$1)].join(''));


var G__80557 = cljs.core.next(seq__80161_80544__$1);
var G__80558 = null;
var G__80559 = (0);
var G__80560 = (0);
seq__80161_80528 = G__80557;
chunk__80162_80529 = G__80558;
count__80163_80530 = G__80559;
i__80164_80531 = G__80560;
continue;
}
} else {
}
}
break;
}
} else {
}

if((!(shadow.cljs.devtools.client.env.autoload))){
return shadow.cljs.devtools.client.hud.load_end_success();
} else {
if(((cljs.core.empty_QMARK_(warnings)) || (shadow.cljs.devtools.client.env.ignore_warnings))){
var sources_to_get = shadow.cljs.devtools.client.env.filter_reload_sources(info,reload_info);
if(cljs.core.not(cljs.core.seq(sources_to_get))){
return shadow.cljs.devtools.client.hud.load_end_success();
} else {
if(cljs.core.seq(cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(msg,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"reload-info","reload-info",1648088086),new cljs.core.Keyword(null,"after-load","after-load",-1278503285)], null)))){
} else {
shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("reloading code but no :after-load hooks are configured!",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["https://shadow-cljs.github.io/docs/UsersGuide.html#_lifecycle_hooks"], 0));
}

return shadow.cljs.devtools.client.shared.load_sources(runtime,sources_to_get,(function (p1__80130_SHARP_){
return shadow.cljs.devtools.client.browser.do_js_reload(msg,p1__80130_SHARP_,shadow.cljs.devtools.client.hud.load_end_success,shadow.cljs.devtools.client.hud.load_failure);
}));
}
} else {
return null;
}
}
});
shadow.cljs.devtools.client.browser.page_load_uri = (cljs.core.truth_(goog.global.document)?goog.Uri.parse(document.location.href):null);
shadow.cljs.devtools.client.browser.match_paths = (function shadow$cljs$devtools$client$browser$match_paths(old,new$){
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2("file",shadow.cljs.devtools.client.browser.page_load_uri.getScheme())){
var rel_new = cljs.core.subs.cljs$core$IFn$_invoke$arity$2(new$,(1));
if(((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(old,rel_new)) || (clojure.string.starts_with_QMARK_(old,[rel_new,"?"].join(''))))){
return rel_new;
} else {
return null;
}
} else {
var node_uri = goog.Uri.parse(old);
var node_uri_resolved = shadow.cljs.devtools.client.browser.page_load_uri.resolve(node_uri);
var node_abs = node_uri_resolved.getPath();
var and__4221__auto__ = ((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$1(shadow.cljs.devtools.client.browser.page_load_uri.hasSameDomainAs(node_uri))) || (cljs.core.not(node_uri.hasDomain())));
if(and__4221__auto__){
var and__4221__auto____$1 = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(node_abs,new$);
if(and__4221__auto____$1){
return new$;
} else {
return and__4221__auto____$1;
}
} else {
return and__4221__auto__;
}
}
});
shadow.cljs.devtools.client.browser.handle_asset_update = (function shadow$cljs$devtools$client$browser$handle_asset_update(p__80193){
var map__80194 = p__80193;
var map__80194__$1 = cljs.core.__destructure_map(map__80194);
var msg = map__80194__$1;
var updates = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80194__$1,new cljs.core.Keyword(null,"updates","updates",2013983452));
var seq__80196 = cljs.core.seq(updates);
var chunk__80198 = null;
var count__80199 = (0);
var i__80200 = (0);
while(true){
if((i__80200 < count__80199)){
var path = chunk__80198.cljs$core$IIndexed$_nth$arity$2(null,i__80200);
if(clojure.string.ends_with_QMARK_(path,"css")){
var seq__80310_80561 = cljs.core.seq(cljs.core.array_seq.cljs$core$IFn$_invoke$arity$1(document.querySelectorAll("link[rel=\"stylesheet\"]")));
var chunk__80314_80562 = null;
var count__80315_80563 = (0);
var i__80316_80564 = (0);
while(true){
if((i__80316_80564 < count__80315_80563)){
var node_80565 = chunk__80314_80562.cljs$core$IIndexed$_nth$arity$2(null,i__80316_80564);
if(cljs.core.not(node_80565.shadow$old)){
var path_match_80566 = shadow.cljs.devtools.client.browser.match_paths(node_80565.getAttribute("href"),path);
if(cljs.core.truth_(path_match_80566)){
var new_link_80567 = (function (){var G__80326 = node_80565.cloneNode(true);
G__80326.setAttribute("href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(path_match_80566),"?r=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.rand.cljs$core$IFn$_invoke$arity$0())].join(''));

return G__80326;
})();
(node_80565.shadow$old = true);

(new_link_80567.onload = ((function (seq__80310_80561,chunk__80314_80562,count__80315_80563,i__80316_80564,seq__80196,chunk__80198,count__80199,i__80200,new_link_80567,path_match_80566,node_80565,path,map__80194,map__80194__$1,msg,updates){
return (function (e){
return goog.dom.removeNode(node_80565);
});})(seq__80310_80561,chunk__80314_80562,count__80315_80563,i__80316_80564,seq__80196,chunk__80198,count__80199,i__80200,new_link_80567,path_match_80566,node_80565,path,map__80194,map__80194__$1,msg,updates))
);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load CSS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([path_match_80566], 0));

goog.dom.insertSiblingAfter(new_link_80567,node_80565);


var G__80568 = seq__80310_80561;
var G__80569 = chunk__80314_80562;
var G__80570 = count__80315_80563;
var G__80571 = (i__80316_80564 + (1));
seq__80310_80561 = G__80568;
chunk__80314_80562 = G__80569;
count__80315_80563 = G__80570;
i__80316_80564 = G__80571;
continue;
} else {
var G__80572 = seq__80310_80561;
var G__80573 = chunk__80314_80562;
var G__80574 = count__80315_80563;
var G__80575 = (i__80316_80564 + (1));
seq__80310_80561 = G__80572;
chunk__80314_80562 = G__80573;
count__80315_80563 = G__80574;
i__80316_80564 = G__80575;
continue;
}
} else {
var G__80576 = seq__80310_80561;
var G__80577 = chunk__80314_80562;
var G__80578 = count__80315_80563;
var G__80579 = (i__80316_80564 + (1));
seq__80310_80561 = G__80576;
chunk__80314_80562 = G__80577;
count__80315_80563 = G__80578;
i__80316_80564 = G__80579;
continue;
}
} else {
var temp__5753__auto___80580 = cljs.core.seq(seq__80310_80561);
if(temp__5753__auto___80580){
var seq__80310_80581__$1 = temp__5753__auto___80580;
if(cljs.core.chunked_seq_QMARK_(seq__80310_80581__$1)){
var c__4649__auto___80582 = cljs.core.chunk_first(seq__80310_80581__$1);
var G__80583 = cljs.core.chunk_rest(seq__80310_80581__$1);
var G__80584 = c__4649__auto___80582;
var G__80585 = cljs.core.count(c__4649__auto___80582);
var G__80586 = (0);
seq__80310_80561 = G__80583;
chunk__80314_80562 = G__80584;
count__80315_80563 = G__80585;
i__80316_80564 = G__80586;
continue;
} else {
var node_80588 = cljs.core.first(seq__80310_80581__$1);
if(cljs.core.not(node_80588.shadow$old)){
var path_match_80590 = shadow.cljs.devtools.client.browser.match_paths(node_80588.getAttribute("href"),path);
if(cljs.core.truth_(path_match_80590)){
var new_link_80591 = (function (){var G__80327 = node_80588.cloneNode(true);
G__80327.setAttribute("href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(path_match_80590),"?r=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.rand.cljs$core$IFn$_invoke$arity$0())].join(''));

return G__80327;
})();
(node_80588.shadow$old = true);

(new_link_80591.onload = ((function (seq__80310_80561,chunk__80314_80562,count__80315_80563,i__80316_80564,seq__80196,chunk__80198,count__80199,i__80200,new_link_80591,path_match_80590,node_80588,seq__80310_80581__$1,temp__5753__auto___80580,path,map__80194,map__80194__$1,msg,updates){
return (function (e){
return goog.dom.removeNode(node_80588);
});})(seq__80310_80561,chunk__80314_80562,count__80315_80563,i__80316_80564,seq__80196,chunk__80198,count__80199,i__80200,new_link_80591,path_match_80590,node_80588,seq__80310_80581__$1,temp__5753__auto___80580,path,map__80194,map__80194__$1,msg,updates))
);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load CSS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([path_match_80590], 0));

goog.dom.insertSiblingAfter(new_link_80591,node_80588);


var G__80595 = cljs.core.next(seq__80310_80581__$1);
var G__80596 = null;
var G__80597 = (0);
var G__80598 = (0);
seq__80310_80561 = G__80595;
chunk__80314_80562 = G__80596;
count__80315_80563 = G__80597;
i__80316_80564 = G__80598;
continue;
} else {
var G__80600 = cljs.core.next(seq__80310_80581__$1);
var G__80601 = null;
var G__80602 = (0);
var G__80603 = (0);
seq__80310_80561 = G__80600;
chunk__80314_80562 = G__80601;
count__80315_80563 = G__80602;
i__80316_80564 = G__80603;
continue;
}
} else {
var G__80604 = cljs.core.next(seq__80310_80581__$1);
var G__80605 = null;
var G__80606 = (0);
var G__80607 = (0);
seq__80310_80561 = G__80604;
chunk__80314_80562 = G__80605;
count__80315_80563 = G__80606;
i__80316_80564 = G__80607;
continue;
}
}
} else {
}
}
break;
}


var G__80608 = seq__80196;
var G__80609 = chunk__80198;
var G__80610 = count__80199;
var G__80611 = (i__80200 + (1));
seq__80196 = G__80608;
chunk__80198 = G__80609;
count__80199 = G__80610;
i__80200 = G__80611;
continue;
} else {
var G__80614 = seq__80196;
var G__80615 = chunk__80198;
var G__80616 = count__80199;
var G__80617 = (i__80200 + (1));
seq__80196 = G__80614;
chunk__80198 = G__80615;
count__80199 = G__80616;
i__80200 = G__80617;
continue;
}
} else {
var temp__5753__auto__ = cljs.core.seq(seq__80196);
if(temp__5753__auto__){
var seq__80196__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__80196__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__80196__$1);
var G__80618 = cljs.core.chunk_rest(seq__80196__$1);
var G__80619 = c__4649__auto__;
var G__80620 = cljs.core.count(c__4649__auto__);
var G__80621 = (0);
seq__80196 = G__80618;
chunk__80198 = G__80619;
count__80199 = G__80620;
i__80200 = G__80621;
continue;
} else {
var path = cljs.core.first(seq__80196__$1);
if(clojure.string.ends_with_QMARK_(path,"css")){
var seq__80329_80622 = cljs.core.seq(cljs.core.array_seq.cljs$core$IFn$_invoke$arity$1(document.querySelectorAll("link[rel=\"stylesheet\"]")));
var chunk__80333_80623 = null;
var count__80334_80624 = (0);
var i__80335_80625 = (0);
while(true){
if((i__80335_80625 < count__80334_80624)){
var node_80626 = chunk__80333_80623.cljs$core$IIndexed$_nth$arity$2(null,i__80335_80625);
if(cljs.core.not(node_80626.shadow$old)){
var path_match_80628 = shadow.cljs.devtools.client.browser.match_paths(node_80626.getAttribute("href"),path);
if(cljs.core.truth_(path_match_80628)){
var new_link_80629 = (function (){var G__80350 = node_80626.cloneNode(true);
G__80350.setAttribute("href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(path_match_80628),"?r=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.rand.cljs$core$IFn$_invoke$arity$0())].join(''));

return G__80350;
})();
(node_80626.shadow$old = true);

(new_link_80629.onload = ((function (seq__80329_80622,chunk__80333_80623,count__80334_80624,i__80335_80625,seq__80196,chunk__80198,count__80199,i__80200,new_link_80629,path_match_80628,node_80626,path,seq__80196__$1,temp__5753__auto__,map__80194,map__80194__$1,msg,updates){
return (function (e){
return goog.dom.removeNode(node_80626);
});})(seq__80329_80622,chunk__80333_80623,count__80334_80624,i__80335_80625,seq__80196,chunk__80198,count__80199,i__80200,new_link_80629,path_match_80628,node_80626,path,seq__80196__$1,temp__5753__auto__,map__80194,map__80194__$1,msg,updates))
);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load CSS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([path_match_80628], 0));

goog.dom.insertSiblingAfter(new_link_80629,node_80626);


var G__80631 = seq__80329_80622;
var G__80632 = chunk__80333_80623;
var G__80633 = count__80334_80624;
var G__80634 = (i__80335_80625 + (1));
seq__80329_80622 = G__80631;
chunk__80333_80623 = G__80632;
count__80334_80624 = G__80633;
i__80335_80625 = G__80634;
continue;
} else {
var G__80635 = seq__80329_80622;
var G__80636 = chunk__80333_80623;
var G__80637 = count__80334_80624;
var G__80638 = (i__80335_80625 + (1));
seq__80329_80622 = G__80635;
chunk__80333_80623 = G__80636;
count__80334_80624 = G__80637;
i__80335_80625 = G__80638;
continue;
}
} else {
var G__80639 = seq__80329_80622;
var G__80640 = chunk__80333_80623;
var G__80641 = count__80334_80624;
var G__80642 = (i__80335_80625 + (1));
seq__80329_80622 = G__80639;
chunk__80333_80623 = G__80640;
count__80334_80624 = G__80641;
i__80335_80625 = G__80642;
continue;
}
} else {
var temp__5753__auto___80643__$1 = cljs.core.seq(seq__80329_80622);
if(temp__5753__auto___80643__$1){
var seq__80329_80645__$1 = temp__5753__auto___80643__$1;
if(cljs.core.chunked_seq_QMARK_(seq__80329_80645__$1)){
var c__4649__auto___80647 = cljs.core.chunk_first(seq__80329_80645__$1);
var G__80648 = cljs.core.chunk_rest(seq__80329_80645__$1);
var G__80649 = c__4649__auto___80647;
var G__80650 = cljs.core.count(c__4649__auto___80647);
var G__80651 = (0);
seq__80329_80622 = G__80648;
chunk__80333_80623 = G__80649;
count__80334_80624 = G__80650;
i__80335_80625 = G__80651;
continue;
} else {
var node_80652 = cljs.core.first(seq__80329_80645__$1);
if(cljs.core.not(node_80652.shadow$old)){
var path_match_80654 = shadow.cljs.devtools.client.browser.match_paths(node_80652.getAttribute("href"),path);
if(cljs.core.truth_(path_match_80654)){
var new_link_80655 = (function (){var G__80352 = node_80652.cloneNode(true);
G__80352.setAttribute("href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(path_match_80654),"?r=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.rand.cljs$core$IFn$_invoke$arity$0())].join(''));

return G__80352;
})();
(node_80652.shadow$old = true);

(new_link_80655.onload = ((function (seq__80329_80622,chunk__80333_80623,count__80334_80624,i__80335_80625,seq__80196,chunk__80198,count__80199,i__80200,new_link_80655,path_match_80654,node_80652,seq__80329_80645__$1,temp__5753__auto___80643__$1,path,seq__80196__$1,temp__5753__auto__,map__80194,map__80194__$1,msg,updates){
return (function (e){
return goog.dom.removeNode(node_80652);
});})(seq__80329_80622,chunk__80333_80623,count__80334_80624,i__80335_80625,seq__80196,chunk__80198,count__80199,i__80200,new_link_80655,path_match_80654,node_80652,seq__80329_80645__$1,temp__5753__auto___80643__$1,path,seq__80196__$1,temp__5753__auto__,map__80194,map__80194__$1,msg,updates))
);

shadow.cljs.devtools.client.browser.devtools_msg.cljs$core$IFn$_invoke$arity$variadic("load CSS",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([path_match_80654], 0));

goog.dom.insertSiblingAfter(new_link_80655,node_80652);


var G__80656 = cljs.core.next(seq__80329_80645__$1);
var G__80657 = null;
var G__80658 = (0);
var G__80659 = (0);
seq__80329_80622 = G__80656;
chunk__80333_80623 = G__80657;
count__80334_80624 = G__80658;
i__80335_80625 = G__80659;
continue;
} else {
var G__80662 = cljs.core.next(seq__80329_80645__$1);
var G__80663 = null;
var G__80664 = (0);
var G__80665 = (0);
seq__80329_80622 = G__80662;
chunk__80333_80623 = G__80663;
count__80334_80624 = G__80664;
i__80335_80625 = G__80665;
continue;
}
} else {
var G__80666 = cljs.core.next(seq__80329_80645__$1);
var G__80667 = null;
var G__80668 = (0);
var G__80669 = (0);
seq__80329_80622 = G__80666;
chunk__80333_80623 = G__80667;
count__80334_80624 = G__80668;
i__80335_80625 = G__80669;
continue;
}
}
} else {
}
}
break;
}


var G__80671 = cljs.core.next(seq__80196__$1);
var G__80672 = null;
var G__80673 = (0);
var G__80674 = (0);
seq__80196 = G__80671;
chunk__80198 = G__80672;
count__80199 = G__80673;
i__80200 = G__80674;
continue;
} else {
var G__80675 = cljs.core.next(seq__80196__$1);
var G__80676 = null;
var G__80677 = (0);
var G__80678 = (0);
seq__80196 = G__80675;
chunk__80198 = G__80676;
count__80199 = G__80677;
i__80200 = G__80678;
continue;
}
}
} else {
return null;
}
}
break;
}
});
shadow.cljs.devtools.client.browser.global_eval = (function shadow$cljs$devtools$client$browser$global_eval(js){
if(cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2("undefined",typeof(module))){
return eval(js);
} else {
return (0,eval)(js);;
}
});
shadow.cljs.devtools.client.browser.repl_init = (function shadow$cljs$devtools$client$browser$repl_init(runtime,p__80362){
var map__80363 = p__80362;
var map__80363__$1 = cljs.core.__destructure_map(map__80363);
var repl_state = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80363__$1,new cljs.core.Keyword(null,"repl-state","repl-state",-1733780387));
return shadow.cljs.devtools.client.shared.load_sources(runtime,cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY,cljs.core.remove.cljs$core$IFn$_invoke$arity$2(shadow.cljs.devtools.client.env.src_is_loaded_QMARK_,new cljs.core.Keyword(null,"repl-sources","repl-sources",723867535).cljs$core$IFn$_invoke$arity$1(repl_state))),(function (sources){
shadow.cljs.devtools.client.browser.do_js_load(sources);

return shadow.cljs.devtools.client.browser.devtools_msg("ready!");
}));
});
shadow.cljs.devtools.client.browser.runtime_info = (((typeof SHADOW_CONFIG !== 'undefined'))?shadow.json.to_clj.cljs$core$IFn$_invoke$arity$1(SHADOW_CONFIG):null);
shadow.cljs.devtools.client.browser.client_info = cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([shadow.cljs.devtools.client.browser.runtime_info,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"host","host",-1558485167),(cljs.core.truth_(goog.global.document)?new cljs.core.Keyword(null,"browser","browser",828191719):new cljs.core.Keyword(null,"browser-worker","browser-worker",1638998282)),new cljs.core.Keyword(null,"user-agent","user-agent",1220426212),[(cljs.core.truth_(goog.userAgent.OPERA)?"Opera":(cljs.core.truth_(goog.userAgent.product.CHROME)?"Chrome":(cljs.core.truth_(goog.userAgent.IE)?"MSIE":(cljs.core.truth_(goog.userAgent.EDGE)?"Edge":(cljs.core.truth_(goog.userAgent.GECKO)?"Firefox":(cljs.core.truth_(goog.userAgent.SAFARI)?"Safari":(cljs.core.truth_(goog.userAgent.WEBKIT)?"Webkit":null)))))))," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.userAgent.VERSION)," [",cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.userAgent.PLATFORM),"]"].join(''),new cljs.core.Keyword(null,"dom","dom",-1236537922),(!((goog.global.document == null)))], null)], 0));
if((typeof shadow !== 'undefined') && (typeof shadow.cljs !== 'undefined') && (typeof shadow.cljs.devtools !== 'undefined') && (typeof shadow.cljs.devtools.client !== 'undefined') && (typeof shadow.cljs.devtools.client.browser !== 'undefined') && (typeof shadow.cljs.devtools.client.browser.ws_was_welcome_ref !== 'undefined')){
} else {
shadow.cljs.devtools.client.browser.ws_was_welcome_ref = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(false);
}
if(((shadow.cljs.devtools.client.env.enabled) && ((shadow.cljs.devtools.client.env.worker_client_id > (0))))){
(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$remote$runtime$api$IEvalJS$ = cljs.core.PROTOCOL_SENTINEL);

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$remote$runtime$api$IEvalJS$_js_eval$arity$2 = (function (this$,code){
var this$__$1 = this;
return shadow.cljs.devtools.client.browser.global_eval(code);
}));

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$cljs$devtools$client$shared$IHostSpecific$ = cljs.core.PROTOCOL_SENTINEL);

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$cljs$devtools$client$shared$IHostSpecific$do_invoke$arity$2 = (function (this$,p__80384){
var map__80386 = p__80384;
var map__80386__$1 = cljs.core.__destructure_map(map__80386);
var _ = map__80386__$1;
var js = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80386__$1,new cljs.core.Keyword(null,"js","js",1768080579));
var this$__$1 = this;
return shadow.cljs.devtools.client.browser.global_eval(js);
}));

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$cljs$devtools$client$shared$IHostSpecific$do_repl_init$arity$4 = (function (runtime,p__80387,done,error){
var map__80388 = p__80387;
var map__80388__$1 = cljs.core.__destructure_map(map__80388);
var repl_sources = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80388__$1,new cljs.core.Keyword(null,"repl-sources","repl-sources",723867535));
var runtime__$1 = this;
return shadow.cljs.devtools.client.shared.load_sources(runtime__$1,cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY,cljs.core.remove.cljs$core$IFn$_invoke$arity$2(shadow.cljs.devtools.client.env.src_is_loaded_QMARK_,repl_sources)),(function (sources){
shadow.cljs.devtools.client.browser.do_js_load(sources);

return (done.cljs$core$IFn$_invoke$arity$0 ? done.cljs$core$IFn$_invoke$arity$0() : done.call(null));
}));
}));

(shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$cljs$devtools$client$shared$IHostSpecific$do_repl_require$arity$4 = (function (runtime,p__80390,done,error){
var map__80391 = p__80390;
var map__80391__$1 = cljs.core.__destructure_map(map__80391);
var msg = map__80391__$1;
var sources = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80391__$1,new cljs.core.Keyword(null,"sources","sources",-321166424));
var reload_namespaces = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80391__$1,new cljs.core.Keyword(null,"reload-namespaces","reload-namespaces",250210134));
var js_requires = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80391__$1,new cljs.core.Keyword(null,"js-requires","js-requires",-1311472051));
var runtime__$1 = this;
var sources_to_load = cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY,cljs.core.remove.cljs$core$IFn$_invoke$arity$2((function (p__80394){
var map__80395 = p__80394;
var map__80395__$1 = cljs.core.__destructure_map(map__80395);
var src = map__80395__$1;
var provides = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80395__$1,new cljs.core.Keyword(null,"provides","provides",-1634397992));
var and__4221__auto__ = shadow.cljs.devtools.client.env.src_is_loaded_QMARK_(src);
if(cljs.core.truth_(and__4221__auto__)){
return cljs.core.not(cljs.core.some(reload_namespaces,provides));
} else {
return and__4221__auto__;
}
}),sources));
if(cljs.core.not(cljs.core.seq(sources_to_load))){
var G__80399 = cljs.core.PersistentVector.EMPTY;
return (done.cljs$core$IFn$_invoke$arity$1 ? done.cljs$core$IFn$_invoke$arity$1(G__80399) : done.call(null,G__80399));
} else {
return shadow.remote.runtime.shared.call.cljs$core$IFn$_invoke$arity$3(runtime__$1,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"op","op",-1882987955),new cljs.core.Keyword(null,"cljs-load-sources","cljs-load-sources",-1458295962),new cljs.core.Keyword(null,"to","to",192099007),shadow.cljs.devtools.client.env.worker_client_id,new cljs.core.Keyword(null,"sources","sources",-321166424),cljs.core.into.cljs$core$IFn$_invoke$arity$3(cljs.core.PersistentVector.EMPTY,cljs.core.map.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"resource-id","resource-id",-1308422582)),sources_to_load)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cljs-sources","cljs-sources",31121610),(function (p__80428){
var map__80429 = p__80428;
var map__80429__$1 = cljs.core.__destructure_map(map__80429);
var msg__$1 = map__80429__$1;
var sources__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80429__$1,new cljs.core.Keyword(null,"sources","sources",-321166424));
try{shadow.cljs.devtools.client.browser.do_js_load(sources__$1);

if(cljs.core.seq(js_requires)){
shadow.cljs.devtools.client.browser.do_js_requires(js_requires);
} else {
}

return (done.cljs$core$IFn$_invoke$arity$1 ? done.cljs$core$IFn$_invoke$arity$1(sources_to_load) : done.call(null,sources_to_load));
}catch (e80430){var ex = e80430;
return (error.cljs$core$IFn$_invoke$arity$1 ? error.cljs$core$IFn$_invoke$arity$1(ex) : error.call(null,ex));
}})], null));
}
}));

shadow.cljs.devtools.client.shared.add_plugin_BANG_(new cljs.core.Keyword("shadow.cljs.devtools.client.browser","client","shadow.cljs.devtools.client.browser/client",-1461019282),cljs.core.PersistentHashSet.EMPTY,(function (p__80433){
var map__80435 = p__80433;
var map__80435__$1 = cljs.core.__destructure_map(map__80435);
var env = map__80435__$1;
var runtime = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80435__$1,new cljs.core.Keyword(null,"runtime","runtime",-1331573996));
var svc = new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"runtime","runtime",-1331573996),runtime], null);
shadow.remote.runtime.api.add_extension(runtime,new cljs.core.Keyword("shadow.cljs.devtools.client.browser","client","shadow.cljs.devtools.client.browser/client",-1461019282),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"on-welcome","on-welcome",1895317125),(function (){
cljs.core.reset_BANG_(shadow.cljs.devtools.client.browser.ws_was_welcome_ref,true);

shadow.cljs.devtools.client.hud.connection_error_clear_BANG_();

shadow.cljs.devtools.client.env.patch_goog_BANG_();

return shadow.cljs.devtools.client.browser.devtools_msg(["#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"client-id","client-id",-464622140).cljs$core$IFn$_invoke$arity$1(cljs.core.deref(new cljs.core.Keyword(null,"state-ref","state-ref",2127874952).cljs$core$IFn$_invoke$arity$1(runtime))))," ready!"].join(''));
}),new cljs.core.Keyword(null,"on-disconnect","on-disconnect",-809021814),(function (e){
if(cljs.core.truth_(cljs.core.deref(shadow.cljs.devtools.client.browser.ws_was_welcome_ref))){
shadow.cljs.devtools.client.hud.connection_error("The Websocket connection was closed!");

return cljs.core.reset_BANG_(shadow.cljs.devtools.client.browser.ws_was_welcome_ref,false);
} else {
return null;
}
}),new cljs.core.Keyword(null,"on-reconnect","on-reconnect",1239988702),(function (e){
return shadow.cljs.devtools.client.hud.connection_error("Reconnecting ...");
}),new cljs.core.Keyword(null,"ops","ops",1237330063),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"access-denied","access-denied",959449406),(function (msg){
cljs.core.reset_BANG_(shadow.cljs.devtools.client.browser.ws_was_welcome_ref,false);

return shadow.cljs.devtools.client.hud.connection_error(["Stale Output! Your loaded JS was not produced by the running shadow-cljs instance."," Is the watch for this build running?"].join(''));
}),new cljs.core.Keyword(null,"cljs-runtime-init","cljs-runtime-init",1305890232),(function (msg){
return shadow.cljs.devtools.client.browser.repl_init(runtime,msg);
}),new cljs.core.Keyword(null,"cljs-asset-update","cljs-asset-update",1224093028),(function (p__80446){
var map__80448 = p__80446;
var map__80448__$1 = cljs.core.__destructure_map(map__80448);
var msg = map__80448__$1;
var updates = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80448__$1,new cljs.core.Keyword(null,"updates","updates",2013983452));
return shadow.cljs.devtools.client.browser.handle_asset_update(msg);
}),new cljs.core.Keyword(null,"cljs-build-configure","cljs-build-configure",-2089891268),(function (msg){
return null;
}),new cljs.core.Keyword(null,"cljs-build-start","cljs-build-start",-725781241),(function (msg){
shadow.cljs.devtools.client.hud.hud_hide();

shadow.cljs.devtools.client.hud.load_start();

return shadow.cljs.devtools.client.env.run_custom_notify_BANG_(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(msg,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"build-start","build-start",-959649480)));
}),new cljs.core.Keyword(null,"cljs-build-complete","cljs-build-complete",273626153),(function (msg){
var msg__$1 = shadow.cljs.devtools.client.env.add_warnings_to_info(msg);
shadow.cljs.devtools.client.hud.hud_warnings(msg__$1);

shadow.cljs.devtools.client.browser.handle_build_complete(runtime,msg__$1);

return shadow.cljs.devtools.client.env.run_custom_notify_BANG_(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(msg__$1,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"build-complete","build-complete",-501868472)));
}),new cljs.core.Keyword(null,"cljs-build-failure","cljs-build-failure",1718154990),(function (msg){
shadow.cljs.devtools.client.hud.load_end();

shadow.cljs.devtools.client.hud.hud_error(msg);

return shadow.cljs.devtools.client.env.run_custom_notify_BANG_(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(msg,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"build-failure","build-failure",-2107487466)));
}),new cljs.core.Keyword("shadow.cljs.devtools.client.env","worker-notify","shadow.cljs.devtools.client.env/worker-notify",-1456820670),(function (p__80459){
var map__80460 = p__80459;
var map__80460__$1 = cljs.core.__destructure_map(map__80460);
var event_op = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80460__$1,new cljs.core.Keyword(null,"event-op","event-op",200358057));
var client_id = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80460__$1,new cljs.core.Keyword(null,"client-id","client-id",-464622140));
if(((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"client-disconnect","client-disconnect",640227957),event_op)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(client_id,shadow.cljs.devtools.client.env.worker_client_id)))){
shadow.cljs.devtools.client.hud.connection_error_clear_BANG_();

return shadow.cljs.devtools.client.hud.connection_error("The watch for this build was stopped!");
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"client-connect","client-connect",-1113973888),event_op)){
shadow.cljs.devtools.client.hud.connection_error_clear_BANG_();

return shadow.cljs.devtools.client.hud.connection_error("The watch for this build was restarted. Reload required!");
} else {
return null;
}
}
})], null)], null));

return svc;
}),(function (p__80467){
var map__80469 = p__80467;
var map__80469__$1 = cljs.core.__destructure_map(map__80469);
var svc = map__80469__$1;
var runtime = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__80469__$1,new cljs.core.Keyword(null,"runtime","runtime",-1331573996));
return shadow.remote.runtime.api.del_extension(runtime,new cljs.core.Keyword("shadow.cljs.devtools.client.browser","client","shadow.cljs.devtools.client.browser/client",-1461019282));
}));

shadow.cljs.devtools.client.shared.init_runtime_BANG_(shadow.cljs.devtools.client.browser.client_info,shadow.cljs.devtools.client.websocket.start,shadow.cljs.devtools.client.websocket.send,shadow.cljs.devtools.client.websocket.stop);
} else {
}

//# sourceMappingURL=shadow.cljs.devtools.client.browser.js.map
