/*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.core.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})})(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.position.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("
"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};lr(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)a&&(v<0||v0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)})(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.draggable.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.leftu[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.topu[3]?f-this.offset.click.topu[2]?l-this.offset.click.left=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c=a?"":"ui-state-active",h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?l(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend(""),r.secondary&&t.append(""),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.9.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.dialog.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||" ",s,o,u,a,f;s=(this.uiDialog=e("
")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("
")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("
")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("
")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){var i,s;r=e.isFunction(r)?{click:r,text:t}:r,r=e.extend({type:"button"},r),s=r.click,r.click=function(){s.apply(n.element[0],arguments)},i=e("",r).appendTo(n.uiButtonSet),e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||" "))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t
").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.effect.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ jQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.effect-slide.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.effect-blind.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}})(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.effect-fade.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}})(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.effect-highlight.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}})(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.effect-pulsate.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}})(jQuery); /*! jQuery UI - v1.9.2 - 2012-11-23 * http://jqueryui.com * Includes: jquery.ui.autocomplete.js * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){var n=0;e.widget("ui.autocomplete",{version:"1.9.2",defaultElement:"",options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,n,r;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){t=!0,r=!0,n=!0;return}t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t){t=!1,r.preventDefault();return}if(n)return;var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},input:function(e){if(r){r=!1,e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("
');$("#modal-overlay").css({filter:"alpha(opacity=40)"}).fadeIn();var g={};g[dle_act_lang[3]]=function(){$(this).dialog("close")};g[dle_act_lang[4]]=function(){ajax_save_for_edit(a,b)};$("#dlepopup-news-edit").remove();$("body").prepend("");$(".dlepopupnewsedit").html("");var h=.9*$(window).height(),k=.9*$(window).width();1024");d=d.replace(/&/g,"&");$("#ratig-layer-"+b).html(d);$("#vote-num-id-"+b).html(c.votenum);$("#likes-id-"+b).html(c.likes);$("#dislikes-id-"+b).html(c.dislikes)}else c.error&&DLEalert(c.errorinfo,dle_info)},"json")} function doCommentsRate(a,b){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=ratingcomments",{go_rate:a,c_id:b,skin:dle_skin,user_hash:dle_login_hash},function(c){HideLoading("");if(c.success){var d=c.rating;d=d.replace(/</g,"<");d=d.replace(/>/g,">");d=d.replace(/&/g,"&");$("#comments-ratig-layer-"+b).html(d);$("#comments-vote-num-id-"+b).html(c.votenum);$("#comments-likes-id-"+b).html(c.likes);$("#comments-dislikes-id-"+b).html(c.dislikes)}else c.error&&DLEalert(c.errorinfo,dle_info)},"json")}function ajax_cancel_reply(){$("#dlefastreplycomments").hide("blind",{},1400)} function ajax_fast_reply(a,b){var c=$("#comments"+a).val(),d=$("#name"+a).val(),e=$("#question_answer"+a).val(),f=$("#sec_code"+a).val(),g=$("#subscribe"+a+":checked").val(),h=$("#postid"+a).val(),k="";if(""==d||""==c)return DLEalert(dle_req_field,dle_info),!1;"1"==dle_captcha_type?"undefined"!=typeof grecaptcha&&(k=grecaptcha.getResponse(recaptcha_widget)):"2"==dle_captcha_type&&(k=$("#comments-recaptcha-response"+a).val());g||(g=0);f||(f="");e||(e="");ShowLoading("");$.post(dle_root+"engine/ajax/controller.php?mod=addcomments",{post_id:h,parent:a,indent:b,comments:c,name:d,mail:"",editor_mode:"",skin:dle_skin,sec_code:f,question_answer:e,g_recaptcha_response:k,allow_subscribe:g,user_hash:dle_login_hash},function(l){HideLoading("");$("#blind-animation"+a).remove();$("#dlefastreplyesponse").html(l);"error"!=l&&document.getElementById("blind-animation"+a)&&($("html,body").stop().animate({scrollTop:$("#dlefastreplyesponse").offset().top-100},600),setTimeout(function(){$("#blind-animation"+a).show("blind",{},700);$("#dlefastreplycomments").hide("blind",{},700)},600))},"html");return!1} function DLESendPM(a){var b={};$("#dlesendpmpopup").remove();$("#dleprofilepopup").remove();b[dle_act_lang[3]]=function(){$(this).dialog("close")};b[dle_p_send]=function(){"2"==dle_wysiwyg&&tinyMCE.triggerSave();var c=$("#pm_subj").val(),d=$("#pm_text").val(),e=$("#pm_name").val(),f=$("#pm_question_answer").val(),g=$("#sec_code_pm").val(),h=$("#outboxcopy:checked").val(),k="";if(""==e||""==d||""==c)return DLEalert(dle_req_field,dle_info),!1;"1"==dle_captcha_type?"undefined"!=typeof grecaptcha&&(k=grecaptcha.getResponse(recaptcha_widget)):"2"==dle_captcha_type&&(k=$("#pm-recaptcha-response").val());h||(h=0);g||(g="");f||(f="");ShowLoading("");$.post(dle_root+"engine/ajax/controller.php?mod=pm",{action:"send_pm",subj:c,comments:d,name:e,skin:dle_skin,sec_code:g,question_answer:f,g_recaptcha_response:k,outboxcopy:h,user_hash:dle_login_hash},function(l){HideLoading("");if(l.success)$("#dlesendpmpopup").remove(),DLEalert(l.success,dle_info);else if(l.error){if("2"==dle_captcha_type&&"undefined"!=typeof grecaptcha){var m=$("#pm-recaptcha-response").data("key");grecaptcha.execute(m,{action:"pm"}).then(function(p){$("#pm-recaptcha-response").val(p)})}DLEalert(l.error,dle_info)}},"json");return!1};ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=pm",{name:a,action:"show_send",skin:dle_skin,user_hash:dle_login_hash},function(c){HideLoading("");$("body").append(c);$("#dlesendpmpopup").dialog({autoOpen:!0,width:800,resizable:!1,dialogClass:"modalfixed dle-popup-sendpm",buttons:b});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlesendpmpopup").dialog("option","position",{my:"center",at:"center",of:window})},"html");return!1} function dle_reply(a,b,c){var d={},e="";$("#dlereplypopup").remove();"1"==c&&($("#dlefastreplycomments").remove(),$("#dlefastreplyesponse").remove());d[dle_act_lang[3]]=function(){$(this).dialog("close")};d[dle_p_send]=function(){if("1"==dle_wysiwyg||"2"==dle_wysiwyg)"2"==dle_wysiwyg&&tinyMCE.triggerSave(),e="wysiwyg";var f=$("#comments"+a).val(),g=$("#name"+a).val(),h=$("#mail"+a).val(),k=$("#question_answer"+a).val(),l=$("#sec_code"+a).val(),m=$("#subscribe"+a+":checked").val(),p=$("#postid"+a).val(),q="";if(""==g||""==f)return DLEalert(dle_req_field,dle_info),!1;"1"==dle_captcha_type?"undefined"!=typeof grecaptcha&&(q=grecaptcha.getResponse(recaptcha_widget)):"2"==dle_captcha_type&&(q=$("#comments-recaptcha-response"+a).val());m||(m=0);l||(l="");k||(k="");ShowLoading("");$.post(dle_root+"engine/ajax/controller.php?mod=addcomments",{post_id:p,parent:a,indent:b,comments:f,name:g,mail:h,editor_mode:e,skin:dle_skin,sec_code:l,question_answer:k,g_recaptcha_response:q,allow_subscribe:m,user_hash:dle_login_hash}, function(n){HideLoading("");$("#blind-animation"+a).remove();$("#comments-tree-item-"+a).length?($("#comments-tree-item-"+a).append(n),"error"!=n&&document.getElementById("blind-animation"+a)&&($("#dlereplypopup").remove(),$("html,body").stop().animate({scrollTop:$("#comments-tree-item-"+a).offset().top+$("#comments-tree-item-"+a).height()-100},600),setTimeout(function(){$("#blind-animation"+a).show("blind",{},700)},600))):$("#comment-id-"+a).length&&($("#comment-id-"+a).append(n),"error"!=n&&document.getElementById("blind-animation"+a)&&($("#dlereplypopup").remove(),$("html,body").stop().animate({scrollTop:$("#comment-id-"+a).offset().top+$("#comment-id-"+a).height()-100},600),setTimeout(function(){$("#blind-animation"+a).show("blind",{},700)},600)))},"html");return!1};ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=replycomments",{id:a,indent:b,skin:dle_skin,user_hash:dle_login_hash},function(f){HideLoading("");"1"==c?($("#comment-id-"+a).append("
"),$("#dlefastreplycomments").html(f),$("html,body").stop().animate({scrollTop:$("#comment-id-"+a).offset().top+$("#comment-id-"+a).height()-100},600),setTimeout(function(){$("#dlefastreplycomments").show("blind",{},700)},600)):($("body").append(""),$("#dlereplypopup").html(f),$("#dlereplypopup").dialog({autoOpen:!0,width:800,resizable:!1,dialogClass:"modalfixed dle-popup-replycomments",buttons:d}),$(".modalfixed.ui-dialog").css({position:"fixed"}),$("#dlereplypopup").dialog("option","position",{my:"center",at:"center",of:window}))},"html");return!1} function doAddComments(){var a=document.getElementById("dle-comments-form"),b="",c="",d="",e="",f="0",g="";if("1"==dle_wysiwyg||"2"==dle_wysiwyg)"2"==dle_wysiwyg&&tinyMCE.triggerSave(),b="wysiwyg";if(""==a.comments.value||""==a.name.value)return DLEalert(dle_req_field,dle_info),!1;a.question_answer&&(c=a.question_answer.value);a.sec_code&&(d=a.sec_code.value);"1"==dle_captcha_type?"undefined"!=typeof grecaptcha&&(e=grecaptcha.getResponse()):"2"==dle_captcha_type&&(e=$("#g-recaptcha-response").val());a.allow_subscribe&&1==a.allow_subscribe.checked&&(f="1");a.mail&&(g=a.mail.value);ShowLoading("");$.post(dle_root+"engine/ajax/controller.php?mod=addcomments",{post_id:a.post_id.value,comments:a.comments.value,name:a.name.value,mail:g,editor_mode:b,skin:dle_skin,sec_code:d,question_answer:c,g_recaptcha_response:e,allow_subscribe:f,user_hash:dle_login_hash},function(h){HideLoading("");$("#dle-ajax-comments").html(h);"error"!=h&&document.getElementById("blind-animation")&&($("html,body").stop().animate({scrollTop:$("#dle-ajax-comments").offset().top-100},600),setTimeout(function(){$("#blind-animation").show("blind",{},700)},600),a.sec_code&&(a.sec_code.value="",reload()),"1"==dle_captcha_type?"undefined"!=typeof grecaptcha&&grecaptcha.reset():"2"==dle_captcha_type&&"undefined"!=typeof grecaptcha&&(h=$("#g-recaptcha-response").data("key"),grecaptcha.execute(h,{action:"comments"}).then(function(k){$("#g-recaptcha-response").val(k)})))},"html");return!1}function isHistoryApiAvailable(){return!(!window.history||!history.pushState)} function CommentsPage(a,b,c){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=comments",{cstart:a,news_id:b,skin:dle_skin},function(d){HideLoading("");isNaN(a)||isNaN(b)||($("#dle-comm-link").off("click"),$("#dle-comm-link").on("click",function(){CommentsPage(a,b);return!1}));scroll(0,$("#dle-comments-list").offset().top-100);$("#dle-comments-list").html(d.comments);$(".dle-comments-navigation").html(d.navigation);isHistoryApiAvailable()&&window.history.pushState(null,null,c)},"json"); return!1}function dle_copy_quote(a){dle_txt="";window.getSelection?dle_txt=window.getSelection():document.selection&&(dle_txt=document.selection.createRange().text);""!=dle_txt&&(dle_txt="[quote="+a+"]"+dle_txt+"[/quote]")} function dle_fastreply(a){if(!document.getElementById("dle-comments-form"))return!1;var b=document.getElementById("dle-comments-form").comments,c="";"0"==dle_wysiwyg||"-1"==dle_wysiwyg?(b.value="0"==dle_wysiwyg?b.value+("[b]"+a+"[/b],\n"):b.value+(a+",\n"),b.focus()):(c=""+a+",
","1"==dle_wysiwyg?($("#comments").froalaEditor("events.focus"),$("#comments").froalaEditor("html.insert",c,!0)):tinyMCE.execCommand("mceInsertContent",!1,c));setTimeout(function(){$("html,body").stop().animate({scrollTop:$("#dle-comments-form").offset().top-100},700)},100);return!1} function dle_ins(a){if(!document.getElementById("dle-comments-form"))return!1;var b=document.getElementById("dle-comments-form").comments,c="";""!=dle_txt?("0"==dle_wysiwyg||"-1"==dle_wysiwyg?(b.value+=dle_txt+"\n",b.focus()):(c=dle_txt+"
","1"==dle_wysiwyg?($("#comments").froalaEditor("events.focus"),$("#comments").froalaEditor("html.insert",c,!0)):tinyMCE.execCommand("mceInsertContent",!1,c)),setTimeout(function(){$("html,body").stop().animate({scrollTop:$("#dle-comments-form").offset().top-100},700)},100)):(ShowLoading(""),$.get(dle_root+"engine/ajax/controller.php?mod=quote",{id:a,user_hash:dle_login_hash},function(d){HideLoading("");d=d.replace(/</g,"<");d=d.replace(/>/g,">");d=d.replace(/&/g,"&");d=d.replace(/"/g,'"');d=d.replace(/'/g,"'");d=d.replace(/'/g,"'");d=d.replace(/"/g,'"');"0"==dle_wysiwyg||"-1"==dle_wysiwyg?(b.value+=d+"\n",b.focus()):(c=d+"
","1"==dle_wysiwyg?($("#comments").froalaEditor("events.focus"),$("#comments").froalaEditor("html.insert",c,!0)):tinyMCE.execCommand("mceInsertContent",!1,c));setTimeout(function(){$("html,body").stop().animate({scrollTop:$("#dle-comments-form").offset().top-100},700)},100)}));return!1} function ShowOrHide(a){var b=$("#"+a),c=null;document.getElementById("image-"+a)&&(c=document.getElementById("image-"+a));a=b.height()/200*1E3;3E3a&&(a=250);"none"==b.css("display")?(b.show("blind",{},a),c&&(c.src=dle_root+"templates/"+dle_skin+"/dleimages/spoiler-minus.gif")):(2E3$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var d=$("#dle-promt-text").val();$(this).dialog("close");$("#dlepopup").remove();$.post(dle_root+"engine/ajax/controller.php?mod=message",{id:a,user_hash:dle_login_hash,text:d},function(e){"ok"==e?document.location=dle_root+"index.php?do=deletenews&id="+a+"&hash="+dle_login_hash:DLEalert("Send Error",dle_info)})}};$("#dlepopup").remove();$("body").append("");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed dle-popup-newsdelete",buttons:c});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",{my:"center",at:"center",of:window})});b[dle_act_lang[0]]=function(){$(this).dialog("close");document.location=dle_root+"index.php?do=deletenews&id="+a+"&hash="+dle_login_hash};$("#dlepopup").remove();$("body").append("");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed dle-popup-newsdelete",buttons:b});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",{my:"center",at:"center",of:window})} function MenuNewsBuild(a,b){var c=[];c[0]="'+menu_short+"";""!=dle_admin&&(c[1]=''+menu_full+"");allow_dle_delete_news&&(c[2]="'+dle_notice+"",c[3]="'+dle_del_news+"");return c} function sendNotice(a){var b={};b[dle_act_lang[3]]=function(){$(this).dialog("close")};b[dle_p_send]=function(){if(1>$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var c=$("#dle-promt-text").val();$(this).dialog("close");$("#dlepopup").remove();$.post(dle_root+"engine/ajax/controller.php?mod=message",{id:a,user_hash:dle_login_hash,text:c,allowdelete:"no"},function(d){"ok"==d&&DLEalert(dle_p_send_ok,dle_info)})}};$("#dlepopup").remove();$("body").append("");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed dle-popup-sendmessage",buttons:b});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",{my:"center",at:"center",of:window})} function AddComplaint(a,b){var c={},d="";c[dle_act_lang[3]]=function(){$(this).dialog("close")};c[dle_p_send]=function(){if(1>$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var e=$("#dle-promt-text").val(),f="";$("#dle-promt-mail").val()&&(f=$("#dle-promt-mail").val());$(this).dialog("close");$("#dlepopup").remove();$.post(dle_root+"engine/ajax/controller.php?mod=complaint",{id:a,text:e,action:b,mail:f,user_hash:dle_login_hash},function(g){"ok"==g?DLEalert(dle_p_send_ok,dle_info):DLEalert(g,dle_info)})}};$("#dlepopup").remove();5==dle_group&&(d=dle_mail+'
');$("body").append("");$("#dlepopup").dialog({autoOpen:!0,width:600,resizable:!1,dialogClass:"modalfixed dle-popup-complaint",buttons:c});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",{my:"center",at:"center",of:window})} function DLEalert(a,b){$("#dlepopup").remove();$("body").append("");$("#dlepopup").dialog({autoOpen:!0,width:470,resizable:!1,dialogClass:"modalfixed dle-popup-alert",buttons:{Ok:function(){$(this).dialog("close");$("#dlepopup").remove()}}});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",{my:"center",at:"center",of:window})} function DLEconfirm(a,b,c){var d={};d[dle_act_lang[1]]=function(){$(this).dialog("close");$("#dlepopup").remove()};d[dle_act_lang[0]]=function(){$(this).dialog("close");$("#dlepopup").remove();c&&c()};$("#dlepopup").remove();$("body").append("");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed dle-popup-confirm",buttons:d});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",{my:"center",at:"center",of:window})} function DLEprompt(a,b,c,d,e){var f={};f[dle_act_lang[3]]=function(){$(this).dialog("close")};f[dle_act_lang[2]]=function(){if(!e&&1>$("#dle-promt-text").val().length)$("#dle-promt-text").addClass("ui-state-error");else{var g=$("#dle-promt-text").val();$(this).dialog("close");$("#dlepopup").remove();d&&d(g)}};$("#dlepopup").remove();$("body").append("");$("#dlepopup").dialog({autoOpen:!0,width:500,resizable:!1,dialogClass:"modalfixed dle-popup-promt",buttons:f});$(".modalfixed.ui-dialog").css({position:"fixed"});$("#dlepopup").dialog("option","position",{my:"center",at:"center",of:window});0
');$("#modal-overlay").css({filter:"alpha(opacity=40)"}).fadeIn("slow");$("#dleuserpopup").remove();$("body").append("");d[dle_act_lang[3]]=function(){$(this).dialog("close");$("#dleuserpopup").remove()};d[dle_act_lang[5]]=function(){window.frames.edituserframe.confirmDelete(dle_login_hash)};d[dle_act_lang[4]]=function(){document.getElementById("edituserframe").contentWindow.document.getElementById("saveuserform").submit()};$("#dleuserpopup").dialog({autoOpen:!0,width:700,resizable:!1,dialogClass:"modalfixed dle-popup-userprofileadmin",buttons:d,open:function(e,f){$("#dleuserpopup").html("")},beforeClose:function(e,f){$("#dleuserpopup").html("")},close:function(e,f){$("#modal-overlay").fadeOut("slow",function(){$("#modal-overlay").remove()})}});830<$(window).width()&&530<$(window).height()&&($(".modalfixed.ui-dialog").css({position:"fixed"}),$("#dleuserpopup").dialog("option","position",{my:"center",at:"center",of:window}));return!1});$("#dleprofilepopup").remove();$("body").append(a);$("#dleprofilepopup").dialog({autoOpen:!0,resizable:!1,dialogClass:"dle-popup-userprofile",buttons:c,width:550});return!1} function ShowProfile(a,b,c){if(dle_user_profile==a&&document.getElementById("dleprofilepopup"))return $("#dleprofilepopup").dialog("open"),!1;dle_user_profile=a;dle_user_profile_link=b;ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=profile",{name:a,skin:dle_skin,user_hash:dle_login_hash},function(d){HideLoading("");ShowPopupProfile(d,c)});return!1} function FastSearch(){$("#story").attr("autocomplete","off");$("#story").blur(function(){$("#searchsuggestions").fadeOut()});$("#story").keyup(function(){var a=$(this).val();0==a.length?$("#searchsuggestions").fadeOut():dle_search_value!=a&&a.length>=dle_min_search&&(clearInterval(dle_search_delay),dle_search_delay=setInterval(function(){dle_do_search(a)},600))})} function dle_do_search(a){clearInterval(dle_search_delay);$("#searchsuggestions").remove();$("body").append("");$.post(dle_root+"engine/ajax/controller.php?mod=search",{query:""+a,user_hash:dle_login_hash},function(b){$("#searchsuggestions").html(b).fadeIn().css({position:"absolute",top:0,left:0}).position({my:"left top",at:"left bottom",of:"#story",collision:"fit flip"})});dle_search_value=a} function ShowLoading(a){$("#loading-layer").remove();$("body").append("");a?$("#loading-layer").html(a):$("#loading-layer").html(dle_act_lang[6]);a=($(window).width()-$("#loading-layer").width())/2;var b=($(window).height()-$("#loading-layer").height())/2;$("#loading-layer").css({left:a+"px",top:b+"px",position:"fixed",zIndex:"99"});$("#loading-layer").fadeTo("slow",.6)} function HideLoading(a){$("#loading-layer").fadeOut("slow",function(){$("#loading-layer").remove()})} function ShowAllVotes(){if(document.getElementById("dlevotespopup"))return $("#dlevotespopup").dialog("open"),!1;$.ajaxSetup({cache:!1});ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=allvotes&dle_skin="+dle_skin,function(a){HideLoading("");$("#dlevotespopup").remove();$("body").append(a);$(".dlevotebutton").button();$("#dlevotespopup").dialog({autoOpen:!0,resizable:!1,dialogClass:"dle-popup-allvotes",width:600});400<$("#dlevotespopupcontent").height()&&$("#dlevotespopupcontent").height(400);$("#dlevotespopup").dialog("option","height",$("#dlevotespopupcontent").height()+60);$("#dlevotespopup").dialog("option","position","center")});return!1} function fast_vote(a){var b=$("#vote_"+a+" input:radio[name=vote_check]:checked").val();if("undefined"==typeof b)return!1;ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=vote",{vote_id:a,vote_action:"vote",vote_mode:"fast_vote",vote_check:b,dle_skin:dle_skin,user_hash:dle_login_hash},function(c){HideLoading("");$("#dle-vote_list-"+a).fadeOut(500,function(){$(this).html(c);$(this).fadeIn(500)})});return!1} function AddIgnorePM(a,b){DLEconfirm(b,dle_confirm,function(){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=pm",{id:a,action:"add_ignore",skin:dle_skin,user_hash:dle_login_hash},function(c){HideLoading("");DLEalert(c,dle_info);return!1})})} function DelIgnorePM(a,b){DLEconfirm(b,dle_confirm,function(){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=pm",{id:a,action:"del_ignore",skin:dle_skin,user_hash:dle_login_hash},function(c){HideLoading("");$("#dle-ignore-list-"+a).html("");DLEalert(c,dle_info);return!1})});return!1} function DelSocial(a,b){DLEconfirm(b,dle_confirm,function(){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=adminfunction",{id:a,action:"del_social",user_hash:dle_login_hash},function(c){HideLoading("");$("#dle-social-list-"+a).html("");DLEalert(c,dle_info);return!1})});return!1} function subscribe(a){DLEconfirm(dle_sub_agree,dle_confirm,function(){ShowLoading("");$.get(dle_root+"engine/ajax/controller.php?mod=commentssubscribe",{news_id:a,skin:dle_skin,user_hash:dle_login_hash},function(b){HideLoading("");b.success?DLEalert(b.info,dle_info):b.error&&DLEalert(b.errorinfo,dle_info)},"json")});return!1} function media_upload(a,b,c,d){var e=(new Date).getTime(),f="none";$("#mediaupload").remove();$("body").append("");$("#mediaupload").dialog({autoOpen:!0,width:710,resizable:!1,dialogClass:"modalfixed dle-popup-upload",open:function(g,h){$("#mediaupload").html("");$(".ui-dialog").draggable("option","containment","")},dragStart:function(g,h){f=$(".modalfixed").css("box-shadow");$(".modalfixed").fadeTo(0,.6).css("box-shadow","none");$("#mediaupload").css("visibility","hidden")},dragStop:function(g,h){$(".modalfixed").fadeTo(0,1).css("box-shadow",f);$("#mediaupload").css("visibility","visible")},beforeClose:function(g,h){$("#mediaupload").html("")}});830<$(window).width()&&530<$(window).height()&&($(".modalfixed.ui-dialog").css({position:"fixed"}),$("#mediaupload").dialog("option","position",{my:"center",at:"center",of:window}));return!1} function dropdownmenu(a,b,c,d){window.event?event.cancelBubble=!0:b.stopPropagation&&b.stopPropagation();b=$("#dropmenudiv");if(b.is(":visible"))return clearhidemenu(),b.fadeOut("fast"),!1;b.remove();$("body").append('');b=$("#dropmenudiv");b.html(c.join(""));d&&b.width(d);c=$(document).width()-30;d=$(a).offset();c-d.lefta("#dle-promt-text").val().length)a("#dle-promt-text").addClass("ui-state-error");else{var g=a("#dle-promt-text").val(),h=a("#orfom").text(),k="";a("#dle-promt-mail").val()&&(k=a("#dle-promt-mail").val());a(this).dialog("close");a("#dlepopup").remove();a.post(dle_root+"engine/ajax/controller.php?mod=complaint",{seltext:h,text:g,mail:k,user_hash:dle_login_hash,action:"orfo",url:window.location.href},function(l){"ok"==l?DLEalert(dle_p_send_ok,dle_info):DLEalert(l,dle_info)})}};a("#dlepopup").remove();5==dle_group&&(d=dle_mail+'
');a("body").append("");a("#dlepopup").dialog({autoOpen:!0,width:600,resizable:!1,dialogClass:"modalfixed dle-popup-complaint",buttons:e});a(".modalfixed.ui-dialog").css({position:"fixed"});a("#dlepopup").dialog("option","position",{my:"center",at:"center",of:window})}});setTimeout(function(){a("img[data-maxwidth]").each(function(){var e=a(this).width(),f=a(this).data("maxwidth");a(this)[0].naturalWidth&&(e=a(this)[0].naturalWidth);e>f&&(a(this).width(f),a(this).wrap(''),"undefined"==typeof hs&&0==b&&(b=!0,a.getScript(dle_root+"engine/classes/highslide/highslide.js",function(){hs.graphicsDir=dle_root+"engine/classes/highslide/graphics/";hs.numberOfImagesToPreload=0;hs.captionEval="this.thumb.alt";hs.showCredits=!1;hs.align="center";hs.transitions=["expand","crossfade"]})))})},300);setTimeout(function(){a("div[data-dlebclicks]").each(function(){var e=a(this).data("dlebid");a(this).find("a").on("click",function(){a.post(dle_root+"engine/ajax/controller.php?mod=adminfunction",{id:e,action:"bannersclick",user_hash:dle_login_hash})})})},400);a("div[data-dlebviews]").each(function(){c.push(a(this).data("dlebid"))});c.length&&setTimeout(function(){a.post(dle_root+"engine/ajax/controller.php?mod=adminfunction",{"ids[]":c,action:"bannersviews",user_hash:dle_login_hash})},1E3)}); ;/* Lazy Load XT 1.1.0 | MIT License */ !function(a,b,c,d){function e(a,b){return a[b]===d?t[b]:a[b]}function f(){var a=b.pageYOffset;return a===d?r.scrollTop:a}function g(a,b){var c=t["on"+a];c&&(w(c)?c.call(b[0]):(c.addClass&&b.addClass(c.addClass),c.removeClass&&b.removeClass(c.removeClass))),b.trigger("lazy"+a,[b]),k()}function h(b){g(b.type,a(this).off(p,h))}function i(c){if(z.length){c=c||t.forceLoad,A=1/0;var d,e,i=f(),j=b.innerHeight||r.clientHeight,k=b.innerWidth||r.clientWidth;for(d=0,e=z.length;e>d;d++){var l,m=z[d],q=m[0],s=m[n],u=!1,v=c||y(q,o)<0;if(a.contains(r,q)){if(c||!s.visibleOnly||q.offsetWidth||q.offsetHeight){if(!v){var x=q.getBoundingClientRect(),B=s.edgeX,C=s.edgeY;l=x.top+i-C-j,v=i>=l&&x.bottom>-C&&x.left<=k+B&&x.right>-B}if(v){m.on(p,h),g("show",m);var D=s.srcAttr,E=w(D)?D(m):q.getAttribute(D);E&&(q.src=E),u=!0}else A>l&&(A=l)}}else u=!0;u&&(y(q,o,0),z.splice(d--,1),e--)}e||g("complete",a(r))}}function j(){B>1?(B=1,i(),setTimeout(j,t.throttle)):B=0}function k(a){z.length&&(a&&"scroll"===a.type&&a.currentTarget===b&&A>=f()||(B||setTimeout(j,0),B=2))}function l(){v.lazyLoadXT()}function m(){i(!0)}var n="lazyLoadXT",o="lazied",p="load error",q="lazy-hidden",r=c.documentElement||c.body,s=b.onscroll===d||!!b.operamini||!r.getBoundingClientRect,t={autoInit:!0,selector:"img[data-src],iframe[data-src]",blankImage:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",throttle:99,forceLoad:s,loadEvent:"pageshow",updateEvent:"load orientationchange resize scroll touchmove focus",forceEvent:"lazyloadall",oninit:{removeClass:"lazy"},onshow:{addClass:q},onload:{removeClass:q,addClass:"lazy-loaded"},onerror:{removeClass:q},checkDuplicates:!0},u={srcAttr:"data-src",edgeX:0,edgeY:0,visibleOnly:!0},v=a(b),w=a.isFunction,x=a.extend,y=a.data||function(b,c){return a(b).data(c)},z=[],A=0,B=0;a[n]=x(t,u,a[n]),a.fn[n]=function(c){c=c||{};var d,f=e(c,"blankImage"),h=e(c,"checkDuplicates"),i=e(c,"scrollContainer"),j=e(c,"show"),l={};a(i).on("scroll",k);for(d in u)l[d]=e(c,d);return this.each(function(d,e){if(e===b)a(t.selector).lazyLoadXT(c);else{var i=h&&y(e,o),m=a(e).data(o,j?-1:1);if(i)return void k();f&&"IMG"===e.tagName&&!e.src&&(e.src=f),m[n]=x({},l),g("init",m),z.push(m),k()}})},a(c).ready(function(){g("start",v),v.on(t.updateEvent,k).on(t.forceEvent,m),a(c).on(t.updateEvent,k),t.autoInit&&(v.on(t.loadEvent,l),l())})}(window.jQuery||window.Zepto||window.$,window,document); ;(function(){function t(a,b,c,d){function e(){if(f)return null;var h=b;b.childNodes&&b.childNodes.length&&!l?b=b[d?"lastChild":"firstChild"]:b[d?"previousSibling":"nextSibling"]?(b=b[d?"previousSibling":"nextSibling"],l=!1):b.parentNode&&(b=b.parentNode,b===a&&(f=!0),l=!0,e());h===c&&(f=!0);return h}d=!!d;b=b||a[d?"lastChild":"firstChild"];var f=!b,l=!1;return e}function v(a){for(var b=1;b\u2026\\n\u00a0\\*]+",selectable:"selectable-content",marker:"txtselect_marker",ignored:null,selectMessage:null,location:new g,validate:!1,enableHaschange:!0, onMark:null,onUnmark:null,onHashRead:function(){var a=A(this.selectable,"user_selection_true");a&&!this.hashWasRead&&(this.hashWasRead=!0,window.setTimeout(function(){for(var b=0,c=0;a;)b+=a.offsetLeft,c+=a.offsetTop,a=a.offsetParent;window.scrollTo(b,c-150)},1))},isBlock:function(a){return"BR"==a.nodeName||-1==G(I(a,"display"),["inline","none"])}};n.prototype={init:function(){this.selectable="string"==typeof this.options.selectable?document.getElementById(this.options.selectable):this.options.selectable; "string"==typeof this.options.marker?(this.marker=document.getElementById(this.options.marker),null===this.marker&&(this.marker=document.createElement("a"),this.marker.setAttribute("id",this.options.marker),this.marker.setAttribute("href","#"),document.body.appendChild(this.marker))):this.marker=this.options.marker;if("string"!=typeof this.options.regexp)throw"regexp is set as string";this.regexp=new RegExp(this.options.regexp,"ig");this.selectable&&(this.isIgnored=this.constructIgnored(this.options.ignored), this.options.selectMessage&&this.initMessage(),this.enumerateElements(),"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?(this.touchEnd=p(this.touchEnd,this),m(this.selectable,"touchend",this.touchEnd)):(this.mouseUp=p(this.mouseUp,this),m(this.selectable,"mouseup",this.mouseUp)),this.markerClick=p(this.markerClick,this),m(this.marker,"click",this.markerClick),m(this.marker,"touchend",this.markerClick),this.hideMarker=p(this.hideMarker,this),m(document,"click",this.hideMarker), this.options.enableHaschange&&(this.hashChange=p(this.hashChange,this),this.options.location.addHashchange(this.hashChange)),this.readHash())},destroy:function(){u(this.marker,"show");this.options.selectMessage&&this.hideMessage();r(this.selectable,"mouseup",this.mouseUp);r(this.selectable,"touchEnd",this.touchEnd);r(this.marker,"click",this.markerClick);r(this.marker,"touchend",this.markerClick);r(document,"click",this.hideMarker);this.options.location.destroy();var a=q(this.selectable,"user_selection_true"); this.removeTextSelection(a);for(var b=q(this.selectable,"closewrap"),a=b.length;a--;)b[a].parentNode.removeChild(b[a]);b=q(this.selectable,"masha_index");for(a=b.length;a--;)b[a].parentNode.removeChild(b[a])},mouseUp:function(a){var b=J(a);window.setTimeout(p(function(){this.showMarker(b)},this),1)},touchEnd:function(){window.setTimeout(p(function(){var a=window.getSelection();if(a.rangeCount&&(a=a.getRangeAt(0).getClientRects(),a.length)){var a=a[a.length-1],b=document.body;this.showMarker({x:a.left+ a.width+b.scrollLeft,y:a.top+a.height/2+b.scrollTop})}},this),1)},hashChange:function(){if(this.lastHash!=this.options.location.getHash()){var a=[],b;for(b in this.ranges)a.push(b);this.deleteSelections(a);this.readHash()}},hideMarker:function(a){(a.target||a.srcElement)!=this.marker&&u(this.marker,"show");this.lastRange=null},markerClick:function(a){D(a);a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;a=a.target||a.srcElement;if(!k(this.marker,"masha-marker-bar")||k(a,"masha-social")||k(a, "masha-marker"))if(u(this.marker,"show"),this.rangeIsSelectable()&&(this.addSelection(),this.updateHash(),this.options.onMark&&this.options.onMark.call(this),this.options.selectMessage&&this._showMessage(),k(a,"masha-social")&&(a=a.getAttribute("data-pattern"))))a=a.replace("{url}",encodeURIComponent(window.location.toString())),this.openShareWindow(a)},openShareWindow:function(a){window.open(a,"","status=no,toolbar=no,menubar=no,width=800,height=400")},getMarkerCoords:function(a,b){return{x:b.x+ 5,y:b.y-33,width:b.width}},getPositionChecksum:function(a){for(var b="",c=0;3>c;c++){var d=(a()||"").charAt(0);d&&(d=d.charCodeAt(0)%62,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890".charAt(d));b+=d}return b},showMarker:function(a){var b=new RegExp(this.options.regexp,"g"),c=window.getSelection().toString();""!=c&&b.test(c)&&this.rangeIsSelectable()&&(a=this.getMarkerCoords(this.marker,a),this.marker.style.top=a.y+"px",this.marker.style.left=a.x+"px",a=window.getSelection(),a.rangeCount&& (this.lastRange=a.getRangeAt(0)),z(this.marker,"show"))},deleteSelections:function(a){for(var b=a.length;b--;){var c=a[b],d=q(this.selectable,c),e=A(d[d.length-1],"closewrap");e.parentNode.removeChild(e);this.removeTextSelection(d);delete this.ranges[c]}},removeTextSelection:function(a){for(var b=a.length;b--;){for(var c=a[b],d=0;d=$(window).width()?$(window).width()-$("#share-popup").width()-15:a.left+5, top:a.top-$("#share-popup").height()-25 }); }; function hideSharePopup(b,a){ $("#share-popup").removeClass('show'); $("#share-popup").hide(); }; jQuery(function($) { var timeoutHover = null; $("body").append(''); $("#share-popup").hover(function() { if(typeof timeout_hover != "undefined") { window.clearTimeout(timeout_hover) } }, function() { timeout_hover = window.setTimeout(function() { hideSharePopup() }, 2E3) }); MaSha.instance = new MaSha({selectable:$("#dle-content")[0], "ignored":".ignore-select", onMark:function() { updateSharePopupContent(); showSharePopup($(".num" + (this.counter - 1), $(this.selectable))[0]) }, onUnmark:function() { "undefined" != typeof hideSharePopup && hideSharePopup("", !0); updateSharePopupContent() }}); }); ;/* CodeMirror - Minified & Bundled Generated with http://codemirror.net/doc/compress.html Version: 5.34.0 CodeMirror Library: - codemirror.js Modes: - css.js - htmlembedded.js - htmlmixed.js - javascript.js - xml.js - php.js - clike.js - sql.js Add-ons: - dialog.js - search.js - searchcursor.js - searchcursor.js - autorefresh.js */ (function(q,I){"object"===typeof exports&&"undefined"!==typeof module?module.exports=I():"function"===typeof define&&define.amd?define(I):q.CodeMirror=I()})(this,function(){function q(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function I(a){for(var b=a.childNodes.length;0h||h>=b)return e+(b-d); e+=h-d;e+=c-e%c;d=h+1}}function H(a,b){for(var c=0;c=b)return d+Math.min(l,b-e);e+=h-d;e+=c-e%c;d=h+1;if(e>=b)return d}}function F(a){for(;Yc.length<=a;)Yc.push(g(Yc)+" ");return Yc[a]}function g(a){return a[a.length-1]}function x(a,b){for(var c=[],d=0;dc?0c?-1:1;;){if(b==c)return b;var e=(b+c)/2;e=0>d?Math.ceil(e):Math.floor(e);if(e==b)return a(e)?b:c;a(e)?c=e:b=e+d}}function za(a,b,c){this.input=c;this.scrollbarFiller=t("div",null,"CodeMirror-scrollbar-filler");this.scrollbarFiller.setAttribute("cm-not-content","true");this.gutterFiller=t("div",null,"CodeMirror-gutter-filler");this.gutterFiller.setAttribute("cm-not-content","true");this.lineDiv=w("div",null,"CodeMirror-code");this.selectionDiv=t("div",null, null,"position: relative; z-index: 1");this.cursorDiv=t("div",null,"CodeMirror-cursors");this.measure=t("div",null,"CodeMirror-measure");this.lineMeasure=t("div",null,"CodeMirror-measure");this.lineSpace=w("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");var d=w("div",[this.lineSpace],"CodeMirror-lines");this.mover=t("div",[d],null,"position: relative");this.sizer=t("div",[this.mover],"CodeMirror-sizer");this.sizerWidth= null;this.heightForcer=t("div",null,null,"position: absolute; height: 30px; width: 1px;");this.gutters=t("div",null,"CodeMirror-gutters");this.lineGutter=null;this.scroller=t("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll");this.scroller.setAttribute("tabIndex","-1");this.wrapper=t("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror");R&&8>fa&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);va||hb&&gc||(this.scroller.draggable=!0);a&&(a.appendChild? a.appendChild(this.wrapper):a(this.wrapper));this.reportedViewFrom=this.reportedViewTo=this.viewFrom=this.viewTo=b.first;this.view=[];this.externalMeasured=this.renderedView=null;this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0;this.updateLineNumbers=null;this.nativeBarWidth=this.barHeight=this.barWidth=0;this.scrollbarsClipped=!1;this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null;this.alignWidgets=!1;this.maxLine=this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH= null;this.maxLineLength=0;this.maxLineChanged=!1;this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null;this.shift=!1;this.activeTouch=this.selForContextMenu=null;c.init(this)}function A(a,b){b-=a.first;if(0>b||b>=a.size)throw Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],h=e.chunkSize();if(b=a.first&&bK(a,b)?b:a}function Va(a,b){return 0>K(a,b)?a:b}function M(a,b){if(b.linec)return z(c,A(a,c).text.length);c=A(a,b.line).text.length;var d=b.ch;c=null==d||d>c?z(b.line,c):0>d?z(b.line,0):b;return c}function cb(a,b){for(var c=[],d=0;d=e:G.to>e);(n||(n=[])).push(new Kb(m,G.from,f?null:G.to))}}c= n;var ba;if(d)for(n=0;n=h:r.to>h)||r.from==h&&"bookmark"==G.type&&(!l||r.marker.insertLeft))m=null==r.from||(G.inclusiveLeft?r.from<=h:r.fromK(l.to,e.from)||0r||!c.inclusiveLeft&&!r)&&n.push({from:l.from,to:e.from});(0E(h,d.marker)))var h=d.marker;return h}function N(a,b,c,d,e){a=A(a,b);if(a=ib&&a.markedSpans)for(b=0;b=r||0>=n&&0<=r)&&(0>=n&&(h.marker.inclusiveRight&&e.inclusiveLeft?0<= K(l.to,c):0=K(l.from,d):0>K(l.from,d))))return!0}}}function Da(a){for(var b;b=Wa(a,!0);)a=b.find(-1,!0).line;return a}function Aa(a,b){var c=A(a,b),d=Da(c);return c==d?b:T(d)}function Zc(a,b){if(b>a.lastLine())return b;var c=A(a,b),d;if(!Ea(a,c))return b;for(;d=Wa(c,!1);)c=d.find(1,!0).line;return T(c)+1}function Ea(a,b){var c=ib&&b.markedSpans;if(c)for(var d,e=0;eb.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function Ed(a,b,c,d){if(!a)return d(b,c,"ltr",0);for(var e=!1,h=0;hb||b==c&&l.to==b)d(Math.max(l.from,b),Math.min(l.to,c),1==l.level?"rtl":"ltr",h),e=!0}e||d(b,c,"ltr")}function Xa(a,b,c){var d;lc=null;for(var e=0;eb)return e;h.to==b&&(h.from!=h.to&&"before"==c?d=e:lc=e);h.from==b&&(h.from!=h.to&&"before"!=c?d=e:lc=e)}return null!= d?d:lc}function Na(a,b){var c=a.order;null==c&&(c=a.order=og(a.text,b));return c}function ja(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=(a=a._handlers)&&a[b];d&&(c=H(d,c),-1=b.offsetWidth&&2fa))}a= Fd?t("span","\u200b"):t("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px");a.setAttribute("cm-text","");return a}function Gd(a,b){2a&&e.splice(r,1,a,e[r+1],c);r+=2;m=Math.min(a,c)}if(b)if(n.opaque)e.splice(d,r-d,a,"overlay "+b),r=d+2;else for(;da.options.maxHighlightLength&&db(a.doc.mode,d.state),h=oc(a,b,d);e&&(d.state=e);b.stateAfter=d.save(!e);b.styles=h.styles;h.classes?b.styleClasses=h.classes:b.styleClasses&&(b.styleClasses=null);c===a.doc.highlightFrontier&&(a.doc.modeFrontier=Math.max(a.doc.modeFrontier,++a.doc.highlightFrontier))}return b.styles}function Ja(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return new Ya(d,!0,b);var h=Rb(a,b,c),l=h>d.first&&A(d,h-1).stateAfter,n=l?Ya.fromSaved(d,l,h):new Ya(d, eb(d.mode),h);d.iter(h,b,function(d){ha(a,d.text,n);var c=n.line;d.stateAfter=c==b-1||0==c%5||c>=e.viewFrom&&ce;e++){d&&(d[0]=Qb(a,c).mode);var h=a.token(b,c);if(b.pos>b.start)return h}throw Error("Mode "+a.name+" failed to advance stream.");}function pc(a,b,c,d){var e=a.doc,h=e.mode;b=M(e,b);var l=A(e,b.line);c=Ja(a,b.line,c);a=new la(l.text,a.options.tabSize,c);var n;for(d&&(n=[]);(d||a.posa.options.maxHighlightLength){n=!1;l&&ha(a,b,d,m.pos);m.pos=b.length;var k=null}else k=dd(Tb(c,m,d.state, f),h);if(f){var g=f[0].name;g&&(k="m-"+(k?g+" "+k:g))}if(!n||G!=k){for(;rl;--b){if(b<=h.first)return h.first;var n=A(h,b-1),r=n.stateAfter;if(r&&(!c||b+(r instanceof ed?r.lookAhead:0)<=h.modeFrontier))return b;n=k(n.text,null,a.options.tabSize);if(null==e||d>n)e=b-1,d=n}return e}function Id(a,b){a.modeFrontier= Math.min(a.modeFrontier,b);if(!(a.highlightFrontierc;d--){var e=A(a,d).stateAfter;if(e&&(!(e instanceof ed)||d+e.lookAheadn.right-r.right:!1}l&&(h=Na(e,a.doc.direction))&&(c.addToken=rg(c.addToken,h));c.map=[];var G=b!=a.display.externalMeasured&&T(e);a:{var m=n= r=l=void 0,f=void 0,k=void 0,g=void 0;h=c;G=ub(a,e,G);var p=e.markedSpans,x=e.text,q=0;if(p)for(var S=x.length,N=0,F=1,y="",v=0;;){if(v==N){f=m=n=r=k="";l=null;v=Infinity;for(var Q=[],t=void 0,z=0;zN||Y.collapsed&&A.to==N&&A.from==N)?(null!=A.to&&A.to!=N&&v>A.to&&(v=A.to,m=""),Y.className&&(f+=" "+Y.className),Y.css&&(k=(k?k+";":"")+Y.css),Y.startStyle&&A.from==N&&(n+=" "+Y.startStyle), Y.endStyle&&A.to==v&&(t||(t=[])).push(Y.endStyle,A.to),Y.title&&!r&&(r=Y.title),Y.collapsed&&(!l||0>E(l.marker,Y))&&(l=A)):A.from>N&&v>A.from&&(v=A.from)}if(t)for(z=0;z=S)break;for(Q=Math.min(S,v);;){if(y){t=N+y.length;l||(z=t>Q?y.slice(0,Q-N):y,h.addToken(h,z,g?g+f:f,n,N+z.length==v?m:"", r,k));if(t>=Q){y=y.slice(Q-N);N=Q;break}N=t;n=""}y=x.slice(q,q=G[F++]);g=B(G[F++],h.cm.options)}}else for(l=1;lfa?n.appendChild(t("span",[u])):n.appendChild(u);a.map.push(a.pos, a.pos+g,u);a.col+=g;a.pos+=g}if(!k)break;f+=g+1;"\t"==k[0]?(k=a.cm.options.tabSize,k-=a.col%k,g=n.appendChild(t("span",F(k),"cm-tab")),g.setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),a.col+=k):("\r"==k[0]||"\n"==k[0]?(g=n.appendChild(t("span","\r"==k[0]?"\u240d":"\u2424","cm-invalidchar")),g.setAttribute("cm-text",k[0])):(g=a.cm.options.specialCharPlaceholder(k[0]),g.setAttribute("cm-text",k[0]),R&&9>fa?n.appendChild(t("span",[g])):n.appendChild(g)),a.col+=1);a.map.push(a.pos, a.pos+1,g);a.pos++}}else a.col+=b.length,n=document.createTextNode(r),a.map.push(a.pos,a.pos+b.length,n),R&&9>fa&&(m=!0),a.pos+=b.length;a.trailingSpace=32==r.charCodeAt(b.length-1);if(c||d||e||m||l)return b=c||"",d&&(b+=d),e&&(b+=e),d=t("span",[n],b,l),h&&(d.title=h),a.content.appendChild(d);a.content.appendChild(n)}}function rg(a,b){return function(c,d,e,h,l,n,r){e=e?e+" cm-force-border":"cm-force-border";for(var G=c.pos,m=G+d.length;;){for(var f=void 0,k=0;kG&&f.from<= G);k++);if(f.to>=m)return a(c,d,e,h,l,n,r);a(c,d.slice(0,f.to-G),e,h,null,n,r);h=null;d=d.slice(f.to-G);G=f.to}}}function ye(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e);!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id));e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e));a.pos+=b;a.trailingSpace=!1}function ze(a,b,c){for(var d=this.line=b,e;d=Wa(d,!1);)d=d.find(1,!0).line,(e|| (e=[])).push(d);this.size=(this.rest=e)?T(g(this.rest))-c+1:1;this.node=this.text=null;this.hidden=Ea(a,b)}function gd(a,b,c){var d=[],e;for(e=b;efa&&(a.node.style.zIndex=2));return a.node}function Be(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):fd(a,b)}function Kd(a,b){var c=b.bgClass?b.bgClass+" "+(b.line.bgClass||""):b.line.bgClass;c&&(c+=" CodeMirror-linebackground");if(b.background)c?b.background.className= c:(b.background.parentNode.removeChild(b.background),b.background=null);else if(c){var d=sc(b);b.background=d.insertBefore(t("div",null,c),d.firstChild);a.display.input.setUneditable(b.background)}b.line.wrapClass?sc(b).className=b.line.wrapClass:b.node!=b.text&&(b.node.className="");b.text.className=(b.textClass?b.textClass+" "+(b.line.textClass||""):b.line.textClass)||""}function Ce(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);b.gutterBackground&&(b.node.removeChild(b.gutterBackground), b.gutterBackground=null);if(b.line.gutterClass){var e=sc(b);b.gutterBackground=t("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px");a.display.input.setUneditable(b.gutterBackground);e.insertBefore(b.gutterBackground,b.text)}e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var h=sc(b),l=b.gutter=t("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+ "px");a.display.input.setUneditable(l);h.insertBefore(l,b.text);b.line.gutterClass&&(l.className+=" "+b.line.gutterClass);!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=l.appendChild(t("div",hc(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px")));if(e)for(b=0;bc)return{map:a.measure.maps[b],cache:a.measure.caches[b],before:!0}}function Nd(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bg;g++){for(;n&&ea(b.line.text.charAt(l.coverStart+n));)--n;for(;l.coverStart+ rfa&&0==n&&r==l.coverEnd-l.coverStart)var u=d.parentNode.getBoundingClientRect();else{u=qc(d,n,r).getClientRects();r=Ie;if("left"==f)for(m=0;mfa&&((g=!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI)||(null!=Pd?g=Pd:(f=C(a.display.measure,t("span","x")), g=f.getBoundingClientRect(),f=qc(f,0,1).getBoundingClientRect(),g=Pd=1fa)||n||u&&(u.left||u.right)||(u=(u=d.parentNode.getClientRects()[0])?{left:u.left,right:u.left+uc(a.display), top:u.top,bottom:u.bottom}:Ie);d=u.top-b.rect.top;n=u.bottom-b.rect.top;g=(d+n)/2;f=b.view.measure.heights;for(l=0;lb)h=r-n,e=h-1,b>=r&&(l="right");if(null!=e){d=a[m+2];n==r&&c==(d.insertLeft?"left":"right")&&(l=c);if("left"==c&&0==e)for(;m&&a[m-2]==a[m-3]&&a[m-1].insertLeft;)d=a[(m-=3)+2],l="left";if("right"==c&&e==r-n)for(;m=d.text.length?(m=d.text.length,b="before"):0>=m&&(m=0,b="after");if(!r)return l("before"==b?m-1:m,"before"==b);var f=Xa(r,m,b),k=lc;f=n(m,f,"before"== b);null!=k&&(f.other=n(m,k,"before"!=b));return f}function Oe(a,b){var c=0;b=M(a.doc,b);a.options.lineWrapping||(c=uc(a.display)*b.ch);var d=A(a.doc,b.line),e=Ia(d)+a.display.lineSpace.offsetTop;return{left:c,right:c,top:e,bottom:e+d.height}}function Sd(a,b,c,d,e){a=z(a,b,c);a.xRel=e;d&&(a.outside=!0);return a}function Td(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return Sd(d.first,0,null,!0,-1);var e=bb(d,c),h=d.first+d.size-1;if(e>h)return Sd(d.first+d.size-1,A(d,h).text.length,null,!0,1); 0>b&&(b=0);for(d=A(d,e);;)if(e=vg(a,d,e,b,c),h=(d=Wa(d,!1))&&d.find(0,!0),d&&(e.ch>h.from.ch||e.ch==h.from.ch&&0d},e,b);return{begin:e,end:b}}function Qe(a,b,c,d){c||(c=xb(a,b));d=jd(a,b,Ra(a,c,d),"line").top;return Pe(a,b,c,d)}function Ud(a,b,c,d){return a.bottom<=c?!1:a.top>c?!0:(d?a.left:a.right)>b}function vg(a,b,c, d,e){e-=Ia(b);var h=xb(a,b),l=Qd(b),n=0,r=b.text.length,m=!0,f=Na(b,a.doc.direction);f&&(f=(a.options.lineWrapping?wg:xg)(a,b,c,h,f,d,e),n=(m=1!=f.level)?f.from:f.to-1,r=m?f.to:f.from-1);var k=null,g=null;f=ma(function(b){var c=Ra(a,h,b);c.top+=l;c.bottom+=l;if(!Ud(c,d,e,!1))return!1;c.top<=e&&c.left<=d&&(k=b,g=c);return!0},n,r);var u=!1;g?(n=d-g.left=u.bottom);f=ab(b.text,f,1);return Sd(c,f,m,u,d-n)}function xg(a,b,c,d,e,h,l){var n=ma(function(n){n=e[n];var r=1!=n.level;return Ud(Sa(a,z(c,r?n.to:n.from,r?"before":"after"),"line",b,d),h,l,!0)},0,e.length-1),r=e[n];if(0l&&(r=e[n-1])}return r}function wg(a,b,c,d,e,h,l){l=Pe(a,b,d,l);c=l.begin;l=l.end;/\s/.test(b.text.charAt(l- 1))&&l--;for(var n=b=null,r=0;r=l||m.to<=c)){var f=Ra(a,d,1!=m.level?Math.min(l,m.to)-1:Math.max(c,m.from)).right;f=ff)b=m,n=f}}b||(b=e[e.length-1]);b.froml&&(b={from:b.from,to:l,level:b.level});return b}function yb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==zb){zb=t("pre");for(var b=0;49>b;++b)zb.appendChild(document.createTextNode("x")),zb.appendChild(t("br"));zb.appendChild(document.createTextNode("x"))}C(a.measure, zb);b=zb.offsetHeight/50;3=a.display.viewTo)return null;b-=a.display.viewFrom;if(0>b)return null;for(var c=a.display.view,d=0;db)return d}function wc(a){a.display.input.showSelection(a.display.input.prepareSelection())}function Se(a,b){void 0===b&&(b=!0);for(var c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),h=d.selection=document.createDocumentFragment(),l=0;l=a.display.viewTo||n.to().lineb&&(b=0);b=Math.round(b);c=Math.round(c);n.appendChild(t("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px;\n top: "+b+"px; width: "+(null==d?f-a:d)+"px;\n height: "+(c-b)+"px"))}function e(b,c,e){function h(d, c){return Rd(a,z(b,d),"div",r,c)}function n(b,d,c){b=Qe(a,r,null,b);d="ltr"==d==("after"==c)?"left":"right";c="after"==c?b.begin:b.end-(/\s/.test(r.text.charAt(b.end-1))?2:1);return h(c,d)[d]}var r=A(l,b),g=r.text.length,G,u,p=Na(r,l.direction);Ed(p,c||0,null==e?g:e,function(a,b,l,r){var ba="ltr"==l,E=h(a,ba?"left":"right"),x=h(b-1,ba?"right":"left"),N=null==c&&0==a,q=null==e&&b==g,Dd=0==r;r=!p||r==p.length-1;3>=x.top-E.top?(b=(k?N:q)&&Dd?m:(ba?E:x).left,d(b,E.top,((k?q:N)&&r?f:(ba?x:E).right)-b, E.bottom)):(ba?(ba=k&&N&&Dd?m:E.left,N=k?f:n(a,l,"before"),a=k?m:n(b,l,"after"),q=k&&q&&r?f:x.right):(ba=k?n(a,l,"before"):m,N=!k&&N&&Dd?f:E.right,a=!k&&q&&r?m:x.left,q=k?n(b,l,"after"):f),d(ba,E.top,N-ba,E.bottom),E.bottomkd(E,G))G=E;0>kd(x,G)&&(G=x);if(!u||0>kd(E,u))u=E;0>kd(x,u)&&(u=x)});return{start:G,end:u}}var h=a.display,l=a.doc,n=document.createDocumentFragment(),r=Fe(a.display),m=r.left,f=Math.max(h.sizerWidth,vb(a)-h.sizer.offsetLeft)- r.right,k="ltr"==l.direction;h=b.from();b=b.to();if(h.line==b.line)e(h.line,h.ch,b.ch);else{var g=A(l,h.line);r=A(l,b.line);r=Da(g)==Da(r);h=e(h.line,h.ch,r?g.text.length+1:null).end;b=e(b.line,r?0:null,b.ch).start;r&&(h.topa.options.cursorBlinkRate&&(b.cursorDiv.style.visibility="hidden")}}function Ue(a){a.state.focused||(a.display.input.focus(),Yd(a))}function Ve(a){a.state.delayingBlurEvent=!0;setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,xc(a))},100)}function Yd(a,b){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1);"nocursor"!= a.options.readOnly&&(a.state.focused||(ca(a,"focus",a,b),a.state.focused=!0,J(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),va&&setTimeout(function(){return a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Xd(a))}function xc(a,b){a.state.delayingBlurEvent||(a.state.focused&&(ca(a,"blur",a,b),a.state.focused=!1,Bb(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused|| (a.display.shift=!1)},150))}function ld(a){a=a.display;for(var b=a.lineDiv.offsetTop,c=0;cfa){var e=d.node.offsetTop+d.node.offsetHeight;var h=e-b;b=e}else h=d.node.getBoundingClientRect(),h=h.bottom-h.top;e=d.line.height-h;2>h&&(h=yb(a));if(.005e)if(Y(d.line,h),We(d.line),d.rest)for(h=0;h=e&&(d=bb(b,Ia(A(b,c))-a.wrapper.clientHeight),e=c)}return{from:d,to:Math.max(e,d+1)}}function Xe(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&& a.options.fixedGutter){for(var d=Vd(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,h=d+"px",l=0;lb.top&&(b.top=0);var e=a.curOp&&null!= a.curOp.scrollTop?a.curOp.scrollTop:c.scroller.scrollTop,h=Md(a),l={};b.bottom-b.top>h&&(b.bottom=b.top+h);var n=a.doc.height+Ld(c),r=b.topn-d;b.tope+h&&(h=Math.min(b.top,(d?n:b.bottom)-h),h!=e&&(l.scrollTop=h));e=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:c.scroller.scrollLeft;c=vb(a)-(a.options.fixedGutter?c.gutters.offsetWidth:0);if(h=b.right-b.left>c)b.right=b.left+c;10>b.left?l.scrollLeft=0:b.leftc+e-3&&(l.scrollLeft=b.right+(h?0:10)-c);return l}function md(a,b){null!=b&&(nd(a),a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+b)}function Vb(a){nd(a);var b=a.getCursor();a.curOp.scrollToPos={from:b,to:b,margin:a.options.cursorScrollMargin}}function yc(a,b,c){null==b&&null==c||nd(a);null!=b&&(a.curOp.scrollLeft=b);null!=c&&(a.curOp.scrollTop=c)}function nd(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=Oe(a,b.from),d=Oe(a,b.to);Ze(a, c,d,b.margin)}}function Ze(a,b,c,d){b=ae(a,{left:Math.min(b.left,c.left),top:Math.min(b.top,c.top)-d,right:Math.max(b.right,c.right),bottom:Math.max(b.bottom,c.bottom)+d});yc(a,b.scrollLeft,b.scrollTop)}function zc(a,b){2>Math.abs(a.doc.scrollTop-b)||(hb||be(a,{top:b}),$e(a,b,!0),hb&&be(a),Ac(a,100))}function $e(a,b,c){b=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,b);if(a.display.scroller.scrollTop!=b||c)a.doc.scrollTop=b,a.display.scrollbars.setScrollTop(b),a.display.scroller.scrollTop!= b&&(a.display.scroller.scrollTop=b)}function Cb(a,b,c,d){b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth);(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))&&!d||(a.doc.scrollLeft=b,Xe(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function Bc(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Ld(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth, clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Za(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function Wb(a,b){b||(b=Bc(a));var c=a.display.barWidth,d=a.display.barHeight;af(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&ld(a),af(a,Bc(a)),c=a.display.barWidth,d=a.display.barHeight}function af(a,b){var c=a.display,d=c.scrollbars.update(b); c.sizer.style.paddingRight=(c.barWidth=d.right)+"px";c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px";c.heightForcer.style.borderBottom=d.bottom+"px solid transparent";d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="";d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+ "px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function bf(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&Bb(a.display.wrapper,a.display.scrollbars.addClass));a.display.scrollbars=new cf[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller);L(b,"mousedown",function(){a.state.focused&&setTimeout(function(){return a.display.input.focus()},0)});b.setAttribute("cm-not-content","true")}, function(b,c){"horizontal"==c?Cb(a,b):zc(a,b)},a);a.display.scrollbars.addClass&&J(a.display.wrapper,a.display.scrollbars.addClass)}function Db(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++zg};a=a.curOp;Ub?Ub.ops.push(a):a.ownsGroup=Ub={ops:[a],delayedCallbacks:[]}}function Eb(a){sg(a.curOp, function(a){for(var b=0;b=h.viewTo)||h.maxLineChanged&&e.options.lineWrapping;d.update=d.mustUpdate&&new od(e,d.mustUpdate&&{top:d.scrollTop,ensure:d.scrollToPos},d.forceUpdate)}for(b=0;bk;k++){var g=!1;n=Sa(e,r);var u=m&&m!=r?Sa(e,m):n;n={left:Math.min(n.left, u.left),top:Math.min(n.top,u.top)-f,right:Math.max(n.left,u.left),bottom:Math.max(n.bottom,u.bottom)+f};u=ae(e,n);var p=e.doc.scrollTop,E=e.doc.scrollLeft;null!=u.scrollTop&&(zc(e,u.scrollTop),1m.top+k.top?r=!0:m.bottom+k.top>(window.innerHeight||document.documentElement.clientHeight)&& (r=!1),null==r||Ag||(m=t("div","\u200b",null,"position: absolute;\n top: "+(m.top-f.viewOffset-e.display.lineSpace.offsetTop)+"px;\n height: "+(m.bottom-m.top+Za(e)+f.barHeight)+"px;\n left: "+m.left+"px; width: "+Math.max(2,m.right-m.left)+"px;"),e.display.lineSpace.appendChild(m),m.scrollIntoView(r),e.display.lineSpace.removeChild(m)))}m=d.maybeHiddenMarkers;r=d.maybeUnhiddenMarkers;if(m)for(f=0;fb)&&(e.updateLineNumbers=b);a.curOp.viewChanged=!0;if(b>=e.viewTo)ib&&Aa(a.doc,b)e.viewFrom?lb(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)lb(a);else if(b<=e.viewFrom){var h=pd(a,c,c+d,1);h?(e.view=e.view.slice(h.index),e.viewFrom=h.lineN,e.viewTo+=d):lb(a)}else if(c>=e.viewTo)(h=pd(a,b,b,-1))?(e.view=e.view.slice(0,h.index),e.viewTo=h.lineN):lb(a);else{h=pd(a,b,b,-1);var l=pd(a,c,c+d,1);h&&l?(e.view=e.view.slice(0,h.index).concat(gd(a,h.lineN,l.lineN)).concat(e.view.slice(l.index)),e.viewTo+=d):lb(a)}if(a=e.externalMeasured)c=e.lineN&&b=d.viewTo||(a=d.view[wb(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==H(a,c)&&a.push(c)))}function lb(a){a.display.viewFrom=a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function pd(a,b,c,d){var e=wb(a,b),h=a.display.view;if(!ib||c==a.doc.first+a.doc.size)return{index:e, lineN:c};for(var l=a.display.viewFrom,n=0;nd?0:h.length-1))return null;c+=d*h[e-(0>d?1:0)].size;e+=d}return{index:e,lineN:c}}function ef(a){a=a.display.view;for(var b=0,c=0;c= a.display.viewTo)){var c=+new Date+a.options.workTime,d=Ja(a,b.highlightFrontier),e=[];b.iter(d.line,Math.min(b.first+b.size,a.display.viewTo+500),function(h){if(d.line>=a.display.viewFrom){var l=h.styles,n=h.text.length>a.options.maxHighlightLength?db(b.mode,d.state):null,r=oc(a,h,d,!0);n&&(d.state=n);h.styles=r.styles;n=h.styleClasses;(r=r.classes)?h.styleClasses=r:n&&(h.styleClasses=null);r=!l||l.length!=h.styles.length||n!=r&&(!n||!r||n.bgClass!=r.bgClass||n.textClass!=r.textClass);for(n=0;!r&& nc)return Ac(a,a.options.workDelay),!0});b.highlightFrontier=d.line;b.modeFrontier=Math.max(b.modeFrontier,d.line);e.length&&Ga(a,function(){for(var b=0;b=c.viewFrom&& b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==ef(a))return!1;Ye(a)&&(lb(a),b.dims=Od(a));var e=d.first+d.size,h=Math.max(b.visible.from-a.options.viewportMargin,d.first),l=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFromh-c.viewFrom&&(h=Math.max(d.first,c.viewFrom));c.viewTo>l&&20>c.viewTo-l&&(l=Math.min(e,c.viewTo));ib&&(h=Aa(a.doc,h),l=Zc(a.doc,l));d=h!=c.viewFrom||l!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight|| c.lastWrapWidth!=b.wrapperWidth;e=a.display;0==e.view.length||h>=e.viewTo||l<=e.viewFrom?(e.view=gd(a,h,l),e.viewFrom=h):(e.viewFrom>h?e.view=gd(a,h,e.viewFrom).concat(e.view):e.viewFroml&&(e.view=e.view.slice(0,wb(a,l))));e.viewTo=l;c.viewOffset=Ia(A(a.doc,c.viewFrom));a.display.mover.style.top=c.viewOffset+"px";l=ef(a);if(!d&&0==l&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers|| c.updateLineNumbers>=c.viewTo))return!1;a.hasFocus()?h=null:(h=D())&&v(a.display.lineDiv,h)?(h={activeElt:h},window.getSelection&&(e=window.getSelection(),e.anchorNode&&e.extend&&v(a.display.lineDiv,e.anchorNode)&&(h.anchorNode=e.anchorNode,h.anchorOffset=e.anchorOffset,h.focusNode=e.focusNode,h.focusOffset=e.focusOffset))):h=null;4=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!ce(a,b))break;ld(a);d=Bc(a);wc(a);Wb(a,d);de(a,d);b.force=!1}b.signal(a,"update",a);if(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom= a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo}function be(a,b){var c=new od(a,b);if(ce(a,c)){ld(a);df(a,c);var d=Bc(a);wc(a);Wb(a,d);de(a,d);c.finish()}}function Cg(a,b,c){function d(b){var d=b.nextSibling;va&&Qa&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b);return d}var e=a.display,h=a.options.lineNumbers,l=e.lineDiv,n=l.firstChild,r=e.view;e=e.viewFrom;for(var m=0;mh.clientWidth,n=h.scrollHeight>h.clientHeight;if(d&&l||c&&n){if(c&&Qa&&va){l=b.target;var r=e.view;a:for(;l!=h;l=l.parentNode)for(var m= 0;mn?l=Math.max(0,l+n-50):r=Math.min(a.doc.height,r+n+50),be(a,{top:l,bottom:r})),20>qd&&(null==e.wheelStartX?(e.wheelStartX=h.scrollLeft,e.wheelStartY=h.scrollTop,e.wheelDX=d,e.wheelDY=c,setTimeout(function(){if(null!=e.wheelStartX){var a=h.scrollLeft-e.wheelStartX,b=h.scrollTop-e.wheelStartY;a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/ e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(Ka=(Ka*qd+a)/(qd+1),++qd)}},200)):(e.wheelDX+=d,e.wheelDY+=c))):(c&&n&&zc(a,Math.max(0,h.scrollTop+c*Ka)),Cb(a,Math.max(0,h.scrollLeft+d*Ka)),(!c||c&&n)&&qa(b),e.wheelStartX=null)}}function Ua(a,b){var c=a[b];a.sort(function(a,b){return K(a.from(),b.from())});b=H(a,c);for(c=1;cK(a,b.from))return a;if(0>=K(a,b.to))return nb(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;a.line==b.to.line&&(d+=nb(b).ch-b.to.ch);return z(c,d)}function fe(a,b){for(var c=[],d=0;dh-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0))){if(e.lastOp==d){pf(e.done);var n=g(e.done)}else e.done.length&&!g(e.done).ranges?n=g(e.done):1e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift();e.done.push(c);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=h;e.lastOp=e.lastSelOp=d;e.lastOrigin=e.lastSelOrigin=b.origin;r||ca(a,"historyAdded")}function sd(a,b){var c=g(b);c&&c.ranges&&c.equals(a)||b.push(a)}function of(a,b,c,d){var e=b["spans_"+a.id],h=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(d){d.markedSpans&&((e||(e=b["spans_"+a.id]={}))[h]=d.markedSpans);++h})}function Fg(a){if(!a)return null; for(var b,c=0;cK(b,a),d!=0>K(c,a)?(a=b,b=c):d!=0>K(b,c)&&(b=c)),new V(a,b)):new V(c||b,b)}function td(a,b,c,d,e){null==e&&(e=a.cm&&(a.cm.display.shift|| a.extend));ua(a,new La([je(a.sel.primary(),b,c,e)],0),d)}function sf(a,b,c){for(var d=[],e=a.cm&&(a.cm.display.shift||a.extend),h=0;hK(b.primary().head,a.sel.primary().head)?-1:1);uf(a,vf(a,b,d,!0));c&&!1===c.scroll||!a.cm||Vb(a.cm)}function uf(a,b){b.equals(a.sel)||(a.sel=b,a.cm&& (a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,mc(a.cm)),ta(a,"cursorActivity",a))}function wf(a){uf(a,vf(a,a.sel,null,!1))}function vf(a,b,c,d){for(var e,h=0;h=b.ch:n.to>b.ch))){if(e&&(ca(r,"beforeCursorEnter"),r.explicitlyCleared))if(h.markedSpans){--l;continue}else break;if(r.atomic){if(c){l=r.find(0>d?1:-1);n=void 0;if(0>d?r.inclusiveRight:r.inclusiveLeft)l=xf(a,l,-d,l&&l.line==b.line?h:null);if(l&&l.line==b.line&&(n=K(l,c))&&(0>d?0>n:0d?-1:1);if(0>d?r.inclusiveLeft:r.inclusiveRight)c=xf(a, c,d,c.line==b.line?h:null);return c?Zb(a,c,b,d,e):null}}}return b}function le(a,b,c,d,e){d=d||1;b=Zb(a,b,c,d,e)||!e&&Zb(a,b,c,d,!0)||Zb(a,b,c,-d,e)||!e&&Zb(a,b,c,-d,!0);return b?b:(a.cantEdit=!0,z(a.first,0))}function xf(a,b,c,d){return 0>c&&0==b.ch?b.line>a.first?M(a,z(b.line-1)):null:0a.lastLine())){if(b.from.linee&&(b={from:b.from,to:z(e,A(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=S(a,b.from,b.to);c|| (c=fe(a,b));a.cm?Hg(a.cm,b,d):he(a,b,d);ud(a,c,$a)}}function Hg(a,b,c){var d=a.doc,e=a.display,h=b.from,l=b.to,n=!1,r=h.line;a.options.lineWrapping||(r=T(Da(A(d,h.line))),d.iter(r,l.line+1,function(a){if(a==e.maxLine)return n=!0}));-1e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,n=!1)}),n&&(a.curOp.updateMaxLine=!0));Id(d,h.line);Ac(a,400);c=b.text.length- (l.line-h.line)-1;b.full?Ba(a):h.line!=l.line||1!=b.text.length||lf(a.doc,b)?Ba(a,h.line,l.line+1,c):mb(a,h.line,"text");c=wa(a,"changes");if((d=wa(a,"change"))||c)b={from:h,to:l,text:b.text,removed:b.removed,origin:b.origin},d&&ta(a,"change",a,b),c&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b);a.display.selForContextMenu=null}function ac(a,b,c,d,e){d||(d=c);if(0>K(d,c)){var h=[d,c];c=h[0];d=h[1];h}"string"==typeof b&&(b=a.splitLines(b));$b(a,{from:c,to:d,text:b,origin:e})}function Ef(a, b,c,d){c=K(h.from,g(d).to);){var l=d.pop();if(0>K(l.from,h.from)){h.from=l.from;break}}d.push(h)}Ga(a,function(){for(var b=d.length-1;0<=b;b--)ac(a.doc,"",d[b].from,d[b].to,"+delete");Vb(a)})}function me(a,b,c){b=ab(a.text,b+c, c);return 0>b||b>a.text.length?null:b}function ne(a,b,c){a=me(a,b.ch,c);return null==a?null:new z(b.line,a,0>c?"after":"before")}function oe(a,b,c,d,e){if(a&&(a=Na(c,b.doc.direction))){a=0>e?g(a):a[0];var h=0>e==(1==a.level)?"after":"before";if(0e?c.text.length-1:0;var r=Ra(b,l,n).top;n=ma(function(a){return Ra(b,l,a).top==r},0>e==(1==a.level)?a.from:a.to-1,n);"before"==h&&(n=me(c,n,1))}else n=0>e?a.to:a.from;return new z(d,n,h)}return new z(d, 0>e?c.text.length:0,0>e?"before":"after")}function Qg(a,b,c,d){var e=Na(b,a.doc.direction);if(!e)return ne(b,c,d);c.ch>=b.text.length?(c.ch=b.text.length,c.sticky="before"):0>=c.ch&&(c.ch=0,c.sticky="after");var h=Xa(e,c.ch,c.sticky),l=e[h];if("ltr"==a.doc.direction&&0==l.level%2&&(0c.ch:l.fromd,g=n(c,k?1:-1);if(null!=g&&(k?g<=l.to&&g<=f.end:g>=l.from&&g>=f.begin))return new z(c.line,g,k?"before":"after")}l=function(a,b,d){for(var h=function(a,b){return b?new z(c.line,n(a,1),"before"):new z(c.line,a,"after")};0<=a&&afa&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var c=Sf(this,a);Ta&&(pe=c?b:null,!c&&88==b&&!Tg&&(Qa?a.metaKey:a.ctrlKey)&&this.replaceSelection("",null,"cut"));18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||Ug(this)}}function Ug(a){function b(a){18!=a.keyCode&&a.altKey||(Bb(c,"CodeMirror-crosshair"),ja(document,"keyup",b),ja(document,"mouseover",b))}var c=a.display.lineDiv; J(c,"CodeMirror-crosshair");L(document,"keyup",b);L(document,"mouseover",b)}function Uf(a){16==a.keyCode&&(this.doc.sel.shift=!1);ka(this,a)}function Vf(a){if(!(fb(this.display,a)||ka(this,a)||a.ctrlKey&&!a.altKey||Qa&&a.metaKey)){var b=a.keyCode,c=a.charCode;if(Ta&&b==pe)pe=null,qa(a);else if(!Ta||a.which&&!(10>a.which)||!Sf(this,a))if(b=String.fromCharCode(null==c?b:c),"\b"!=b&&!Sg(this,a,b))this.display.input.onKeyPress(a)}}function Vg(a,b){var c=+new Date;if(Mc&&Mc.compare(c,a,b))return Nc=Mc= null,"triple";if(Nc&&Nc.compare(c,a,b))return Mc=new qe(c,a,b),Nc=null,"double";Nc=new qe(c,a,b);Mc=null;return"single"}function Wf(a){var b=this.display;if(!(ka(this,a)||b.activeTouch&&b.input.supportsTouch()))if(b.input.ensurePolled(),b.shift=a.shiftKey,fb(b,a))va||(b.scroller.draggable=!1,setTimeout(function(){return b.scroller.draggable=!0},100));else if(!zd(this,a,"gutterClick",!0)){var c=Ab(this,a),d=tb(a),e=c?Vg(c,d):"single";window.focus();1==d&&this.state.selectingText&&this.state.selectingText(a); c&&Wg(this,d,c,e,a)||(1==d?c?Xg(this,c,e,a):(a.target||a.srcElement)==b.scroller&&qa(a):2==d?(c&&td(this.doc,c),setTimeout(function(){return b.input.focus()},20)):3==d&&(re?Xf(this,a):Ve(this)))}}function Wg(a,b,c,d,e){var h="Click";"double"==d?h="Double"+h:"triple"==d&&(h="Triple"+h);return Lc(a,Mf((1==b?"Left":2==b?"Middle":"Right")+h,e),e,function(b){"string"==typeof b&&(b=Kc[b]);if(!b)return!1;var d=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),d=b(a,c)!=yd}finally{a.state.suppressEdits=!1}return d})} function Xg(a,b,c,d){R?setTimeout(W(Ue,a),0):a.curOp.focus=D();var e=a.getOption("configureMouse");e=e?e(a,c,d):{};null==e.unit&&(e.unit=(Yg?d.shiftKey&&d.metaKey:d.altKey)?"rectangle":"single"==c?"char":"double"==c?"word":"line");if(null==e.extend||a.doc.extend)e.extend=a.doc.extend||d.shiftKey;null==e.addNew&&(e.addNew=Qa?d.metaKey:d.ctrlKey);null==e.moveOnDrag&&(e.moveOnDrag=!(Qa?d.altKey:d.ctrlKey));var h=a.doc.sel,l;a.options.dragDrop&&Zg&&!a.isReadOnly()&&"single"==c&&-1<(l=h.contains(b))&& (0>K((l=h.ranges[l]).from(),b)||0b.xRel)?$g(a,d,b,e):ah(a,d,b,e)}function $g(a,b,c,d){var e=a.display,h=!1,l=ra(a,function(b){va&&(e.scroller.draggable=!1);a.state.draggingText=!1;ja(document,"mouseup",l);ja(document,"mousemove",n);ja(e.scroller,"dragstart",r);ja(e.scroller,"drop",l);h||(qa(b),d.addNew||td(a.doc,c,null,null,d.extend),va||R&&9==fa?setTimeout(function(){document.body.focus();e.input.focus()},20):e.input.focus())}),n=function(a){h=h||10<=Math.abs(b.clientX- a.clientX)+Math.abs(b.clientY-a.clientY)},r=function(){return h=!0};va&&(e.scroller.draggable=!0);a.state.draggingText=l;l.copy=!d.moveOnDrag;e.scroller.dragDrop&&e.scroller.dragDrop();L(document,"mouseup",l);L(document,"mousemove",n);L(e.scroller,"dragstart",r);L(e.scroller,"drop",l);Ve(a);setTimeout(function(){return e.input.focus()},20)}function Yf(a,b,c){if("char"==c)return new V(b,b);if("word"==c)return a.findWordAt(b);if("line"==c)return new V(z(b.line,0),M(a.doc,z(b.line+1,0)));a=c(a,b);return new V(a.from, a.to)}function ah(a,b,c,d){function e(b){if(0!=K(p,b))if(p=b,"rectangle"==d.unit){var e=[],h=a.options.tabSize,l=k(A(r,c.line).text,c.ch,h),n=k(A(r,b.line).text,b.ch,h),f=Math.min(l,n);l=Math.max(l,n);n=Math.min(c.line,b.line);for(var E=Math.min(a.lastLine(),Math.max(c.line,b.line));n<=E;n++){var x=A(r,n).text,G=U(x,f,h);f==l?e.push(new V(z(n,G),z(n,G))):x.length>G&&e.push(new V(z(n,G),z(n,U(x,l,h))))}e.length||e.push(new V(c,c));ua(r,Ua(m.ranges.slice(0,g).concat(e),g),{origin:"*mouse",scroll:!1}); a.scrollIntoView(b)}else e=u,f=Yf(a,b,d.unit),b=e.anchor,0=m.to||l.lineE.bottom?20:0;f&&setTimeout(ra(a,function(){x==c&&(n.scroller.scrollTop+= f,h(b))}),50)}}function l(b){a.state.selectingText=!1;x=Infinity;qa(b);n.input.focus();ja(document,"mousemove",N);ja(document,"mouseup",q);r.history.lastSelOrigin=null}var n=a.display,r=a.doc;qa(b);var m=r.sel,f=m.ranges;if(d.addNew&&!d.extend){var g=r.sel.contains(c);var u=-1h:0=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&qa(b);d=a.display;var l=d.lineDiv.getBoundingClientRect();if(h>l.bottom||!wa(a,c))return Nb(b);h-=l.top-d.viewOffset;for(l=0;l=e)return e=bb(a.doc,h),ca(a,c,a,e,a.options.gutters[l],b),Nb(b)}}function Xf(a,b){var c;(c=fb(a.display,b))||(c=wa(a,"gutterContextMenu")?zd(a,b,"gutterContextMenu", !1):!1);if(!c&&!ka(a,b,"contextmenu"))a.display.input.onContextMenu(b)}function Zf(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");vc(a)}function Oc(a){ff(a);Ba(a);Xe(a)}function ch(a,b,c){!b!=!(c&&c!=ec)&&(c=a.display.dragFunctions,b=b?L:ja,b(a.display.scroller,"dragstart",c.start),b(a.display.scroller,"dragenter",c.enter),b(a.display.scroller,"dragover",c.over),b(a.display.scroller,"dragleave",c.leave),b(a.display.scroller, "drop",c.drop))}function dh(a){a.options.lineWrapping?(J(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Bb(a.display.wrapper,"CodeMirror-wrap"),kc(a));Wd(a);Ba(a);vc(a);setTimeout(function(){return Wb(a)},100)}function ia(a,b){var c=this;if(!(this instanceof ia))return new ia(a,b);this.options=b=b?y(b):{};y($f,b,!1);ee(b);var d=b.value;"string"==typeof d&&(d=new Ca(d,b.mode,null,b.lineSeparator,b.direction));this.doc=d;var e=new ia.inputStyles[b.inputStyle](this); e=this.display=new za(a,d,e);e.wrapper.CodeMirror=this;ff(this);Zf(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");bf(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Gb,keySeq:null,specialChars:null};b.autofocus&&!gc&&e.input.focus();R&&11>fa&&setTimeout(function(){return c.display.input.reset(!0)},20);eh(this);ag||(Mg(),ag=!0); Db(this);this.curOp.forceUpdate=!0;mf(this,d);b.autofocus&&!gc||this.hasFocus()?setTimeout(W(Yd,this),20):xc(this);for(var h in Ad)if(Ad.hasOwnProperty(h))Ad[h](c,b[h],ec);Ye(this);b.finishInit&&b.finishInit(this);for(d=0;dfa?L(d.scroller,"dblclick",ra(a,function(b){if(!ka(a,b)){var d=Ab(a,b);!d||zd(a,b,"gutterClick",!0)||fb(a.display,b)||(qa(b),b=a.findWordAt(d),td(a.doc,b.anchor,b.head))}})):L(d.scroller,"dblclick",function(b){return ka(a,b)||qa(b)});re||L(d.scroller,"contextmenu",function(b){return Xf(a,b)});var e,h={end:0};L(d.scroller,"touchstart",function(b){var c; if(c=!ka(a,b))1!=b.touches.length?c=!1:(c=b.touches[0],c=1>=c.radiusX&&1>=c.radiusY),c=!c;c&&!zd(a,b,"gutterClick",!0)&&(d.input.ensurePolled(),clearTimeout(e),c=+new Date,d.activeTouch={start:c,moved:!1,prev:300>=c-h.end?h:null},1==b.touches.length&&(d.activeTouch.left=b.touches[0].pageX,d.activeTouch.top=b.touches[0].pageY))});L(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)});L(d.scroller,"touchend",function(e){var h=d.activeTouch;if(h&&!fb(d,e)&&null!=h.left&&!h.moved&& 300>new Date-h.start){var l=a.coordsChar(d.activeTouch,"page");h=!h.prev||c(h,h.prev)?new V(l,l):!h.prev.prev||c(h,h.prev.prev)?a.findWordAt(l):new V(z(l.line,0),M(a.doc,z(l.line+1,0)));a.setSelection(h.anchor,h.head);a.focus();qa(e)}b()});L(d.scroller,"touchcancel",b);L(d.scroller,"scroll",function(){d.scroller.clientHeight&&(zc(a,d.scroller.scrollTop),Cb(a,d.scroller.scrollLeft,!0),ca(a,"scroll",a))});L(d.scroller,"mousewheel",function(b){return hf(a,b)});L(d.scroller,"DOMMouseScroll",function(b){return hf(a, b)});L(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0});d.dragFunctions={enter:function(b){ka(a,b)||sb(b)},over:function(b){if(!ka(a,b)){var d=Ab(a,b);if(d){var c=document.createDocumentFragment();Te(a,d,c);a.display.dragCursor||(a.display.dragCursor=t("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv));C(a.display.dragCursor,c)}sb(b)}},start:function(b){if(R&&(!a.state.draggingText||100> +new Date-Jf))sb(b);else if(!ka(a,b)&&!fb(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setDragImage&&!bg)){var d=t("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";Ta&&(d.width=d.height=1,a.display.wrapper.appendChild(d),d._top=d.offsetTop);b.dataTransfer.setDragImage(d,0,0);Ta&&d.parentNode.removeChild(d)}},drop:ra(a,Lg),leave:function(b){ka(a, b)||If(a)}};var l=d.input.getField();L(l,"keyup",function(b){return Uf.call(a,b)});L(l,"keydown",ra(a,Tf));L(l,"keypress",ra(a,Vf));L(l,"focus",function(b){return Yd(a,b)});L(l,"blur",function(b){return xc(a,b)})}function Pc(a,b,c,d){var e=a.doc,h;null==c&&(c="add");"smart"==c&&(e.mode.indent?h=Ja(a,b).state:c="prev");var l=a.options.tabSize,n=A(e,b),m=k(n.text,null,l);n.stateAfter&&(n.stateAfter=null);var f=n.text.match(/^\s*/)[0];if(!d&&!/\S/.test(n.text)){var g=0;c="not"}else if("smart"==c&&(g= e.mode.indent(h,n.text.slice(f.length),n.text),g==yd||150e.first?k(A(e,b-1).text,null,l):0:"add"==c?g=m+a.options.indentUnit:"subtract"==c?g=m-a.options.indentUnit:"number"==typeof c&&(g=m+c);g=Math.max(0,g);c="";d=0;if(a.options.indentWithTabs)for(a=Math.floor(g/l);a;--a)d+=l,c+="\t";d=a.first+a.size?d=!1:(b=new z(d,b.ch,b.sticky),d=m=A(a,d));if(d)b=oe(e,a.cm,m,b.line,c);else return!1}else b= h;return!0}var l=b,n=c,m=A(a,b.line);if("char"==d)h();else if("column"==d)h(!0);else if("word"==d||"group"==d){var f=null;d="group"==d;for(var g=a.cm&&a.cm.getHelper(b,"wordChars"),k=!0;!(0>c)||h(!k);k=!1){var u=m.text.charAt(b.ch)||"\n";u=Q(u,g)?"w":d&&"\n"==u?"n":!d||/\s/.test(u)?null:"p";!d||k||u||(u="s");if(f&&f!=u){0>c&&(c=1,h(),b.sticky="after");break}u&&(f=u);if(0c?0>=l:l>=e.height){b.hitSide=!0;break}l+=5*c}return b}function ig(a,b){var c=Nd(a,b.line);if(!c||c.hidden)return null;var d=A(a.doc,b.line);c=Ge(c,d,b.line);d=Na(d,a.doc.direction);var e="left";d&&(e=Xa(d,b.ch)%2?"right":"left");c=He(c.map,b.ch,e);c.offset="right"== c.collapse?c.end:c.start;return c}function fh(a){for(;a;a=a.parentNode)if(/CodeMirror-gutter-wrapper/.test(a.className))return!0;return!1}function fc(a,b){b&&(a.bad=!0);return a}function gh(a,b,c,d,e){function h(a){return function(b){return b.id==a}}function l(a){a&&(f&&(m+=g,f=!1),m+=a)}function n(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)l(c||b.textContent.replace(/\u200b/g,""));else{c=b.getAttribute("cm-marker");var r;if(c)b=a.findMarks(z(d,0),z(e+1,0),h(+c)),b.length&&(r= b[0].find(0))&&l(S(a.doc,r.from,r.to).join(g));else if("false"!=b.getAttribute("contenteditable")){(r=/^(pre|div|p)$/i.test(b.nodeName))&&f&&(m+=g,f=!1);for(c=0;ce?m.map:f[e],l=0;le?a.line:a.rest[e]);e=h[l]+c;if(0>c||n!=b)e=h[l+(c?1:0)];return z(d,e)}}}var e=a.text.firstChild,h=!1;if(!b||!v(e,b))return fc(z(T(a.line),0),!0); if(b==e&&(h=!0,b=e.childNodes[c],c=0,!b))return c=a.rest?g(a.rest):a.line,fc(z(T(c),c.text.length),h);var l=3==b.nodeType?b:null,n=b;l||1!=b.childNodes.length||3!=b.firstChild.nodeType||(l=b.firstChild,c&&(c=l.nodeValue.length));for(;n.parentNode!=e;)n=n.parentNode;var m=a.measure,f=m.maps;if(b=d(l,n,c))return fc(b,h);e=n.nextSibling;for(l=l?l.nodeValue.length-c:0;e;e=e.nextSibling){if(b=d(e,e.firstChild,0))return fc(z(b.line,b.ch-l),h);l+=e.textContent.length}for(n=n.previousSibling;n;n=n.previousSibling){if(b= d(n,n.firstChild,-1))return fc(z(b.line,b.ch+c),h);c+=n.textContent.length}}var ya=navigator.userAgent,jg=navigator.platform,hb=/gecko\/\d/i.test(ya),kg=/MSIE \d/.test(ya),lg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ya),Rc=/Edge\/(\d+)/.exec(ya),R=kg||lg||Rc,fa=R&&(kg?document.documentMode||6:+(Rc||lg)[1]),va=!Rc&&/WebKit\//.test(ya),ih=va&&/Qt\/\d+\.\d+/.test(ya),hd=!Rc&&/Chrome\//.test(ya),Ta=/Opera\//.test(ya),bg=/Apple Computer/.test(navigator.vendor),jh=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ya), Ag=/PhantomJS/.test(ya),Qc=!Rc&&/AppleWebKit/.test(ya)&&/Mobile\/\w+/.test(ya),id=/Android/.test(ya),gc=Qc||id||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ya),Qa=Qc||/Mac/.test(jg),Yg=/\bCrOS\b/.test(ya),kh=/win/i.test(jg),Hb=Ta&&ya.match(/Version\/(\d*\.\d*)/);Hb&&(Hb=Number(Hb[1]));Hb&&15<=Hb&&(Ta=!1,va=!0);var Nf=Qa&&(ih||Ta&&(null==Hb||12.11>Hb)),re=hb||R&&9<=fa,Bb=function(a,b){var c=a.className,d=q(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+ (e?d[1]+e:"")}};var qc=document.createRange?function(a,b,c,d){var e=document.createRange();e.setEnd(d||a,c);e.setStart(a,b);return e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}d.collapse(!0);d.moveEnd("character",c);d.moveStart("character",b);return d};var Sc=function(a){a.select()};Qc?Sc=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:R&&(Sc=function(a){try{a.select()}catch(b){}});var Gb=function(){this.id=null};Gb.prototype.set= function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)};var yd={toString:function(){return"CodeMirror.Pass"}},$a={scroll:!1},se={origin:"*mouse"},Tc={origin:"+move"},Yc=[""],mg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,ng=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/, Af=!1,ib=!1,lc=null,og=function(){function a(a){return 247>=a?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1785>=a?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(a- 1536):1774<=a&&2220>=a?"r":8192<=a&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,d){this.level=a;this.from=b;this.to=d}var c=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,e=/[LRr]/,h=/[Lb1n]/,l=/[1n]/;return function(n,m){var f="ltr"==m?"L":"R";if(0==n.length||"ltr"==m&&!c.test(n))return!1;for(var r=n.length,k=[],u=0;ufa)return!1;var a=t("div");return"draggable"in a||"dragDrop"in a}(),Fd,Jd,ve=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var h=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),l=h.indexOf("\r");-1!=l?(c.push(h.slice(0,l)),b+= l+1):(c.push(h),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},lh=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},Tg=function(){var a=t("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),Pd=null,Hd={},Ob={},Pb={},la=function(a,b,c){this.pos=this.start= 0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0;this.lineOracle=c};la.prototype.eol=function(){return this.pos>=this.string.length};la.prototype.sol=function(){return this.pos==this.lineStart};la.prototype.peek=function(){return this.string.charAt(this.pos)||void 0};la.prototype.next=function(){if(this.posb};la.prototype.eatSpace=function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a};la.prototype.skipToEnd=function(){this.pos=this.string.length};la.prototype.skipTo=function(a){a=this.string.indexOf(a,this.pos);if(-1this.maxLookAhead&&(this.maxLookAhead=a);return b};Ya.prototype.baseToken=function(a){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=a;)this.baseTokenPos+=2;var b=this.baseTokens[this.baseTokenPos+ 1];return{type:b&&b.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-a}};Ya.prototype.nextLine=function(){this.line++;0fa&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ib.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;c?(this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0",this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+(a.viewHeight-(b?d:0)))+"px"):(this.vert.style.display= "",this.vert.firstChild.style.height="0");b?(this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px",this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+(a.viewWidth-a.barLeft-(c?d:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0");!this.checkedZeroWidth&&0=K(a,d.to()))return c}return-1};var V=function(a,b){this.anchor=a;this.head=b};V.prototype.from=function(){return Va(this.anchor, this.head)};V.prototype.to=function(){return pa(this.anchor,this.head)};V.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};Fc.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;cthis.size- b&&(1=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5);b=new Gc(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=H(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new Gc(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10a.display.maxLineLength&&(a.display.maxLine=h,a.display.maxLineLength=l,a.display.maxLineChanged=!0);null!=c&&a&&this.collapsed&&Ba(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&wf(a.doc));a&&ta(a,"markerCleared",a,this,c,d);b&&Eb(a);this.parent&&this.parent.clear()}};ob.prototype.find=function(a,b){null== a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;eK(n.head,n.anchor),a[h]=new V(n?m:l,n?l:m)):a[h]=new V(l,l)}a=new La(a,this.sel.primIndex)}b=a;for(a=d.length-1;0<=a;a--)$b(this,d[a]);b?tf(this,b):this.cm&&Vb(this.cm)}),undo:sa(function(){vd(this, "undo")}),redo:sa(function(){vd(this,"redo")}),undoSelection:sa(function(){vd(this,"undo",!0)}),redoSelection:sa(function(){vd(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=M(this,a);b=M(this,b);var d=[],e=a.line;this.iter(a.line,b.line+1,function(h){if(h=h.markedSpans)for(var l= 0;l=m.to||null==m.from&&e!=a.line||null!=m.from&&e==b.line&&m.from>=b.ch||c&&!c(m.marker)||d.push(m.marker.parent||m.marker)}++e});return d},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;ca)return b=a,!0;a-=e;++c});return M(this, z(c,b))},indexFromPos:function(a){a=M(this,a);var b=a.ch;if(a.linea.ch)return 0;var c=this.lineSeparator().length;this.iter(this.first,a.line,function(a){b+=a.text.length+c});return b},copy:function(a){var b=new Ca(Jb(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel=this.sel;b.extend=!1;a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a|| (a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.toVc;Vc++)pb[Vc+48]=pb[Vc+96]=String(Vc);for(var Cd=65;90>=Cd;Cd++)pb[Cd]= String.fromCharCode(Cd);for(var Wc=1;12>=Wc;Wc++)pb[Wc+111]=pb[Wc+63235]="F"+Wc;var Jc={basic:{Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},pcDefault:{"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo", "Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection", "Alt-U":"redoSelection",fallthrough:"basic"},emacsy:{"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},macDefault:{"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo", "Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft", "Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]}};Jc["default"]=Qa?Jc.macDefault:Jc.pcDefault;var Kc={selectAll:yf,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),$a)},killLine:function(a){return dc(a,function(b){if(b.empty()){var c=A(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.linea.doc.first){var l=A(a.doc,e.line-1).text;l&&(e=new z(e.line,1),a.replaceRange(h.charAt(0)+a.doc.lineSeparator()+l.charAt(l.length-1),z(e.line-1,l.length-1),e,"+transpose"))}c.push(new V(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){return Ga(a,function(){for(var b=a.listSelections(),c=b.length-1;0<=c;c--)a.replaceRange(a.doc.lineSeparator(),b[c].anchor,b[c].head,"+input"); b=a.listSelections();for(c=0;ca&&0==K(b,this.pos)&&c==this.button};var Nc,Mc,ec={toString:function(){return"CodeMirror.Init"}},$f={},Ad={};ia.defaults=$f;ia.optionHandlers=Ad;var te=[];ia.defineInitHook= function(a){return te.push(a)};var Ha=null,da=function(a){this.cm=a;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new Gb;this.composing=null;this.gracePeriod=!1;this.readDOMTimeout=null};da.prototype.init=function(a){function b(a){if(!ka(e,a)){if(e.somethingSelected())Ha={lineWise:!1,text:e.getSelections()},"cut"==a.type&&e.replaceSelection("",null,"cut");else if(e.options.lineWiseCopyCut){var b=eg(e);Ha={lineWise:!0,text:b.text};"cut"==a.type&& e.operation(function(){e.setSelections(b.ranges,0,$a);e.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var c=Ha.text.join("\n");a.clipboardData.setData("Text",c);if(a.clipboardData.getData("Text")==c){a.preventDefault();return}}var l=gg();a=l.firstChild;e.display.lineSpace.insertBefore(l,e.display.lineSpace.firstChild);a.value=Ha.text.join("\n");var m=document.activeElement;Sc(a);setTimeout(function(){e.display.lineSpace.removeChild(l);m.focus();m==h&& d.showPrimarySelection()},50)}}var c=this,d=this,e=d.cm,h=d.div=a.lineDiv;fg(h,e.options.spellcheck);L(h,"paste",function(a){ka(e,a)||dg(a,e)||11>=fa&&setTimeout(ra(e,function(){return c.updateFromDOM()}),20)});L(h,"compositionstart",function(a){c.composing={data:a.data,done:!1}});L(h,"compositionupdate",function(a){c.composing||(c.composing={data:a.data,done:!1})});L(h,"compositionend",function(a){c.composing&&(a.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)});L(h,"touchstart", function(){return d.forceCompositionEnd()});L(h,"input",function(){c.composing||c.readFromDOMSoon()});L(h,"copy",b);L(h,"cut",b)};da.prototype.prepareSelection=function(){var a=Se(this.cm,!1);a.focus=this.cm.state.focused;return a};da.prototype.showSelection=function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))};da.prototype.showPrimarySelection=function(){var a=window.getSelection(),b=this.cm,c=b.doc.sel.primary(),d=c.from();c=c.to(); if(b.display.viewTo==b.display.viewFrom||d.line>=b.display.viewTo||c.line=b.display.viewFrom&&ig(b,d)||{node:e[0].measure.map[2],offset:0},c=c.linea.firstLine()&&(d=z(d.line-1,A(a.doc,d.line-1).length));e.ch==A(a.doc,e.line).text.length&&e.lineb.viewTo-1)return!1;var h;d.line==b.viewFrom||0==(h=wb(a,d.line))?(c=T(b.view[0].line),h=b.view[0].node):(c=T(b.view[h].line),h=b.view[h-1].node.nextSibling);var l=wb(a,e.line);l==b.view.length-1?(e=b.viewTo-1,b=b.lineDiv.lastChild): (e=T(b.view[l+1].line)-1,b=b.view[l+1].node.previousSibling);if(!h)return!1;b=a.doc.splitLines(gh(a,h,b,c,e));for(h=S(a.doc,z(c,0),z(e,A(a.doc,e).text.length));1d.ch&&f.charCodeAt(f.length-l-1)==k.charCodeAt(k.length-l-1);)m--,l++;b[b.length-1]=f.slice(0,f.length-l).replace(/^\u200b+/,"");b[0]=b[0].slice(m).replace(/\u200b+$/,"");d=z(c,m);c=z(e,h.length?g(h).length-l:0);if(1fa&&h.scrollbars.setScrollTop(h.scroller.scrollTop=f);if(null!=l.selectionStart){(!R||R&&9>fa)&&b();var a=0,c=function(){h.selForContextMenu==e.doc.sel&&0==l.selectionStart&&0a++?h.detectingSelectAll=setTimeout(c,500):(h.selForContextMenu= null,h.input.reset())};h.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,h=e.display,l=d.textarea,m=Ab(e,a),f=h.scroller.scrollTop;if(m&&!Ta){e.options.resetSelectionOnContextMenu&&-1==e.doc.sel.contains(m)&&ra(e,ua)(e.doc,gb(m),$a);var k=l.style.cssText,u=d.wrapper.style.cssText;d.wrapper.style.cssText="position: absolute";m=d.wrapper.getBoundingClientRect();l.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(a.clientY-m.top-5)+"px; left: "+(a.clientX-m.left-5)+ "px;\n z-index: 1000; background: "+(R?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(va)var g=window.scrollY;h.input.focus();va&&window.scrollTo(null,g);h.input.reset();e.somethingSelected()||(l.value=d.prevInput=" ");d.contextMenuPending=!0;h.selForContextMenu=e.doc.sel;clearTimeout(h.detectingSelectAll);R&&9<=fa&&b();if(re){sb(a);var p=function(){ja(window,"mouseup",p);setTimeout(c, 20)};L(window,"mouseup",p)}else setTimeout(c,50)}};oa.prototype.readOnlyChanged=function(a){a||this.reset();this.textarea.disabled="nocursor"==a};oa.prototype.setUneditable=function(){};oa.prototype.needsContentAttribute=!1;(function(a){function b(b,e,h,l){a.defaults[b]=e;h&&(c[b]=l?function(a,b,d){d!=ec&&h(a,b,d)}:h)}var c=a.optionHandlers;a.defineOption=b;a.Init=ec;b("value","",function(a,b){return a.setValue(b)},!0);b("mode",null,function(a,b){a.doc.modeOption=b;ge(a)},!0);b("indentUnit",2,ge, !0);b("indentWithTabs",!1);b("smartIndent",!0);b("tabSize",4,function(a){Cc(a);vc(a);Ba(a)},!0);b("lineSeparator",null,function(a,b){if(a.doc.lineSep=b){var c=[],d=a.doc.first;a.doc.iter(function(a){for(var e=0;;){var h=a.text.indexOf(b,e);if(-1==h)break;e=h+b.length;c.push(z(d,h))}d++});for(var e=c.length-1;0<=e;e--)ac(a.doc,b,c[e],z(c[e].line,c[e].ch+b.length))}});b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(a,b,c){a.state.specialChars=new RegExp(b.source+ (b.test("\t")?"":"|\t"),"g");c!=ec&&a.refresh()});b("specialCharPlaceholder",m,function(a){return a.refresh()},!0);b("electricChars",!0);b("inputStyle",gc?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor");},!0);b("spellcheck",!1,function(a,b){return a.getInputField().spellcheck=b},!0);b("rtlMoveVisually",!kh);b("wholeLineUpdateBefore",!0);b("theme","default",function(a){Zf(a);Oc(a)},!0);b("keyMap","default",function(a,b,c){b=wd(b);(c=c!= ec&&wd(c))&&c.detach&&c.detach(a,b);b.attach&&b.attach(a,c||null)});b("extraKeys",null);b("configureMouse",null);b("lineWrapping",!1,dh,!0);b("gutters",[],function(a){ee(a.options);Oc(a)},!0);b("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?Vd(a.display)+"px":"0";a.refresh()},!0);b("coverGutterNextToScrollbar",!1,function(a){return Wb(a)},!0);b("scrollbarStyle","native",function(a){bf(a);Wb(a);a.display.scrollbars.setScrollTop(a.doc.scrollTop);a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)}, !0);b("lineNumbers",!1,function(a){ee(a.options);Oc(a)},!0);b("firstLineNumber",1,Oc,!0);b("lineNumberFormatter",function(a){return a},Oc,!0);b("showCursorWhenSelecting",!1,wc,!0);b("resetSelectionOnContextMenu",!0);b("lineWiseCopyCut",!0);b("pasteLinesPerSelection",!0);b("readOnly",!1,function(a,b){"nocursor"==b&&(xc(a),a.display.input.blur());a.display.input.readOnlyChanged(b)});b("disableInput",!1,function(a,b){b||a.display.input.reset()},!0);b("dragDrop",!0,ch);b("allowDropFileTypes",null);b("cursorBlinkRate", 530);b("cursorScrollMargin",0);b("cursorHeight",1,wc,!0);b("singleCursorHeightPerLine",!0,wc,!0);b("workTime",100);b("workDelay",100);b("flattenSpans",!0,Cc,!0);b("addModeClass",!1,Cc,!0);b("pollInterval",100);b("undoDepth",200,function(a,b){return a.doc.history.undoDepth=b});b("historyEventDelay",1250);b("viewportMargin",10,function(a){return a.refresh()},!0);b("maxHighlightLength",1E4,Cc,!0);b("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()});b("tabindex",null,function(a, b){return a.display.input.getField().tabIndex=b||""});b("autofocus",null);b("direction","ltr",function(a,b){return a.doc.setDirection(b)},!0)})(ia);(function(a){var b=a.optionHandlers,c=a.helpers={};a.prototype={constructor:a,focus:function(){window.focus();this.display.input.focus()},setOption:function(a,c){var d=this.options,e=d[a];if(d[a]!=c||"mode"==a)d[a]=c,b.hasOwnProperty(a)&&ra(this,b[a])(this,c,e),ca(this,"optionChange",this,a)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc}, addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](wd(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cc&&(Pc(this,m.head.line,a,!0),c=m.head.line,d==this.doc.sel.primIndex&& Vb(this));else{var f=m.from();m=m.to();var k=Math.max(c,f.line);c=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(m=k;m>1;if((m? b[2*m-1]:0)>=a)d=m;else if(b[2*m+1]c?b:0==c?null:b.slice(0,c-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var d=[];if(!c.hasOwnProperty(b))return d;var e=c[b],m=this.getModeAt(a);if("string"==typeof m[b])e[m[b]]&&d.push(e[m[b]]);else if(m[b])for(var f=0;fe&&(a=e,d=!0);a=A(this.doc,a)}return jd(this,a,{top:0,left:0},b||"page",c||d).top+(d?this.doc.height-Ia(a):0)}, defaultTextHeight:function(){return yb(this.display)},defaultCharWidth:function(){return uc(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,l,m){var d=this.display;a=Sa(this,M(this.doc,a));var e=a.bottom,h=a.left;b.style.position="absolute";b.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(b);d.sizer.appendChild(b);if("over"==l)e=a.top;else if("above"==l||"near"==l){var f=Math.max(d.wrapper.clientHeight, this.doc.height),n=Math.max(d.sizer.clientWidth,d.lineSpace.clientWidth);("above"==l||a.bottom+b.offsetHeight>f)&&a.top>b.offsetHeight?e=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=f&&(e=a.bottom);h+b.offsetWidth>n&&(h=n-b.offsetWidth)}b.style.top=e+"px";b.style.left=b.style.right="";"right"==m?(h=d.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==m?h=0:"middle"==m&&(h=(d.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px");c&&(a=ae(this,{left:h,top:e,right:h+b.offsetWidth,bottom:e+ b.offsetHeight}),null!=a.scrollTop&&zc(this,a.scrollTop),null!=a.scrollLeft&&Cb(this,a.scrollLeft))},triggerOnKeyDown:xa(Tf),triggerOnKeyPress:xa(Vf),triggerOnKeyUp:Uf,triggerOnMouseDown:xa(Wf),execCommand:function(a){if(Kc.hasOwnProperty(a))return Kc[a].call(null,this)},triggerElectric:xa(function(a){cg(this,a)}),findPosH:function(a,b,c,l){var d=1;0>b&&(d=-1,b=-b);a=M(this.doc,a);for(var e=0;ea?d.from():d.to()},Tc)}),deleteH:xa(function(a,b){var c=this.doc;this.doc.sel.somethingSelected()?c.replaceSelection("",null,"+delete"):dc(this,function(d){var e=we(c,d.head,a,b,!1);return 0>a?{from:e,to:d.head}:{from:d.head,to:e}})}),findPosV:function(a,b,c,l){var d=1;0>b&&(d=-1,b=-b);var e=M(this.doc,a);for(a=0;aa?h.from():h.to();var l=Sa(c,h.head,"div");null!=h.goalColumn&&(l.left=h.goalColumn);e.push(l.left);var f=hg(c,l,a,b);"page"==b&&h==d.sel.primary()&&md(c,Rd(c,f,"div").top-l.top);return f},Tc);if(e.length)for(var f=0;fH(nh,Xc)&&(ia.prototype[Xc]=function(a){return function(){return a.apply(this.doc,arguments)}}(Ca.prototype[Xc])); Fa(Ca);ia.inputStyles={textarea:oa,contenteditable:da};ia.defineMode=function(a){ia.defaults.mode||"null"==a||(ia.defaults.mode=a);Gd.apply(this,arguments)};ia.defineMIME=function(a,b){Ob[a]=b};ia.defineMode("null",function(){return{token:function(a){return a.skipToEnd()}}});ia.defineMIME("text/plain","null");ia.defineExtension=function(a,b){ia.prototype[a]=b};ia.defineDocExtension=function(a,b){Ca.prototype[a]=b};ia.fromTextArea=function(a,b){function c(){a.value=m.getValue()}b=b?y(b):{};b.value= a.value;!b.tabindex&&a.tabIndex&&(b.tabindex=a.tabIndex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var d=D();b.autofocus=d==a||null!=a.getAttribute("autofocus")&&d==document.body}if(a.form&&(L(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var e=a.form;var h=e.submit;try{var l=e.submit=function(){c();e.submit=h;e.submit();e.submit=l}}catch(r){}}b.finishInit=function(b){b.save=c;b.getTextArea=function(){return a};b.toTextArea=function(){b.toTextArea=isNaN;c(); a.parentNode.removeChild(b.getWrapperElement());a.style.display="";a.form&&(ja(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=h))}};a.style.display="none";var m=ia(function(b){return a.parentNode.insertBefore(b,a.nextSibling)},b);return m};(function(a){a.off=ja;a.on=L;a.wheelEventPixels=Dg;a.Doc=Ca;a.splitLines=ve;a.countColumn=k;a.findColumn=U;a.isWordChar=O;a.Pass=yd;a.signal=ca;a.Line=Xb;a.changeEnd=nb;a.scrollbarModel=cf;a.Pos=z;a.cmpPos=K;a.modes=Hd;a.mimeModes=Ob;a.resolveMode= jb;a.getMode=nc;a.modeExtensions=Pb;a.extendMode=cd;a.copyState=db;a.startState=eb;a.innerMode=Qb;a.commands=Kc;a.keyMap=Jc;a.keyName=Of;a.isModifierKey=Lf;a.lookupKey=cc;a.normalizeKeyMap=Pg;a.StringStream=la;a.SharedTextMarker=Ic;a.TextMarker=ob;a.LineWidget=Hc;a.e_preventDefault=qa;a.e_stopPropagation=ad;a.e_stop=sb;a.addClass=J;a.contains=v;a.rmClass=Bb;a.keyNames=pb})(ia);ia.version="5.34.0";return ia}); (function(q){"object"==typeof exports&&"object"==typeof module?q(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],q):q(CodeMirror)})(function(q){function I(f){for(var k={},g=0;g*\/]/.test(p)?g(null,"select-op"):"."==p&&f.match(/^-?[_a-z][_a-z0-9-]*/i)?g("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(p)?g(null,p):("u"==p||"U"==p)&&f.match(/rl(-prefix)?\(/i)||("d"==p||"D"==p)&&f.match("omain(",!0,!0)||("r"==p||"R"==p)&&f.match("egexp(",!0,!0)?(f.backUp(1),k.tokenize=v,g("property","word")):/[\w\\\-]/.test(p)?(f.eatWhile(/[\w\\\-]/), g("property","word")):g(null,null)}function x(f){return function(k,p){for(var E=!1,x;null!=(x=k.next());){if(x==f&&!E){")"==f&&k.backUp(1);break}E=!E&&"\\"==x}if(x==f||!E&&")"!=f)p.tokenize=null;return g("string","string")}}function v(f,k){f.next();f.match(/\s*["')]/,!1)?k.tokenize=null:k.tokenize=x(")");return g(null,"(")}function t(f,k,g){this.type=f;this.indent=k;this.prev=g}function S(f,k,g,p){f.context=new t(g,k.indentation()+(!1===p?0:aa),f.context);return g}function y(f){f.context.prev&&(f.context= f.context.prev);return f.context.type}function F(f,k,g,p){for(p=p||1;0