// Compiled by ClojureScript 1.9.562 {}
goog.provide('hoplon.core');
goog.require('cljs.core');
goog.require('goog.Uri');
goog.require('goog.object');
goog.require('clojure.set');
goog.require('javelin.core');
goog.require('cljs.reader');
goog.require('clojure.string');



cljs.core.enable_console_print_BANG_.call(null);
/**
 * Is the application running in a prerendering container (eg. PhantomJS via
 *   the prerender task)?
 */
hoplon.core.prerendering_QMARK_ = (new goog.Uri(window.location.href)).getParameterValue("prerendering");
/**
 * This is an internal implementation detail, exposed for the convenience of
 *   the hoplon.core/static macro. Experimental.
 */
hoplon.core.static_elements = cljs.core.reduce.call(null,(function (p1__29747_SHARP_,p2__29748_SHARP_){
return cljs.core.assoc.call(null,p1__29747_SHARP_,p2__29748_SHARP_.getAttribute("static-id"),p2__29748_SHARP_);
}),cljs.core.PersistentArrayMap.EMPTY,document.querySelector("[static-id]"));
/**
 * Public helper.
 *   Adds f as a watcher to ref and evaluates (f init @ref) once. The watcher
 *   f is a function of two arguments: the previous and next values. If init is
 *   not provided the default (nil) will be used.
 */
hoplon.core.do_watch = (function hoplon$core$do_watch(var_args){
var args29749 = [];
var len__24369__auto___29752 = arguments.length;
var i__24370__auto___29753 = (0);
while(true){
if((i__24370__auto___29753 < len__24369__auto___29752)){
args29749.push((arguments[i__24370__auto___29753]));

var G__29754 = (i__24370__auto___29753 + (1));
i__24370__auto___29753 = G__29754;
continue;
} else {
}
break;
}

var G__29751 = args29749.length;
switch (G__29751) {
case 2:
return hoplon.core.do_watch.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return hoplon.core.do_watch.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args29749.length)].join('')));

}
});

hoplon.core.do_watch.cljs$core$IFn$_invoke$arity$2 = (function (ref,f){
return hoplon.core.do_watch.call(null,ref,null,f);
});

hoplon.core.do_watch.cljs$core$IFn$_invoke$arity$3 = (function (ref,init,f){
var k = cljs.core.gensym.call(null);
f.call(null,init,cljs.core.deref.call(null,ref));

cljs.core.add_watch.call(null,ref,k,((function (k){
return (function (_,___$1,old,new$){
return f.call(null,old,new$);
});})(k))
);

return k;
});

hoplon.core.do_watch.cljs$lang$maxFixedArity = 3;

/**
 * Public helper.
 *   Experimental.
 */
hoplon.core.bust_cache = (function hoplon$core$bust_cache(path){
var vec__29762 = cljs.core.reverse.call(null,clojure.string.split.call(null,path,/\//));
var seq__29763 = cljs.core.seq.call(null,vec__29762);
var first__29764 = cljs.core.first.call(null,seq__29763);
var seq__29763__$1 = cljs.core.next.call(null,seq__29763);
var f = first__29764;
var more = seq__29763__$1;
var vec__29765 = clojure.string.split.call(null,f,/\./,(2));
var f1 = cljs.core.nth.call(null,vec__29765,(0),null);
var f2 = cljs.core.nth.call(null,vec__29765,(1),null);
return clojure.string.join.call(null,"/",cljs.core.reverse.call(null,cljs.core.conj.call(null,more,clojure.string.join.call(null,".",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [[cljs.core.str.cljs$core$IFn$_invoke$arity$1(f1),cljs.core.str.cljs$core$IFn$_invoke$arity$1("."),cljs.core.str.cljs$core$IFn$_invoke$arity$1("8df845c326b54231b37e30c527837896")].join(''),f2], null)))));
});
/**
 * Public helper.
 *   Class normalization for attribute providers.
 */
hoplon.core.normalize_class = (function hoplon$core$normalize_class(kvs){
var __GT_map = (function (p1__29768_SHARP_){
return cljs.core.zipmap.call(null,p1__29768_SHARP_,cljs.core.repeat.call(null,true));
});
if(cljs.core.map_QMARK_.call(null,kvs)){
return kvs;
} else {
return __GT_map.call(null,((typeof kvs === 'string')?kvs.split(/\s+/):cljs.core.seq.call(null,kvs)));
}
});
hoplon.core.child_vec = (function hoplon$core$child_vec(this$){
var x = this$.childNodes;
var l = x.length;
var i = (0);
var ret = cljs.core.transient$.call(null,cljs.core.PersistentVector.EMPTY);
while(true){
var or__23148__auto__ = (function (){var and__23136__auto__ = cljs.core._EQ_.call(null,i,l);
if(and__23136__auto__){
return cljs.core.persistent_BANG_.call(null,ret);
} else {
return and__23136__auto__;
}
})();
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
var G__29769 = (i + (1));
var G__29770 = cljs.core.conj_BANG_.call(null,ret,x.item(i));
i = G__29769;
ret = G__29770;
continue;
}
break;
}
});
hoplon.core.vflatten = (function hoplon$core$vflatten(var_args){
var args29771 = [];
var len__24369__auto___29774 = arguments.length;
var i__24370__auto___29775 = (0);
while(true){
if((i__24370__auto___29775 < len__24369__auto___29774)){
args29771.push((arguments[i__24370__auto___29775]));

var G__29776 = (i__24370__auto___29775 + (1));
i__24370__auto___29775 = G__29776;
continue;
} else {
}
break;
}

var G__29773 = args29771.length;
switch (G__29773) {
case 1:
return hoplon.core.vflatten.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return hoplon.core.vflatten.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args29771.length)].join('')));

}
});

hoplon.core.vflatten.cljs$core$IFn$_invoke$arity$1 = (function (tree){
return cljs.core.persistent_BANG_.call(null,hoplon.core.vflatten.call(null,tree,cljs.core.transient$.call(null,cljs.core.PersistentVector.EMPTY)));
});

hoplon.core.vflatten.cljs$core$IFn$_invoke$arity$2 = (function (tree,ret){
var l = cljs.core.count.call(null,tree);
var i = (0);
while(true){
if(cljs.core._EQ_.call(null,i,l)){
return ret;
} else {
var x = cljs.core.nth.call(null,tree,i);
if(!(cljs.core.sequential_QMARK_.call(null,x))){
cljs.core.conj_BANG_.call(null,ret,x);
} else {
hoplon.core.vflatten.call(null,x,ret);
}

var G__29778 = (i + (1));
i = G__29778;
continue;
}
break;
}
});

hoplon.core.vflatten.cljs$lang$maxFixedArity = 2;


/**
 * @interface
 */
hoplon.core.INode = function(){};

hoplon.core.node = (function hoplon$core$node(this$){
if((!((this$ == null))) && (!((this$.hoplon$core$INode$node$arity$1 == null)))){
return this$.hoplon$core$INode$node$arity$1(this$);
} else {
var x__23866__auto__ = (((this$ == null))?null:this$);
var m__23867__auto__ = (hoplon.core.node[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,this$);
} else {
var m__23867__auto____$1 = (hoplon.core.node["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__auto____$1.call(null,this$);
} else {
throw cljs.core.missing_protocol.call(null,"INode.node",this$);
}
}
}
});

(hoplon.core.INode["string"] = true);

(hoplon.core.node["string"] = (function (this$){
return hoplon.core.$text.call(null,this$);
}));
(hoplon.core.INode["number"] = true);

(hoplon.core.node["number"] = (function (this$){
return hoplon.core.$text.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(this$)].join(''));
}));
hoplon.core.__GT_node = (function hoplon$core$__GT_node(x){
if(((!((x == null)))?(((false) || ((cljs.core.PROTOCOL_SENTINEL === x.hoplon$core$INode$)))?true:(((!x.cljs$lang$protocol_mask$partition$))?cljs.core.native_satisfies_QMARK_.call(null,hoplon.core.INode,x):false)):cljs.core.native_satisfies_QMARK_.call(null,hoplon.core.INode,x))){
return hoplon.core.node.call(null,x);
} else {
return x;
}
});
hoplon.core.removeChild = Element.prototype.removeChild;
hoplon.core.appendChild = Element.prototype.appendChild;
hoplon.core.insertBefore = Element.prototype.insertBefore;
hoplon.core.replaceChild = Element.prototype.replaceChild;
hoplon.core.setAttribute = Element.prototype.setAttribute;
hoplon.core.merge_kids = (function hoplon$core$merge_kids(this$,_,new$){
var new$__$1 = cljs.core.mapv.call(null,hoplon.core.__GT_node,cljs.core.reduce.call(null,(function (p1__29782_SHARP_,p2__29781_SHARP_){
if((p2__29781_SHARP_ == null)){
return p1__29782_SHARP_;
} else {
return cljs.core.conj.call(null,p1__29782_SHARP_,p2__29781_SHARP_);
}
}),cljs.core.PersistentVector.EMPTY,hoplon.core.vflatten.call(null,new$)));
var new_QMARK_ = cljs.core.set.call(null,new$__$1);
var G__29809 = new$__$1;
var vec__29811 = G__29809;
var seq__29812 = cljs.core.seq.call(null,vec__29811);
var first__29813 = cljs.core.first.call(null,seq__29812);
var seq__29812__$1 = cljs.core.next.call(null,seq__29812);
var x = first__29813;
var xs = seq__29812__$1;
var G__29810 = hoplon.core.child_vec.call(null,this$);
var vec__29814 = G__29810;
var seq__29815 = cljs.core.seq.call(null,vec__29814);
var first__29816 = cljs.core.first.call(null,seq__29815);
var seq__29815__$1 = cljs.core.next.call(null,seq__29815);
var k = first__29816;
var ks = seq__29815__$1;
var kids = vec__29814;
var G__29809__$1 = G__29809;
var G__29810__$1 = G__29810;
while(true){
var vec__29817 = G__29809__$1;
var seq__29818 = cljs.core.seq.call(null,vec__29817);
var first__29819 = cljs.core.first.call(null,seq__29818);
var seq__29818__$1 = cljs.core.next.call(null,seq__29818);
var x__$1 = first__29819;
var xs__$1 = seq__29818__$1;
var vec__29820 = G__29810__$1;
var seq__29821 = cljs.core.seq.call(null,vec__29820);
var first__29822 = cljs.core.first.call(null,seq__29821);
var seq__29821__$1 = cljs.core.next.call(null,seq__29821);
var k__$1 = first__29822;
var ks__$1 = seq__29821__$1;
var kids__$1 = vec__29820;
if(cljs.core.truth_((function (){var or__23148__auto__ = x__$1;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return k__$1;
}
})())){
var G__29823 = xs__$1;
var G__29824 = ((cljs.core._EQ_.call(null,x__$1,k__$1))?ks__$1:((cljs.core.not.call(null,k__$1))?(function (){var ks__$2 = ks__$1;
hoplon.core.appendChild.call(this$,x__$1);

return ks__$2;
})():((cljs.core.not.call(null,x__$1))?(function (){var ks__$2 = ks__$1;
if(cljs.core.truth_(new_QMARK_.call(null,k__$1))){
} else {
hoplon.core.removeChild.call(this$,k__$1);
}

return ks__$2;
})():(function (){var kids__$2 = kids__$1;
hoplon.core.insertBefore.call(this$,x__$1,k__$1);

return kids__$2;
})()
)));
G__29809__$1 = G__29823;
G__29810__$1 = G__29824;
continue;
} else {
return null;
}
break;
}
});
hoplon.core.ensure_kids_BANG_ = (function hoplon$core$ensure_kids_BANG_(this$){
var this$__$1 = this$;
if(cljs.core.truth_(this$__$1.hoplonKids)){
} else {
var kids_29825 = cljs.core.atom.call(null,hoplon.core.child_vec.call(null,this$__$1));
this$__$1.hoplonKids = kids_29825;

hoplon.core.do_watch.call(null,kids_29825,cljs.core.partial.call(null,hoplon.core.merge_kids,this$__$1));
}

return this$__$1;
});
hoplon.core.remove_all_kids_BANG_ = (function hoplon$core$remove_all_kids_BANG_(this$){
this$.hoplonKids = null;

return hoplon.core.merge_kids.call(null,this$,null,null);
});
/**
 * Returns true if elem is a native element. Native elements' children
 *   are not managed by Hoplon.
 */
hoplon.core.native_QMARK_ = (function hoplon$core$native_QMARK_(elem){
return ((elem instanceof Element)) && ((elem.hoplonKids == null));
});
/**
 * Returns true if elem is a managed element. Managed elements have
 *   their children managed by Hoplon.
 */
hoplon.core.managed_QMARK_ = (function hoplon$core$managed_QMARK_(elem){
return cljs.core.not.call(null,hoplon.core.native_QMARK_.call(null,elem));
});
/**
 * Appends `child` to `parent` for the case of `parent` being a
 *   managed element.
 */
hoplon.core.managed_append_child = (function hoplon$core$managed_append_child(parent,child,kidfn){
var child__$1 = child;
hoplon.core.ensure_kids_BANG_.call(null,parent);

var kids_29828 = kidfn.call(null,parent);
var i_29829 = cljs.core.count.call(null,cljs.core.deref.call(null,kids_29828));
if(cljs.core.truth_(javelin.core.cell_QMARK_.call(null,child__$1))){
hoplon.core.do_watch.call(null,child__$1,((function (kids_29828,i_29829,child__$1){
return (function (p1__29827_SHARP_,p2__29826_SHARP_){
return cljs.core.swap_BANG_.call(null,kids_29828,cljs.core.assoc,i_29829,p2__29826_SHARP_);
});})(kids_29828,i_29829,child__$1))
);
} else {
cljs.core.swap_BANG_.call(null,kids_29828,cljs.core.assoc,i_29829,child__$1);
}

return child__$1;
});
hoplon.core.set_appendChild_BANG_ = (function hoplon$core$set_appendChild_BANG_(this$,kidfn){
return this$.appendChild = (function (child){
var this$__$1 = this;
if(cljs.core.truth_(child.parentNode)){
child.parentNode.removeChild(child);
} else {
}

if(cljs.core.truth_((function (){var and__23136__auto__ = hoplon.core.native_QMARK_.call(null,this$__$1);
if(cljs.core.truth_(and__23136__auto__)){
return cljs.core.not.call(null,javelin.core.cell_QMARK_.call(null,child));
} else {
return and__23136__auto__;
}
})())){
return hoplon.core.appendChild.call(this$__$1,child);
} else {
if(cljs.core.truth_((function (){var and__23136__auto__ = hoplon.core.native_QMARK_.call(null,this$__$1);
if(cljs.core.truth_(and__23136__auto__)){
return javelin.core.cell_QMARK_.call(null,child);
} else {
return and__23136__auto__;
}
})())){
return hoplon.core.managed_append_child.call(null,this$__$1,child,kidfn);
} else {
if(cljs.core.truth_(hoplon.core.managed_QMARK_.call(null,this$__$1))){
return hoplon.core.managed_append_child.call(null,this$__$1,child,kidfn);
} else {
throw cljs.core.ex_info.call(null,"Unexpected child type",new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"reason","reason",-2070751759),new cljs.core.Keyword("hoplon.core","unexpected-child-type","hoplon.core/unexpected-child-type",1756641127),new cljs.core.Keyword(null,"child","child",623967545),child,new cljs.core.Keyword(null,"native?","native?",-1916990868),hoplon.core.native_QMARK_.call(null,child),new cljs.core.Keyword(null,"managed?","managed?",-1222195407),hoplon.core.managed_QMARK_.call(null,child),new cljs.core.Keyword(null,"this","this",-611633625),this$__$1], null));

}
}
}
});
});
hoplon.core.set_removeChild_BANG_ = (function hoplon$core$set_removeChild_BANG_(this$,kidfn){
return this$.removeChild = (function (x){
var this$__$1 = this;
var x__$1 = x;
hoplon.core.ensure_kids_BANG_.call(null,this$__$1);

cljs.core.swap_BANG_.call(null,kidfn.call(null,this$__$1),((function (x__$1,this$__$1){
return (function (p1__29830_SHARP_){
return cljs.core.into.call(null,cljs.core.PersistentVector.EMPTY,cljs.core.remove.call(null,cljs.core.partial.call(null,cljs.core._EQ_,x__$1),p1__29830_SHARP_));
});})(x__$1,this$__$1))
);

return x__$1;
});
});
hoplon.core.set_insertBefore_BANG_ = (function hoplon$core$set_insertBefore_BANG_(this$,kidfn){
return this$.insertBefore = (function (x,y){
var this$__$1 = this;
var x__$1 = x;
hoplon.core.ensure_kids_BANG_.call(null,this$__$1);

if(cljs.core.not.call(null,y)){
cljs.core.swap_BANG_.call(null,kidfn.call(null,this$__$1),cljs.core.conj,x__$1);
} else {
if(cljs.core.not_EQ_.call(null,x__$1,y)){
cljs.core.swap_BANG_.call(null,kidfn.call(null,this$__$1),((function (x__$1,this$__$1){
return (function (p1__29831_SHARP_){
return cljs.core.vec.call(null,cljs.core.mapcat.call(null,((function (x__$1,this$__$1){
return (function (z){
if(cljs.core._EQ_.call(null,z,y)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x__$1,z], null);
} else {
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [z], null);
}
});})(x__$1,this$__$1))
,p1__29831_SHARP_));
});})(x__$1,this$__$1))
);
} else {
}
}

return x__$1;
});
});
hoplon.core.set_replaceChild_BANG_ = (function hoplon$core$set_replaceChild_BANG_(this$,kidfn){
return this$.replaceChild = (function (x,y){
var this$__$1 = this;
var y__$1 = y;
hoplon.core.ensure_kids_BANG_.call(null,this$__$1);

cljs.core.swap_BANG_.call(null,kidfn.call(null,this$__$1),((function (y__$1,this$__$1){
return (function (p1__29832_SHARP_){
return cljs.core.mapv.call(null,((function (y__$1,this$__$1){
return (function (z){
if(cljs.core._EQ_.call(null,z,y__$1)){
return x;
} else {
return z;
}
});})(y__$1,this$__$1))
,p1__29832_SHARP_);
});})(y__$1,this$__$1))
);

return y__$1;
});
});
hoplon.core.set_setAttribute_BANG_ = (function hoplon$core$set_setAttribute_BANG_(this$,attrfn){
return this$.setAttribute = (function (k,v){
var this$__$1 = this;
var _ = undefined;
var kk_29833 = cljs.core.keyword.call(null,k);
var attr_29834 = attrfn.call(null,this$__$1);
var has_QMARK__29835 = (function (){var and__23136__auto__ = attr_29834;
if(cljs.core.truth_(and__23136__auto__)){
return cljs.core.contains_QMARK_.call(null,cljs.core.deref.call(null,attr_29834),kk_29833);
} else {
return and__23136__auto__;
}
})();
if(cljs.core.truth_(has_QMARK__29835)){
cljs.core.swap_BANG_.call(null,attr_29834,cljs.core.assoc,kk_29833,v);
} else {
hoplon.core.setAttribute.call(this$__$1,k,v);
}

return _;
});
});
hoplon.core.set_appendChild_BANG_.call(null,Element.prototype,(function (p1__29836_SHARP_){
return p1__29836_SHARP_.hoplonKids;
}));
hoplon.core.set_removeChild_BANG_.call(null,Element.prototype,(function (p1__29837_SHARP_){
return p1__29837_SHARP_.hoplonKids;
}));
hoplon.core.set_insertBefore_BANG_.call(null,Element.prototype,(function (p1__29838_SHARP_){
return p1__29838_SHARP_.hoplonKids;
}));
hoplon.core.set_replaceChild_BANG_.call(null,Element.prototype,(function (p1__29839_SHARP_){
return p1__29839_SHARP_.hoplonKids;
}));

/**
 * @interface
 */
hoplon.core.ICustomElement = function(){};

hoplon.core._set_attributes_BANG_ = (function hoplon$core$_set_attributes_BANG_(this$,kvs){
if((!((this$ == null))) && (!((this$.hoplon$core$ICustomElement$_set_attributes_BANG_$arity$2 == null)))){
return this$.hoplon$core$ICustomElement$_set_attributes_BANG_$arity$2(this$,kvs);
} else {
var x__23866__auto__ = (((this$ == null))?null:this$);
var m__23867__auto__ = (hoplon.core._set_attributes_BANG_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,this$,kvs);
} else {
var m__23867__auto____$1 = (hoplon.core._set_attributes_BANG_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__auto____$1.call(null,this$,kvs);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-set-attributes!",this$);
}
}
}
});

hoplon.core._set_styles_BANG_ = (function hoplon$core$_set_styles_BANG_(this$,kvs){
if((!((this$ == null))) && (!((this$.hoplon$core$ICustomElement$_set_styles_BANG_$arity$2 == null)))){
return this$.hoplon$core$ICustomElement$_set_styles_BANG_$arity$2(this$,kvs);
} else {
var x__23866__auto__ = (((this$ == null))?null:this$);
var m__23867__auto__ = (hoplon.core._set_styles_BANG_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,this$,kvs);
} else {
var m__23867__auto____$1 = (hoplon.core._set_styles_BANG_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__auto____$1.call(null,this$,kvs);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-set-styles!",this$);
}
}
}
});

hoplon.core._append_child_BANG_ = (function hoplon$core$_append_child_BANG_(this$,child){
if((!((this$ == null))) && (!((this$.hoplon$core$ICustomElement$_append_child_BANG_$arity$2 == null)))){
return this$.hoplon$core$ICustomElement$_append_child_BANG_$arity$2(this$,child);
} else {
var x__23866__auto__ = (((this$ == null))?null:this$);
var m__23867__auto__ = (hoplon.core._append_child_BANG_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,this$,child);
} else {
var m__23867__auto____$1 = (hoplon.core._append_child_BANG_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__auto____$1.call(null,this$,child);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-append-child!",this$);
}
}
}
});

hoplon.core._remove_child_BANG_ = (function hoplon$core$_remove_child_BANG_(this$,child){
if((!((this$ == null))) && (!((this$.hoplon$core$ICustomElement$_remove_child_BANG_$arity$2 == null)))){
return this$.hoplon$core$ICustomElement$_remove_child_BANG_$arity$2(this$,child);
} else {
var x__23866__auto__ = (((this$ == null))?null:this$);
var m__23867__auto__ = (hoplon.core._remove_child_BANG_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,this$,child);
} else {
var m__23867__auto____$1 = (hoplon.core._remove_child_BANG_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__auto____$1.call(null,this$,child);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-remove-child!",this$);
}
}
}
});

hoplon.core._replace_child_BANG_ = (function hoplon$core$_replace_child_BANG_(this$,new$,existing){
if((!((this$ == null))) && (!((this$.hoplon$core$ICustomElement$_replace_child_BANG_$arity$3 == null)))){
return this$.hoplon$core$ICustomElement$_replace_child_BANG_$arity$3(this$,new$,existing);
} else {
var x__23866__auto__ = (((this$ == null))?null:this$);
var m__23867__auto__ = (hoplon.core._replace_child_BANG_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,this$,new$,existing);
} else {
var m__23867__auto____$1 = (hoplon.core._replace_child_BANG_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__auto____$1.call(null,this$,new$,existing);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-replace-child!",this$);
}
}
}
});

hoplon.core._insert_before_BANG_ = (function hoplon$core$_insert_before_BANG_(this$,new$,existing){
if((!((this$ == null))) && (!((this$.hoplon$core$ICustomElement$_insert_before_BANG_$arity$3 == null)))){
return this$.hoplon$core$ICustomElement$_insert_before_BANG_$arity$3(this$,new$,existing);
} else {
var x__23866__auto__ = (((this$ == null))?null:this$);
var m__23867__auto__ = (hoplon.core._insert_before_BANG_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,this$,new$,existing);
} else {
var m__23867__auto____$1 = (hoplon.core._insert_before_BANG_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__auto____$1.call(null,this$,new$,existing);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomElement.-insert-before!",this$);
}
}
}
});

hoplon.core.set_attributes_BANG_ = (function hoplon$core$set_attributes_BANG_(var_args){
var args29840 = [];
var len__24369__auto___29847 = arguments.length;
var i__24370__auto___29848 = (0);
while(true){
if((i__24370__auto___29848 < len__24369__auto___29847)){
args29840.push((arguments[i__24370__auto___29848]));

var G__29849 = (i__24370__auto___29848 + (1));
i__24370__auto___29848 = G__29849;
continue;
} else {
}
break;
}

var G__29846 = args29840.length;
switch (G__29846) {
case 2:
return hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
var argseq__24392__auto__ = (new cljs.core.IndexedSeq(args29840.slice((3)),(0),null));
return hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),argseq__24392__auto__);

}
});

hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$2 = (function (this$,kvs){
return hoplon.core._set_attributes_BANG_.call(null,this$,kvs);
});

hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (this$,k,v,kvs){
return hoplon.core.set_attributes_BANG_.call(null,this$,cljs.core.apply.call(null,cljs.core.hash_map,k,v,kvs));
});

hoplon.core.set_attributes_BANG_.cljs$lang$applyTo = (function (seq29841){
var G__29842 = cljs.core.first.call(null,seq29841);
var seq29841__$1 = cljs.core.next.call(null,seq29841);
var G__29843 = cljs.core.first.call(null,seq29841__$1);
var seq29841__$2 = cljs.core.next.call(null,seq29841__$1);
var G__29844 = cljs.core.first.call(null,seq29841__$2);
var seq29841__$3 = cljs.core.next.call(null,seq29841__$2);
return hoplon.core.set_attributes_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__29842,G__29843,G__29844,seq29841__$3);
});

hoplon.core.set_attributes_BANG_.cljs$lang$maxFixedArity = (3);

hoplon.core.set_styles_BANG_ = (function hoplon$core$set_styles_BANG_(var_args){
var args29851 = [];
var len__24369__auto___29858 = arguments.length;
var i__24370__auto___29859 = (0);
while(true){
if((i__24370__auto___29859 < len__24369__auto___29858)){
args29851.push((arguments[i__24370__auto___29859]));

var G__29860 = (i__24370__auto___29859 + (1));
i__24370__auto___29859 = G__29860;
continue;
} else {
}
break;
}

var G__29857 = args29851.length;
switch (G__29857) {
case 2:
return hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
var argseq__24392__auto__ = (new cljs.core.IndexedSeq(args29851.slice((3)),(0),null));
return hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),argseq__24392__auto__);

}
});

hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$2 = (function (this$,kvs){
return hoplon.core._set_styles_BANG_.call(null,this$,kvs);
});

hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (this$,k,v,kvs){
return hoplon.core.set_styles_BANG_.call(null,this$,cljs.core.apply.call(null,cljs.core.hash_map,k,v,kvs));
});

hoplon.core.set_styles_BANG_.cljs$lang$applyTo = (function (seq29852){
var G__29853 = cljs.core.first.call(null,seq29852);
var seq29852__$1 = cljs.core.next.call(null,seq29852);
var G__29854 = cljs.core.first.call(null,seq29852__$1);
var seq29852__$2 = cljs.core.next.call(null,seq29852__$1);
var G__29855 = cljs.core.first.call(null,seq29852__$2);
var seq29852__$3 = cljs.core.next.call(null,seq29852__$2);
return hoplon.core.set_styles_BANG_.cljs$core$IFn$_invoke$arity$variadic(G__29853,G__29854,G__29855,seq29852__$3);
});

hoplon.core.set_styles_BANG_.cljs$lang$maxFixedArity = (3);

hoplon.core.append_child_BANG_ = (function hoplon$core$append_child_BANG_(this$,child){
return hoplon.core._append_child_BANG_.call(null,this$,child);
});
hoplon.core.remove_child_BANG_ = (function hoplon$core$remove_child_BANG_(this$,child){
return hoplon.core._remove_child_BANG_.call(null,this$,child);
});
hoplon.core.replace_child_BANG_ = (function hoplon$core$replace_child_BANG_(this$,new$,existing){
return hoplon.core._replace_child_BANG_.call(null,this$,new$,existing);
});
hoplon.core.insert_before_BANG_ = (function hoplon$core$insert_before_BANG_(this$,new$,existing){
return hoplon.core._insert_before_BANG_.call(null,this$,new$,existing);
});

/**
 * @interface
 */
hoplon.core.ICustomAttribute = function(){};

hoplon.core._attr_BANG_ = (function hoplon$core$_attr_BANG_(this$,elem,value){
if((!((this$ == null))) && (!((this$.hoplon$core$ICustomAttribute$_attr_BANG_$arity$3 == null)))){
return this$.hoplon$core$ICustomAttribute$_attr_BANG_$arity$3(this$,elem,value);
} else {
var x__23866__auto__ = (((this$ == null))?null:this$);
var m__23867__auto__ = (hoplon.core._attr_BANG_[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,this$,elem,value);
} else {
var m__23867__auto____$1 = (hoplon.core._attr_BANG_["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__auto____$1.call(null,this$,elem,value);
} else {
throw cljs.core.missing_protocol.call(null,"ICustomAttribute.-attr!",this$);
}
}
}
});

hoplon.core.attribute_QMARK_ = (function hoplon$core$attribute_QMARK_(this$){
if(!((this$ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === this$.hoplon$core$ICustomAttribute$))){
return true;
} else {
if((!this$.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,hoplon.core.ICustomAttribute,this$);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,hoplon.core.ICustomAttribute,this$);
}
});
cljs.core.Keyword.prototype.hoplon$core$ICustomAttribute$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.Keyword.prototype.hoplon$core$ICustomAttribute$_attr_BANG_$arity$3 = (function (this$,elem,value){
var this$__$1 = this;
if(cljs.core.truth_(javelin.core.cell_QMARK_.call(null,value))){
return hoplon.core.do_watch.call(null,value,((function (this$__$1){
return (function (p1__29865_SHARP_,p2__29864_SHARP_){
return hoplon.core.do_BANG_.call(null,elem,this$__$1,p2__29864_SHARP_);
});})(this$__$1))
);
} else {
if(cljs.core.fn_QMARK_.call(null,value)){
return hoplon.core.on_BANG_.call(null,elem,this$__$1,value);
} else {
return hoplon.core.do_BANG_.call(null,elem,this$__$1,value);

}
}
});
hoplon.core.is_ie8 = cljs.core.not.call(null,goog.object.get(window,"Node"));
hoplon.core._head_STAR_ = ((!(hoplon.core.is_ie8))?(function (p1__29866_SHARP_){
return p1__29866_SHARP_.head;
}):(function (p1__29867_SHARP_){
return p1__29867_SHARP_.documentElement.firstChild;
}));
hoplon.core.vector_QMARK__STAR_ = ((!(hoplon.core.is_ie8))?cljs.core.vector_QMARK_:(function (p1__29868_SHARP_){
try{return cljs.core.vector_QMARK_.call(null,p1__29868_SHARP_);
}catch (e29869){if((e29869 instanceof Error)){
var _ = e29869;
return null;
} else {
throw e29869;

}
}}));
hoplon.core.seq_QMARK__STAR_ = ((!(hoplon.core.is_ie8))?cljs.core.seq_QMARK_:(function (p1__29870_SHARP_){
try{return cljs.core.seq_QMARK_.call(null,p1__29870_SHARP_);
}catch (e29871){if((e29871 instanceof Error)){
var _ = e29871;
return null;
} else {
throw e29871;

}
}}));
/**
 * Like cljs.core/nth but returns nil or not found if the index is outside the coll
 */
hoplon.core.safe_nth = (function hoplon$core$safe_nth(var_args){
var args29872 = [];
var len__24369__auto___29876 = arguments.length;
var i__24370__auto___29877 = (0);
while(true){
if((i__24370__auto___29877 < len__24369__auto___29876)){
args29872.push((arguments[i__24370__auto___29877]));

var G__29878 = (i__24370__auto___29877 + (1));
i__24370__auto___29877 = G__29878;
continue;
} else {
}
break;
}

var G__29874 = args29872.length;
switch (G__29874) {
case 2:
return hoplon.core.safe_nth.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return hoplon.core.safe_nth.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args29872.length)].join('')));

}
});

hoplon.core.safe_nth.cljs$core$IFn$_invoke$arity$2 = (function (coll,index){
return hoplon.core.safe_nth.call(null,coll,index,null);
});

hoplon.core.safe_nth.cljs$core$IFn$_invoke$arity$3 = (function (coll,index,not_found){
try{return cljs.core.nth.call(null,coll,index,not_found);
}catch (e29875){if((e29875 instanceof Error)){
var _ = e29875;
return not_found;
} else {
throw e29875;

}
}});

hoplon.core.safe_nth.cljs$lang$maxFixedArity = 3;

/**
 * Executes a fuction after a delay, if no delay is passed, 0 is used as a default.
 */
hoplon.core.timeout = (function hoplon$core$timeout(var_args){
var args29880 = [];
var len__24369__auto___29883 = arguments.length;
var i__24370__auto___29884 = (0);
while(true){
if((i__24370__auto___29884 < len__24369__auto___29883)){
args29880.push((arguments[i__24370__auto___29884]));

var G__29885 = (i__24370__auto___29884 + (1));
i__24370__auto___29884 = G__29885;
continue;
} else {
}
break;
}

var G__29882 = args29880.length;
switch (G__29882) {
case 1:
return hoplon.core.timeout.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return hoplon.core.timeout.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args29880.length)].join('')));

}
});

hoplon.core.timeout.cljs$core$IFn$_invoke$arity$1 = (function (f){
return hoplon.core.timeout.call(null,f,(0));
});

hoplon.core.timeout.cljs$core$IFn$_invoke$arity$2 = (function (f,t){
return window.setTimeout(f,t);
});

hoplon.core.timeout.cljs$lang$maxFixedArity = 2;

hoplon.core.when_dom = (function hoplon$core$when_dom(this$,f){
if(!((this$ instanceof Element))){
return setTimeout((function (){
return f.call(null);
}),(0));
} else {
var temp__5276__auto__ = goog.object.get(this$,"_hoplonWhenDom");
if(cljs.core.truth_(temp__5276__auto__)){
var v = temp__5276__auto__;
return v.push(f);
} else {
goog.object.set(this$,"_hoplonWhenDom",[f]);

return setTimeout(((function (temp__5276__auto__){
return (function (){
return ((function (temp__5276__auto__){
return (function hoplon$core$when_dom_$_doit(){
if(cljs.core.not.call(null,document.documentElement.contains(this$))){
return setTimeout(((function (temp__5276__auto__){
return (function (){
return hoplon$core$when_dom_$_doit.call(null);
});})(temp__5276__auto__))
,(20));
} else {
var seq__29899_29903 = cljs.core.seq.call(null,goog.object.get(this$,"_hoplonWhenDom"));
var chunk__29900_29904 = null;
var count__29901_29905 = (0);
var i__29902_29906 = (0);
while(true){
if((i__29902_29906 < count__29901_29905)){
var f_29907__$1 = cljs.core._nth.call(null,chunk__29900_29904,i__29902_29906);
f_29907__$1.call(null);

var G__29908 = seq__29899_29903;
var G__29909 = chunk__29900_29904;
var G__29910 = count__29901_29905;
var G__29911 = (i__29902_29906 + (1));
seq__29899_29903 = G__29908;
chunk__29900_29904 = G__29909;
count__29901_29905 = G__29910;
i__29902_29906 = G__29911;
continue;
} else {
var temp__5278__auto___29912 = cljs.core.seq.call(null,seq__29899_29903);
if(temp__5278__auto___29912){
var seq__29899_29913__$1 = temp__5278__auto___29912;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__29899_29913__$1)){
var c__24059__auto___29914 = cljs.core.chunk_first.call(null,seq__29899_29913__$1);
var G__29915 = cljs.core.chunk_rest.call(null,seq__29899_29913__$1);
var G__29916 = c__24059__auto___29914;
var G__29917 = cljs.core.count.call(null,c__24059__auto___29914);
var G__29918 = (0);
seq__29899_29903 = G__29915;
chunk__29900_29904 = G__29916;
count__29901_29905 = G__29917;
i__29902_29906 = G__29918;
continue;
} else {
var f_29919__$1 = cljs.core.first.call(null,seq__29899_29913__$1);
f_29919__$1.call(null);

var G__29920 = cljs.core.next.call(null,seq__29899_29913__$1);
var G__29921 = null;
var G__29922 = (0);
var G__29923 = (0);
seq__29899_29903 = G__29920;
chunk__29900_29904 = G__29921;
count__29901_29905 = G__29922;
i__29902_29906 = G__29923;
continue;
}
} else {
}
}
break;
}

return goog.object.set(this$,"_hoplonWhenDom",null);
}
});})(temp__5276__auto__))
.call(null);
});})(temp__5276__auto__))
,(0));
}
}
});
hoplon.core.parse_args = (function hoplon$core$parse_args(args){
var attr = cljs.core.transient$.call(null,cljs.core.PersistentArrayMap.EMPTY);
var kids = cljs.core.transient$.call(null,cljs.core.PersistentVector.EMPTY);
var G__29940 = args;
var vec__29941 = G__29940;
var seq__29942 = cljs.core.seq.call(null,vec__29941);
var first__29943 = cljs.core.first.call(null,seq__29942);
var seq__29942__$1 = cljs.core.next.call(null,seq__29942);
var arg = first__29943;
var args__$1 = seq__29942__$1;
var attr__$1 = attr;
var kids__$1 = kids;
var G__29940__$1 = G__29940;
while(true){
var attr__$2 = attr__$1;
var kids__$2 = kids__$1;
var vec__29944 = G__29940__$1;
var seq__29945 = cljs.core.seq.call(null,vec__29944);
var first__29946 = cljs.core.first.call(null,seq__29945);
var seq__29945__$1 = cljs.core.next.call(null,seq__29945);
var arg__$1 = first__29946;
var args__$2 = seq__29945__$1;
if(cljs.core.not.call(null,(function (){var or__23148__auto__ = arg__$1;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return args__$2;
}
})())){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.persistent_BANG_.call(null,attr__$2),cljs.core.persistent_BANG_.call(null,kids__$2)], null);
} else {
if(cljs.core.map_QMARK_.call(null,arg__$1)){
var G__29947 = cljs.core.reduce_kv.call(null,((function (attr__$1,kids__$1,G__29940__$1,attr__$2,kids__$2,vec__29944,seq__29945,first__29946,seq__29945__$1,arg__$1,args__$2,attr,kids,G__29940,vec__29941,seq__29942,first__29943,seq__29942__$1,arg,args__$1){
return (function (p1__29924_SHARP_,p2__29925_SHARP_,p3__29926_SHARP_){
return cljs.core.assoc_BANG_.call(null,p1__29924_SHARP_,p2__29925_SHARP_,p3__29926_SHARP_);
});})(attr__$1,kids__$1,G__29940__$1,attr__$2,kids__$2,vec__29944,seq__29945,first__29946,seq__29945__$1,arg__$1,args__$2,attr,kids,G__29940,vec__29941,seq__29942,first__29943,seq__29942__$1,arg,args__$1))
,attr__$2,arg__$1);
var G__29948 = kids__$2;
var G__29949 = args__$2;
attr__$1 = G__29947;
kids__$1 = G__29948;
G__29940__$1 = G__29949;
continue;
} else {
if(cljs.core.truth_(hoplon.core.attribute_QMARK_.call(null,arg__$1))){
var G__29950 = cljs.core.assoc_BANG_.call(null,attr__$2,arg__$1,cljs.core.first.call(null,args__$2));
var G__29951 = kids__$2;
var G__29952 = cljs.core.rest.call(null,args__$2);
attr__$1 = G__29950;
kids__$1 = G__29951;
G__29940__$1 = G__29952;
continue;
} else {
if(cljs.core.truth_(hoplon.core.seq_QMARK__STAR_.call(null,arg__$1))){
var G__29953 = attr__$2;
var G__29954 = cljs.core.reduce.call(null,cljs.core.conj_BANG_,kids__$2,hoplon.core.vflatten.call(null,arg__$1));
var G__29955 = args__$2;
attr__$1 = G__29953;
kids__$1 = G__29954;
G__29940__$1 = G__29955;
continue;
} else {
if(cljs.core.truth_(hoplon.core.vector_QMARK__STAR_.call(null,arg__$1))){
var G__29956 = attr__$2;
var G__29957 = cljs.core.reduce.call(null,cljs.core.conj_BANG_,kids__$2,hoplon.core.vflatten.call(null,arg__$1));
var G__29958 = args__$2;
attr__$1 = G__29956;
kids__$1 = G__29957;
G__29940__$1 = G__29958;
continue;
} else {
var G__29959 = attr__$2;
var G__29960 = cljs.core.conj_BANG_.call(null,kids__$2,arg__$1);
var G__29961 = args__$2;
attr__$1 = G__29959;
kids__$1 = G__29960;
G__29940__$1 = G__29961;
continue;

}
}
}
}
}
break;
}
});
hoplon.core.add_attributes_BANG_ = (function hoplon$core$add_attributes_BANG_(this$,attr){
return cljs.core.reduce_kv.call(null,(function (p1__29963_SHARP_,p2__29962_SHARP_,p3__29964_SHARP_){
hoplon.core._attr_BANG_.call(null,p2__29962_SHARP_,p1__29963_SHARP_,p3__29964_SHARP_);

return p1__29963_SHARP_;
}),this$,attr);
});
hoplon.core.add_children_BANG_ = (function hoplon$core$add_children_BANG_(this$,p__29965){
var vec__29973 = p__29965;
var seq__29974 = cljs.core.seq.call(null,vec__29973);
var first__29975 = cljs.core.first.call(null,seq__29974);
var seq__29974__$1 = cljs.core.next.call(null,seq__29974);
var child_cell = first__29975;
var _ = seq__29974__$1;
var kids = vec__29973;
var this$__$1 = this$;
var seq__29976_29980 = cljs.core.seq.call(null,hoplon.core.vflatten.call(null,kids));
var chunk__29977_29981 = null;
var count__29978_29982 = (0);
var i__29979_29983 = (0);
while(true){
if((i__29979_29983 < count__29978_29982)){
var x_29984 = cljs.core._nth.call(null,chunk__29977_29981,i__29979_29983);
var temp__5278__auto___29985 = hoplon.core.__GT_node.call(null,x_29984);
if(cljs.core.truth_(temp__5278__auto___29985)){
var x_29986__$1 = temp__5278__auto___29985;
hoplon.core.append_child_BANG_.call(null,this$__$1,x_29986__$1);
} else {
}

var G__29987 = seq__29976_29980;
var G__29988 = chunk__29977_29981;
var G__29989 = count__29978_29982;
var G__29990 = (i__29979_29983 + (1));
seq__29976_29980 = G__29987;
chunk__29977_29981 = G__29988;
count__29978_29982 = G__29989;
i__29979_29983 = G__29990;
continue;
} else {
var temp__5278__auto___29991 = cljs.core.seq.call(null,seq__29976_29980);
if(temp__5278__auto___29991){
var seq__29976_29992__$1 = temp__5278__auto___29991;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__29976_29992__$1)){
var c__24059__auto___29993 = cljs.core.chunk_first.call(null,seq__29976_29992__$1);
var G__29994 = cljs.core.chunk_rest.call(null,seq__29976_29992__$1);
var G__29995 = c__24059__auto___29993;
var G__29996 = cljs.core.count.call(null,c__24059__auto___29993);
var G__29997 = (0);
seq__29976_29980 = G__29994;
chunk__29977_29981 = G__29995;
count__29978_29982 = G__29996;
i__29979_29983 = G__29997;
continue;
} else {
var x_29998 = cljs.core.first.call(null,seq__29976_29992__$1);
var temp__5278__auto___29999__$1 = hoplon.core.__GT_node.call(null,x_29998);
if(cljs.core.truth_(temp__5278__auto___29999__$1)){
var x_30000__$1 = temp__5278__auto___29999__$1;
hoplon.core.append_child_BANG_.call(null,this$__$1,x_30000__$1);
} else {
}

var G__30001 = cljs.core.next.call(null,seq__29976_29992__$1);
var G__30002 = null;
var G__30003 = (0);
var G__30004 = (0);
seq__29976_29980 = G__30001;
chunk__29977_29981 = G__30002;
count__29978_29982 = G__30003;
i__29979_29983 = G__30004;
continue;
}
} else {
}
}
break;
}

return this$__$1;
});
Element.prototype.cljs$core$IPrintWithWriter$ = cljs.core.PROTOCOL_SENTINEL;

Element.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this$,writer,opts){
var this$__$1 = this;
return cljs.core.write_all.call(null,writer,"#<Element: ",this$__$1.tagName,">");
});

Element.prototype.cljs$core$IFn$ = cljs.core.PROTOCOL_SENTINEL;

Element.prototype.call = (function() { 
var G__30037__delegate = function (self__,args){
var self____$1 = this;
var this$ = self____$1;
var vec__30006 = hoplon.core.parse_args.call(null,args);
var attr = cljs.core.nth.call(null,vec__30006,(0),null);
var kids = cljs.core.nth.call(null,vec__30006,(1),null);
var G__30009 = this$;
hoplon.core.add_attributes_BANG_.call(null,G__30009,attr);

hoplon.core.add_children_BANG_.call(null,G__30009,kids);

return G__30009;
};
var G__30037 = function (self__,var_args){
var args = null;
if (arguments.length > 1) {
var G__30038__i = 0, G__30038__a = new Array(arguments.length -  1);
while (G__30038__i < G__30038__a.length) {G__30038__a[G__30038__i] = arguments[G__30038__i + 1]; ++G__30038__i;}
  args = new cljs.core.IndexedSeq(G__30038__a,0,null);
} 
return G__30037__delegate.call(this,self__,args);};
G__30037.cljs$lang$maxFixedArity = 1;
G__30037.cljs$lang$applyTo = (function (arglist__30039){
var self__ = cljs.core.first(arglist__30039);
var args = cljs.core.rest(arglist__30039);
return G__30037__delegate(self__,args);
});
G__30037.cljs$core$IFn$_invoke$arity$variadic = G__30037__delegate;
return G__30037;
})()
;

Element.prototype.apply = (function (self__,args30005){
var self____$1 = this;
return self____$1.call.apply(self____$1,[self____$1].concat(cljs.core.aclone.call(null,args30005)));
});

Element.prototype.cljs$core$IFn$_invoke$arity$2 = (function() { 
var G__30040__delegate = function (args){
var this$ = this;
var vec__30010 = hoplon.core.parse_args.call(null,args);
var attr = cljs.core.nth.call(null,vec__30010,(0),null);
var kids = cljs.core.nth.call(null,vec__30010,(1),null);
var G__30013 = this$;
hoplon.core.add_attributes_BANG_.call(null,G__30013,attr);

hoplon.core.add_children_BANG_.call(null,G__30013,kids);

return G__30013;
};
var G__30040 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30041__i = 0, G__30041__a = new Array(arguments.length -  0);
while (G__30041__i < G__30041__a.length) {G__30041__a[G__30041__i] = arguments[G__30041__i + 0]; ++G__30041__i;}
  args = new cljs.core.IndexedSeq(G__30041__a,0,null);
} 
return G__30040__delegate.call(this,args);};
G__30040.cljs$lang$maxFixedArity = 0;
G__30040.cljs$lang$applyTo = (function (arglist__30042){
var args = cljs.core.seq(arglist__30042);
return G__30040__delegate(args);
});
G__30040.cljs$core$IFn$_invoke$arity$variadic = G__30040__delegate;
return G__30040;
})()
;

Element.prototype.hoplon$core$ICustomElement$ = cljs.core.PROTOCOL_SENTINEL;

Element.prototype.hoplon$core$ICustomElement$_set_attributes_BANG_$arity$2 = (function (this$,kvs){
var this$__$1 = this;
var e = this$__$1;
var seq__30014 = cljs.core.seq.call(null,kvs);
var chunk__30016 = null;
var count__30017 = (0);
var i__30018 = (0);
while(true){
if((i__30018 < count__30017)){
var vec__30020 = cljs.core._nth.call(null,chunk__30016,i__30018);
var k = cljs.core.nth.call(null,vec__30020,(0),null);
var v = cljs.core.nth.call(null,vec__30020,(1),null);
var k_30043__$1 = cljs.core.name.call(null,k);
if(cljs.core.not.call(null,v)){
e.removeAttribute(k_30043__$1);
} else {
e.setAttribute(k_30043__$1,((cljs.core._EQ_.call(null,true,v))?k_30043__$1:v));
}

var G__30044 = seq__30014;
var G__30045 = chunk__30016;
var G__30046 = count__30017;
var G__30047 = (i__30018 + (1));
seq__30014 = G__30044;
chunk__30016 = G__30045;
count__30017 = G__30046;
i__30018 = G__30047;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__30014);
if(temp__5278__auto__){
var seq__30014__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30014__$1)){
var c__24059__auto__ = cljs.core.chunk_first.call(null,seq__30014__$1);
var G__30048 = cljs.core.chunk_rest.call(null,seq__30014__$1);
var G__30049 = c__24059__auto__;
var G__30050 = cljs.core.count.call(null,c__24059__auto__);
var G__30051 = (0);
seq__30014 = G__30048;
chunk__30016 = G__30049;
count__30017 = G__30050;
i__30018 = G__30051;
continue;
} else {
var vec__30023 = cljs.core.first.call(null,seq__30014__$1);
var k = cljs.core.nth.call(null,vec__30023,(0),null);
var v = cljs.core.nth.call(null,vec__30023,(1),null);
var k_30052__$1 = cljs.core.name.call(null,k);
if(cljs.core.not.call(null,v)){
e.removeAttribute(k_30052__$1);
} else {
e.setAttribute(k_30052__$1,((cljs.core._EQ_.call(null,true,v))?k_30052__$1:v));
}

var G__30053 = cljs.core.next.call(null,seq__30014__$1);
var G__30054 = null;
var G__30055 = (0);
var G__30056 = (0);
seq__30014 = G__30053;
chunk__30016 = G__30054;
count__30017 = G__30055;
i__30018 = G__30056;
continue;
}
} else {
return null;
}
}
break;
}
});

Element.prototype.hoplon$core$ICustomElement$_set_styles_BANG_$arity$2 = (function (this$,kvs){
var this$__$1 = this;
var e = this$__$1;
var seq__30026 = cljs.core.seq.call(null,kvs);
var chunk__30027 = null;
var count__30028 = (0);
var i__30029 = (0);
while(true){
if((i__30029 < count__30028)){
var vec__30030 = cljs.core._nth.call(null,chunk__30027,i__30029);
var k = cljs.core.nth.call(null,vec__30030,(0),null);
var v = cljs.core.nth.call(null,vec__30030,(1),null);
goog.object.set(e.style,cljs.core.name.call(null,k),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(v)].join(''));

var G__30057 = seq__30026;
var G__30058 = chunk__30027;
var G__30059 = count__30028;
var G__30060 = (i__30029 + (1));
seq__30026 = G__30057;
chunk__30027 = G__30058;
count__30028 = G__30059;
i__30029 = G__30060;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__30026);
if(temp__5278__auto__){
var seq__30026__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30026__$1)){
var c__24059__auto__ = cljs.core.chunk_first.call(null,seq__30026__$1);
var G__30061 = cljs.core.chunk_rest.call(null,seq__30026__$1);
var G__30062 = c__24059__auto__;
var G__30063 = cljs.core.count.call(null,c__24059__auto__);
var G__30064 = (0);
seq__30026 = G__30061;
chunk__30027 = G__30062;
count__30028 = G__30063;
i__30029 = G__30064;
continue;
} else {
var vec__30033 = cljs.core.first.call(null,seq__30026__$1);
var k = cljs.core.nth.call(null,vec__30033,(0),null);
var v = cljs.core.nth.call(null,vec__30033,(1),null);
goog.object.set(e.style,cljs.core.name.call(null,k),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(v)].join(''));

var G__30065 = cljs.core.next.call(null,seq__30026__$1);
var G__30066 = null;
var G__30067 = (0);
var G__30068 = (0);
seq__30026 = G__30065;
chunk__30027 = G__30066;
count__30028 = G__30067;
i__30029 = G__30068;
continue;
}
} else {
return null;
}
}
break;
}
});

Element.prototype.hoplon$core$ICustomElement$_append_child_BANG_$arity$2 = (function (this$,child){
var this$__$1 = this;
if(!(hoplon.core.is_ie8)){
return this$__$1.appendChild(child);
} else {
try{return this$__$1.appendChild(child);
}catch (e30036){if((e30036 instanceof Error)){
var _ = e30036;
return null;
} else {
throw e30036;

}
}}
});

Element.prototype.hoplon$core$ICustomElement$_remove_child_BANG_$arity$2 = (function (this$,child){
var this$__$1 = this;
return this$__$1.removeChild(child);
});

Element.prototype.hoplon$core$ICustomElement$_replace_child_BANG_$arity$3 = (function (this$,new$,existing){
var this$__$1 = this;
return this$__$1.replaceChild(new$,existing);
});

Element.prototype.hoplon$core$ICustomElement$_insert_before_BANG_$arity$3 = (function (this$,new$,existing){
var this$__$1 = this;
return this$__$1.insertBefore(new$,existing);
});
hoplon.core.make_singleton_ctor = (function hoplon$core$make_singleton_ctor(elem){
return (function() { 
var G__30075__delegate = function (args){
var vec__30072 = hoplon.core.parse_args.call(null,args);
var attrs = cljs.core.nth.call(null,vec__30072,(0),null);
var kids = cljs.core.nth.call(null,vec__30072,(1),null);
hoplon.core.add_attributes_BANG_.call(null,elem,attrs);

if(cljs.core.not.call(null,new cljs.core.Keyword(null,"static","static",1214358571).cljs$core$IFn$_invoke$arity$1(attrs))){
hoplon.core.remove_all_kids_BANG_.call(null,elem);

return hoplon.core.add_children_BANG_.call(null,elem,kids);
} else {
return null;
}
};
var G__30075 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30076__i = 0, G__30076__a = new Array(arguments.length -  0);
while (G__30076__i < G__30076__a.length) {G__30076__a[G__30076__i] = arguments[G__30076__i + 0]; ++G__30076__i;}
  args = new cljs.core.IndexedSeq(G__30076__a,0,null);
} 
return G__30075__delegate.call(this,args);};
G__30075.cljs$lang$maxFixedArity = 0;
G__30075.cljs$lang$applyTo = (function (arglist__30077){
var args = cljs.core.seq(arglist__30077);
return G__30075__delegate(args);
});
G__30075.cljs$core$IFn$_invoke$arity$variadic = G__30075__delegate;
return G__30075;
})()
;
});
hoplon.core.make_elem_ctor = (function hoplon$core$make_elem_ctor(tag){
var mkelem = (function() { 
var G__30081__delegate = function (rest__30078_SHARP_){
return cljs.core.apply.call(null,document.createElement(tag),rest__30078_SHARP_);
};
var G__30081 = function (var_args){
var rest__30078_SHARP_ = null;
if (arguments.length > 0) {
var G__30082__i = 0, G__30082__a = new Array(arguments.length -  0);
while (G__30082__i < G__30082__a.length) {G__30082__a[G__30082__i] = arguments[G__30082__i + 0]; ++G__30082__i;}
  rest__30078_SHARP_ = new cljs.core.IndexedSeq(G__30082__a,0,null);
} 
return G__30081__delegate.call(this,rest__30078_SHARP_);};
G__30081.cljs$lang$maxFixedArity = 0;
G__30081.cljs$lang$applyTo = (function (arglist__30083){
var rest__30078_SHARP_ = cljs.core.seq(arglist__30083);
return G__30081__delegate(rest__30078_SHARP_);
});
G__30081.cljs$core$IFn$_invoke$arity$variadic = G__30081__delegate;
return G__30081;
})()
;
if(!(hoplon.core.is_ie8)){
return mkelem;
} else {
return ((function (mkelem){
return (function() { 
var G__30084__delegate = function (args){
try{return cljs.core.apply.call(null,mkelem,args);
}catch (e30080){if((e30080 instanceof Error)){
var _ = e30080;
return cljs.core.apply.call(null,hoplon.core.make_elem_ctor.call(null,"div"),args);
} else {
throw e30080;

}
}};
var G__30084 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__30085__i = 0, G__30085__a = new Array(arguments.length -  0);
while (G__30085__i < G__30085__a.length) {G__30085__a[G__30085__i] = arguments[G__30085__i + 0]; ++G__30085__i;}
  args = new cljs.core.IndexedSeq(G__30085__a,0,null);
} 
return G__30084__delegate.call(this,args);};
G__30084.cljs$lang$maxFixedArity = 0;
G__30084.cljs$lang$applyTo = (function (arglist__30086){
var args = cljs.core.seq(arglist__30086);
return G__30084__delegate(args);
});
G__30084.cljs$core$IFn$_invoke$arity$variadic = G__30084__delegate;
return G__30084;
})()
;
;})(mkelem))
}
});
hoplon.core.html = (function hoplon$core$html(var_args){
var args__24376__auto__ = [];
var len__24369__auto___30088 = arguments.length;
var i__24370__auto___30089 = (0);
while(true){
if((i__24370__auto___30089 < len__24369__auto___30088)){
args__24376__auto__.push((arguments[i__24370__auto___30089]));

var G__30090 = (i__24370__auto___30089 + (1));
i__24370__auto___30089 = G__30090;
continue;
} else {
}
break;
}

var argseq__24377__auto__ = ((((0) < args__24376__auto__.length))?(new cljs.core.IndexedSeq(args__24376__auto__.slice((0)),(0),null)):null);
return hoplon.core.html.cljs$core$IFn$_invoke$arity$variadic(argseq__24377__auto__);
});

hoplon.core.html.cljs$core$IFn$_invoke$arity$variadic = (function (args){

return hoplon.core.add_attributes_BANG_.call(null,document.documentElement,cljs.core.nth.call(null,hoplon.core.parse_args.call(null,args),(0)));
});

hoplon.core.html.cljs$lang$maxFixedArity = (0);

hoplon.core.html.cljs$lang$applyTo = (function (seq30087){
return hoplon.core.html.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq30087));
});

/**
 * Updates the document's `head` element in place.
 */
hoplon.core.head = hoplon.core.make_singleton_ctor.call(null,hoplon.core._head_STAR_.call(null,document));
/**
 * Updates the document's `body` element in place.
 */
hoplon.core.body = hoplon.core.make_singleton_ctor.call(null,document.body);
hoplon.core.a = hoplon.core.make_elem_ctor.call(null,"a");
hoplon.core.abbr = hoplon.core.make_elem_ctor.call(null,"abbr");
hoplon.core.address = hoplon.core.make_elem_ctor.call(null,"address");
hoplon.core.area = hoplon.core.make_elem_ctor.call(null,"area");
hoplon.core.article = hoplon.core.make_elem_ctor.call(null,"article");
hoplon.core.aside = hoplon.core.make_elem_ctor.call(null,"aside");
hoplon.core.audio = hoplon.core.make_elem_ctor.call(null,"audio");
hoplon.core.b = hoplon.core.make_elem_ctor.call(null,"b");
hoplon.core.base = hoplon.core.make_elem_ctor.call(null,"base");
hoplon.core.bdi = hoplon.core.make_elem_ctor.call(null,"bdi");
hoplon.core.bdo = hoplon.core.make_elem_ctor.call(null,"bdo");
hoplon.core.blockquote = hoplon.core.make_elem_ctor.call(null,"blockquote");
hoplon.core.br = hoplon.core.make_elem_ctor.call(null,"br");
hoplon.core.button = hoplon.core.make_elem_ctor.call(null,"button");
hoplon.core.canvas = hoplon.core.make_elem_ctor.call(null,"canvas");
hoplon.core.caption = hoplon.core.make_elem_ctor.call(null,"caption");
hoplon.core.cite = hoplon.core.make_elem_ctor.call(null,"cite");
hoplon.core.code = hoplon.core.make_elem_ctor.call(null,"code");
hoplon.core.col = hoplon.core.make_elem_ctor.call(null,"col");
hoplon.core.colgroup = hoplon.core.make_elem_ctor.call(null,"colgroup");
hoplon.core.data = hoplon.core.make_elem_ctor.call(null,"data");
hoplon.core.datalist = hoplon.core.make_elem_ctor.call(null,"datalist");
hoplon.core.dd = hoplon.core.make_elem_ctor.call(null,"dd");
hoplon.core.del = hoplon.core.make_elem_ctor.call(null,"del");
hoplon.core.details = hoplon.core.make_elem_ctor.call(null,"details");
hoplon.core.dfn = hoplon.core.make_elem_ctor.call(null,"dfn");
hoplon.core.dialog = hoplon.core.make_elem_ctor.call(null,"dialog");
hoplon.core.div = hoplon.core.make_elem_ctor.call(null,"div");
hoplon.core.dl = hoplon.core.make_elem_ctor.call(null,"dl");
hoplon.core.dt = hoplon.core.make_elem_ctor.call(null,"dt");
hoplon.core.em = hoplon.core.make_elem_ctor.call(null,"em");
hoplon.core.embed = hoplon.core.make_elem_ctor.call(null,"embed");
hoplon.core.fieldset = hoplon.core.make_elem_ctor.call(null,"fieldset");
hoplon.core.figcaption = hoplon.core.make_elem_ctor.call(null,"figcaption");
hoplon.core.figure = hoplon.core.make_elem_ctor.call(null,"figure");
hoplon.core.footer = hoplon.core.make_elem_ctor.call(null,"footer");
hoplon.core.form = hoplon.core.make_elem_ctor.call(null,"form");
hoplon.core.h1 = hoplon.core.make_elem_ctor.call(null,"h1");
hoplon.core.h2 = hoplon.core.make_elem_ctor.call(null,"h2");
hoplon.core.h3 = hoplon.core.make_elem_ctor.call(null,"h3");
hoplon.core.h4 = hoplon.core.make_elem_ctor.call(null,"h4");
hoplon.core.h5 = hoplon.core.make_elem_ctor.call(null,"h5");
hoplon.core.h6 = hoplon.core.make_elem_ctor.call(null,"h6");
hoplon.core.header = hoplon.core.make_elem_ctor.call(null,"header");
hoplon.core.hgroup = hoplon.core.make_elem_ctor.call(null,"hgroup");
hoplon.core.hr = hoplon.core.make_elem_ctor.call(null,"hr");
hoplon.core.i = hoplon.core.make_elem_ctor.call(null,"i");
hoplon.core.iframe = hoplon.core.make_elem_ctor.call(null,"iframe");
hoplon.core.img = hoplon.core.make_elem_ctor.call(null,"img");
hoplon.core.input = hoplon.core.make_elem_ctor.call(null,"input");
hoplon.core.ins = hoplon.core.make_elem_ctor.call(null,"ins");
hoplon.core.kbd = hoplon.core.make_elem_ctor.call(null,"kbd");
hoplon.core.keygen = hoplon.core.make_elem_ctor.call(null,"keygen");
hoplon.core.label = hoplon.core.make_elem_ctor.call(null,"label");
hoplon.core.legend = hoplon.core.make_elem_ctor.call(null,"legend");
hoplon.core.li = hoplon.core.make_elem_ctor.call(null,"li");
hoplon.core.link = hoplon.core.make_elem_ctor.call(null,"link");
hoplon.core.main = hoplon.core.make_elem_ctor.call(null,"main");
hoplon.core.html_map = hoplon.core.make_elem_ctor.call(null,"map");
hoplon.core.mark = hoplon.core.make_elem_ctor.call(null,"mark");
hoplon.core.menu = hoplon.core.make_elem_ctor.call(null,"menu");
hoplon.core.menuitem = hoplon.core.make_elem_ctor.call(null,"menuitem");
hoplon.core.html_meta = hoplon.core.make_elem_ctor.call(null,"meta");
hoplon.core.meter = hoplon.core.make_elem_ctor.call(null,"meter");
hoplon.core.multicol = hoplon.core.make_elem_ctor.call(null,"multicol");
hoplon.core.nav = hoplon.core.make_elem_ctor.call(null,"nav");
hoplon.core.noframes = hoplon.core.make_elem_ctor.call(null,"noframes");
hoplon.core.noscript = hoplon.core.make_elem_ctor.call(null,"noscript");
hoplon.core.html_object = hoplon.core.make_elem_ctor.call(null,"object");
hoplon.core.ol = hoplon.core.make_elem_ctor.call(null,"ol");
hoplon.core.optgroup = hoplon.core.make_elem_ctor.call(null,"optgroup");
hoplon.core.option = hoplon.core.make_elem_ctor.call(null,"option");
hoplon.core.output = hoplon.core.make_elem_ctor.call(null,"output");
hoplon.core.p = hoplon.core.make_elem_ctor.call(null,"p");
hoplon.core.param = hoplon.core.make_elem_ctor.call(null,"param");
hoplon.core.picture = hoplon.core.make_elem_ctor.call(null,"picture");
hoplon.core.pre = hoplon.core.make_elem_ctor.call(null,"pre");
hoplon.core.progress = hoplon.core.make_elem_ctor.call(null,"progress");
hoplon.core.q = hoplon.core.make_elem_ctor.call(null,"q");
hoplon.core.rp = hoplon.core.make_elem_ctor.call(null,"rp");
hoplon.core.rt = hoplon.core.make_elem_ctor.call(null,"rt");
hoplon.core.rtc = hoplon.core.make_elem_ctor.call(null,"rtc");
hoplon.core.ruby = hoplon.core.make_elem_ctor.call(null,"ruby");
hoplon.core.s = hoplon.core.make_elem_ctor.call(null,"s");
hoplon.core.samp = hoplon.core.make_elem_ctor.call(null,"samp");
hoplon.core.script = hoplon.core.make_elem_ctor.call(null,"script");
hoplon.core.section = hoplon.core.make_elem_ctor.call(null,"section");
hoplon.core.select = hoplon.core.make_elem_ctor.call(null,"select");
hoplon.core.shadow = hoplon.core.make_elem_ctor.call(null,"shadow");
hoplon.core.small = hoplon.core.make_elem_ctor.call(null,"small");
hoplon.core.source = hoplon.core.make_elem_ctor.call(null,"source");
hoplon.core.span = hoplon.core.make_elem_ctor.call(null,"span");
hoplon.core.strong = hoplon.core.make_elem_ctor.call(null,"strong");
hoplon.core.style = hoplon.core.make_elem_ctor.call(null,"style");
hoplon.core.sub = hoplon.core.make_elem_ctor.call(null,"sub");
hoplon.core.summary = hoplon.core.make_elem_ctor.call(null,"summary");
hoplon.core.sup = hoplon.core.make_elem_ctor.call(null,"sup");
hoplon.core.table = hoplon.core.make_elem_ctor.call(null,"table");
hoplon.core.tbody = hoplon.core.make_elem_ctor.call(null,"tbody");
hoplon.core.td = hoplon.core.make_elem_ctor.call(null,"td");
hoplon.core.template = hoplon.core.make_elem_ctor.call(null,"template");
hoplon.core.textarea = hoplon.core.make_elem_ctor.call(null,"textarea");
hoplon.core.tfoot = hoplon.core.make_elem_ctor.call(null,"tfoot");
hoplon.core.th = hoplon.core.make_elem_ctor.call(null,"th");
hoplon.core.thead = hoplon.core.make_elem_ctor.call(null,"thead");
hoplon.core.html_time = hoplon.core.make_elem_ctor.call(null,"time");
hoplon.core.title = hoplon.core.make_elem_ctor.call(null,"title");
hoplon.core.tr = hoplon.core.make_elem_ctor.call(null,"tr");
hoplon.core.track = hoplon.core.make_elem_ctor.call(null,"track");
hoplon.core.u = hoplon.core.make_elem_ctor.call(null,"u");
hoplon.core.ul = hoplon.core.make_elem_ctor.call(null,"ul");
hoplon.core.html_var = hoplon.core.make_elem_ctor.call(null,"var");
hoplon.core.video = hoplon.core.make_elem_ctor.call(null,"video");
hoplon.core.wbr = hoplon.core.make_elem_ctor.call(null,"wbr");
hoplon.core.spliced = cljs.core.vector;
hoplon.core.$text = (function hoplon$core$$text(p1__30091_SHARP_){
return document.createTextNode(p1__30091_SHARP_);
});
hoplon.core.$comment = (function hoplon$core$$comment(p1__30092_SHARP_){
return document.createComment(p1__30092_SHARP_);
});
hoplon.core._LT__BANG___ = hoplon.core.$comment;
hoplon.core.___GT_ = new cljs.core.Keyword("hoplon.core","-->","hoplon.core/-->",1031510657);
hoplon.core.add_initfn_BANG_ = (function hoplon$core$add_initfn_BANG_(f){
return window.addEventListener("load",(function (){
return setTimeout((function (){
return f.call(null);
}),(0));
}));
});
hoplon.core.page_load = (function hoplon$core$page_load(){
return document.dispatchEvent("page-load");
});
hoplon.core.on_page_load = (function hoplon$core$on_page_load(f){
return document.addEventListener("page-load",f);
});
hoplon.core.add_initfn_BANG_.call(null,(function (){
return document.body.addEventListener("submit",(function (p1__30093_SHARP_){
var e = p1__30093_SHARP_.target;
if(cljs.core.truth_((function (){var or__23148__auto__ = e.getAttribute("action");
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return e.getAttribute("method");
}
})())){
return null;
} else {
return p1__30093_SHARP_.preventDefault();
}
}));
}));
if(typeof hoplon.core.do_BANG_ !== 'undefined'){
} else {
hoplon.core.do_BANG_ = (function (){var method_table__24179__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24180__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24181__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24182__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24183__auto__ = cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"default","default",-1987822328),new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365)], null),new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"hoplon.core","do!"),((function (method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__auto__){
return (function (elem,key,val){
var temp__5276__auto__ = cljs.core.namespace.call(null,key);
if(cljs.core.truth_(temp__5276__auto__)){
var n = temp__5276__auto__;
return cljs.core.keyword.call(null,n,"*");
} else {
return key;
}
});})(method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__auto__))
,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),hierarchy__24183__auto__,method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__));
})();
}
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),(function (elem,key,val){
return hoplon.core.do_BANG_.call(null,elem,new cljs.core.Keyword(null,"attr","attr",-604132353),cljs.core.PersistentArrayMap.createAsIfByAssoc([key,val]));
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword("css","*","css/*",-1295355419),(function (elem,key,val){
return hoplon.core.set_styles_BANG_.call(null,elem,key,val);
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword("html","*","html/*",-1283138243),(function (elem,key,val){
return hoplon.core.set_attributes_BANG_.call(null,elem,key,val);
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword("svg","*","svg/*",-1295405562),(function (elem,key,val){
return hoplon.core.set_attributes_BANG_.call(null,elem,key,val);
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"attr","attr",-604132353),(function (elem,_,kvs){
return hoplon.core.set_attributes_BANG_.call(null,elem,kvs);
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"css","css",1135045163),(function (elem,_,kvs){
return hoplon.core.set_styles_BANG_.call(null,elem,kvs);
}));
if(typeof hoplon.core.on_BANG_ !== 'undefined'){
} else {
hoplon.core.on_BANG_ = (function (){var method_table__24179__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24180__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24181__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24182__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24183__auto__ = cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"default","default",-1987822328),new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365)], null),new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"hoplon.core","on!"),((function (method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__auto__){
return (function (elem,key,val){
var temp__5276__auto__ = cljs.core.namespace.call(null,key);
if(cljs.core.truth_(temp__5276__auto__)){
var n = temp__5276__auto__;
return cljs.core.keyword.call(null,n,"*");
} else {
return key;
}
});})(method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__auto__))
,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),hierarchy__24183__auto__,method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__));
})();
}
cljs.core._add_method.call(null,hoplon.core.on_BANG_,new cljs.core.Keyword("hoplon.core","default","hoplon.core/default",-778824365),(function (elem,event,callback){
return hoplon.core.when_dom.call(null,elem,(function (){
return elem.addEventListener(cljs.core.name.call(null,event),callback);
}));
}));
cljs.core._add_method.call(null,hoplon.core.on_BANG_,new cljs.core.Keyword("html","*","html/*",-1283138243),(function (elem,event,callback){
return hoplon.core.when_dom.call(null,elem,(function (){
return elem.addEventListener(cljs.core.name.call(null,event),callback);
}));
}));
/**
 * Given a cell items containing a seqable collection, constructs a cell that
 *   works like a fill vector. The template tpl is a function of one argument: the
 *   formula cell containing the ith item in items. The tpl function is called
 *   once (and only once) for each index in items. When the items collection
 *   shrinks the DOM element created by the template is not destroyed--it is only
 *   removed from the DOM and cached. When the items collection grows again those
 *   cached elements will be reinserted into the DOM at their original index.
 */
hoplon.core.loop_tpl_STAR_ = (function hoplon$core$loop_tpl_STAR_(items,tpl){
var on_deck = cljs.core.atom.call(null,cljs.core.List.EMPTY);
var items_seq = javelin.core.formula.call(null,((function (on_deck){
return (function (G__30105,G__30106){
return G__30105.call(null,G__30106);
});})(on_deck))
).call(null,cljs.core.seq,items);
var ith_item = ((function (on_deck,items_seq){
return (function (p1__30094_SHARP_){
return javelin.core.formula.call(null,((function (on_deck,items_seq){
return (function (G__30108,G__30109,G__30107){
return G__30107.call(null,G__30108,G__30109);
});})(on_deck,items_seq))
).call(null,items_seq,p1__30094_SHARP_,hoplon.core.safe_nth);
});})(on_deck,items_seq))
;
var shift_BANG_ = ((function (on_deck,items_seq,ith_item){
return (function (p1__30095_SHARP_){
var x = cljs.core.first.call(null,cljs.core.deref.call(null,p1__30095_SHARP_));
cljs.core.swap_BANG_.call(null,p1__30095_SHARP_,cljs.core.rest);

return x;
});})(on_deck,items_seq,ith_item))
;
var current = javelin.core.cell.call(null,cljs.core.PersistentVector.EMPTY);
hoplon.core.do_watch.call(null,items_seq,((function (current,on_deck,items_seq,ith_item,shift_BANG_){
return (function (old_items,new_items){
var old = cljs.core.count.call(null,old_items);
var new$ = cljs.core.count.call(null,new_items);
var diff = (new$ - old);
if((diff > (0))){
var seq__30110 = cljs.core.seq.call(null,cljs.core.range.call(null,old,new$));
var chunk__30111 = null;
var count__30112 = (0);
var i__30113 = (0);
while(true){
if((i__30113 < count__30112)){
var i = cljs.core._nth.call(null,chunk__30111,i__30113);
var e_30114 = (function (){var or__23148__auto__ = shift_BANG_.call(null,on_deck);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return tpl.call(null,ith_item.call(null,i));
}
})();
cljs.core.swap_BANG_.call(null,current,cljs.core.conj,e_30114);

var G__30115 = seq__30110;
var G__30116 = chunk__30111;
var G__30117 = count__30112;
var G__30118 = (i__30113 + (1));
seq__30110 = G__30115;
chunk__30111 = G__30116;
count__30112 = G__30117;
i__30113 = G__30118;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__30110);
if(temp__5278__auto__){
var seq__30110__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__30110__$1)){
var c__24059__auto__ = cljs.core.chunk_first.call(null,seq__30110__$1);
var G__30119 = cljs.core.chunk_rest.call(null,seq__30110__$1);
var G__30120 = c__24059__auto__;
var G__30121 = cljs.core.count.call(null,c__24059__auto__);
var G__30122 = (0);
seq__30110 = G__30119;
chunk__30111 = G__30120;
count__30112 = G__30121;
i__30113 = G__30122;
continue;
} else {
var i = cljs.core.first.call(null,seq__30110__$1);
var e_30123 = (function (){var or__23148__auto__ = shift_BANG_.call(null,on_deck);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return tpl.call(null,ith_item.call(null,i));
}
})();
cljs.core.swap_BANG_.call(null,current,cljs.core.conj,e_30123);

var G__30124 = cljs.core.next.call(null,seq__30110__$1);
var G__30125 = null;
var G__30126 = (0);
var G__30127 = (0);
seq__30110 = G__30124;
chunk__30111 = G__30125;
count__30112 = G__30126;
i__30113 = G__30127;
continue;
}
} else {
return null;
}
}
break;
}
} else {
if((diff < (0))){
var n__24169__auto__ = (- diff);
var _ = (0);
while(true){
if((_ < n__24169__auto__)){
var e_30128 = cljs.core.peek.call(null,cljs.core.deref.call(null,current));
cljs.core.swap_BANG_.call(null,current,cljs.core.pop);

cljs.core.swap_BANG_.call(null,on_deck,cljs.core.conj,e_30128);

var G__30129 = (_ + (1));
_ = G__30129;
continue;
} else {
return null;
}
break;
}
} else {
return null;
}
}
});})(current,on_deck,items_seq,ith_item,shift_BANG_))
);

return current;
});
/**
 * Defines a cell whose value is the URI fragment.
 */
hoplon.core.route_cell = (function hoplon$core$route_cell(var_args){
var args__24376__auto__ = [];
var len__24369__auto___30138 = arguments.length;
var i__24370__auto___30139 = (0);
while(true){
if((i__24370__auto___30139 < len__24369__auto___30138)){
args__24376__auto__.push((arguments[i__24370__auto___30139]));

var G__30140 = (i__24370__auto___30139 + (1));
i__24370__auto___30139 = G__30140;
continue;
} else {
}
break;
}

var argseq__24377__auto__ = ((((0) < args__24376__auto__.length))?(new cljs.core.IndexedSeq(args__24376__auto__.slice((0)),(0),null)):null);
return hoplon.core.route_cell.cljs$core$IFn$_invoke$arity$variadic(argseq__24377__auto__);
});

hoplon.core.route_cell.cljs$core$IFn$_invoke$arity$variadic = (function (p__30131){
var vec__30132 = p__30131;
var default$ = cljs.core.nth.call(null,vec__30132,(0),null);
var c = javelin.core.cell.call(null,window.location.hash);
var _ = javelin.core.formula.call(null,((function (c,vec__30132,default$){
return (function (G__30135,G__30137,G__30136){
var or__23148__auto__ = (function (){var and__23136__auto__ = G__30135.call(null,G__30136);
if(cljs.core.truth_(and__23136__auto__)){
return G__30136;
} else {
return and__23136__auto__;
}
})();
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return G__30137;
}
});})(c,vec__30132,default$))
).call(null,cljs.core.seq,default$,c);
window.addEventListener("hashchange",((function (_,c,vec__30132,default$){
return (function (){
return cljs.core.reset_BANG_.call(null,c,window.location.hash);
});})(_,c,vec__30132,default$))
);

return _;
});

hoplon.core.route_cell.cljs$lang$maxFixedArity = (0);

hoplon.core.route_cell.cljs$lang$applyTo = (function (seq30130){
return hoplon.core.route_cell.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq30130));
});

