!function(){function o(o,e,r){var n;return n=o.getWrapperElement().appendChild(document.createElement("div")),n.className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top",n.innerHTML=e,n}CodeMirror.defineExtension("openDialog",function(e,r,n){function t(){u||(u=!0,d.parentNode.removeChild(d))}var i,d=o(this,e,n&&n.bottom),u=!1,c=this,a=d.getElementsByTagName("input")[0];return a?(CodeMirror.on(a,"keydown",function(o){13!=o.keyCode&&27!=o.keyCode||(CodeMirror.e_stop(o),t(),c.focus(),13==o.keyCode&&r(a.value))}),a.focus(),CodeMirror.on(a,"blur",t)):(i=d.getElementsByTagName("button")[0])&&(CodeMirror.on(i,"click",function(){t(),c.focus()}),i.focus(),CodeMirror.on(i,"blur",t)),t}),CodeMirror.defineExtension("openConfirm",function(e,r,n){function t(){u||(u=!0,i.parentNode.removeChild(i),c.focus())}var i=o(this,e,n&&n.bottom),d=i.getElementsByTagName("button"),u=!1,c=this,a=1;d[0].focus();for(var f=0;f<d.length;++f){var l=d[f];!function(o){CodeMirror.on(l,"click",function(e){CodeMirror.e_preventDefault(e),t(),o&&o(c)})}(r[f]),CodeMirror.on(l,"blur",function(){--a,setTimeout(function(){a<=0&&t()},200)}),CodeMirror.on(l,"focus",function(){++a})}})}();