goog.provide('shadow.dom');
shadow.dom.transition_supported_QMARK_ = true;

/**
 * @interface
 */
shadow.dom.IElement = function(){};

var shadow$dom$IElement$_to_dom$dyn_33135 = (function (this$){
var x__5373__auto__ = (((this$ == null))?null:this$);
var m__5374__auto__ = (shadow.dom._to_dom[goog.typeOf(x__5373__auto__)]);
if((!((m__5374__auto__ == null)))){
return (m__5374__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5374__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5374__auto__.call(null,this$));
} else {
var m__5372__auto__ = (shadow.dom._to_dom["_"]);
if((!((m__5372__auto__ == null)))){
return (m__5372__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5372__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5372__auto__.call(null,this$));
} else {
throw cljs.core.missing_protocol("IElement.-to-dom",this$);
}
}
});
shadow.dom._to_dom = (function shadow$dom$_to_dom(this$){
if((((!((this$ == null)))) && ((!((this$.shadow$dom$IElement$_to_dom$arity$1 == null)))))){
return this$.shadow$dom$IElement$_to_dom$arity$1(this$);
} else {
return shadow$dom$IElement$_to_dom$dyn_33135(this$);
}
});


/**
 * @interface
 */
shadow.dom.SVGElement = function(){};

var shadow$dom$SVGElement$_to_svg$dyn_33137 = (function (this$){
var x__5373__auto__ = (((this$ == null))?null:this$);
var m__5374__auto__ = (shadow.dom._to_svg[goog.typeOf(x__5373__auto__)]);
if((!((m__5374__auto__ == null)))){
return (m__5374__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5374__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5374__auto__.call(null,this$));
} else {
var m__5372__auto__ = (shadow.dom._to_svg["_"]);
if((!((m__5372__auto__ == null)))){
return (m__5372__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5372__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5372__auto__.call(null,this$));
} else {
throw cljs.core.missing_protocol("SVGElement.-to-svg",this$);
}
}
});
shadow.dom._to_svg = (function shadow$dom$_to_svg(this$){
if((((!((this$ == null)))) && ((!((this$.shadow$dom$SVGElement$_to_svg$arity$1 == null)))))){
return this$.shadow$dom$SVGElement$_to_svg$arity$1(this$);
} else {
return shadow$dom$SVGElement$_to_svg$dyn_33137(this$);
}
});

shadow.dom.lazy_native_coll_seq = (function shadow$dom$lazy_native_coll_seq(coll,idx){
if((idx < coll.length)){
return (new cljs.core.LazySeq(null,(function (){
return cljs.core.cons((coll[idx]),(function (){var G__31782 = coll;
var G__31783 = (idx + (1));
return (shadow.dom.lazy_native_coll_seq.cljs$core$IFn$_invoke$arity$2 ? shadow.dom.lazy_native_coll_seq.cljs$core$IFn$_invoke$arity$2(G__31782,G__31783) : shadow.dom.lazy_native_coll_seq.call(null,G__31782,G__31783));
})());
}),null,null));
} else {
return null;
}
});

/**
* @constructor
 * @implements {cljs.core.IIndexed}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IDeref}
 * @implements {shadow.dom.IElement}
*/
shadow.dom.NativeColl = (function (coll){
this.coll = coll;
this.cljs$lang$protocol_mask$partition0$ = 8421394;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(shadow.dom.NativeColl.prototype.cljs$core$IDeref$_deref$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.coll;
}));

(shadow.dom.NativeColl.prototype.cljs$core$IIndexed$_nth$arity$2 = (function (this$,n){
var self__ = this;
var this$__$1 = this;
return (self__.coll[n]);
}));

(shadow.dom.NativeColl.prototype.cljs$core$IIndexed$_nth$arity$3 = (function (this$,n,not_found){
var self__ = this;
var this$__$1 = this;
var or__5025__auto__ = (self__.coll[n]);
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return not_found;
}
}));

(shadow.dom.NativeColl.prototype.cljs$core$ICounted$_count$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.coll.length;
}));

(shadow.dom.NativeColl.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return shadow.dom.lazy_native_coll_seq(self__.coll,(0));
}));

(shadow.dom.NativeColl.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(shadow.dom.NativeColl.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.coll;
}));

(shadow.dom.NativeColl.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"coll","coll",-1006698606,null)], null);
}));

(shadow.dom.NativeColl.cljs$lang$type = true);

(shadow.dom.NativeColl.cljs$lang$ctorStr = "shadow.dom/NativeColl");

(shadow.dom.NativeColl.cljs$lang$ctorPrWriter = (function (this__5310__auto__,writer__5311__auto__,opt__5312__auto__){
return cljs.core._write(writer__5311__auto__,"shadow.dom/NativeColl");
}));

/**
 * Positional factory function for shadow.dom/NativeColl.
 */
shadow.dom.__GT_NativeColl = (function shadow$dom$__GT_NativeColl(coll){
return (new shadow.dom.NativeColl(coll));
});

shadow.dom.native_coll = (function shadow$dom$native_coll(coll){
return (new shadow.dom.NativeColl(coll));
});
shadow.dom.dom_node = (function shadow$dom$dom_node(el){
if((el == null)){
return null;
} else {
if((((!((el == null))))?((((false) || ((cljs.core.PROTOCOL_SENTINEL === el.shadow$dom$IElement$))))?true:false):false)){
return el.shadow$dom$IElement$_to_dom$arity$1(null);
} else {
if(typeof el === 'string'){
return document.createTextNode(el);
} else {
if(typeof el === 'number'){
return document.createTextNode(cljs.core.str.cljs$core$IFn$_invoke$arity$1(el));
} else {
return el;

}
}
}
}
});
shadow.dom.query_one = (function shadow$dom$query_one(var_args){
var G__31825 = arguments.length;
switch (G__31825) {
case 1:
return shadow.dom.query_one.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.query_one.cljs$core$IFn$_invoke$arity$1 = (function (sel){
return document.querySelector(sel);
}));

(shadow.dom.query_one.cljs$core$IFn$_invoke$arity$2 = (function (sel,root){
return shadow.dom.dom_node(root).querySelector(sel);
}));

(shadow.dom.query_one.cljs$lang$maxFixedArity = 2);

shadow.dom.query = (function shadow$dom$query(var_args){
var G__31829 = arguments.length;
switch (G__31829) {
case 1:
return shadow.dom.query.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.query.cljs$core$IFn$_invoke$arity$1 = (function (sel){
return (new shadow.dom.NativeColl(document.querySelectorAll(sel)));
}));

(shadow.dom.query.cljs$core$IFn$_invoke$arity$2 = (function (sel,root){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(root).querySelectorAll(sel)));
}));

(shadow.dom.query.cljs$lang$maxFixedArity = 2);

shadow.dom.by_id = (function shadow$dom$by_id(var_args){
var G__31834 = arguments.length;
switch (G__31834) {
case 2:
return shadow.dom.by_id.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 1:
return shadow.dom.by_id.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

}
});

(shadow.dom.by_id.cljs$core$IFn$_invoke$arity$2 = (function (id,el){
return shadow.dom.dom_node(el).getElementById(id);
}));

(shadow.dom.by_id.cljs$core$IFn$_invoke$arity$1 = (function (id){
return document.getElementById(id);
}));

(shadow.dom.by_id.cljs$lang$maxFixedArity = 2);

shadow.dom.build = shadow.dom.dom_node;
shadow.dom.ev_stop = (function shadow$dom$ev_stop(var_args){
var G__31839 = arguments.length;
switch (G__31839) {
case 1:
return shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

break;
case 4:
return shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));

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

}
});

(shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1 = (function (e){
if(cljs.core.truth_(e.stopPropagation)){
e.stopPropagation();

e.preventDefault();
} else {
(e.cancelBubble = true);

(e.returnValue = false);
}

return e;
}));

(shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$2 = (function (e,el){
shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1(e);

return el;
}));

(shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$4 = (function (e,el,scope,owner){
shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1(e);

return el;
}));

(shadow.dom.ev_stop.cljs$lang$maxFixedArity = 4);

/**
 * check wether a parent node (or the document) contains the child
 */
shadow.dom.contains_QMARK_ = (function shadow$dom$contains_QMARK_(var_args){
var G__31843 = arguments.length;
switch (G__31843) {
case 1:
return shadow.dom.contains_QMARK_.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.contains_QMARK_.cljs$core$IFn$_invoke$arity$1 = (function (el){
return goog.dom.contains(document,shadow.dom.dom_node(el));
}));

(shadow.dom.contains_QMARK_.cljs$core$IFn$_invoke$arity$2 = (function (parent,el){
return goog.dom.contains(shadow.dom.dom_node(parent),shadow.dom.dom_node(el));
}));

(shadow.dom.contains_QMARK_.cljs$lang$maxFixedArity = 2);

shadow.dom.add_class = (function shadow$dom$add_class(el,cls){
return goog.dom.classlist.add(shadow.dom.dom_node(el),cls);
});
shadow.dom.remove_class = (function shadow$dom$remove_class(el,cls){
return goog.dom.classlist.remove(shadow.dom.dom_node(el),cls);
});
shadow.dom.toggle_class = (function shadow$dom$toggle_class(var_args){
var G__31846 = arguments.length;
switch (G__31846) {
case 2:
return shadow.dom.toggle_class.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

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

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

}
});

(shadow.dom.toggle_class.cljs$core$IFn$_invoke$arity$2 = (function (el,cls){
return goog.dom.classlist.toggle(shadow.dom.dom_node(el),cls);
}));

(shadow.dom.toggle_class.cljs$core$IFn$_invoke$arity$3 = (function (el,cls,v){
if(cljs.core.truth_(v)){
return shadow.dom.add_class(el,cls);
} else {
return shadow.dom.remove_class(el,cls);
}
}));

(shadow.dom.toggle_class.cljs$lang$maxFixedArity = 3);

shadow.dom.dom_listen = (cljs.core.truth_((function (){var or__5025__auto__ = (!((typeof document !== 'undefined')));
if(or__5025__auto__){
return or__5025__auto__;
} else {
return document.addEventListener;
}
})())?(function shadow$dom$dom_listen_good(el,ev,handler){
return el.addEventListener(ev,handler,false);
}):(function shadow$dom$dom_listen_ie(el,ev,handler){
try{return el.attachEvent(["on",cljs.core.str.cljs$core$IFn$_invoke$arity$1(ev)].join(''),(function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null,e,el));
}));
}catch (e31854){if((e31854 instanceof Object)){
var e = e31854;
return console.log("didnt support attachEvent",el,e);
} else {
throw e31854;

}
}}));
shadow.dom.dom_listen_remove = (cljs.core.truth_((function (){var or__5025__auto__ = (!((typeof document !== 'undefined')));
if(or__5025__auto__){
return or__5025__auto__;
} else {
return document.removeEventListener;
}
})())?(function shadow$dom$dom_listen_remove_good(el,ev,handler){
return el.removeEventListener(ev,handler,false);
}):(function shadow$dom$dom_listen_remove_ie(el,ev,handler){
return el.detachEvent(["on",cljs.core.str.cljs$core$IFn$_invoke$arity$1(ev)].join(''),handler);
}));
shadow.dom.on_query = (function shadow$dom$on_query(root_el,ev,selector,handler){
var seq__31857 = cljs.core.seq(shadow.dom.query.cljs$core$IFn$_invoke$arity$2(selector,root_el));
var chunk__31858 = null;
var count__31859 = (0);
var i__31860 = (0);
while(true){
if((i__31860 < count__31859)){
var el = chunk__31858.cljs$core$IIndexed$_nth$arity$2(null,i__31860);
var handler_33162__$1 = ((function (seq__31857,chunk__31858,count__31859,i__31860,el){
return (function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null,e,el));
});})(seq__31857,chunk__31858,count__31859,i__31860,el))
;
shadow.dom.dom_listen(el,cljs.core.name(ev),handler_33162__$1);


var G__33164 = seq__31857;
var G__33165 = chunk__31858;
var G__33166 = count__31859;
var G__33167 = (i__31860 + (1));
seq__31857 = G__33164;
chunk__31858 = G__33165;
count__31859 = G__33166;
i__31860 = G__33167;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__31857);
if(temp__5804__auto__){
var seq__31857__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__31857__$1)){
var c__5548__auto__ = cljs.core.chunk_first(seq__31857__$1);
var G__33170 = cljs.core.chunk_rest(seq__31857__$1);
var G__33171 = c__5548__auto__;
var G__33172 = cljs.core.count(c__5548__auto__);
var G__33173 = (0);
seq__31857 = G__33170;
chunk__31858 = G__33171;
count__31859 = G__33172;
i__31860 = G__33173;
continue;
} else {
var el = cljs.core.first(seq__31857__$1);
var handler_33174__$1 = ((function (seq__31857,chunk__31858,count__31859,i__31860,el,seq__31857__$1,temp__5804__auto__){
return (function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null,e,el));
});})(seq__31857,chunk__31858,count__31859,i__31860,el,seq__31857__$1,temp__5804__auto__))
;
shadow.dom.dom_listen(el,cljs.core.name(ev),handler_33174__$1);


var G__33175 = cljs.core.next(seq__31857__$1);
var G__33176 = null;
var G__33177 = (0);
var G__33178 = (0);
seq__31857 = G__33175;
chunk__31858 = G__33176;
count__31859 = G__33177;
i__31860 = G__33178;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.on = (function shadow$dom$on(var_args){
var G__31910 = arguments.length;
switch (G__31910) {
case 3:
return shadow.dom.on.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
case 4:
return shadow.dom.on.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));

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

}
});

(shadow.dom.on.cljs$core$IFn$_invoke$arity$3 = (function (el,ev,handler){
return shadow.dom.on.cljs$core$IFn$_invoke$arity$4(el,ev,handler,false);
}));

(shadow.dom.on.cljs$core$IFn$_invoke$arity$4 = (function (el,ev,handler,capture){
if(cljs.core.vector_QMARK_(ev)){
return shadow.dom.on_query(el,cljs.core.first(ev),cljs.core.second(ev),handler);
} else {
var handler__$1 = (function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null,e,el));
});
return shadow.dom.dom_listen(shadow.dom.dom_node(el),cljs.core.name(ev),handler__$1);
}
}));

(shadow.dom.on.cljs$lang$maxFixedArity = 4);

shadow.dom.remove_event_handler = (function shadow$dom$remove_event_handler(el,ev,handler){
return shadow.dom.dom_listen_remove(shadow.dom.dom_node(el),cljs.core.name(ev),handler);
});
shadow.dom.add_event_listeners = (function shadow$dom$add_event_listeners(el,events){
var seq__31929 = cljs.core.seq(events);
var chunk__31930 = null;
var count__31931 = (0);
var i__31932 = (0);
while(true){
if((i__31932 < count__31931)){
var vec__31941 = chunk__31930.cljs$core$IIndexed$_nth$arity$2(null,i__31932);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__31941,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__31941,(1),null);
shadow.dom.on.cljs$core$IFn$_invoke$arity$3(el,k,v);


var G__33191 = seq__31929;
var G__33192 = chunk__31930;
var G__33193 = count__31931;
var G__33194 = (i__31932 + (1));
seq__31929 = G__33191;
chunk__31930 = G__33192;
count__31931 = G__33193;
i__31932 = G__33194;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__31929);
if(temp__5804__auto__){
var seq__31929__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__31929__$1)){
var c__5548__auto__ = cljs.core.chunk_first(seq__31929__$1);
var G__33195 = cljs.core.chunk_rest(seq__31929__$1);
var G__33196 = c__5548__auto__;
var G__33197 = cljs.core.count(c__5548__auto__);
var G__33198 = (0);
seq__31929 = G__33195;
chunk__31930 = G__33196;
count__31931 = G__33197;
i__31932 = G__33198;
continue;
} else {
var vec__31950 = cljs.core.first(seq__31929__$1);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__31950,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__31950,(1),null);
shadow.dom.on.cljs$core$IFn$_invoke$arity$3(el,k,v);


var G__33199 = cljs.core.next(seq__31929__$1);
var G__33200 = null;
var G__33201 = (0);
var G__33202 = (0);
seq__31929 = G__33199;
chunk__31930 = G__33200;
count__31931 = G__33201;
i__31932 = G__33202;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.set_style = (function shadow$dom$set_style(el,styles){
var dom = shadow.dom.dom_node(el);
var seq__31954 = cljs.core.seq(styles);
var chunk__31955 = null;
var count__31956 = (0);
var i__31957 = (0);
while(true){
if((i__31957 < count__31956)){
var vec__31969 = chunk__31955.cljs$core$IIndexed$_nth$arity$2(null,i__31957);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__31969,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__31969,(1),null);
goog.style.setStyle(dom,cljs.core.name(k),(((v == null))?"":v));


var G__33203 = seq__31954;
var G__33204 = chunk__31955;
var G__33205 = count__31956;
var G__33206 = (i__31957 + (1));
seq__31954 = G__33203;
chunk__31955 = G__33204;
count__31956 = G__33205;
i__31957 = G__33206;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__31954);
if(temp__5804__auto__){
var seq__31954__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__31954__$1)){
var c__5548__auto__ = cljs.core.chunk_first(seq__31954__$1);
var G__33207 = cljs.core.chunk_rest(seq__31954__$1);
var G__33208 = c__5548__auto__;
var G__33209 = cljs.core.count(c__5548__auto__);
var G__33210 = (0);
seq__31954 = G__33207;
chunk__31955 = G__33208;
count__31956 = G__33209;
i__31957 = G__33210;
continue;
} else {
var vec__31973 = cljs.core.first(seq__31954__$1);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__31973,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__31973,(1),null);
goog.style.setStyle(dom,cljs.core.name(k),(((v == null))?"":v));


var G__33212 = cljs.core.next(seq__31954__$1);
var G__33213 = null;
var G__33214 = (0);
var G__33215 = (0);
seq__31954 = G__33212;
chunk__31955 = G__33213;
count__31956 = G__33214;
i__31957 = G__33215;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.set_attr_STAR_ = (function shadow$dom$set_attr_STAR_(el,key,value){
var G__31978_33217 = key;
var G__31978_33218__$1 = (((G__31978_33217 instanceof cljs.core.Keyword))?G__31978_33217.fqn:null);
switch (G__31978_33218__$1) {
case "id":
(el.id = cljs.core.str.cljs$core$IFn$_invoke$arity$1(value));

break;
case "class":
(el.className = cljs.core.str.cljs$core$IFn$_invoke$arity$1(value));

break;
case "for":
(el.htmlFor = value);

break;
case "cellpadding":
el.setAttribute("cellPadding",value);

break;
case "cellspacing":
el.setAttribute("cellSpacing",value);

break;
case "colspan":
el.setAttribute("colSpan",value);

break;
case "frameborder":
el.setAttribute("frameBorder",value);

break;
case "height":
el.setAttribute("height",value);

break;
case "maxlength":
el.setAttribute("maxLength",value);

break;
case "role":
el.setAttribute("role",value);

break;
case "rowspan":
el.setAttribute("rowSpan",value);

break;
case "type":
el.setAttribute("type",value);

break;
case "usemap":
el.setAttribute("useMap",value);

break;
case "valign":
el.setAttribute("vAlign",value);

break;
case "width":
el.setAttribute("width",value);

break;
case "on":
shadow.dom.add_event_listeners(el,value);

break;
case "style":
if((value == null)){
} else {
if(typeof value === 'string'){
el.setAttribute("style",value);
} else {
if(cljs.core.map_QMARK_(value)){
shadow.dom.set_style(el,value);
} else {
goog.style.setStyle(el,value);

}
}
}

break;
default:
var ks_33224 = cljs.core.name(key);
if(cljs.core.truth_((function (){var or__5025__auto__ = goog.string.startsWith(ks_33224,"data-");
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return goog.string.startsWith(ks_33224,"aria-");
}
})())){
el.setAttribute(ks_33224,value);
} else {
(el[ks_33224] = value);
}

}

return el;
});
shadow.dom.set_attrs = (function shadow$dom$set_attrs(el,attrs){
return cljs.core.reduce_kv((function (el__$1,key,value){
shadow.dom.set_attr_STAR_(el__$1,key,value);

return el__$1;
}),shadow.dom.dom_node(el),attrs);
});
shadow.dom.set_attr = (function shadow$dom$set_attr(el,key,value){
return shadow.dom.set_attr_STAR_(shadow.dom.dom_node(el),key,value);
});
shadow.dom.has_class_QMARK_ = (function shadow$dom$has_class_QMARK_(el,cls){
return goog.dom.classlist.contains(shadow.dom.dom_node(el),cls);
});
shadow.dom.merge_class_string = (function shadow$dom$merge_class_string(current,extra_class){
if(cljs.core.seq(current)){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(current)," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(extra_class)].join('');
} else {
return extra_class;
}
});
shadow.dom.parse_tag = (function shadow$dom$parse_tag(spec){
var spec__$1 = cljs.core.name(spec);
var fdot = spec__$1.indexOf(".");
var fhash = spec__$1.indexOf("#");
if(((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fdot)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fhash)))){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1,null,null], null);
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fhash)){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1.substring((0),fdot),null,clojure.string.replace(spec__$1.substring((fdot + (1))),/\./," ")], null);
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fdot)){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1.substring((0),fhash),spec__$1.substring((fhash + (1))),null], null);
} else {
if((fhash > fdot)){
throw ["cant have id after class?",spec__$1].join('');
} else {
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1.substring((0),fhash),spec__$1.substring((fhash + (1)),fdot),clojure.string.replace(spec__$1.substring((fdot + (1))),/\./," ")], null);

}
}
}
}
});
shadow.dom.create_dom_node = (function shadow$dom$create_dom_node(tag_def,p__32003){
var map__32004 = p__32003;
var map__32004__$1 = cljs.core.__destructure_map(map__32004);
var props = map__32004__$1;
var class$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__32004__$1,new cljs.core.Keyword(null,"class","class",-2030961996));
var tag_props = ({});
var vec__32006 = shadow.dom.parse_tag(tag_def);
var tag_name = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32006,(0),null);
var tag_id = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32006,(1),null);
var tag_classes = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32006,(2),null);
if(cljs.core.truth_(tag_id)){
(tag_props["id"] = tag_id);
} else {
}

if(cljs.core.truth_(tag_classes)){
(tag_props["class"] = shadow.dom.merge_class_string(class$,tag_classes));
} else {
}

var G__32013 = goog.dom.createDom(tag_name,tag_props);
shadow.dom.set_attrs(G__32013,cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(props,new cljs.core.Keyword(null,"class","class",-2030961996)));

return G__32013;
});
shadow.dom.append = (function shadow$dom$append(var_args){
var G__32019 = arguments.length;
switch (G__32019) {
case 1:
return shadow.dom.append.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.append.cljs$core$IFn$_invoke$arity$1 = (function (node){
if(cljs.core.truth_(node)){
var temp__5804__auto__ = shadow.dom.dom_node(node);
if(cljs.core.truth_(temp__5804__auto__)){
var n = temp__5804__auto__;
document.body.appendChild(n);

return n;
} else {
return null;
}
} else {
return null;
}
}));

(shadow.dom.append.cljs$core$IFn$_invoke$arity$2 = (function (el,node){
if(cljs.core.truth_(node)){
var temp__5804__auto__ = shadow.dom.dom_node(node);
if(cljs.core.truth_(temp__5804__auto__)){
var n = temp__5804__auto__;
shadow.dom.dom_node(el).appendChild(n);

return n;
} else {
return null;
}
} else {
return null;
}
}));

(shadow.dom.append.cljs$lang$maxFixedArity = 2);

shadow.dom.destructure_node = (function shadow$dom$destructure_node(create_fn,p__32031){
var vec__32032 = p__32031;
var seq__32033 = cljs.core.seq(vec__32032);
var first__32034 = cljs.core.first(seq__32033);
var seq__32033__$1 = cljs.core.next(seq__32033);
var nn = first__32034;
var first__32034__$1 = cljs.core.first(seq__32033__$1);
var seq__32033__$2 = cljs.core.next(seq__32033__$1);
var np = first__32034__$1;
var nc = seq__32033__$2;
var node = vec__32032;
if((nn instanceof cljs.core.Keyword)){
} else {
throw cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2("invalid dom node",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"node","node",581201198),node], null));
}

if((((np == null)) && ((nc == null)))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var G__32036 = nn;
var G__32037 = cljs.core.PersistentArrayMap.EMPTY;
return (create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(G__32036,G__32037) : create_fn.call(null,G__32036,G__32037));
})(),cljs.core.List.EMPTY], null);
} else {
if(cljs.core.map_QMARK_(np)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(nn,np) : create_fn.call(null,nn,np)),nc], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var G__32041 = nn;
var G__32042 = cljs.core.PersistentArrayMap.EMPTY;
return (create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(G__32041,G__32042) : create_fn.call(null,G__32041,G__32042));
})(),cljs.core.conj.cljs$core$IFn$_invoke$arity$2(nc,np)], null);

}
}
});
shadow.dom.make_dom_node = (function shadow$dom$make_dom_node(structure){
var vec__32047 = shadow.dom.destructure_node(shadow.dom.create_dom_node,structure);
var node = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32047,(0),null);
var node_children = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32047,(1),null);
var seq__32050_33243 = cljs.core.seq(node_children);
var chunk__32051_33244 = null;
var count__32052_33245 = (0);
var i__32053_33246 = (0);
while(true){
if((i__32053_33246 < count__32052_33245)){
var child_struct_33249 = chunk__32051_33244.cljs$core$IIndexed$_nth$arity$2(null,i__32053_33246);
var children_33250 = shadow.dom.dom_node(child_struct_33249);
if(cljs.core.seq_QMARK_(children_33250)){
var seq__32103_33252 = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom.dom_node,children_33250));
var chunk__32105_33253 = null;
var count__32106_33254 = (0);
var i__32107_33255 = (0);
while(true){
if((i__32107_33255 < count__32106_33254)){
var child_33256 = chunk__32105_33253.cljs$core$IIndexed$_nth$arity$2(null,i__32107_33255);
if(cljs.core.truth_(child_33256)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_33256);


var G__33257 = seq__32103_33252;
var G__33258 = chunk__32105_33253;
var G__33259 = count__32106_33254;
var G__33260 = (i__32107_33255 + (1));
seq__32103_33252 = G__33257;
chunk__32105_33253 = G__33258;
count__32106_33254 = G__33259;
i__32107_33255 = G__33260;
continue;
} else {
var G__33261 = seq__32103_33252;
var G__33262 = chunk__32105_33253;
var G__33263 = count__32106_33254;
var G__33264 = (i__32107_33255 + (1));
seq__32103_33252 = G__33261;
chunk__32105_33253 = G__33262;
count__32106_33254 = G__33263;
i__32107_33255 = G__33264;
continue;
}
} else {
var temp__5804__auto___33265 = cljs.core.seq(seq__32103_33252);
if(temp__5804__auto___33265){
var seq__32103_33266__$1 = temp__5804__auto___33265;
if(cljs.core.chunked_seq_QMARK_(seq__32103_33266__$1)){
var c__5548__auto___33267 = cljs.core.chunk_first(seq__32103_33266__$1);
var G__33268 = cljs.core.chunk_rest(seq__32103_33266__$1);
var G__33269 = c__5548__auto___33267;
var G__33270 = cljs.core.count(c__5548__auto___33267);
var G__33271 = (0);
seq__32103_33252 = G__33268;
chunk__32105_33253 = G__33269;
count__32106_33254 = G__33270;
i__32107_33255 = G__33271;
continue;
} else {
var child_33273 = cljs.core.first(seq__32103_33266__$1);
if(cljs.core.truth_(child_33273)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_33273);


var G__33275 = cljs.core.next(seq__32103_33266__$1);
var G__33276 = null;
var G__33278 = (0);
var G__33279 = (0);
seq__32103_33252 = G__33275;
chunk__32105_33253 = G__33276;
count__32106_33254 = G__33278;
i__32107_33255 = G__33279;
continue;
} else {
var G__33280 = cljs.core.next(seq__32103_33266__$1);
var G__33281 = null;
var G__33282 = (0);
var G__33283 = (0);
seq__32103_33252 = G__33280;
chunk__32105_33253 = G__33281;
count__32106_33254 = G__33282;
i__32107_33255 = G__33283;
continue;
}
}
} else {
}
}
break;
}
} else {
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,children_33250);
}


var G__33285 = seq__32050_33243;
var G__33286 = chunk__32051_33244;
var G__33287 = count__32052_33245;
var G__33288 = (i__32053_33246 + (1));
seq__32050_33243 = G__33285;
chunk__32051_33244 = G__33286;
count__32052_33245 = G__33287;
i__32053_33246 = G__33288;
continue;
} else {
var temp__5804__auto___33289 = cljs.core.seq(seq__32050_33243);
if(temp__5804__auto___33289){
var seq__32050_33291__$1 = temp__5804__auto___33289;
if(cljs.core.chunked_seq_QMARK_(seq__32050_33291__$1)){
var c__5548__auto___33294 = cljs.core.chunk_first(seq__32050_33291__$1);
var G__33297 = cljs.core.chunk_rest(seq__32050_33291__$1);
var G__33298 = c__5548__auto___33294;
var G__33299 = cljs.core.count(c__5548__auto___33294);
var G__33300 = (0);
seq__32050_33243 = G__33297;
chunk__32051_33244 = G__33298;
count__32052_33245 = G__33299;
i__32053_33246 = G__33300;
continue;
} else {
var child_struct_33301 = cljs.core.first(seq__32050_33291__$1);
var children_33302 = shadow.dom.dom_node(child_struct_33301);
if(cljs.core.seq_QMARK_(children_33302)){
var seq__32116_33303 = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom.dom_node,children_33302));
var chunk__32118_33304 = null;
var count__32119_33305 = (0);
var i__32120_33306 = (0);
while(true){
if((i__32120_33306 < count__32119_33305)){
var child_33311 = chunk__32118_33304.cljs$core$IIndexed$_nth$arity$2(null,i__32120_33306);
if(cljs.core.truth_(child_33311)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_33311);


var G__33312 = seq__32116_33303;
var G__33313 = chunk__32118_33304;
var G__33314 = count__32119_33305;
var G__33315 = (i__32120_33306 + (1));
seq__32116_33303 = G__33312;
chunk__32118_33304 = G__33313;
count__32119_33305 = G__33314;
i__32120_33306 = G__33315;
continue;
} else {
var G__33316 = seq__32116_33303;
var G__33317 = chunk__32118_33304;
var G__33318 = count__32119_33305;
var G__33319 = (i__32120_33306 + (1));
seq__32116_33303 = G__33316;
chunk__32118_33304 = G__33317;
count__32119_33305 = G__33318;
i__32120_33306 = G__33319;
continue;
}
} else {
var temp__5804__auto___33320__$1 = cljs.core.seq(seq__32116_33303);
if(temp__5804__auto___33320__$1){
var seq__32116_33321__$1 = temp__5804__auto___33320__$1;
if(cljs.core.chunked_seq_QMARK_(seq__32116_33321__$1)){
var c__5548__auto___33322 = cljs.core.chunk_first(seq__32116_33321__$1);
var G__33323 = cljs.core.chunk_rest(seq__32116_33321__$1);
var G__33324 = c__5548__auto___33322;
var G__33325 = cljs.core.count(c__5548__auto___33322);
var G__33326 = (0);
seq__32116_33303 = G__33323;
chunk__32118_33304 = G__33324;
count__32119_33305 = G__33325;
i__32120_33306 = G__33326;
continue;
} else {
var child_33327 = cljs.core.first(seq__32116_33321__$1);
if(cljs.core.truth_(child_33327)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_33327);


var G__33329 = cljs.core.next(seq__32116_33321__$1);
var G__33330 = null;
var G__33331 = (0);
var G__33332 = (0);
seq__32116_33303 = G__33329;
chunk__32118_33304 = G__33330;
count__32119_33305 = G__33331;
i__32120_33306 = G__33332;
continue;
} else {
var G__33333 = cljs.core.next(seq__32116_33321__$1);
var G__33334 = null;
var G__33335 = (0);
var G__33336 = (0);
seq__32116_33303 = G__33333;
chunk__32118_33304 = G__33334;
count__32119_33305 = G__33335;
i__32120_33306 = G__33336;
continue;
}
}
} else {
}
}
break;
}
} else {
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,children_33302);
}


var G__33337 = cljs.core.next(seq__32050_33291__$1);
var G__33338 = null;
var G__33339 = (0);
var G__33340 = (0);
seq__32050_33243 = G__33337;
chunk__32051_33244 = G__33338;
count__32052_33245 = G__33339;
i__32053_33246 = G__33340;
continue;
}
} else {
}
}
break;
}

return node;
});
(cljs.core.Keyword.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.Keyword.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return shadow.dom.make_dom_node(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this$__$1], null));
}));

(cljs.core.PersistentVector.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.PersistentVector.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return shadow.dom.make_dom_node(this$__$1);
}));

(cljs.core.LazySeq.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.LazySeq.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom._to_dom,this$__$1);
}));
if(cljs.core.truth_(((typeof HTMLElement) != 'undefined'))){
(HTMLElement.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(HTMLElement.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return this$__$1;
}));
} else {
}
if(cljs.core.truth_(((typeof DocumentFragment) != 'undefined'))){
(DocumentFragment.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(DocumentFragment.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return this$__$1;
}));
} else {
}
/**
 * clear node children
 */
shadow.dom.reset = (function shadow$dom$reset(node){
return goog.dom.removeChildren(shadow.dom.dom_node(node));
});
shadow.dom.remove = (function shadow$dom$remove(node){
if((((!((node == null))))?(((((node.cljs$lang$protocol_mask$partition0$ & (8388608))) || ((cljs.core.PROTOCOL_SENTINEL === node.cljs$core$ISeqable$))))?true:false):false)){
var seq__32175 = cljs.core.seq(node);
var chunk__32176 = null;
var count__32177 = (0);
var i__32178 = (0);
while(true){
if((i__32178 < count__32177)){
var n = chunk__32176.cljs$core$IIndexed$_nth$arity$2(null,i__32178);
(shadow.dom.remove.cljs$core$IFn$_invoke$arity$1 ? shadow.dom.remove.cljs$core$IFn$_invoke$arity$1(n) : shadow.dom.remove.call(null,n));


var G__33350 = seq__32175;
var G__33351 = chunk__32176;
var G__33352 = count__32177;
var G__33353 = (i__32178 + (1));
seq__32175 = G__33350;
chunk__32176 = G__33351;
count__32177 = G__33352;
i__32178 = G__33353;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__32175);
if(temp__5804__auto__){
var seq__32175__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__32175__$1)){
var c__5548__auto__ = cljs.core.chunk_first(seq__32175__$1);
var G__33355 = cljs.core.chunk_rest(seq__32175__$1);
var G__33356 = c__5548__auto__;
var G__33357 = cljs.core.count(c__5548__auto__);
var G__33358 = (0);
seq__32175 = G__33355;
chunk__32176 = G__33356;
count__32177 = G__33357;
i__32178 = G__33358;
continue;
} else {
var n = cljs.core.first(seq__32175__$1);
(shadow.dom.remove.cljs$core$IFn$_invoke$arity$1 ? shadow.dom.remove.cljs$core$IFn$_invoke$arity$1(n) : shadow.dom.remove.call(null,n));


var G__33362 = cljs.core.next(seq__32175__$1);
var G__33363 = null;
var G__33364 = (0);
var G__33365 = (0);
seq__32175 = G__33362;
chunk__32176 = G__33363;
count__32177 = G__33364;
i__32178 = G__33365;
continue;
}
} else {
return null;
}
}
break;
}
} else {
return goog.dom.removeNode(node);
}
});
shadow.dom.replace_node = (function shadow$dom$replace_node(old,new$){
return goog.dom.replaceNode(shadow.dom.dom_node(new$),shadow.dom.dom_node(old));
});
shadow.dom.text = (function shadow$dom$text(var_args){
var G__32209 = arguments.length;
switch (G__32209) {
case 2:
return shadow.dom.text.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 1:
return shadow.dom.text.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

}
});

(shadow.dom.text.cljs$core$IFn$_invoke$arity$2 = (function (el,new_text){
return (shadow.dom.dom_node(el).innerText = new_text);
}));

(shadow.dom.text.cljs$core$IFn$_invoke$arity$1 = (function (el){
return shadow.dom.dom_node(el).innerText;
}));

(shadow.dom.text.cljs$lang$maxFixedArity = 2);

shadow.dom.check = (function shadow$dom$check(var_args){
var G__32222 = arguments.length;
switch (G__32222) {
case 1:
return shadow.dom.check.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.check.cljs$core$IFn$_invoke$arity$1 = (function (el){
return shadow.dom.check.cljs$core$IFn$_invoke$arity$2(el,true);
}));

(shadow.dom.check.cljs$core$IFn$_invoke$arity$2 = (function (el,checked){
return (shadow.dom.dom_node(el).checked = checked);
}));

(shadow.dom.check.cljs$lang$maxFixedArity = 2);

shadow.dom.checked_QMARK_ = (function shadow$dom$checked_QMARK_(el){
return shadow.dom.dom_node(el).checked;
});
shadow.dom.form_elements = (function shadow$dom$form_elements(el){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(el).elements));
});
shadow.dom.children = (function shadow$dom$children(el){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(el).children));
});
shadow.dom.child_nodes = (function shadow$dom$child_nodes(el){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(el).childNodes));
});
shadow.dom.attr = (function shadow$dom$attr(var_args){
var G__32241 = arguments.length;
switch (G__32241) {
case 2:
return shadow.dom.attr.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

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

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

}
});

(shadow.dom.attr.cljs$core$IFn$_invoke$arity$2 = (function (el,key){
return shadow.dom.dom_node(el).getAttribute(cljs.core.name(key));
}));

(shadow.dom.attr.cljs$core$IFn$_invoke$arity$3 = (function (el,key,default$){
var or__5025__auto__ = shadow.dom.dom_node(el).getAttribute(cljs.core.name(key));
if(cljs.core.truth_(or__5025__auto__)){
return or__5025__auto__;
} else {
return default$;
}
}));

(shadow.dom.attr.cljs$lang$maxFixedArity = 3);

shadow.dom.del_attr = (function shadow$dom$del_attr(el,key){
return shadow.dom.dom_node(el).removeAttribute(cljs.core.name(key));
});
shadow.dom.data = (function shadow$dom$data(el,key){
return shadow.dom.dom_node(el).getAttribute(["data-",cljs.core.name(key)].join(''));
});
shadow.dom.set_data = (function shadow$dom$set_data(el,key,value){
return shadow.dom.dom_node(el).setAttribute(["data-",cljs.core.name(key)].join(''),cljs.core.str.cljs$core$IFn$_invoke$arity$1(value));
});
shadow.dom.set_html = (function shadow$dom$set_html(node,text){
return (shadow.dom.dom_node(node).innerHTML = text);
});
shadow.dom.get_html = (function shadow$dom$get_html(node){
return shadow.dom.dom_node(node).innerHTML;
});
shadow.dom.fragment = (function shadow$dom$fragment(var_args){
var args__5755__auto__ = [];
var len__5749__auto___33392 = arguments.length;
var i__5750__auto___33394 = (0);
while(true){
if((i__5750__auto___33394 < len__5749__auto___33392)){
args__5755__auto__.push((arguments[i__5750__auto___33394]));

var G__33395 = (i__5750__auto___33394 + (1));
i__5750__auto___33394 = G__33395;
continue;
} else {
}
break;
}

var argseq__5756__auto__ = ((((0) < args__5755__auto__.length))?(new cljs.core.IndexedSeq(args__5755__auto__.slice((0)),(0),null)):null);
return shadow.dom.fragment.cljs$core$IFn$_invoke$arity$variadic(argseq__5756__auto__);
});

(shadow.dom.fragment.cljs$core$IFn$_invoke$arity$variadic = (function (nodes){
var fragment = document.createDocumentFragment();
var seq__32256_33396 = cljs.core.seq(nodes);
var chunk__32257_33397 = null;
var count__32258_33398 = (0);
var i__32259_33399 = (0);
while(true){
if((i__32259_33399 < count__32258_33398)){
var node_33400 = chunk__32257_33397.cljs$core$IIndexed$_nth$arity$2(null,i__32259_33399);
fragment.appendChild(shadow.dom._to_dom(node_33400));


var G__33401 = seq__32256_33396;
var G__33402 = chunk__32257_33397;
var G__33403 = count__32258_33398;
var G__33404 = (i__32259_33399 + (1));
seq__32256_33396 = G__33401;
chunk__32257_33397 = G__33402;
count__32258_33398 = G__33403;
i__32259_33399 = G__33404;
continue;
} else {
var temp__5804__auto___33405 = cljs.core.seq(seq__32256_33396);
if(temp__5804__auto___33405){
var seq__32256_33407__$1 = temp__5804__auto___33405;
if(cljs.core.chunked_seq_QMARK_(seq__32256_33407__$1)){
var c__5548__auto___33408 = cljs.core.chunk_first(seq__32256_33407__$1);
var G__33410 = cljs.core.chunk_rest(seq__32256_33407__$1);
var G__33411 = c__5548__auto___33408;
var G__33412 = cljs.core.count(c__5548__auto___33408);
var G__33413 = (0);
seq__32256_33396 = G__33410;
chunk__32257_33397 = G__33411;
count__32258_33398 = G__33412;
i__32259_33399 = G__33413;
continue;
} else {
var node_33414 = cljs.core.first(seq__32256_33407__$1);
fragment.appendChild(shadow.dom._to_dom(node_33414));


var G__33415 = cljs.core.next(seq__32256_33407__$1);
var G__33416 = null;
var G__33417 = (0);
var G__33418 = (0);
seq__32256_33396 = G__33415;
chunk__32257_33397 = G__33416;
count__32258_33398 = G__33417;
i__32259_33399 = G__33418;
continue;
}
} else {
}
}
break;
}

return (new shadow.dom.NativeColl(fragment));
}));

(shadow.dom.fragment.cljs$lang$maxFixedArity = (0));

/** @this {Function} */
(shadow.dom.fragment.cljs$lang$applyTo = (function (seq32251){
var self__5735__auto__ = this;
return self__5735__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq(seq32251));
}));

/**
 * given a html string, eval all <script> tags and return the html without the scripts
 * don't do this for everything, only content you trust.
 */
shadow.dom.eval_scripts = (function shadow$dom$eval_scripts(s){
var scripts = cljs.core.re_seq(/<script[^>]*?>(.+?)<\/script>/,s);
var seq__32273_33425 = cljs.core.seq(scripts);
var chunk__32274_33426 = null;
var count__32275_33428 = (0);
var i__32276_33429 = (0);
while(true){
if((i__32276_33429 < count__32275_33428)){
var vec__32299_33430 = chunk__32274_33426.cljs$core$IIndexed$_nth$arity$2(null,i__32276_33429);
var script_tag_33431 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32299_33430,(0),null);
var script_body_33432 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32299_33430,(1),null);
eval(script_body_33432);


var G__33435 = seq__32273_33425;
var G__33436 = chunk__32274_33426;
var G__33437 = count__32275_33428;
var G__33438 = (i__32276_33429 + (1));
seq__32273_33425 = G__33435;
chunk__32274_33426 = G__33436;
count__32275_33428 = G__33437;
i__32276_33429 = G__33438;
continue;
} else {
var temp__5804__auto___33439 = cljs.core.seq(seq__32273_33425);
if(temp__5804__auto___33439){
var seq__32273_33440__$1 = temp__5804__auto___33439;
if(cljs.core.chunked_seq_QMARK_(seq__32273_33440__$1)){
var c__5548__auto___33441 = cljs.core.chunk_first(seq__32273_33440__$1);
var G__33442 = cljs.core.chunk_rest(seq__32273_33440__$1);
var G__33443 = c__5548__auto___33441;
var G__33444 = cljs.core.count(c__5548__auto___33441);
var G__33445 = (0);
seq__32273_33425 = G__33442;
chunk__32274_33426 = G__33443;
count__32275_33428 = G__33444;
i__32276_33429 = G__33445;
continue;
} else {
var vec__32315_33446 = cljs.core.first(seq__32273_33440__$1);
var script_tag_33447 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32315_33446,(0),null);
var script_body_33448 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32315_33446,(1),null);
eval(script_body_33448);


var G__33450 = cljs.core.next(seq__32273_33440__$1);
var G__33451 = null;
var G__33452 = (0);
var G__33453 = (0);
seq__32273_33425 = G__33450;
chunk__32274_33426 = G__33451;
count__32275_33428 = G__33452;
i__32276_33429 = G__33453;
continue;
}
} else {
}
}
break;
}

return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (s__$1,p__32319){
var vec__32320 = p__32319;
var script_tag = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32320,(0),null);
var script_body = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32320,(1),null);
return clojure.string.replace(s__$1,script_tag,"");
}),s,scripts);
});
shadow.dom.str__GT_fragment = (function shadow$dom$str__GT_fragment(s){
var el = document.createElement("div");
(el.innerHTML = s);

return (new shadow.dom.NativeColl(goog.dom.childrenToNode_(document,el)));
});
shadow.dom.node_name = (function shadow$dom$node_name(el){
return shadow.dom.dom_node(el).nodeName;
});
shadow.dom.ancestor_by_class = (function shadow$dom$ancestor_by_class(el,cls){
return goog.dom.getAncestorByClass(shadow.dom.dom_node(el),cls);
});
shadow.dom.ancestor_by_tag = (function shadow$dom$ancestor_by_tag(var_args){
var G__32334 = arguments.length;
switch (G__32334) {
case 2:
return shadow.dom.ancestor_by_tag.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

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

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

}
});

(shadow.dom.ancestor_by_tag.cljs$core$IFn$_invoke$arity$2 = (function (el,tag){
return goog.dom.getAncestorByTagNameAndClass(shadow.dom.dom_node(el),cljs.core.name(tag));
}));

(shadow.dom.ancestor_by_tag.cljs$core$IFn$_invoke$arity$3 = (function (el,tag,cls){
return goog.dom.getAncestorByTagNameAndClass(shadow.dom.dom_node(el),cljs.core.name(tag),cljs.core.name(cls));
}));

(shadow.dom.ancestor_by_tag.cljs$lang$maxFixedArity = 3);

shadow.dom.get_value = (function shadow$dom$get_value(dom){
return goog.dom.forms.getValue(shadow.dom.dom_node(dom));
});
shadow.dom.set_value = (function shadow$dom$set_value(dom,value){
return goog.dom.forms.setValue(shadow.dom.dom_node(dom),value);
});
shadow.dom.px = (function shadow$dom$px(value){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1((value | (0))),"px"].join('');
});
shadow.dom.pct = (function shadow$dom$pct(value){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(value),"%"].join('');
});
shadow.dom.remove_style_STAR_ = (function shadow$dom$remove_style_STAR_(el,style){
return el.style.removeProperty(cljs.core.name(style));
});
shadow.dom.remove_style = (function shadow$dom$remove_style(el,style){
var el__$1 = shadow.dom.dom_node(el);
return shadow.dom.remove_style_STAR_(el__$1,style);
});
shadow.dom.remove_styles = (function shadow$dom$remove_styles(el,style_keys){
var el__$1 = shadow.dom.dom_node(el);
var seq__32342 = cljs.core.seq(style_keys);
var chunk__32343 = null;
var count__32344 = (0);
var i__32345 = (0);
while(true){
if((i__32345 < count__32344)){
var it = chunk__32343.cljs$core$IIndexed$_nth$arity$2(null,i__32345);
shadow.dom.remove_style_STAR_(el__$1,it);


var G__33466 = seq__32342;
var G__33467 = chunk__32343;
var G__33468 = count__32344;
var G__33469 = (i__32345 + (1));
seq__32342 = G__33466;
chunk__32343 = G__33467;
count__32344 = G__33468;
i__32345 = G__33469;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__32342);
if(temp__5804__auto__){
var seq__32342__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__32342__$1)){
var c__5548__auto__ = cljs.core.chunk_first(seq__32342__$1);
var G__33474 = cljs.core.chunk_rest(seq__32342__$1);
var G__33475 = c__5548__auto__;
var G__33476 = cljs.core.count(c__5548__auto__);
var G__33477 = (0);
seq__32342 = G__33474;
chunk__32343 = G__33475;
count__32344 = G__33476;
i__32345 = G__33477;
continue;
} else {
var it = cljs.core.first(seq__32342__$1);
shadow.dom.remove_style_STAR_(el__$1,it);


var G__33479 = cljs.core.next(seq__32342__$1);
var G__33480 = null;
var G__33481 = (0);
var G__33482 = (0);
seq__32342 = G__33479;
chunk__32343 = G__33480;
count__32344 = G__33481;
i__32345 = G__33482;
continue;
}
} else {
return null;
}
}
break;
}
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IKVReduce}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
shadow.dom.Coordinate = (function (x,y,__meta,__extmap,__hash){
this.x = x;
this.y = y;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2230716170;
this.cljs$lang$protocol_mask$partition1$ = 139264;
});
(shadow.dom.Coordinate.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__5323__auto__,k__5324__auto__){
var self__ = this;
var this__5323__auto____$1 = this;
return this__5323__auto____$1.cljs$core$ILookup$_lookup$arity$3(null,k__5324__auto__,null);
}));

(shadow.dom.Coordinate.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__5325__auto__,k32354,else__5326__auto__){
var self__ = this;
var this__5325__auto____$1 = this;
var G__32363 = k32354;
var G__32363__$1 = (((G__32363 instanceof cljs.core.Keyword))?G__32363.fqn:null);
switch (G__32363__$1) {
case "x":
return self__.x;

break;
case "y":
return self__.y;

break;
default:
return cljs.core.get.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k32354,else__5326__auto__);

}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = (function (this__5343__auto__,f__5344__auto__,init__5345__auto__){
var self__ = this;
var this__5343__auto____$1 = this;
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret__5346__auto__,p__32368){
var vec__32373 = p__32368;
var k__5347__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32373,(0),null);
var v__5348__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32373,(1),null);
return (f__5344__auto__.cljs$core$IFn$_invoke$arity$3 ? f__5344__auto__.cljs$core$IFn$_invoke$arity$3(ret__5346__auto__,k__5347__auto__,v__5348__auto__) : f__5344__auto__.call(null,ret__5346__auto__,k__5347__auto__,v__5348__auto__));
}),init__5345__auto__,this__5343__auto____$1);
}));

(shadow.dom.Coordinate.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__5338__auto__,writer__5339__auto__,opts__5340__auto__){
var self__ = this;
var this__5338__auto____$1 = this;
var pr_pair__5341__auto__ = (function (keyval__5342__auto__){
return cljs.core.pr_sequential_writer(writer__5339__auto__,cljs.core.pr_writer,""," ","",opts__5340__auto__,keyval__5342__auto__);
});
return cljs.core.pr_sequential_writer(writer__5339__auto__,pr_pair__5341__auto__,"#shadow.dom.Coordinate{",", ","}",opts__5340__auto__,cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"x","x",2099068185),self__.x],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"y","y",-1757859776),self__.y],null))], null),self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__32353){
var self__ = this;
var G__32353__$1 = this;
return (new cljs.core.RecordIter((0),G__32353__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"x","x",2099068185),new cljs.core.Keyword(null,"y","y",-1757859776)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator(self__.__extmap):cljs.core.nil_iter())));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__5321__auto__){
var self__ = this;
var this__5321__auto____$1 = this;
return self__.__meta;
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__5318__auto__){
var self__ = this;
var this__5318__auto____$1 = this;
return (new shadow.dom.Coordinate(self__.x,self__.y,self__.__meta,self__.__extmap,self__.__hash));
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__5327__auto__){
var self__ = this;
var this__5327__auto____$1 = this;
return (2 + cljs.core.count(self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__5319__auto__){
var self__ = this;
var this__5319__auto____$1 = this;
var h__5134__auto__ = self__.__hash;
if((!((h__5134__auto__ == null)))){
return h__5134__auto__;
} else {
var h__5134__auto____$1 = (function (coll__5320__auto__){
return (145542109 ^ cljs.core.hash_unordered_coll(coll__5320__auto__));
})(this__5319__auto____$1);
(self__.__hash = h__5134__auto____$1);

return h__5134__auto____$1;
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this32355,other32356){
var self__ = this;
var this32355__$1 = this;
return (((!((other32356 == null)))) && ((((this32355__$1.constructor === other32356.constructor)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this32355__$1.x,other32356.x)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this32355__$1.y,other32356.y)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this32355__$1.__extmap,other32356.__extmap)))))))));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__5333__auto__,k__5334__auto__){
var self__ = this;
var this__5333__auto____$1 = this;
if(cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"y","y",-1757859776),null,new cljs.core.Keyword(null,"x","x",2099068185),null], null), null),k__5334__auto__)){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(cljs.core._with_meta(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,this__5333__auto____$1),self__.__meta),k__5334__auto__);
} else {
return (new shadow.dom.Coordinate(self__.x,self__.y,self__.__meta,cljs.core.not_empty(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.__extmap,k__5334__auto__)),null));
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__5330__auto__,k32354){
var self__ = this;
var this__5330__auto____$1 = this;
var G__32418 = k32354;
var G__32418__$1 = (((G__32418 instanceof cljs.core.Keyword))?G__32418.fqn:null);
switch (G__32418__$1) {
case "x":
case "y":
return true;

break;
default:
return cljs.core.contains_QMARK_(self__.__extmap,k32354);

}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__5331__auto__,k__5332__auto__,G__32353){
var self__ = this;
var this__5331__auto____$1 = this;
var pred__32452 = cljs.core.keyword_identical_QMARK_;
var expr__32453 = k__5332__auto__;
if(cljs.core.truth_((pred__32452.cljs$core$IFn$_invoke$arity$2 ? pred__32452.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"x","x",2099068185),expr__32453) : pred__32452.call(null,new cljs.core.Keyword(null,"x","x",2099068185),expr__32453)))){
return (new shadow.dom.Coordinate(G__32353,self__.y,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_((pred__32452.cljs$core$IFn$_invoke$arity$2 ? pred__32452.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"y","y",-1757859776),expr__32453) : pred__32452.call(null,new cljs.core.Keyword(null,"y","y",-1757859776),expr__32453)))){
return (new shadow.dom.Coordinate(self__.x,G__32353,self__.__meta,self__.__extmap,null));
} else {
return (new shadow.dom.Coordinate(self__.x,self__.y,self__.__meta,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k__5332__auto__,G__32353),null));
}
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__5336__auto__){
var self__ = this;
var this__5336__auto____$1 = this;
return cljs.core.seq(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.MapEntry(new cljs.core.Keyword(null,"x","x",2099068185),self__.x,null)),(new cljs.core.MapEntry(new cljs.core.Keyword(null,"y","y",-1757859776),self__.y,null))], null),self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__5322__auto__,G__32353){
var self__ = this;
var this__5322__auto____$1 = this;
return (new shadow.dom.Coordinate(self__.x,self__.y,G__32353,self__.__extmap,self__.__hash));
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__5328__auto__,entry__5329__auto__){
var self__ = this;
var this__5328__auto____$1 = this;
if(cljs.core.vector_QMARK_(entry__5329__auto__)){
return this__5328__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null,cljs.core._nth(entry__5329__auto__,(0)),cljs.core._nth(entry__5329__auto__,(1)));
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj,this__5328__auto____$1,entry__5329__auto__);
}
}));

(shadow.dom.Coordinate.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"x","x",-555367584,null),new cljs.core.Symbol(null,"y","y",-117328249,null)], null);
}));

(shadow.dom.Coordinate.cljs$lang$type = true);

(shadow.dom.Coordinate.cljs$lang$ctorPrSeq = (function (this__5369__auto__){
return (new cljs.core.List(null,"shadow.dom/Coordinate",null,(1),null));
}));

(shadow.dom.Coordinate.cljs$lang$ctorPrWriter = (function (this__5369__auto__,writer__5370__auto__){
return cljs.core._write(writer__5370__auto__,"shadow.dom/Coordinate");
}));

/**
 * Positional factory function for shadow.dom/Coordinate.
 */
shadow.dom.__GT_Coordinate = (function shadow$dom$__GT_Coordinate(x,y){
return (new shadow.dom.Coordinate(x,y,null,null,null));
});

/**
 * Factory function for shadow.dom/Coordinate, taking a map of keywords to field values.
 */
shadow.dom.map__GT_Coordinate = (function shadow$dom$map__GT_Coordinate(G__32358){
var extmap__5365__auto__ = (function (){var G__32483 = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$variadic(G__32358,new cljs.core.Keyword(null,"x","x",2099068185),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"y","y",-1757859776)], 0));
if(cljs.core.record_QMARK_(G__32358)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,G__32483);
} else {
return G__32483;
}
})();
return (new shadow.dom.Coordinate(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__32358),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__32358),null,cljs.core.not_empty(extmap__5365__auto__),null));
});

shadow.dom.get_position = (function shadow$dom$get_position(el){
var pos = goog.style.getPosition(shadow.dom.dom_node(el));
return shadow.dom.__GT_Coordinate(pos.x,pos.y);
});
shadow.dom.get_client_position = (function shadow$dom$get_client_position(el){
var pos = goog.style.getClientPosition(shadow.dom.dom_node(el));
return shadow.dom.__GT_Coordinate(pos.x,pos.y);
});
shadow.dom.get_page_offset = (function shadow$dom$get_page_offset(el){
var pos = goog.style.getPageOffset(shadow.dom.dom_node(el));
return shadow.dom.__GT_Coordinate(pos.x,pos.y);
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IKVReduce}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
shadow.dom.Size = (function (w,h,__meta,__extmap,__hash){
this.w = w;
this.h = h;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2230716170;
this.cljs$lang$protocol_mask$partition1$ = 139264;
});
(shadow.dom.Size.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__5323__auto__,k__5324__auto__){
var self__ = this;
var this__5323__auto____$1 = this;
return this__5323__auto____$1.cljs$core$ILookup$_lookup$arity$3(null,k__5324__auto__,null);
}));

(shadow.dom.Size.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__5325__auto__,k32523,else__5326__auto__){
var self__ = this;
var this__5325__auto____$1 = this;
var G__32535 = k32523;
var G__32535__$1 = (((G__32535 instanceof cljs.core.Keyword))?G__32535.fqn:null);
switch (G__32535__$1) {
case "w":
return self__.w;

break;
case "h":
return self__.h;

break;
default:
return cljs.core.get.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k32523,else__5326__auto__);

}
}));

(shadow.dom.Size.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = (function (this__5343__auto__,f__5344__auto__,init__5345__auto__){
var self__ = this;
var this__5343__auto____$1 = this;
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret__5346__auto__,p__32550){
var vec__32552 = p__32550;
var k__5347__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32552,(0),null);
var v__5348__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32552,(1),null);
return (f__5344__auto__.cljs$core$IFn$_invoke$arity$3 ? f__5344__auto__.cljs$core$IFn$_invoke$arity$3(ret__5346__auto__,k__5347__auto__,v__5348__auto__) : f__5344__auto__.call(null,ret__5346__auto__,k__5347__auto__,v__5348__auto__));
}),init__5345__auto__,this__5343__auto____$1);
}));

(shadow.dom.Size.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__5338__auto__,writer__5339__auto__,opts__5340__auto__){
var self__ = this;
var this__5338__auto____$1 = this;
var pr_pair__5341__auto__ = (function (keyval__5342__auto__){
return cljs.core.pr_sequential_writer(writer__5339__auto__,cljs.core.pr_writer,""," ","",opts__5340__auto__,keyval__5342__auto__);
});
return cljs.core.pr_sequential_writer(writer__5339__auto__,pr_pair__5341__auto__,"#shadow.dom.Size{",", ","}",opts__5340__auto__,cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"w","w",354169001),self__.w],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"h","h",1109658740),self__.h],null))], null),self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__32522){
var self__ = this;
var G__32522__$1 = this;
return (new cljs.core.RecordIter((0),G__32522__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"w","w",354169001),new cljs.core.Keyword(null,"h","h",1109658740)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator(self__.__extmap):cljs.core.nil_iter())));
}));

(shadow.dom.Size.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__5321__auto__){
var self__ = this;
var this__5321__auto____$1 = this;
return self__.__meta;
}));

(shadow.dom.Size.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__5318__auto__){
var self__ = this;
var this__5318__auto____$1 = this;
return (new shadow.dom.Size(self__.w,self__.h,self__.__meta,self__.__extmap,self__.__hash));
}));

(shadow.dom.Size.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__5327__auto__){
var self__ = this;
var this__5327__auto____$1 = this;
return (2 + cljs.core.count(self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__5319__auto__){
var self__ = this;
var this__5319__auto____$1 = this;
var h__5134__auto__ = self__.__hash;
if((!((h__5134__auto__ == null)))){
return h__5134__auto__;
} else {
var h__5134__auto____$1 = (function (coll__5320__auto__){
return (-1228019642 ^ cljs.core.hash_unordered_coll(coll__5320__auto__));
})(this__5319__auto____$1);
(self__.__hash = h__5134__auto____$1);

return h__5134__auto____$1;
}
}));

(shadow.dom.Size.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this32524,other32525){
var self__ = this;
var this32524__$1 = this;
return (((!((other32525 == null)))) && ((((this32524__$1.constructor === other32525.constructor)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this32524__$1.w,other32525.w)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this32524__$1.h,other32525.h)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this32524__$1.__extmap,other32525.__extmap)))))))));
}));

(shadow.dom.Size.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__5333__auto__,k__5334__auto__){
var self__ = this;
var this__5333__auto____$1 = this;
if(cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"w","w",354169001),null,new cljs.core.Keyword(null,"h","h",1109658740),null], null), null),k__5334__auto__)){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(cljs.core._with_meta(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,this__5333__auto____$1),self__.__meta),k__5334__auto__);
} else {
return (new shadow.dom.Size(self__.w,self__.h,self__.__meta,cljs.core.not_empty(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.__extmap,k__5334__auto__)),null));
}
}));

(shadow.dom.Size.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__5330__auto__,k32523){
var self__ = this;
var this__5330__auto____$1 = this;
var G__32679 = k32523;
var G__32679__$1 = (((G__32679 instanceof cljs.core.Keyword))?G__32679.fqn:null);
switch (G__32679__$1) {
case "w":
case "h":
return true;

break;
default:
return cljs.core.contains_QMARK_(self__.__extmap,k32523);

}
}));

(shadow.dom.Size.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__5331__auto__,k__5332__auto__,G__32522){
var self__ = this;
var this__5331__auto____$1 = this;
var pred__32694 = cljs.core.keyword_identical_QMARK_;
var expr__32695 = k__5332__auto__;
if(cljs.core.truth_((pred__32694.cljs$core$IFn$_invoke$arity$2 ? pred__32694.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"w","w",354169001),expr__32695) : pred__32694.call(null,new cljs.core.Keyword(null,"w","w",354169001),expr__32695)))){
return (new shadow.dom.Size(G__32522,self__.h,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_((pred__32694.cljs$core$IFn$_invoke$arity$2 ? pred__32694.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"h","h",1109658740),expr__32695) : pred__32694.call(null,new cljs.core.Keyword(null,"h","h",1109658740),expr__32695)))){
return (new shadow.dom.Size(self__.w,G__32522,self__.__meta,self__.__extmap,null));
} else {
return (new shadow.dom.Size(self__.w,self__.h,self__.__meta,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k__5332__auto__,G__32522),null));
}
}
}));

(shadow.dom.Size.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__5336__auto__){
var self__ = this;
var this__5336__auto____$1 = this;
return cljs.core.seq(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.MapEntry(new cljs.core.Keyword(null,"w","w",354169001),self__.w,null)),(new cljs.core.MapEntry(new cljs.core.Keyword(null,"h","h",1109658740),self__.h,null))], null),self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__5322__auto__,G__32522){
var self__ = this;
var this__5322__auto____$1 = this;
return (new shadow.dom.Size(self__.w,self__.h,G__32522,self__.__extmap,self__.__hash));
}));

(shadow.dom.Size.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__5328__auto__,entry__5329__auto__){
var self__ = this;
var this__5328__auto____$1 = this;
if(cljs.core.vector_QMARK_(entry__5329__auto__)){
return this__5328__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null,cljs.core._nth(entry__5329__auto__,(0)),cljs.core._nth(entry__5329__auto__,(1)));
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj,this__5328__auto____$1,entry__5329__auto__);
}
}));

(shadow.dom.Size.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"w","w",1994700528,null),new cljs.core.Symbol(null,"h","h",-1544777029,null)], null);
}));

(shadow.dom.Size.cljs$lang$type = true);

(shadow.dom.Size.cljs$lang$ctorPrSeq = (function (this__5369__auto__){
return (new cljs.core.List(null,"shadow.dom/Size",null,(1),null));
}));

(shadow.dom.Size.cljs$lang$ctorPrWriter = (function (this__5369__auto__,writer__5370__auto__){
return cljs.core._write(writer__5370__auto__,"shadow.dom/Size");
}));

/**
 * Positional factory function for shadow.dom/Size.
 */
shadow.dom.__GT_Size = (function shadow$dom$__GT_Size(w,h){
return (new shadow.dom.Size(w,h,null,null,null));
});

/**
 * Factory function for shadow.dom/Size, taking a map of keywords to field values.
 */
shadow.dom.map__GT_Size = (function shadow$dom$map__GT_Size(G__32528){
var extmap__5365__auto__ = (function (){var G__32750 = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$variadic(G__32528,new cljs.core.Keyword(null,"w","w",354169001),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"h","h",1109658740)], 0));
if(cljs.core.record_QMARK_(G__32528)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,G__32750);
} else {
return G__32750;
}
})();
return (new shadow.dom.Size(new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__32528),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__32528),null,cljs.core.not_empty(extmap__5365__auto__),null));
});

shadow.dom.size__GT_clj = (function shadow$dom$size__GT_clj(size){
return (new shadow.dom.Size(size.width,size.height,null,null,null));
});
shadow.dom.get_size = (function shadow$dom$get_size(el){
return shadow.dom.size__GT_clj(goog.style.getSize(shadow.dom.dom_node(el)));
});
shadow.dom.get_height = (function shadow$dom$get_height(el){
return shadow.dom.get_size(el).h;
});
shadow.dom.get_viewport_size = (function shadow$dom$get_viewport_size(){
return shadow.dom.size__GT_clj(goog.dom.getViewportSize());
});
shadow.dom.first_child = (function shadow$dom$first_child(el){
return (shadow.dom.dom_node(el).children[(0)]);
});
shadow.dom.select_option_values = (function shadow$dom$select_option_values(el){
var native$ = shadow.dom.dom_node(el);
var opts = (native$["options"]);
var a__5613__auto__ = opts;
var l__5614__auto__ = a__5613__auto__.length;
var i = (0);
var ret = cljs.core.PersistentVector.EMPTY;
while(true){
if((i < l__5614__auto__)){
var G__33572 = (i + (1));
var G__33573 = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(ret,(opts[i]["value"]));
i = G__33572;
ret = G__33573;
continue;
} else {
return ret;
}
break;
}
});
shadow.dom.build_url = (function shadow$dom$build_url(path,query_params){
if(cljs.core.empty_QMARK_(query_params)){
return path;
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(path),"?",clojure.string.join.cljs$core$IFn$_invoke$arity$2("&",cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p__32844){
var vec__32845 = p__32844;
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32845,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32845,(1),null);
return [cljs.core.name(k),"=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(encodeURIComponent(cljs.core.str.cljs$core$IFn$_invoke$arity$1(v)))].join('');
}),query_params))].join('');
}
});
shadow.dom.redirect = (function shadow$dom$redirect(var_args){
var G__32850 = arguments.length;
switch (G__32850) {
case 1:
return shadow.dom.redirect.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

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

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

}
});

(shadow.dom.redirect.cljs$core$IFn$_invoke$arity$1 = (function (path){
return shadow.dom.redirect.cljs$core$IFn$_invoke$arity$2(path,cljs.core.PersistentArrayMap.EMPTY);
}));

(shadow.dom.redirect.cljs$core$IFn$_invoke$arity$2 = (function (path,query_params){
return (document["location"]["href"] = shadow.dom.build_url(path,query_params));
}));

(shadow.dom.redirect.cljs$lang$maxFixedArity = 2);

shadow.dom.reload_BANG_ = (function shadow$dom$reload_BANG_(){
return (document.location.href = document.location.href);
});
shadow.dom.tag_name = (function shadow$dom$tag_name(el){
var dom = shadow.dom.dom_node(el);
return dom.tagName;
});
shadow.dom.insert_after = (function shadow$dom$insert_after(ref,new$){
var new_node = shadow.dom.dom_node(new$);
goog.dom.insertSiblingAfter(new_node,shadow.dom.dom_node(ref));

return new_node;
});
shadow.dom.insert_before = (function shadow$dom$insert_before(ref,new$){
var new_node = shadow.dom.dom_node(new$);
goog.dom.insertSiblingBefore(new_node,shadow.dom.dom_node(ref));

return new_node;
});
shadow.dom.insert_first = (function shadow$dom$insert_first(ref,new$){
var temp__5802__auto__ = shadow.dom.dom_node(ref).firstChild;
if(cljs.core.truth_(temp__5802__auto__)){
var child = temp__5802__auto__;
return shadow.dom.insert_before(child,new$);
} else {
return shadow.dom.append.cljs$core$IFn$_invoke$arity$2(ref,new$);
}
});
shadow.dom.index_of = (function shadow$dom$index_of(el){
var el__$1 = shadow.dom.dom_node(el);
var i = (0);
while(true){
var ps = el__$1.previousSibling;
if((ps == null)){
return i;
} else {
var G__33601 = ps;
var G__33602 = (i + (1));
el__$1 = G__33601;
i = G__33602;
continue;
}
break;
}
});
shadow.dom.get_parent = (function shadow$dom$get_parent(el){
return goog.dom.getParentElement(shadow.dom.dom_node(el));
});
shadow.dom.parents = (function shadow$dom$parents(el){
var parent = shadow.dom.get_parent(el);
if(cljs.core.truth_(parent)){
return cljs.core.cons(parent,(new cljs.core.LazySeq(null,(function (){
return (shadow.dom.parents.cljs$core$IFn$_invoke$arity$1 ? shadow.dom.parents.cljs$core$IFn$_invoke$arity$1(parent) : shadow.dom.parents.call(null,parent));
}),null,null)));
} else {
return null;
}
});
shadow.dom.matches = (function shadow$dom$matches(el,sel){
return shadow.dom.dom_node(el).matches(sel);
});
shadow.dom.get_next_sibling = (function shadow$dom$get_next_sibling(el){
return goog.dom.getNextElementSibling(shadow.dom.dom_node(el));
});
shadow.dom.get_previous_sibling = (function shadow$dom$get_previous_sibling(el){
return goog.dom.getPreviousElementSibling(shadow.dom.dom_node(el));
});
shadow.dom.xmlns = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(new cljs.core.PersistentArrayMap(null, 2, ["svg","http://www.w3.org/2000/svg","xlink","http://www.w3.org/1999/xlink"], null));
shadow.dom.create_svg_node = (function shadow$dom$create_svg_node(tag_def,props){
var vec__32922 = shadow.dom.parse_tag(tag_def);
var tag_name = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32922,(0),null);
var tag_id = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32922,(1),null);
var tag_classes = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32922,(2),null);
var el = document.createElementNS("http://www.w3.org/2000/svg",tag_name);
if(cljs.core.truth_(tag_id)){
el.setAttribute("id",tag_id);
} else {
}

if(cljs.core.truth_(tag_classes)){
el.setAttribute("class",shadow.dom.merge_class_string(new cljs.core.Keyword(null,"class","class",-2030961996).cljs$core$IFn$_invoke$arity$1(props),tag_classes));
} else {
}

var seq__32928_33615 = cljs.core.seq(props);
var chunk__32929_33616 = null;
var count__32930_33617 = (0);
var i__32931_33618 = (0);
while(true){
if((i__32931_33618 < count__32930_33617)){
var vec__32944_33620 = chunk__32929_33616.cljs$core$IIndexed$_nth$arity$2(null,i__32931_33618);
var k_33621 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32944_33620,(0),null);
var v_33622 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32944_33620,(1),null);
el.setAttributeNS((function (){var temp__5804__auto__ = cljs.core.namespace(k_33621);
if(cljs.core.truth_(temp__5804__auto__)){
var ns = temp__5804__auto__;
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(shadow.dom.xmlns),ns);
} else {
return null;
}
})(),cljs.core.name(k_33621),v_33622);


var G__33625 = seq__32928_33615;
var G__33626 = chunk__32929_33616;
var G__33627 = count__32930_33617;
var G__33628 = (i__32931_33618 + (1));
seq__32928_33615 = G__33625;
chunk__32929_33616 = G__33626;
count__32930_33617 = G__33627;
i__32931_33618 = G__33628;
continue;
} else {
var temp__5804__auto___33629 = cljs.core.seq(seq__32928_33615);
if(temp__5804__auto___33629){
var seq__32928_33630__$1 = temp__5804__auto___33629;
if(cljs.core.chunked_seq_QMARK_(seq__32928_33630__$1)){
var c__5548__auto___33632 = cljs.core.chunk_first(seq__32928_33630__$1);
var G__33634 = cljs.core.chunk_rest(seq__32928_33630__$1);
var G__33635 = c__5548__auto___33632;
var G__33636 = cljs.core.count(c__5548__auto___33632);
var G__33638 = (0);
seq__32928_33615 = G__33634;
chunk__32929_33616 = G__33635;
count__32930_33617 = G__33636;
i__32931_33618 = G__33638;
continue;
} else {
var vec__32968_33639 = cljs.core.first(seq__32928_33630__$1);
var k_33640 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32968_33639,(0),null);
var v_33641 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32968_33639,(1),null);
el.setAttributeNS((function (){var temp__5804__auto____$1 = cljs.core.namespace(k_33640);
if(cljs.core.truth_(temp__5804__auto____$1)){
var ns = temp__5804__auto____$1;
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(shadow.dom.xmlns),ns);
} else {
return null;
}
})(),cljs.core.name(k_33640),v_33641);


var G__33643 = cljs.core.next(seq__32928_33630__$1);
var G__33644 = null;
var G__33645 = (0);
var G__33646 = (0);
seq__32928_33615 = G__33643;
chunk__32929_33616 = G__33644;
count__32930_33617 = G__33645;
i__32931_33618 = G__33646;
continue;
}
} else {
}
}
break;
}

return el;
});
shadow.dom.svg_node = (function shadow$dom$svg_node(el){
if((el == null)){
return null;
} else {
if((((!((el == null))))?((((false) || ((cljs.core.PROTOCOL_SENTINEL === el.shadow$dom$SVGElement$))))?true:false):false)){
return el.shadow$dom$SVGElement$_to_svg$arity$1(null);
} else {
return el;

}
}
});
shadow.dom.make_svg_node = (function shadow$dom$make_svg_node(structure){
var vec__32996 = shadow.dom.destructure_node(shadow.dom.create_svg_node,structure);
var node = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32996,(0),null);
var node_children = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__32996,(1),null);
var seq__32999_33651 = cljs.core.seq(node_children);
var chunk__33002_33652 = null;
var count__33003_33653 = (0);
var i__33004_33654 = (0);
while(true){
if((i__33004_33654 < count__33003_33653)){
var child_struct_33657 = chunk__33002_33652.cljs$core$IIndexed$_nth$arity$2(null,i__33004_33654);
if((!((child_struct_33657 == null)))){
if(typeof child_struct_33657 === 'string'){
var text_33659 = (node["textContent"]);
(node["textContent"] = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(text_33659),child_struct_33657].join(''));
} else {
var children_33660 = shadow.dom.svg_node(child_struct_33657);
if(cljs.core.seq_QMARK_(children_33660)){
var seq__33066_33661 = cljs.core.seq(children_33660);
var chunk__33068_33662 = null;
var count__33069_33663 = (0);
var i__33070_33664 = (0);
while(true){
if((i__33070_33664 < count__33069_33663)){
var child_33667 = chunk__33068_33662.cljs$core$IIndexed$_nth$arity$2(null,i__33070_33664);
if(cljs.core.truth_(child_33667)){
node.appendChild(child_33667);


var G__33668 = seq__33066_33661;
var G__33669 = chunk__33068_33662;
var G__33670 = count__33069_33663;
var G__33671 = (i__33070_33664 + (1));
seq__33066_33661 = G__33668;
chunk__33068_33662 = G__33669;
count__33069_33663 = G__33670;
i__33070_33664 = G__33671;
continue;
} else {
var G__33672 = seq__33066_33661;
var G__33673 = chunk__33068_33662;
var G__33674 = count__33069_33663;
var G__33675 = (i__33070_33664 + (1));
seq__33066_33661 = G__33672;
chunk__33068_33662 = G__33673;
count__33069_33663 = G__33674;
i__33070_33664 = G__33675;
continue;
}
} else {
var temp__5804__auto___33676 = cljs.core.seq(seq__33066_33661);
if(temp__5804__auto___33676){
var seq__33066_33677__$1 = temp__5804__auto___33676;
if(cljs.core.chunked_seq_QMARK_(seq__33066_33677__$1)){
var c__5548__auto___33679 = cljs.core.chunk_first(seq__33066_33677__$1);
var G__33681 = cljs.core.chunk_rest(seq__33066_33677__$1);
var G__33682 = c__5548__auto___33679;
var G__33683 = cljs.core.count(c__5548__auto___33679);
var G__33684 = (0);
seq__33066_33661 = G__33681;
chunk__33068_33662 = G__33682;
count__33069_33663 = G__33683;
i__33070_33664 = G__33684;
continue;
} else {
var child_33685 = cljs.core.first(seq__33066_33677__$1);
if(cljs.core.truth_(child_33685)){
node.appendChild(child_33685);


var G__33687 = cljs.core.next(seq__33066_33677__$1);
var G__33688 = null;
var G__33689 = (0);
var G__33690 = (0);
seq__33066_33661 = G__33687;
chunk__33068_33662 = G__33688;
count__33069_33663 = G__33689;
i__33070_33664 = G__33690;
continue;
} else {
var G__33692 = cljs.core.next(seq__33066_33677__$1);
var G__33693 = null;
var G__33694 = (0);
var G__33695 = (0);
seq__33066_33661 = G__33692;
chunk__33068_33662 = G__33693;
count__33069_33663 = G__33694;
i__33070_33664 = G__33695;
continue;
}
}
} else {
}
}
break;
}
} else {
node.appendChild(children_33660);
}
}


var G__33696 = seq__32999_33651;
var G__33697 = chunk__33002_33652;
var G__33698 = count__33003_33653;
var G__33699 = (i__33004_33654 + (1));
seq__32999_33651 = G__33696;
chunk__33002_33652 = G__33697;
count__33003_33653 = G__33698;
i__33004_33654 = G__33699;
continue;
} else {
var G__33701 = seq__32999_33651;
var G__33702 = chunk__33002_33652;
var G__33703 = count__33003_33653;
var G__33704 = (i__33004_33654 + (1));
seq__32999_33651 = G__33701;
chunk__33002_33652 = G__33702;
count__33003_33653 = G__33703;
i__33004_33654 = G__33704;
continue;
}
} else {
var temp__5804__auto___33706 = cljs.core.seq(seq__32999_33651);
if(temp__5804__auto___33706){
var seq__32999_33707__$1 = temp__5804__auto___33706;
if(cljs.core.chunked_seq_QMARK_(seq__32999_33707__$1)){
var c__5548__auto___33708 = cljs.core.chunk_first(seq__32999_33707__$1);
var G__33709 = cljs.core.chunk_rest(seq__32999_33707__$1);
var G__33710 = c__5548__auto___33708;
var G__33711 = cljs.core.count(c__5548__auto___33708);
var G__33712 = (0);
seq__32999_33651 = G__33709;
chunk__33002_33652 = G__33710;
count__33003_33653 = G__33711;
i__33004_33654 = G__33712;
continue;
} else {
var child_struct_33714 = cljs.core.first(seq__32999_33707__$1);
if((!((child_struct_33714 == null)))){
if(typeof child_struct_33714 === 'string'){
var text_33716 = (node["textContent"]);
(node["textContent"] = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(text_33716),child_struct_33714].join(''));
} else {
var children_33720 = shadow.dom.svg_node(child_struct_33714);
if(cljs.core.seq_QMARK_(children_33720)){
var seq__33106_33721 = cljs.core.seq(children_33720);
var chunk__33108_33722 = null;
var count__33109_33723 = (0);
var i__33110_33724 = (0);
while(true){
if((i__33110_33724 < count__33109_33723)){
var child_33726 = chunk__33108_33722.cljs$core$IIndexed$_nth$arity$2(null,i__33110_33724);
if(cljs.core.truth_(child_33726)){
node.appendChild(child_33726);


var G__33727 = seq__33106_33721;
var G__33728 = chunk__33108_33722;
var G__33729 = count__33109_33723;
var G__33730 = (i__33110_33724 + (1));
seq__33106_33721 = G__33727;
chunk__33108_33722 = G__33728;
count__33109_33723 = G__33729;
i__33110_33724 = G__33730;
continue;
} else {
var G__33731 = seq__33106_33721;
var G__33732 = chunk__33108_33722;
var G__33733 = count__33109_33723;
var G__33734 = (i__33110_33724 + (1));
seq__33106_33721 = G__33731;
chunk__33108_33722 = G__33732;
count__33109_33723 = G__33733;
i__33110_33724 = G__33734;
continue;
}
} else {
var temp__5804__auto___33736__$1 = cljs.core.seq(seq__33106_33721);
if(temp__5804__auto___33736__$1){
var seq__33106_33737__$1 = temp__5804__auto___33736__$1;
if(cljs.core.chunked_seq_QMARK_(seq__33106_33737__$1)){
var c__5548__auto___33738 = cljs.core.chunk_first(seq__33106_33737__$1);
var G__33743 = cljs.core.chunk_rest(seq__33106_33737__$1);
var G__33744 = c__5548__auto___33738;
var G__33745 = cljs.core.count(c__5548__auto___33738);
var G__33746 = (0);
seq__33106_33721 = G__33743;
chunk__33108_33722 = G__33744;
count__33109_33723 = G__33745;
i__33110_33724 = G__33746;
continue;
} else {
var child_33747 = cljs.core.first(seq__33106_33737__$1);
if(cljs.core.truth_(child_33747)){
node.appendChild(child_33747);


var G__33751 = cljs.core.next(seq__33106_33737__$1);
var G__33752 = null;
var G__33753 = (0);
var G__33754 = (0);
seq__33106_33721 = G__33751;
chunk__33108_33722 = G__33752;
count__33109_33723 = G__33753;
i__33110_33724 = G__33754;
continue;
} else {
var G__33758 = cljs.core.next(seq__33106_33737__$1);
var G__33759 = null;
var G__33760 = (0);
var G__33761 = (0);
seq__33106_33721 = G__33758;
chunk__33108_33722 = G__33759;
count__33109_33723 = G__33760;
i__33110_33724 = G__33761;
continue;
}
}
} else {
}
}
break;
}
} else {
node.appendChild(children_33720);
}
}


var G__33762 = cljs.core.next(seq__32999_33707__$1);
var G__33763 = null;
var G__33764 = (0);
var G__33765 = (0);
seq__32999_33651 = G__33762;
chunk__33002_33652 = G__33763;
count__33003_33653 = G__33764;
i__33004_33654 = G__33765;
continue;
} else {
var G__33767 = cljs.core.next(seq__32999_33707__$1);
var G__33768 = null;
var G__33769 = (0);
var G__33770 = (0);
seq__32999_33651 = G__33767;
chunk__33002_33652 = G__33768;
count__33003_33653 = G__33769;
i__33004_33654 = G__33770;
continue;
}
}
} else {
}
}
break;
}

return node;
});
(shadow.dom.SVGElement["string"] = true);

(shadow.dom._to_svg["string"] = (function (this$){
if((this$ instanceof cljs.core.Keyword)){
return shadow.dom.make_svg_node(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this$], null));
} else {
throw cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2("strings cannot be in svgs",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"this","this",-611633625),this$], null));
}
}));

(cljs.core.PersistentVector.prototype.shadow$dom$SVGElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.PersistentVector.prototype.shadow$dom$SVGElement$_to_svg$arity$1 = (function (this$){
var this$__$1 = this;
return shadow.dom.make_svg_node(this$__$1);
}));

(cljs.core.LazySeq.prototype.shadow$dom$SVGElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.LazySeq.prototype.shadow$dom$SVGElement$_to_svg$arity$1 = (function (this$){
var this$__$1 = this;
return cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom._to_svg,this$__$1);
}));

(shadow.dom.SVGElement["null"] = true);

(shadow.dom._to_svg["null"] = (function (_){
return null;
}));
shadow.dom.svg = (function shadow$dom$svg(var_args){
var args__5755__auto__ = [];
var len__5749__auto___33772 = arguments.length;
var i__5750__auto___33773 = (0);
while(true){
if((i__5750__auto___33773 < len__5749__auto___33772)){
args__5755__auto__.push((arguments[i__5750__auto___33773]));

var G__33775 = (i__5750__auto___33773 + (1));
i__5750__auto___33773 = G__33775;
continue;
} else {
}
break;
}

var argseq__5756__auto__ = ((((1) < args__5755__auto__.length))?(new cljs.core.IndexedSeq(args__5755__auto__.slice((1)),(0),null)):null);
return shadow.dom.svg.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5756__auto__);
});

(shadow.dom.svg.cljs$core$IFn$_invoke$arity$variadic = (function (attrs,children){
return shadow.dom._to_svg(cljs.core.vec(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"svg","svg",856789142),attrs], null),children)));
}));

(shadow.dom.svg.cljs$lang$maxFixedArity = (1));

/** @this {Function} */
(shadow.dom.svg.cljs$lang$applyTo = (function (seq33122){
var G__33123 = cljs.core.first(seq33122);
var seq33122__$1 = cljs.core.next(seq33122);
var self__5734__auto__ = this;
return self__5734__auto__.cljs$core$IFn$_invoke$arity$variadic(G__33123,seq33122__$1);
}));


//# sourceMappingURL=shadow.dom.js.map
