import "./cljs_env.js";
goog.provide('clojure_eval.extensions.eval_region');
var module$node_modules$$codemirror$state$dist$index_cjs=shadow.js.require("module$node_modules$$codemirror$state$dist$index_cjs", {});
var module$node_modules$$codemirror$view$dist$index_cjs=shadow.js.require("module$node_modules$$codemirror$view$dist$index_cjs", {});
var module$node_modules$w3c_keyname$index_cjs=shadow.js.require("module$node_modules$w3c_keyname$index_cjs", {});
/**
 * Returns node or its highest ancestor that starts or ends at the cursor position.
 */
clojure_eval.extensions.eval_region.uppermost_edge_here = (function clojure_eval$extensions$eval_region$uppermost_edge_here(pos,node){
var or__4223__auto__ = cljs.core.last(cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(cljs.core.every_pred.cljs$core$IFn$_invoke$arity$2(cljs.core.complement(clojure_eval.node.top_QMARK_),(function (p1__55547_SHARP_){
return ((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$variadic(pos,clojure_eval.node.end(p1__55547_SHARP_),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([clojure_eval.node.end(node)], 0))) || (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$variadic(pos,clojure_eval.node.start(p1__55547_SHARP_),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([clojure_eval.node.start(node)], 0))));
})),cljs.core.iterate(clojure_eval.node.up,node)));
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return node;
}
});
clojure_eval.extensions.eval_region.main_selection = (function clojure_eval$extensions$eval_region$main_selection(state){
var obj55551 = (function (){var obj55549 = (function (){var parent__54409__auto__ = (state["selection"]);
var f__54410__auto__ = (parent__54409__auto__["asSingle"]);
return f__54410__auto__.call(parent__54409__auto__);
})();
var k55550 = "ranges";
if((function (){var obj55553 = obj55549;
return (((!((obj55553 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55550,obj55553)));
})()){
return (obj55549[k55550]);
} else {
return undefined;
}
})();
var k55552 = (0);
if((function (){var obj55554 = obj55551;
return (((!((obj55554 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55552,obj55554)));
})()){
return (obj55551[k55552]);
} else {
return undefined;
}
});
clojure_eval.extensions.eval_region.node_at_cursor = (function clojure_eval$extensions$eval_region$node_at_cursor(var_args){
var G__55560 = arguments.length;
switch (G__55560) {
case 1:
return clojure_eval.extensions.eval_region.node_at_cursor.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return clojure_eval.extensions.eval_region.node_at_cursor.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('')));

}
});

(clojure_eval.extensions.eval_region.node_at_cursor.cljs$core$IFn$_invoke$arity$1 = (function (state){
return clojure_eval.extensions.eval_region.node_at_cursor.cljs$core$IFn$_invoke$arity$2(state,(function (){var obj55561 = clojure_eval.extensions.eval_region.main_selection(state);
var k55562 = "from";
if((function (){var obj55563 = obj55561;
return (((!((obj55563 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55562,obj55563)));
})()){
return (obj55561[k55562]);
} else {
return undefined;
}
})());
}));

(clojure_eval.extensions.eval_region.node_at_cursor.cljs$core$IFn$_invoke$arity$2 = (function (state,from){
var G__55567 = clojure_eval.node.nearest_touching(state,from,(-1));
var G__55567__$1 = (((G__55567 == null))?null:(function (p1__55557_SHARP_){
if(((clojure_eval.node.terminal_type_QMARK_(clojure_eval.node.type(p1__55557_SHARP_))) || ((((clojure_eval.node.start(p1__55557_SHARP_) <= from)) || ((clojure_eval.node.end(p1__55557_SHARP_) <= from)))))){
var G__55568 = p1__55557_SHARP_;
if(((clojure_eval.node.top_QMARK_(p1__55557_SHARP_)) || ((((!(clojure_eval.node.terminal_type_QMARK_(clojure_eval.node.type(p1__55557_SHARP_))))) && ((((clojure_eval.node.start(p1__55557_SHARP_) < from)) && ((from < clojure_eval.node.end(p1__55557_SHARP_))))))))){
return cljs.core.first(clojure_eval.node.children.cljs$core$IFn$_invoke$arity$3(G__55568,from,(-1)));
} else {
return G__55568;
}
} else {
return null;
}
})(G__55567));
var G__55567__$2 = (((G__55567__$1 == null))?null:clojure_eval.extensions.eval_region.uppermost_edge_here(from,G__55567__$1));
if((G__55567__$2 == null)){
return null;
} else {
return clojure_eval.node.balanced_range.cljs$core$IFn$_invoke$arity$2(state,G__55567__$2);
}
}));

(clojure_eval.extensions.eval_region.node_at_cursor.cljs$lang$maxFixedArity = 2);

clojure_eval.extensions.eval_region.top_level_node = (function clojure_eval$extensions$eval_region$top_level_node(state){
return cljs.core.last(cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(cljs.core.every_pred.cljs$core$IFn$_invoke$arity$2(cljs.core.identity,cljs.core.complement(clojure_eval.node.top_QMARK_)),cljs.core.iterate(clojure_eval.node.up,clojure_eval.node.nearest_touching(state,(function (){var obj55571 = clojure_eval.extensions.eval_region.main_selection(state);
var k55572 = "from";
if((function (){var obj55573 = obj55571;
return (((!((obj55573 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55572,obj55573)));
})()){
return (obj55571[k55572]);
} else {
return undefined;
}
})(),(-1)))));
});
if((typeof clojure_eval !== 'undefined') && (typeof clojure_eval.extensions !== 'undefined') && (typeof clojure_eval.extensions.eval_region !== 'undefined') && (typeof clojure_eval.extensions.eval_region.modifier_effect !== 'undefined')){
} else {
clojure_eval.extensions.eval_region.modifier_effect = module$node_modules$$codemirror$state$dist$index_cjs.StateEffect.define();
}
if((typeof clojure_eval !== 'undefined') && (typeof clojure_eval.extensions !== 'undefined') && (typeof clojure_eval.extensions.eval_region !== 'undefined') && (typeof clojure_eval.extensions.eval_region.modifier_field !== 'undefined')){
} else {
clojure_eval.extensions.eval_region.modifier_field = module$node_modules$$codemirror$state$dist$index_cjs.StateField.define(({"create":cljs.core.constantly(cljs.core.PersistentArrayMap.EMPTY),"update":(function (value,tr){
var or__4223__auto__ = (function (){var G__55599 = cljs.core.first(cljs.core.filter.cljs$core$IFn$_invoke$arity$2((function (p1__55595_SHARP_){
return p1__55595_SHARP_.is(clojure_eval.extensions.eval_region.modifier_effect);
}),tr.effects));
if((G__55599 == null)){
return null;
} else {
var obj55602 = G__55599;
var k55603 = "value";
if((function (){var obj55604 = obj55602;
return (((!((obj55604 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55603,obj55604)));
})()){
return (obj55602[k55603]);
} else {
return undefined;
}
}
})();
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return value;
}
})}));
}
clojure_eval.extensions.eval_region.get_modifier_field = (function clojure_eval$extensions$eval_region$get_modifier_field(state){
return state.field(clojure_eval.extensions.eval_region.modifier_field);
});
clojure_eval.extensions.eval_region.set_modifier_field_BANG_ = (function clojure_eval$extensions$eval_region$set_modifier_field_BANG_(p__55610,value){
var map__55613 = p__55610;
var map__55613__$1 = (((((!((map__55613 == null))))?(((((map__55613.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55613.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55613):map__55613);
var view = map__55613__$1;
var dispatch = (function (){var obj55619 = map__55613__$1;
var k55620 = "dispatch";
if((function (){var obj55621 = obj55619;
return (((!((obj55621 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55620,obj55621)));
})()){
return (obj55619[k55620]);
} else {
return undefined;
}
})();
var state = (function (){var obj55622 = map__55613__$1;
var k55623 = "state";
if((function (){var obj55624 = obj55622;
return (((!((obj55624 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55623,obj55624)));
})()){
return (obj55622[k55623]);
} else {
return undefined;
}
})();
var G__55626 = ({"effects": clojure_eval.extensions.eval_region.modifier_effect.of(value)});
return (dispatch.cljs$core$IFn$_invoke$arity$1 ? dispatch.cljs$core$IFn$_invoke$arity$1(G__55626) : dispatch.call(null,G__55626));
});
clojure_eval.extensions.eval_region.mark = (function clojure_eval$extensions$eval_region$mark(spec,p__55628){
var map__55629 = p__55628;
var map__55629__$1 = (((((!((map__55629 == null))))?(((((map__55629.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55629.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55629):map__55629);
var from = (function (){var obj55635 = map__55629__$1;
var k55636 = "from";
if((function (){var obj55637 = obj55635;
return (((!((obj55637 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55636,obj55637)));
})()){
return (obj55635[k55636]);
} else {
return undefined;
}
})();
var to = (function (){var obj55639 = map__55629__$1;
var k55640 = "to";
if((function (){var obj55641 = obj55639;
return (((!((obj55641 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55640,obj55641)));
})()){
return (obj55639[k55640]);
} else {
return undefined;
}
})();
return module$node_modules$$codemirror$view$dist$index_cjs.Decoration.mark(spec).range(from,to);
});
clojure_eval.extensions.eval_region.single_mark = (function clojure_eval$extensions$eval_region$single_mark(spec,range){
return module$node_modules$$codemirror$view$dist$index_cjs.Decoration.set([clojure_eval.extensions.eval_region.mark(spec,range)]);
});
if((typeof clojure_eval !== 'undefined') && (typeof clojure_eval.extensions !== 'undefined') && (typeof clojure_eval.extensions.eval_region !== 'undefined') && (typeof clojure_eval.extensions.eval_region.mark_spec !== 'undefined')){
} else {
clojure_eval.extensions.eval_region.mark_spec = ({"attributes":({"style":"background-color: rgba(0, 243, 255, 0.14);"})});
}
if((typeof clojure_eval !== 'undefined') && (typeof clojure_eval.extensions !== 'undefined') && (typeof clojure_eval.extensions.eval_region !== 'undefined') && (typeof clojure_eval.extensions.eval_region.mark_spec_highlight !== 'undefined')){
} else {
clojure_eval.extensions.eval_region.mark_spec_highlight = ({"attributes":({"style":"background-color: rgba(0, 243, 255, 0.35);"})});
}
clojure_eval.extensions.eval_region.cursor_range = (function clojure_eval$extensions$eval_region$cursor_range(state){
if(cljs.core.truth_(state.selection.main.empty)){
return clojure_eval.extensions.eval_region.node_at_cursor.cljs$core$IFn$_invoke$arity$1(state);
} else {
return state.selection.main;
}
});
if((typeof clojure_eval !== 'undefined') && (typeof clojure_eval.extensions !== 'undefined') && (typeof clojure_eval.extensions.eval_region !== 'undefined') && (typeof clojure_eval.extensions.eval_region.region_field !== 'undefined')){
} else {
clojure_eval.extensions.eval_region.region_field = module$node_modules$$codemirror$state$dist$index_cjs.StateField.define(({"create":cljs.core.constantly(module$node_modules$$codemirror$view$dist$index_cjs.Decoration.none),"update":(function (_value,p__55651){
var map__55652 = p__55651;
var map__55652__$1 = (((((!((map__55652 == null))))?(((((map__55652.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55652.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55652):map__55652);
var state = (function (){var obj55655 = map__55652__$1;
var k55656 = "state";
if((function (){var obj55657 = obj55655;
return (((!((obj55657 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55656,obj55657)));
})()){
return (obj55655[k55656]);
} else {
return undefined;
}
})();
var map__55658 = clojure_eval.extensions.eval_region.get_modifier_field(state);
var map__55658__$1 = cljs.core.__destructure_map(map__55658);
var Alt = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__55658__$1,"Alt");
var Shift = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__55658__$1,"Shift");
var Enter = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__55658__$1,"Enter");
var spec = (cljs.core.truth_(Enter)?clojure_eval.extensions.eval_region.mark_spec_highlight:clojure_eval.extensions.eval_region.mark_spec);
var temp__5751__auto__ = (cljs.core.truth_((function (){var and__4221__auto__ = Alt;
if(cljs.core.truth_(and__4221__auto__)){
return Shift;
} else {
return and__4221__auto__;
}
})())?clojure_eval.extensions.eval_region.top_level_node(state):(cljs.core.truth_(Alt)?(function (){var or__4223__auto__ = clojure_eval.util.guard(clojure_eval.extensions.eval_region.main_selection(state),(function (p1__55648_SHARP_){
return cljs.core.not((function (){var obj55665 = p1__55648_SHARP_;
var k55666 = "empty";
if((function (){var obj55667 = obj55665;
return (((!((obj55667 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55666,obj55667)));
})()){
return (obj55665[k55666]);
} else {
return undefined;
}
})());
}));
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return clojure_eval.extensions.eval_region.cursor_range(state);
}
})():null));
if(cljs.core.truth_(temp__5751__auto__)){
var range = temp__5751__auto__;
return clojure_eval.extensions.eval_region.single_mark(spec,range);
} else {
return module$node_modules$$codemirror$view$dist$index_cjs.Decoration.none;
}
})}));
}
clojure_eval.extensions.eval_region.get_region_field = (function clojure_eval$extensions$eval_region$get_region_field(state){
return state.field(clojure_eval.extensions.eval_region.region_field);
});
clojure_eval.extensions.eval_region.current_range = (function clojure_eval$extensions$eval_region$current_range(state){
var or__4223__auto__ = (function (){var G__55674 = clojure_eval.extensions.eval_region.get_region_field(state);
var G__55674__$1 = (((G__55674 == null))?null:(function (){var obj__54402__auto__ = G__55674;
var f__54403__auto__ = (obj__54402__auto__["iter"]);
return f__54403__auto__.call(obj__54402__auto__);
})());
if((G__55674__$1 == null)){
return null;
} else {
return clojure_eval.util.guard(G__55674__$1,(function (p1__55672_SHARP_){
var obj55767 = p1__55672_SHARP_;
var k55768 = "value";
if((function (){var obj55769 = obj55767;
return (((!((obj55769 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55768,obj55769)));
})()){
return (obj55767[k55768]);
} else {
return undefined;
}
}));
}
})();
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return state.selection.main;
}
});
/**
 * Maintains modifier-state-field, containing a map of {<modifier> true}, including Enter.
 */
clojure_eval.extensions.eval_region.modifier_extension = (function clojure_eval$extensions$eval_region$modifier_extension(modifier){
var handle_enter = (function clojure_eval$extensions$eval_region$modifier_extension_$_handle_enter(p__55771){
var map__55772 = p__55771;
var map__55772__$1 = (((((!((map__55772 == null))))?(((((map__55772.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55772.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55772):map__55772);
var view = map__55772__$1;
var state = (function (){var obj55774 = map__55772__$1;
var k55775 = "state";
if((function (){var obj55778 = obj55774;
return (((!((obj55778 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55775,obj55778)));
})()){
return (obj55774[k55775]);
} else {
return undefined;
}
})();
clojure_eval.extensions.eval_region.set_modifier_field_BANG_(view,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(clojure_eval.extensions.eval_region.get_modifier_field(state),"Enter",true));

return null;
});
var handle_key_event = (function (p__55779,p__55780){
var map__55781 = p__55779;
var map__55781__$1 = (((((!((map__55781 == null))))?(((((map__55781.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55781.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55781):map__55781);
var event = map__55781__$1;
var altKey = (function (){var obj55783 = map__55781__$1;
var k55784 = "altKey";
if((function (){var obj55785 = obj55783;
return (((!((obj55785 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55784,obj55785)));
})()){
return (obj55783[k55784]);
} else {
return undefined;
}
})();
var shiftKey = (function (){var obj55786 = map__55781__$1;
var k55787 = "shiftKey";
if((function (){var obj55788 = obj55786;
return (((!((obj55788 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55787,obj55788)));
})()){
return (obj55786[k55787]);
} else {
return undefined;
}
})();
var metaKey = (function (){var obj55789 = map__55781__$1;
var k55790 = "metaKey";
if((function (){var obj55791 = obj55789;
return (((!((obj55791 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55790,obj55791)));
})()){
return (obj55789[k55790]);
} else {
return undefined;
}
})();
var controlKey = (function (){var obj55794 = map__55781__$1;
var k55795 = "controlKey";
if((function (){var obj55796 = obj55794;
return (((!((obj55796 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55795,obj55796)));
})()){
return (obj55794[k55795]);
} else {
return undefined;
}
})();
var type = (function (){var obj55798 = map__55781__$1;
var k55799 = "type";
if((function (){var obj55800 = obj55798;
return (((!((obj55800 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55799,obj55800)));
})()){
return (obj55798[k55799]);
} else {
return undefined;
}
})();
var map__55801 = p__55780;
var map__55801__$1 = (((((!((map__55801 == null))))?(((((map__55801.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55801.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55801):map__55801);
var view = map__55801__$1;
var state = (function (){var obj55805 = map__55801__$1;
var k55806 = "state";
if((function (){var obj55807 = obj55805;
return (((!((obj55807 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55806,obj55807)));
})()){
return (obj55805[k55806]);
} else {
return undefined;
}
})();
var prev = clojure_eval.extensions.eval_region.get_modifier_field(state);
var next = (function (){var G__55809 = cljs.core.PersistentArrayMap.EMPTY;
var G__55809__$1 = (cljs.core.truth_(altKey)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__55809,"Alt",true):G__55809);
var G__55809__$2 = (cljs.core.truth_(shiftKey)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__55809__$1,"Shift",true):G__55809__$1);
var G__55809__$3 = (cljs.core.truth_(metaKey)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__55809__$2,"Meta",true):G__55809__$2);
var G__55809__$4 = (cljs.core.truth_(controlKey)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__55809__$3,"Control",true):G__55809__$3);
if(((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2("keydown",type)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2("Enter",module$node_modules$w3c_keyname$index_cjs.keyName(event))))){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__55809__$4,"Enter",true);
} else {
return G__55809__$4;
}
})();
if(cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(prev,next)){
return clojure_eval.extensions.eval_region.set_modifier_field_BANG_(view,next);
} else {
return null;
}
});
var handle_backspace = (function (p__55812){
var map__55814 = p__55812;
var map__55814__$1 = (((((!((map__55814 == null))))?(((((map__55814.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55814.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55814):map__55814);
var view = map__55814__$1;
var state = (function (){var obj55816 = map__55814__$1;
var k55817 = "state";
if((function (){var obj55818 = obj55816;
return (((!((obj55818 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55817,obj55818)));
})()){
return (obj55816[k55817]);
} else {
return undefined;
}
})();
var dispatch = (function (){var obj55819 = map__55814__$1;
var k55820 = "dispatch";
if((function (){var obj55821 = obj55819;
return (((!((obj55821 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55820,obj55821)));
})()){
return (obj55819[k55820]);
} else {
return undefined;
}
})();
var map__55822 = clojure_eval.extensions.eval_region.current_range(state);
var map__55822__$1 = (((((!((map__55822 == null))))?(((((map__55822.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55822.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55822):map__55822);
var from = (function (){var obj55824 = map__55822__$1;
var k55825 = "from";
if((function (){var obj55826 = obj55824;
return (((!((obj55826 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55825,obj55826)));
})()){
return (obj55824[k55825]);
} else {
return undefined;
}
})();
var to = (function (){var obj55827 = map__55822__$1;
var k55828 = "to";
if((function (){var obj55829 = obj55827;
return (((!((obj55829 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55828,obj55829)));
})()){
return (obj55827[k55828]);
} else {
return undefined;
}
})();
if(cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(from,to)){
var G__55830_55986 = ({"changes":({"from":from,"to":to,"insert":""}),"annotations":clojure_eval.util.user_event_annotation("delete")});
(dispatch.cljs$core$IFn$_invoke$arity$1 ? dispatch.cljs$core$IFn$_invoke$arity$1(G__55830_55986) : dispatch.call(null,G__55830_55986));
} else {
}

return true;
});
return [clojure_eval.extensions.eval_region.modifier_field,module$node_modules$$codemirror$view$dist$index_cjs.keymap.of([({"key":[cljs.core.str.cljs$core$IFn$_invoke$arity$1(modifier),"-Enter"].join(''),"shift":handle_enter,"run":handle_enter}),({"key":[cljs.core.str.cljs$core$IFn$_invoke$arity$1(modifier),"-Backspace"].join(''),"run":handle_backspace,"shift":handle_backspace})]),module$node_modules$$codemirror$view$dist$index_cjs.EditorView.domEventHandlers(({"keydown": handle_key_event, "keyup": handle_key_event}))];
});
clojure_eval.extensions.eval_region.extension = (function clojure_eval$extensions$eval_region$extension(p__55831){
var map__55832 = p__55831;
var map__55832__$1 = cljs.core.__destructure_map(map__55832);
var modifier = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__55832__$1,new cljs.core.Keyword(null,"modifier","modifier",1634442788),"Alt");
return [clojure_eval.extensions.eval_region.modifier_extension(modifier),clojure_eval.extensions.eval_region.region_field,module$node_modules$$codemirror$view$dist$index_cjs.EditorView.decorations.from(clojure_eval.extensions.eval_region.region_field)];
});
clojure_eval.extensions.eval_region.cursor_node_string = (function clojure_eval$extensions$eval_region$cursor_node_string(state){
return clojure_eval.util.guard((function (){var G__55839 = clojure_eval.extensions.eval_region.node_at_cursor.cljs$core$IFn$_invoke$arity$1(state);
if((G__55839 == null)){
return null;
} else {
return clojure_eval.util.range_str(state,G__55839);
}
})(),cljs.core.complement(clojure.string.blank_QMARK_));
});
clojure_eval.extensions.eval_region.top_level_string = (function clojure_eval$extensions$eval_region$top_level_string(state){
return clojure_eval.util.guard((function (){var G__55840 = clojure_eval.extensions.eval_region.top_level_node(state);
if((G__55840 == null)){
return null;
} else {
return clojure_eval.util.range_str(state,G__55840);
}
})(),cljs.core.complement(clojure.string.blank_QMARK_));
});

//# sourceMappingURL=clojure_eval.extensions.eval_region.js.map
