metamaps--metamaps/public/assets/application-bd57f495f9d53425da97ebe64d1edb1f.js

34 lines
646 KiB
JavaScript
Raw Normal View History

2013-01-06 04:55:52 +00:00
/*!
* jQuery JavaScript Library v1.8.1
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: Thu Aug 30 2012 17:17:22 GMT-0400 (Eastern Daylight Time)
*/
function BestInPlaceEditor(e){this.element=e,this.initOptions(),this.bindForm(),this.initNil(),jQuery(this.activator).bind("click",{editor:this},this.clickHandler)}function openAnalyze(){analyzeOpen=!0,findOpen&&closeFind(),organizeOpen&&closeOrganize(),$("#sideOptionFind").css("z-index","8"),$("#sideOptionAnalyze, #closeAnalyze").css("z-index","10"),$("#sideOptionOrganize").css("z-index","8"),$("#sideOptionAnalyze").animate({width:"100px",height:"76px"},100),$("#closeAnalyze").css("display","block"),$("#sideOptionAnalyze").css("cursor","default")}function closeAnalyze(){analyzeOpen=!1,$("#closeAnalyze").css("display","none"),$("#sideOptionAnalyze").css("cursor","pointer"),$("#sideOptionAnalyze").animate({width:"64px",height:"32px"},100)}function switchVisible(e,t){categoryVisible[e]==1?hideCategory(e,t):categoryVisible[e]==0&&showCategory(e,t)}function hideCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",.4,"end"),t.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function showCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",1,"end"),t.eachAdjacency(function(e){e.setData("alpha",1,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function hideAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){!e.getData("inCommons")&&!e.getData("onCanvas")&&(e.setData("alpha",.4,"end"),e.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function showAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){e.setData("alpha",1,"end"),e.eachAdjacency(function(e){e.setData("alpha",1,"end")})}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function onCanvasSearch(e,t,n){Mconsole.graph.eachNode(function(r){e!=null?r.name.indexOf(e)!==-1&&e!=""?r.setData("onCanvas",!0):r.setData("onCanvas",!1):t!=null?r.getData("inmaps").indexOf(parseInt(t))!==-1?r.setData("onCanvas",!0):r.setData("onCanvas",!1):n!=null&&(r.getData("userid").toString()==n?r.setData("onCanvas",!0):r.setData("onCanvas",!1)),Mconsole.plot()})}function clearCanvas(){Mconsole.graph.eachNode(function(e){Mconsole.graph.removeNode(e.id),Mconsole.labels.disposeLabel(e.id)}),Mconsole.plot()}function clearFoundData(){Mconsole.graph.eachNode(function(e){e.getData("inCommons")===!0&&(Mconsole.graph.removeNode(e.id),Mconsole.labels.disposeLabel(e.id))}),Mconsole.plot()}function openFind(){findOpen=!0,analyzeOpen&&closeAnalyze(),organizeOpen&&closeOrganize(),$("#sideOptionFind, #closeFind").css("z-index","10"),$("#sideOptionAnalyze").css("z-index","9"),$("#sideOptionOrganize").css("z-index","8"),firstVal=$('#sideOptionFind option[value="name"]').attr("selected"),secondVal=$('#sideOptionFind option[value="metacode"]').attr("selected"),thirdVal=$('#sideOptionFind option[value="map (by name)"]').attr("selected"),fourthVal=$('#sideOptionFind option[value="mapper (by name)"]').attr("selected"),firstVal==="selected"||thirdVal==="selected"||fourthVal==="selected"?$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#topic_by_name_input").focus()}):secondVal==="selected"?$("#sideOptionFind").animate({width:"380px",height:"463px"},100,function(){}):thirdVal==="selected"?$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#map_by_name_input").focus()}):fourthVal==="selected"&&$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#mapper_by_name_input").focus()}),$("#closeFind, #findWhere").css("display","block"),$("#sideOptionFind").css("cursor","default")}function closeFind(){findOpen=!1,Mconsole.graph.eachNode(function(e){e.setData("inCommons",!1),e.setData("onCanvas",!1)}),Mconsole.plot(),$("#closeFind, #findWhere").css("display","none"),$("#sideOptionFind").css("cursor","pointer"),$("#sideOptionFind").animate({width:
start,m&&(a.end=a.start,a.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.1",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(
,!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length==1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function Y(e,t,n,r){n=n||[],t=t||m;var i,s,o,f,l=t.nodeType;if(l!==1&&l!==9)return[];if(!e||typeof e!="string")return n;o=u(t);if(!o&&!r)if(i=j.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&a(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return w.apply(n,b.call(t.getElement
n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{ln=s.href}catch(Nn){ln=i.createElement("a"),ln.href="",ln=ln.href}cn=wn.exec(ln.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");re
(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.ui.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.browser.msie)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.ui.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-(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r),left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(e.browser.safari&&e.browser.ve
,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.
(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)]:(n=/rgba\(0, 0, 0, 0\)/.exec(t))?i.transparent:i[e.trim(t).toLowerCase()]}function r(t,r){var i;do{i=(e.curCSS||e.css)(t,r);if(i!=""&&i!="transparent"||e.nodeName(t,"body"))break;r="backgroundColor"}while(t=t.parentNode);return n(i)}function u(){var e=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,t={},n,r;if(e&&e.length&&e[0]&&e[e[0]]){var i=e.length;while(i--)n=e[i],typeof e[n]=="string"&&(r=n.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()}),t[r]=e[n])}else for(n in e)typeof e[n]=="string"&&(t[n]=e[n]);return t}function a(t){var n,r;for(n in t)r=t[n],(r==null||e.isFunction(r)||n in o||/scrollbar/.test(n)||!/color/i.test(n)&&isNaN(parseFloat(r)))&&delete t[n];return t}function f(e,t){var n={_:0},r;for(r in t)e[r]!=t[r]&&(n[r]=t[r]);return n}function l(t,n,r,i){typeof t=="object"&&(i=n,r=null,n=t,t=n.effect),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=n||{},r=r||n.duration,r=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,i=i||n.complete,[t,n,r,i]}function c(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects[t]?!0:!1}e.effects={},e.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(t,i){e.fx.step[i]=function(e){e.colorInit||(e.start=r(e.elem,i),e.end=n(e.end),e.colorInit=!0),e.elem.style[i]="rgb("+Math.max(Math.min(parseInt(e.pos*(e.end[0]-e.start[0])+e.start[0],10),255),0)+","+Math.max(Math.min(parseInt(e.pos*(e.end[1]-e.start[1])+e.start[1],10),255),0)+","+Math.max(Math.min(parseInt(e.pos*(e.end[2]-e.start[2])+e.start[2],10),255),0)+")"}});var i={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},s=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.effects.animateClass=function(t,n,r,i){return e.isFunction(r)&&(i=r,r=null),this.queue(function(){var o=e(this),l=o.attr("style")||" ",c=a(u.call(this)),h,p=o.attr("class")||"";e.each(s,function(e,n){t[n]&&o[n+"Class"](t[n])}),h=a(u.call(this)),o.attr("class",p),o.animate(f(c,h),{queue:!1,duration:n,easing:r,complete:function(){e.each(s,function(e,n){t[n]&&o[n+"Class"](t[n])}),typeof o.attr("style")=="object"?(o.attr("style").cssText="",o.attr("style").cssText=l):o.attr("style",l),i&&i.apply(this,arguments),e.dequeue(this)}})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.apply(this,[{add:t},n,r,i]):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.apply(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.apply(this,[r?{add:n}:{remove:n},i,s,o]):this._toggleClass(n,r):e.effects.animateClass.apply(this,[{toggle:n},r,i,s])},switchClass:function(t,n,r,i,s){return e.effects.animateClass.apply(this,[{add:n,remove:t},r,i,s])}}),e.extend(e.effects,{version:"1.8.23",save:function(e,t){for(var n=0
:"json",success:function(e,t){i(e)},error:function(){i([])}})}):this.source=this.options.source},search:function(e,t){e=e!=null?e:this.element.val(),this.term=this.element.val();if(e.length<this.options.minLength)return this.close(t);clearTimeout(this.closing);if(this._trigger("search",t)===!1)return;return this._search(e)},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:e},this._response())},_response:function(){var e=this,t=++n;return function(r){t===n&&e.__response(r),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){!this.options.disabled&&e&&e.length?(e=this._normalize(e),this._suggest(e),this._trigger("open")):this.close()},close:function(e){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",e))},_change:function(e){this.previous!==this.element.val()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(n,t),this.menu.deactivate(),this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new e.Event("mouseover"))},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItem(t,n)})},_renderItem:function(t,n){return e("<li></li>").data("item.autocomplete",n).append(e("<a></a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.first()&&/^previous/.test(e)||this.menu.last()&&/^next/.test(e)){this.element.val(this.term),this.menu.deactivate();return}this.menu[e](t)},widget:function(){return this.menu.element},_keyEvent:function(e,t){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(e,t),t.preventDefault()}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}})}(jQuery),function(e){e.widget("ui.menu",{_create:function(){var t=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(n){if(!e(n.target).closest(".ui-menu-item a").length)return;n.preventDefault(),t.select(n)}),this.refresh()},refresh:function(){var t=this,n=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");n.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(n){t.activate(n,e(this).parent())}).mouseleave(function(){t.deactivate()})},activate:function(e,t){this.deactivate();if(this.hasScroll()){var n=t.offset().top-this.element.offset().top,r=this.element.scrollTop(),i=this.element.height();n<0?this.element.scrollTop(r+n):n>=i&&this.element.scrollTop(r+n-i+t.height())}this.active=t.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",e,{item:t})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,t,n){if(!this.active){this.activate(n,this.element.children(t));return}var r=this.active[e+"All"](".ui-menu-item").eq(0);r.length?this.activate(n,r):t
floor(Math.round((n-t)/864e5)/7)+1},parseDate:function(e,t,n){if(e==null||t==null)throw"Invalid arguments";t=typeof t=="object"?t.toString():t+"";if(t=="")return null;var r=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff;r=typeof r!="string"?r:(new Date).getFullYear()%100+parseInt(r,10);var i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=-1,f=-1,l=-1,c=-1,h=!1,p=function(t){var n=y+1<e.length&&e.charAt(y+1)==t;return n&&y++,n},d=function(e){var n=p(e),r=e=="@"?14:e=="!"?20:e=="y"&&n?4:e=="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=t.substring(g).match(i);if(!s)throw"Missing number at position "+g;return g+=s[0].length,parseInt(s[0],10)},v=function(e,n,r){var i=$.map(p(e)?r:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)}),s=-1;$.each(i,function(e,n){var r=n[1];if(t.substr(g,r.length).toLowerCase()==r.toLowerCase())return s=n[0],g+=r.length,!1});if(s!=-1)return s+1;throw"Unknown name at position "+g},m=function(){if(t.charAt(g)!=e.charAt(y))throw"Unexpected literal at position "+g;g++},g=0;for(var y=0;y<e.length;y++)if(h)e.charAt(y)=="'"&&!p("'")?h=!1:m();else switch(e.charAt(y)){case"d":l=d("d");break;case"D":v("D",i,s);break;case"o":c=d("o");break;case"m":f=d("m");break;case"M":f=v("M",o,u);break;case"y":a=d("y");break;case"@":var b=new Date(d("@"));a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"!":var b=new Date((d("!")-this._ticksTo1970)/1e4);a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"'":p("'")?m():h=!0;break;default:m()}if(g<t.length)throw"Extra/unparsed characters found in date: "+t.substring(g);a==-1?a=(new Date).getFullYear():a<100&&(a+=(new Date).getFullYear()-(new Date).getFullYear()%100+(a<=r?0:-100));if(c>-1){f=1,l=c;do{var w=this._getDaysInMonth(a,f-1);if(l<=w)break;f++,l-=w}while(!0)}var b=this._daylightSavingAdjust(new Date(a,f-1,l));if(b.getFullYear()!=a||b.getMonth()+1!=f||b.getDate()!=l)throw"Invalid date";return b},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,s=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,o=(n?n.monthNames:null)||this._defaults.monthNames,u=function(t){var n=h+1<e.length&&e.charAt(h+1)==t;return n&&h++,n},a=function(e,t,n){var r=""+t;if(u(e))while(r.length<n)r="0"+r;return r},f=function(e,t,n,r){return u(e)?r[t]:n[t]},l="",c=!1;if(t)for(var h=0;h<e.length;h++)if(c)e.charAt(h)=="'"&&!u("'")?c=!1:l+=e.charAt(h);else switch(e.charAt(h)){case"d":l+=a("d",t.getDate(),2);break;case"D":l+=f("D",t.getDay(),r,i);break;case"o":l+=a("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":l+=a("m",t.getMonth()+1,2);break;case"M":l+=f("M",t.getMonth(),s,o);break;case"y":l+=u("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=t.getTime()*1e4+this._ticksTo1970;break;case"'":u("'")?l+="'":c=!0;break;default:l+=e.charAt(h)}return l},_possibleChars:function(e){var t="",n=!1,r=function(t){var n=i+1<e.length&&e.charAt(i+1)==t;return n&&i++,n};for(var i=0;i<e.length;i++)if(n)e.charAt(i)=="'"&&!r("'")?n=!1:t+=e.charAt(i);else switch(e.charAt(i)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":r("'")?t+="'":n=!0;break;default:t+=e.charAt(i)}return t},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()==e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i
{t==="value"&&(this.options.value=n,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),e.Widget.prototype._setOption.apply(this,arguments)},_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)}}),e.extend(e.ui.progressbar,{version:"1.8.23"})}(jQuery),function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t=this,r=this.options,i=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),s="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=r.values&&r.values.length||1,u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(r.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),r.range&&(r.range===!0&&(r.values||(r.values=[this._valueMin(),this._valueMin()]),r.values.length&&r.values.length!==2&&(r.values=[r.values[0],r.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(r.range==="min"||r.range==="max"?" ui-slider-range-"+r.range:"")));for(var a=i.length;a<o;a+=1)u.push(s);this.handles=i.add(e(u.join("")).appendTo(t.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).hover(function(){r.disabled||e(this).addClass("ui-state-hover")},function(){e(this).removeClass("ui-state-hover")}).focus(function(){r.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("index.ui-slider-handle",t)}),this.handles.keydown(function(r){var i=e(this).data("index.ui-slider-handle"),s,o,u,a;if(t.options.disabled)return;switch(r.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:r.preventDefault();if(!t._keySliding){t._keySliding=!0,e(this).addClass("ui-state-active"),s=t._start(r,i);if(s===!1)return}}a=t.options.step,t.options.values&&t.options.values.length?o=u=t.values(i):o=u=t.value();switch(r.keyCode){case e.ui.keyCode.HOME:u=t._valueMin();break;case e.ui.keyCode.END:u=t._valueMax();break;case e.ui.keyCode.PAGE_UP:u=t._trimAlignValue(o+(t._valueMax()-t._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:u=t._trimAlignValue(o-(t._valueMax()-t._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(o===t._valueMax())return;u=t._trimAlignValue(o+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(o===t._valueMin())return;u=t._trimAlignValue(o-a)}t._slide(r,i,u)}).keyup(function(n){var r=e(this).data("index.ui-slider-handle");t._keySliding&&(t._keySliding=!1,t._stop(n,r),t._change(n,r),e(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(t){var n=this.options,r,i,s,o,u,a,f,l,c;return n.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),r={x:t.pageX,y:t.
);var e=jQuery(document.createElement("form")).attr("action","javascript:void(0)").attr("style","display:inline").append(jQuery(document.createElement("textarea")).val(this.sanitizeValue(this.display_value)));this.okButton&&e.append(jQuery(document.createElement("input")).attr("type","submit").attr("value",this.okButton)),this.cancelButton&&e.append(jQuery(document.createElement("input")).attr("type","button").attr("value",this.cancelButton)),this.element.html(e),this.setHtmlAttributes(),jQuery(this.element.find("textarea")[0]).css({"min-width":width,"min-height":height}),jQuery(this.element.find("textarea")[0]).elastic(),this.element.find("textarea")[0].focus(),this.element.find("form").bind("submit",{editor:this},BestInPlaceEditor.forms.textarea.submitHandler),this.cancelButton&&this.element.find("input[type='button']").bind("click",{editor:this},BestInPlaceEditor.forms.textarea.cancelButtonHandler),this.element.find("textarea").bind("blur",{editor:this},BestInPlaceEditor.forms.textarea.blurHandler),this.element.find("textarea").bind("keyup",{editor:this},BestInPlaceEditor.forms.textarea.keyupHandler),this.blurTimer=null,this.userClicked=!1},getValue:function(){return this.sanitizeValue(this.element.find("textarea").val())},blurHandler:function(e){e.data.editor.okButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.abortIfConfirm()},500):e.data.editor.cancelButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.update()},500):e.data.editor.update()},submitHandler:function(e){e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.update()},cancelButtonHandler:function(e){e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.abortIfConfirm(),e.stopPropagation()},keyupHandler:function(e){e.keyCode==27&&e.data.editor.abortIfConfirm()}}},jQuery.fn.best_in_place=function(){function e(e){if(!e.data("bestInPlaceEditor"))return e.data("bestInPlaceEditor",new BestInPlaceEditor(e)),!0}return jQuery(this.context).delegate(this.selector,"click",function(){var t=jQuery(this);e(t)&&t.click()}),this.each(function(){e(jQuery(this))}),this},function(e){e.fn.extend({elastic:function(){var t=["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight"];return this.each(function(){function f(e,t){curratedHeight=Math.floor(parseInt(e,10)),n.height()!=curratedHeight&&n.css({height:curratedHeight+"px",overflow:t})}function l(){var e=n.val().replace(/&/g,"&amp;").replace(/ /g,"&nbsp;").replace(/<|>/g,"&gt;").replace(/\n/g,"<br />"),t=r.html().replace(/<br>/ig,"<br />");if(e+"&nbsp;"!=t){r.html(e+"&nbsp;");if(Math.abs(r.height()+i-n.height())>3){var u=r.height()+i;u>=o?f(o,"auto"):u<=s?f(s,"hidden"):f(u,"hidden")}}}if(this.type!="textarea")return!1;var n=e(this),r=e("<div />").css({position:"absolute",display:"none","word-wrap":"break-word"}),i=parseInt(n.css("line-height"),10)||parseInt(n.css("font-size"),"10"),s=parseInt(n.css("height"),10)||i*3,o=parseInt(n.css("max-height"),10)||Number.MAX_VALUE,u=0,a=0;o<0&&(o=Number.MAX_VALUE),r.appendTo(n.parent()),a=t.length;while(a--)r.css(t[a].toString(),n.css(t[a].toString()));n.css({overflow:"hidden"}),n.bind("keyup change cut paste",function(){l()}),n.bind("blur",function(){r.height()<o&&(r.height()>s?n.height(r.height()):n.height(s))}),n.live("input paste",function(e){setTimeout(l,250)}),l()})}})}(jQuery),function(e){var t=null;e.fn.railsAutocomplete=function(){return this.live("focus",function(){this.railsAutoCompleter||(this.railsAutoCompleter=new e.railsAutocomplete(this))})},e.railsAutocomplete=function(e){_e=e,this.init(_e)},e.railsAutocomplete.fn=e.railsAutocomplete.prototype={railsAutocomplete:"0.0.1"},e.railsAutocomplete.fn.extend=e.railsAutocomplete.extend=e.extend,e.railsAutocomplete.fn.extend({init:function(t){function n(e){return e.split(t.delimiter)}function r(e){return n(e).pop().replace(/^\s+/,"")}t.delimiter=e(t).attr("data-delimiter")||null,e(t).autocomplete({source:function(n,i){e.getJSON(e(t
("option[value='metacode']").removeAttr("disabled"),$("#sideOptionFind .select_type").children("option[value='map (by name)']").removeAttr("disabled"),$("#sideOptionFind .select_type").children("option[value='mapper (by name)']").removeAttr("disabled"),$(".find").css("display","none"),$(".find_topic_by_name").css("display","block"),$("#topic_by_name_input").focus()):secondVal=="selected"?($("#sideOptionFind .select_type").val()!="name"&&($("#sideOptionFind .select_type").val("name"),$("#sideOptionFind").animate({width:"305px",height:"76px"},300,function(){})),$("#sideOptionFind .select_type").children("option[value='metacode']").attr("disabled","disabled"),$("#sideOptionFind .select_type").children("option[value='map (by name)']").attr("disabled","disabled"),$("#sideOptionFind .select_type").children("option[value='mapper (by name)']").attr("disabled","disabled"),$(".find").css("display","none"),$(".find_map_by_name").css("display","block"),$("#map_by_name_input").focus()):thirdVal=="selected"&&($("#sideOptionFind .select_type").val("name"),$("#sideOptionFind .select_type").children("option[value='metacode']").attr("disabled","disabled"),$("#sideOptionFind .select_type").children("option[value='map (by name)']").attr("disabled","disabled"),$("#sideOptionFind .select_type").children("option[value='mapper (by name)']").attr("disabled","disabled"),$(".find").css("display","none"),$(".find_mapper_by_name").css("display","block"),$("#mapper_by_name_input").focus())}),$("#sideOptionFind .select_type").change(function(){firstVal=$(this).children("option[value='name']").attr("selected"),secondVal=$(this).children("option[value='metacode']").attr("selected"),thirdVal=$(this).children("option[value='map (by name)']").attr("selected"),fourthVal=$(this).children("option[value='mapper (by name)']").attr("selected"),firstVal==="selected"?$(".find").fadeOut("fast",function(){showAll(),$(".find_topic_by_metacode ul li").not("#hideAll, #showAll").removeClass("toggledOff");for(var e in categoryVisible)categoryVisible[e]=!0;$("#sideOptionFind").animate({width:"305px",height:"76px"},300,function(){$(".find_topic_by_name").css("display","block"),$("#topic_by_name_input").focus()})}):secondVal==="selected"?$(".find").fadeOut("fast",function(){$("#sideOptionFind").animate({width:"380px",height:"463px"},300,function(){$(".find_topic_by_metacode").fadeIn("fast")})}):thirdVal==="selected"?$(".find").fadeOut("fast",function(){$("#sideOptionFind").animate({width:"305px",height:"76px"},300,function(){$(".find_map_by_name").css("display","block"),$("#map_by_name_input").focus()})}):fourthVal==="selected"&&$(".find").fadeOut("fast",function(){$("#sideOptionFind").animate({width:"305px",height:"76px"},300,function(){$(".find_mapper_by_name").css("display","block"),$("#mapper_by_name_input").focus()})})}),$(".find_topic_by_name #topic_by_name_input").bind("railsAutocomplete.select",function(e,t){t.item.id!=undefined&&window.open("/topics/"+t.item.id),$(".find_topic_by_name #topic_by_name_input").val("")}),$(".find_topic_by_name").bind("submit",function(e,t){e.preventDefault()}),$(".find_map_by_name #map_by_name_input").bind("railsAutocomplete.select",function(e,t){firstVal=$("#sideOptionFind .select_content").children("option[value='topics']").attr("selected"),secondVal=$("#sideOptionFind .select_content").children("option[value='maps']").attr("selected"),thirdVal=$("#sideOptionFind .select_content").children("option[value='mappers']").attr("selected"),firstVal=="selected"?(firstNewVal=$("#onCanvas").attr("checked"),secondNewVal=$("#inCommons").attr("checked"),firstNewVal=="checked"&&secondNewVal=="checked"?(setTimeout(function(){onCanvasSearch(null,t.item.id,null)},0),$("#topicsByMap").val(t.item.id),$("#topicsByUser").val(""),$("#topicsByName").val(""),$("#get_topics_form").submit()):firstNewVal=="checked"?setTimeout(function(){onCanvasSearch(null,t.item.id,null)},0):secondNewVal=="checked"?($("#topicsByMap").val(t.item.id),$("#topicsByUser").val(""),$("#topicsByName").val(""),$("#get_topics_form").submit()):alert("You either need to have searching O
:function(e){var t=this.getSize(),n=e?t.width-e.width-this.translateOffsetX*2:t.width;height=e?t.height-e.height-this.translateOffsetY*2:t.height;var r=this.getCtx();e&&r.scale(1/this.scaleOffsetX,1/this.scaleOffsetY),r.translate(n/2,height/2)},resize:function(e,t){var n=this.getSize(),i=this.canvas,s=i.style;this.size=!1,i.width=e,i.height=t,s.width=e+"px",s.height=t+"px",r?this.translateToCenter():this.translateToCenter(n),this.translateOffsetX=this.translateOffsetY=0,this.scaleOffsetX=this.scaleOffsetY=1,this.clear(),this.viz.resize(e,t,this)},translate:function(e,t,n){var r=this.scaleOffsetX,i=this.scaleOffsetY;this.translateOffsetX+=e*r,this.translateOffsetY+=t*i,this.getCtx().translate(e,t),!n&&this.plot()},scale:function(e,t,n){this.scaleOffsetX*=e,this.scaleOffsetY*=t,this.getCtx().scale(e,t),!n&&this.plot()},clear:function(){var e=this.getSize(),t=this.translateOffsetX,n=this.translateOffsetY,r=this.scaleOffsetX,i=this.scaleOffsetY;this.getCtx().clearRect((-e.width/2-t)*1/r,(-e.height/2-n)*1/i,e.width*1/r,e.height*1/i)},plot:function(){this.clear(),this.viz.plot(this)}}),f.Background={},f.Background.Circles=new t({initialize:function(t,n){this.viz=t,this.config=e.merge({idSuffix:"-bkcanvas",levelDistance:100,numberOfCircles:6,CanvasStyles:{},offset:0},n)},resize:function(e,t,n){this.plot(n)},plot:function(e){var t=e.canvas,n=e.getCtx(),r=this.config,i=r.CanvasStyles;for(var s in i)n[s]=i[s];var o=r.numberOfCircles,u=r.levelDistance;for(var a=1;a<=o;a++)n.beginPath(),n.arc(0,0,u*a,0,2*Math.PI,!1),n.stroke(),n.closePath()}})})();var l=function(e,t){this.theta=e,this.rho=t};$jit.Polar=l,l.prototype={getc:function(e){return this.toComplex(e)},getp:function(){return this},set:function(e){e=e.getp(),this.theta=e.theta,this.rho=e.rho},setc:function(e,t){this.rho=Math.sqrt(e*e+t*t),this.theta=Math.atan2(t,e),this.theta<0&&(this.theta+=Math.PI*2)},setp:function(e,t){this.theta=e,this.rho=t},clone:function(){return new l(this.theta,this.rho)},toComplex:function(e){var t=Math.cos(this.theta)*this.rho,n=Math.sin(this.theta)*this.rho;return e?{x:t,y:n}:new h(t,n)},add:function(e){return new l(this.theta+e.theta,this.rho+e.rho)},scale:function(e){return new l(this.theta,this.rho*e)},equals:function(e){return this.theta==e.theta&&this.rho==e.rho},$add:function(e){return this.theta=this.theta+e.theta,this.rho+=e.rho,this},$madd:function(e){return this.theta=(this.theta+e.theta)%(Math.PI*2),this.rho+=e.rho,this},$scale:function(e){return this.rho*=e,this},interpolate:function(e,t){var n=Math.PI,r=n*2,i=function(e){var t=e<0?e%r+r:e%r;return t},s=this.theta,o=e.theta,u,a=Math.abs(s-o);a==n?s>o?u=i(o+(s-r-o)*t):u=i(o-r+(s-o)*t):a>=n?s>o?u=i(o+(s-r-o)*t):u=i(o-r+(s-(o-r))*t):u=i(o+(s-o)*t);var f=(this.rho-e.rho)*t+e.rho;return{theta:u,rho:f}}};var c=function(e,t){return new l(e,t)};l.KER=c(0,0);var h=function(e,t){this.x=e,this.y=t};$jit.Complex=h,h.prototype={getc:function(){return this},getp:function(e){return this.toPolar(e)},set:function(e){e=e.getc(!0),this.x=e.x,this.y=e.y},setc:function(e,t){this.x=e,this.y=t},setp:function(e,t){this.x=Math.cos(e)*t,this.y=Math.sin(e)*t},clone:function(){return new h(this.x,this.y)},toPolar:function(e){var t=this.norm(),n=Math.atan2(this.y,this.x);return n<0&&(n+=Math.PI*2),e?{theta:n,rho:t}:new l(n,t)},norm:function(){return Math.sqrt(this.squaredNorm())},squaredNorm:function(){return this.x*this.x+this.y*this.y},add:function(e){return new h(this.x+e.x,this.y+e.y)},prod:function(e){return new h(this.x*e.x-this.y*e.y,this.y*e.x+this.x*e.y)},conjugate:function(){return new h(this.x,-this.y)},scale:function(e){return new h(this.x*e,this.y*e)},equals:function(e){return this.x==e.x&&this.y==e.y},$add:function(e){return this.x+=e.x,this.y+=e.y,this},$prod:function(e){var t=this.x,n=this.y;return this.x=t*e.x-n*e.y,this.y=n*e.x+t*e.y,this},$conjugate:function(){return this.y=-this.y,this},$scale:function(e){return this.x*=e,this.y*=e,this},$div:function(e){var t=this.x,n=this.y,r=e.squaredNorm();return this.x=t*e.x+n*e.y,this.y=n*e.x-t*e.y,this.$scale(1/r)}};var p=function(e,t){return new h(e,t)}
e.data.$orn==r)){var t=e.getData("width",i),s=e.getData("height",i);u=u<t?t:u,a=a<s?s:a}}),{width:u<0?s.width:u,height:a<0?s.height:a}}return s}function i(e,t,n,r){var i=r=="left"||r=="right"?"y":"x";e.getPos(t)[i]+=n}function s(t,r){var i=[];return e.each(t,function(e){e=n.call(e),e[0]+=r,e[1]+=r,i.push(e)}),i}function o(e,t){if(e.length==0)return t;if(t.length==0)return e;var n=e.shift(),r=t.shift();return[[n[0],r[1]]].concat(o(e,t))}function u(e,t){t=t||[];if(e.length==0)return t;var n=e.pop();return u(e,o(n,t))}function a(e,t,n,r,i){if(e.length<=i||t.length<=i)return 0;var s=e[i][1],o=t[i][0];return Math.max(a(e,t,n,r,++i)+n,s-o+r)}function f(e,t,n){function r(e,i,u){if(i.length<=u)return[];var f=i[u],l=a(e,f,t,n,0);return[l].concat(r(o(e,s(f,l)),i,++u))}return r([],e,0)}function l(e,t,r){function i(e,n,u){if(n.length<=u)return[];var f=n[u],l=-a(f,e,t,r,0);return[l].concat(i(o(s(f,l),e),n,++u))}e=n.call(e);var u=i([],e.reverse(),0);return u.reverse()}function c(e,t,n,r){var i=f(e,t,n),s=l(e,t,n);r=="left"?s=i:r=="right"&&(i=s);for(var o=0,u=[];o<i.length;o++)u[o]=(i[o]+s[o])/2;return u}function h(e,t,n,o,a){function S(t,l,h){var p=t.getData(g,n),m=l||t.getData(y,n),x=[],T=[],N=!1,C=m+o.levelDistance;t.eachSubnode(function(t){if(t.exist&&(!f||"$orn"in t.data&&t.data.$orn==a)){N||(N=r(e,o,t._depth,a,n));var i=S(t,N[y],h+C);x.push(i.tree),T.push(i.extent)}});var k=c(T,w,b,E);for(var A=0,_=[],j=[];A<x.length;A++)i(x[A],n,k[A],a),j.push(s(T[A],k[A]));var F=[[-p/2,p/2]].concat(u(j));return t.getPos(n)[d]=0,a=="top"||a=="left"?t.getPos(n)[v]=h:t.getPos(n)[v]=-h,{tree:t,extent:F}}var f=o.multitree,l=["x","y"],h=["width","height"],p=+(a=="left"||a=="right"),d=l[p],v=l[1-p],m=o.Node,g=h[p],y=h[1-p],b=o.siblingOffset,w=o.subtreeOffset,E=o.align;S(t,!1,0)}var n=Array.prototype.slice;return new t({compute:function(t,n){var r=t||"start",i=this.graph.getNode(this.root);e.extend(i,{drawn:!0,exist:!0,selected:!0}),w.compute(this.graph,r,this.config),(!!n||!("_depth"in i))&&this.graph.computeLevels(this.root,0,"ignore"),this.computePositions(i,r)},computePositions:function(t,n){var r=this.config,i=r.multitree,s=r.align,o=s!=="center"&&r.indent,u=r.orientation,a=i?["top","right","bottom","left"]:[u],f=this;e.each(a,function(e){h(f.graph,t,n,f.config,e,n);var r=["x","y"][+(e=="left"||e=="right")];(function u(t){t.eachSubnode(function(a){a.exist&&(!i||"$orn"in a.data&&a.data.$orn==e)&&(a.getPos(n)[r]+=t.getPos(n)[r],o&&(a.getPos(n)[r]+=s=="left"?o:-o),u(a))})})(t)})}})}(),$jit.ST=function(){function r(e){e=e||this.clickedNode;if(!this.config.constrained)return[];var t=this.geom,r=this.graph,i=this.canvas,s=e._depth,o=[];r.eachNode(function(t){t.exist&&!t.selected&&(t.isDescendantOf(e.id)?t._depth<=s&&o.push(t):o.push(t))});var u=t.getRightLevelToShow(e,i);e.eachLevel(u,u,function(e){e.exist&&!e.selected&&o.push(e)});for(var a=0;a<n.length;a++){var f=this.graph.getNode(n[a]);f.isDescendantOf(e.id)||o.push(f)}return o}function s(e){var t=[],n=this.config;return e=e||this.clickedNode,this.clickedNode.eachLevel(0,n.levelsToShow,function(e){!n.multitree||"$orn"in e.data||!e.anySubnode(function(e){return e.exist&&!e.drawn})?e.drawn&&!e.anySubnode("drawn")&&t.push(e):t.push(e)}),t}var n=[];return new t({Implements:[y,a,b.Tree],initialize:function(t){var n=$jit.ST,r={levelsToShow:2,levelDistance:30,constrained:!0,Node:{type:"rectangle"},duration:700,offsetX:0,offsetY:0};this.controller=this.config=e.merge(i("Canvas","Fx","Tree","Node","Edge","Controller","Tips","NodeStyles","Events","Navigation","Label"),r,t);var s=this.config;s.useCanvas?(this.canvas=s.useCanvas,this.config.labelContainer=this.canvas.id+"-label"):(s.background&&(s.background=e.merge({type:"Circles"},s.background)),this.canvas=new f(this,s),this.config.labelContainer=(typeof s.injectInto=="string"?s.injectInto:s.injectInto.id)+"-label"),this.graphOptions={complex:!0},this.graph=new d(this.graphOptions,this.config.Node,this.config.Edge),this.labels=new n.Label[s.Label.type](this),this.fx=new n.Plot(this,n),this.op=new n.Op(this),this.group=new n.Group(this),this.geom=new n.Geom(
,v.font=x.style+" "+x.size+"px "+x.family,v.textBaseline="middle",E(t.name,L)&&(w?(v.textAlign="right",v.fillText(L,u+Math.max.apply(null,f)-b.labelOffset,a+s/2)):(v.textAlign="center",v.fillText(L,u+i/2,a-Math.max.apply(null,f)-x.size/2-b.labelOffset))),S(t.name,L,t)&&(w?(v.textAlign="center",v.translate(u-b.labelOffset-x.size/2,a+s/2),v.rotate(Math.PI/2),v.fillText(t.name,0,0)):(v.textAlign="center",v.fillText(t.name,u+i/2,a+x.size/2+b.labelOffset))),v.restore())}},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height"),s=this.getAlignedPos(n,r,i),o=s.x,u=s.y,a=e.getData("dimArray"),f=a.length,l=e.getData("config"),c=t.x-o,h=l.orientation=="horizontal",p=(h?i:r)/f;if(h){if(t.x<o||t.x>o+r||t.y>u+i||t.y<u)return!1}else if(t.x<o||t.x>o+r||t.y>u||t.y<u-i)return!1;for(var d=0,v=a.length;d<v;d++){var m=a[d];if(h){var g=u+p*d;if(t.x<=o+m&&t.y>=g&&t.y<=g+p)return{name:e.getData("stringArray")[d],color:e.getData("colorArray")[d],value:e.getData("valueArray")[d],label:e.name}}else{var g=o+p*d;if(t.x>=g&&t.x<=g+p&&t.y>=u-m)return{name:e.getData("stringArray")[d],color:e.getData("colorArray")[d],value:e.getData("valueArray")[d],label:e.name}}}return!1}}}),$jit.BarChart=new t({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:!1,initialize:function(t){this.controller=this.config=e.merge(i("Canvas","Margin","Label","BarChart"),{Label:{type:"Native"}},t);var n=this.config.showLabels,r=e.type(n),s=this.config.showAggregates,o=e.type(s);this.config.showLabels=r=="function"?n:e.lambda(n),this.config.showAggregates=o=="function"?s:e.lambda(s),this.initializeViz()},initializeViz:function(){var t=this.config,n=this,r=t.type.split(":")[0],i=t.orientation=="horizontal",s={},o=new $jit.ST({injectInto:t.injectInto,orientation:i?"left":"bottom",levelDistance:0,siblingOffset:t.barsOffset,subtreeOffset:0,withLabels:t.Label.type!="Native",useCanvas:t.useCanvas,Label:{type:t.Label.type},Node:{overridable:!0,type:"barchart-"+r,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:t.Tips.enable,type:"Native",force:!0,onShow:function(e,n,r){var i=r;t.Tips.onShow(e,i,n)}},Events:{enable:!0,type:"Native",onClick:function(e,n,r){if(!t.Events.enable)return;var i=n.getContains();t.Events.onClick(i,n,r)},onMouseMove:function(e,r,i){if(!t.hoveredColor)return;if(e){var s=r.getContains();n.select(e.id,s.name,s.index)}else n.select(!1,!1,!1)}},onCreateLabel:function(n,r){var i=t.Label,o=r.getData("valueArray"),u=e.reduce(o,function(e,t){return e+t},0),a={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")},f=a.wrapper,l=a.label,c=a.aggregate,h=f.style,p=l.style,d=c.style;s[r.id]=a,f.appendChild(l),f.appendChild(c),t.showLabels(r.name,u,r)||(p.display="none"),t.showAggregates(r.name,u,r)||(d.display="none"),h.position="relative",h.overflow="visible",h.fontSize=i.size+"px",h.fontFamily=i.family,h.color=i.color,h.textAlign="center",d.position=p.position="absolute",n.style.width=r.getData("width")+"px",n.style.height=r.getData("height")+"px",d.left=p.left="0px",l.innerHTML=r.name,n.appendChild(f)},onPlaceLabel:function(e,n){if(!s[n.id])return;var r=s[n.id],i=r.wrapper.style,o=r.label.style,u=r.aggregate.style,a=t.type.split(":")[0]=="grouped",f=t.orientation=="horizontal",l=n.getData("dimArray"),c=n.getData("valueArray"),h=a&&f?Math.max.apply(null,l):n.getData("width"),p=a&&!f?Math.max.apply(null,l):n.getData("height"),d=parseInt(i.fontSize,10),v=e.style;if(l&&c){i.width=u.width=o.width=e.style.width=h+"px";for(var m=0,g=c.length,y=0;m<g;m++)l[m]>0&&(y+=c[m]);t.showLabels(n.name,y,n)?o.display="":o.display="none",t.showAggregates(n.name,y,n)?u.display="":u.display="none",t.orientation=="horizontal"?(u.textAlign="right",o.textAlign="left",o.textIndex=u.textIndent=t.labelOffset+"px",u.top=o.top=(p-d)/2+"px",e.style.height=i.height=p+"px"):(u.top=-d-t.labelOffset+"px",o.top=t.labelOffset+p+"px",e.style.top=parseInt(e.style.top,10)-p+"px",e.style.height=i.height=p+"px"),r.aggregate.innerHTML=y}}}),u=o.canvas.getSiz
for(var u=0;u<r;u++)i[e[u].id]=e[u],t.request(e[u].id,e[u]._level,{onComplete:function(e,t){t&&t.children&&(t.id=e,o.op.sum(t,{type:"nothing"})),++n==r&&(d.Util.computeLevels(o.graph,o.root,0),s())}})}}),$jit.Icicle.Plot=new t({Implements:d.Plot,plot:function(t,n){t=t||this.viz.controller;var r=this.viz,i=r.graph,s=i.getNode(r.clickedNode&&r.clickedNode.id||r.root),o=s._depth;r.canvas.clear(),this.plotTree(s,e.merge(t,{withLabels:!0,hideLabels:!1,plotSubtree:function(e,t){return!r.config.constrained||t._depth-o<r.config.levelsToShow}}),n)}}),$jit.Icicle.Label={},$jit.Icicle.Label.Native=new t({Implements:d.Label.Native,renderLabel:function(e,t,n){var r=e.getCtx(),i=t.getData("width"),s=t.getData("height"),o=t.getLabelData("size"),u=r.measureText(t.name);if(s<o*1.5||i<u.width)return;var a=t.pos.getc(!0);r.fillText(t.name,a.x+i/2,a.y+s/2)}}),$jit.Icicle.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.getSize(),o={x:Math.round(r.x+s.width/2),y:Math.round(r.y+s.height/2)};e.setAttribute("x",o.x),e.setAttribute("y",o.y),n.onPlaceLabel(e,t)}}),$jit.Icicle.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.getSize(),o={x:Math.round(r.x+s.width/2),y:Math.round(r.y+s.height/2)},u=e.style;u.left=o.x+"px",u.top=o.y+"px",u.display="",n.onPlaceLabel(e,t)}}),$jit.Icicle.Plot.NodeTypes=new t({none:{render:e.empty},rectangle:{render:function(t,n,r){var i=this.viz.config,s=i.offset,o=t.getData("width"),u=t.getData("height"),a=t.getData("border"),f=t.pos.getc(!0),l=f.x+s/2,c=f.y+s/2,h=n.getCtx();if(o-s<2||u-s<2)return;if(i.cushion){var p=t.getData("color"),d=h.createRadialGradient(l+(o-s)/2,c+(u-s)/2,1,l+(o-s)/2,c+(u-s)/2,o<u?u:o),v=e.rgbToHex(e.map(e.hexToRgb(p),function(e){return e*.3>>0}));d.addColorStop(0,p),d.addColorStop(1,v),h.fillStyle=d}a&&(h.strokeStyle=a,h.lineWidth=3),h.fillRect(l,c,Math.max(0,o-s),Math.max(0,u-s)),a&&h.strokeRect(f.x,f.y,o,u)},contains:function(e,t){if(this.viz.clickedNode&&!$jit.Graph.Util.isDescendantOf(e,this.viz.clickedNode.id))return!1;var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.rectangle.contains({x:n.x+r/2,y:n.y+i/2},t,r,i)}}}),$jit.Icicle.Plot.EdgeTypes=new t({none:e.empty}),b.ForceDirected=new t({getOptions:function(e){var t=this.canvas.getSize(),n=t.width,r=t.height,i=0;this.graph.eachNode(function(e){i++});var s=n*r/i,o=Math.sqrt(s),u=this.config.levelDistance;return{width:n,height:r,tstart:n*.1,nodef:function(e){return s/(e||1)},edgef:function(e){return o*(e-u)}}},compute:function(t,n){var r=e.splat(t||["current","start","end"]),i=this.getOptions();w.compute(this.graph,r,this.config),this.graph.computeLevels(this.root,0,"ignore"),this.graph.eachNode(function(t){e.each(r,function(n){var s=t.getPos(n);s.equals(h.KER)&&(s.x=i.width/5*(Math.random()-.5),s.y=i.height/5*(Math.random()-.5)),t.disp={},e.each(r,function(e){t.disp[e]=p(0,0)})})}),this.computePositions(r,i,n)},computePositions:function(e,t,n){var r=this.config.iterations,i=0,s=this;if(n)(function o(){for(var u=n.iter,a=0;a<u;a++){t.t=t.tstart*(1-i++/(r-1)),s.computePositionStep(e,t);if(i>=r){n.onComplete();return}}n.onStep(Math.round(i/(r-1)*100)),setTimeout(o,1)})();else for(;i<r;i++)t.t=t.tstart*(1-i/(r-1)),this.computePositionStep(e,t)},computePositionStep:function(t,n){var r=this.graph,i=Math.min,s=Math.max,o=p(0,0);r.eachNode(function(i){e.each(t,function(e){i.disp[e].x=0,i.disp[e].y=0}),r.eachNode(function(r){r.id!=i.id&&e.each(t,function(e){var t=i.getPos(e),s=r.getPos(e);o.x=t.x-s.x,o.y=t.y-s.y;var u=o.norm()||1;i.disp[e].$add(o.$scale(n.nodef(u)/u))})})});var u=!!r.getNode(this.root).visited;r.eachNode(function(r){r.eachAdjacency(function(i){var s=i.nodeTo;!!s.visited===u&&e.each(t,function(e){var t=r.getPos(e),i=s.getPos(e);o.x=t.x-i.x,o.y=t.y-i.y;var u=o.norm()||1;r.disp[e].$add(o.$scale(-n.edgef(u)/u)),s.disp[e].$add(o.$scale(-1))})}),r.visited=!u});var a=n.t,f=n.width/2,l=n.height/2;r.eachNode(fu
Mutators={Implements:function(n,r){return e.each(e.splat(r),function(e){t.prototyping=e;var r=typeof e=="function"?new e:e;for(var i in r)i in n||(n[i]=r[i]);delete t.prototyping}),n}},e.extend(t,{inherit:function(n,r){for(var i in r){var s=r[i],o=n[i],u=e.type(s);o&&u=="function"?s!=o&&t.override(n,i,s):u=="object"?n[i]=e.merge(o,s):n[i]=s}return n},override:function(e,n,r){var i=t.prototyping;i&&e[n]!=i[n]&&(i=null);var s=function(){var t=this.parent;this.parent=i?i[n]:e[n];var s=r.apply(this,arguments);return this.parent=t,s};e[n]=s}}),t.prototype.implement=function(){var n=this.prototype;return e.each(Array.prototype.slice.call(arguments||[]),function(e){t.inherit(n,e)}),this},$jit.Class=t,$jit.json={prune:function(e,t){this.each(e,function(e,n){n==t&&e.children&&(delete e.children,e.children=[])})},getParent:function(e,t){if(e.id==t)return!1;var n=e.children;if(n&&n.length>0)for(var r=0;r<n.length;r++){if(n[r].id==t)return e;var i=this.getParent(n[r],t);if(i)return i}return!1},getSubtree:function(e,t){if(e.id==t)return e;for(var n=0,r=e.children;n<r.length;n++){var i=this.getSubtree(r[n],t);if(i!=null)return i}return null},eachLevel:function(e,t,n,r){if(t<=n){r(e,t);if(!e.children)return;for(var i=0,s=e.children;i<s.length;i++)this.eachLevel(s[i],t+1,n,r)}},each:function(e,t){this.eachLevel(e,0,Number.MAX_VALUE,t)}},$jit.Trans={$extend:!0,linear:function(e){return e}};var n=$jit.Trans;(function(){var t=function(t,n){return n=e.splat(n),e.extend(t,{easeIn:function(e){return t(e,n)},easeOut:function(e){return 1-t(1-e,n)},easeInOut:function(e){return e<=.5?t(2*e,n)/2:(2-t(2*(1-e),n))/2}})},r={Pow:function(e,t){return Math.pow(e,t[0]||6)},Expo:function(e){return Math.pow(2,8*(e-1))},Circ:function(e){return 1-Math.sin(Math.acos(e))},Sine:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Back:function(e,t){return t=t[0]||1.618,Math.pow(e,2)*((t+1)*e-t)},Bounce:function(e){var t;for(var n=0,r=1;1;n+=r,r/=2)if(e>=(7-4*n)/11){t=r*r-Math.pow((11-6*n-11*e)/4,2);break}return t},Elastic:function(e,t){return Math.pow(2,10*--e)*Math.cos(20*e*Math.PI*(t[0]||1)/3)}};e.each(r,function(e,r){n[r]=t(e)}),e.each(["Quad","Cubic","Quart","Quint"],function(e,r){n[e]=t(function(e){return Math.pow(e,[r+2])})})})();var r=new t({initialize:function(e){this.setOptions(e)},setOptions:function(t){var r={duration:2500,fps:40,transition:n.Quart.easeInOut,compute:e.empty,complete:e.empty,link:"ignore"};return this.opt=e.merge(r,t||{}),this},step:function(){var t=e.time(),n=this.opt;if(t<this.time+n.duration){var r=n.transition((t-this.time)/n.duration);n.compute(r)}else this.timer=clearInterval(this.timer),n.compute(1),n.complete()},start:function(){return this.check()?(this.time=0,this.startTimer(),this):this},startTimer:function(){var t=this,n=this.opt.fps;return this.timer?!1:(this.time=e.time()-this.time,this.timer=setInterval(function(){t.step()},Math.round(1e3/n)),!0)},pause:function(){return this.stopTimer(),this},resume:function(){return this.startTimer(),this},stopTimer:function(){return this.timer?(this.time=e.time()-this.time,this.timer=clearInterval(this.timer),!0):!1},check:function(){return this.timer?this.opt.link=="cancel"?(this.stopTimer(),!0):!1:!0}}),i=function(){var t=arguments;for(var n=0,r=t.length,s={};n<r;n++){var o=i[t[n]];o.$extend?e.extend(s,o):s[t[n]]=o}return s};i.AreaChart={$extend:!0,animate:!0,labelOffset:3,type:"stacked",Tips:{enable:!1,onShow:e.empty,onHide:e.empty},Events:{enable:!1,onClick:e.empty},selectOnHover:!0,showAggregates:!0,showLabels:!0,filterOnClick:!1,restoreOnRightClick:!1},i.Margin={$extend:!1,top:0,left:0,right:0,bottom:0},i.Canvas={$extend:!0,injectInto:"id",width:!1,height:!1,useCanvas:!1,withLabels:!0,background:!1},i.Tree={$extend:!0,orientation:"left",subtreeOffset:8,siblingOffset:5,indent:10,multitree:!1,align:"center"},i.Node={$extend:!1,overridable:!1,type:"circle",color:"#ccb",alpha:1,dim:3,height:20,width:90,autoHeight:!1,autoWidth:!1,lineWidth:1,transform:!0,align:"center",angularWidth:1,span:1,CanvasStyles:{}},i.Edge={$extend:!1,overridable:!1,type:"line",color:"#ccb",lineWidth:1,dim:15,al
(),{type:"nothing"}),r.labels.clearLabels()},onComplete:function(){i.onComplete()},duration:Math.ceil(i.duration/s.length)});break;default:this.doError()}},removeEdge:function(t,n){var r=this.viz,i=e.merge(this.options,r.controller,n),s=e.type(t[0])=="string"?[t]:t,o,u,a;switch(i.type){case"nothing":for(o=0;o<s.length;o++)r.graph.removeAdjacence(s[o][0],s[o][1]);break;case"replot":this.removeEdge(s,{type:"nothing"}),r.refresh(!0);break;case"fade:seq":case"fade":u=this;for(o=0;o<s.length;o++)a=r.graph.getAdjacence(s[o][0],s[o][1]),a&&a.setData("alpha",0,"end");r.fx.animate(e.merge(i,{modes:["edge-property:alpha"],onComplete:function(){u.removeEdge(s,{type:"nothing"}),r.reposition(),r.fx.animate(e.merge(i,{modes:["linear"]}))}}));break;case"fade:con":u=this;for(o=0;o<s.length;o++)a=r.graph.getAdjacence(s[o][0],s[o][1]),a&&(a.setData("alpha",0,"end"),a.ignore=!0);r.reposition(),r.fx.animate(e.merge(i,{modes:["edge-property:alpha","linear"],onComplete:function(){u.removeEdge(s,{type:"nothing"})}}));break;case"iter":u=this,r.fx.sequence({condition:function(){return s.length!=0},step:function(){u.removeEdge(s.shift(),{type:"nothing"}),r.labels.clearLabels()},onComplete:function(){i.onComplete()},duration:Math.ceil(i.duration/s.length)});break;default:this.doError()}},sum:function(t,n){var r=this.viz,i=e.merge(this.options,r.controller,n),s=r.root,o;r.root=n.id||r.root;switch(i.type){case"nothing":o=r.construct(t),o.eachNode(function(e){e.eachAdjacency(function(e){r.graph.addAdjacence(e.nodeFrom,e.nodeTo,e.data)})});break;case"replot":r.refresh(!0),this.sum(t,{type:"nothing"}),r.refresh(!0);break;case"fade:seq":case"fade":case"fade:con":that=this,o=r.construct(t);var u=this.preprocessSum(o),a=u?["node-property:alpha","edge-property:alpha"]:["node-property:alpha"];r.reposition(),i.type!="fade:con"?r.fx.animate(e.merge(i,{modes:["linear"],onComplete:function(){r.fx.animate(e.merge(i,{modes:a,onComplete:function(){i.onComplete()}}))}})):(r.graph.eachNode(function(e){e.id!=s&&e.pos.getp().equals(l.KER)&&(e.pos.set(e.endPos),e.startPos.set(e.endPos))}),r.fx.animate(e.merge(i,{modes:["linear"].concat(a)})));break;default:this.doError()}},morph:function(t,n,r){var i=this.viz,s=e.merge(this.options,i.controller,n),o=i.root,u;i.root=n.id||i.root;switch(s.type){case"nothing":u=i.construct(t),u.eachNode(function(e){var t=i.graph.hasNode(e.id);e.eachAdjacency(function(e){var t=!!i.graph.getAdjacence(e.nodeFrom.id,e.nodeTo.id);i.graph.addAdjacence(e.nodeFrom,e.nodeTo,e.data);if(t){var n=i.graph.getAdjacence(e.nodeFrom.id,e.nodeTo.id);for(var r in e.data||{})n.data[r]=e.data[r]}});if(t){var n=i.graph.getNode(e.id);for(var r in e.data||{})n.data[r]=e.data[r]}}),i.graph.eachNode(function(e){e.eachAdjacency(function(e){u.getAdjacence(e.nodeFrom.id,e.nodeTo.id)||i.graph.removeAdjacence(e.nodeFrom.id,e.nodeTo.id)}),u.hasNode(e.id)||i.graph.removeNode(e.id)});break;case"replot":i.labels.clearLabels(!0),this.morph(t,{type:"nothing"}),i.refresh(!0),i.refresh(!0);break;case"fade:seq":case"fade":case"fade:con":that=this,u=i.construct(t);var a=r&&"node-property"in r&&e.map(e.splat(r["node-property"]),function(e){return"$"+e});i.graph.eachNode(function(t){var n=u.getNode(t.id);if(!n)t.setData("alpha",1),t.setData("alpha",1,"start"),t.setData("alpha",0,"end"),t.ignore=!0;else{var r=n.data;for(var i in r)a&&e.indexOf(a,i)>-1?t.endData[i]=r[i]:t.data[i]=r[i]}}),i.graph.eachNode(function(e){if(e.ignore)return;e.eachAdjacency(function(e){if(e.nodeFrom.ignore||e.nodeTo.ignore)return;var t=u.getNode(e.nodeFrom.id),n=u.getNode(e.nodeTo.id);if(!t.adjacentTo(n)){var e=i.graph.getAdjacence(t.id,n.id);f=!0,e.setData("alpha",1),e.setData("alpha",1,"start"),e.setData("alpha",0,"end")}})});var f=this.preprocessSum(u),c=f?["node-property:alpha","edge-property:alpha"]:["node-property:alpha"];c[0]=c[0]+(r&&"node-property"in r?":"+e.splat(r["node-property"]).join(":"):""),c[1]=(c[1]||"edge-property:alpha")+(r&&"edge-property"in r?":"+e.splat(r["edge-property"]).join(":"):""),r&&"label-property"in r&&c.push("label-property:"+e.splat(r["label-property"]).join(":")),i.repos
(i+1)%r,o=0;t!=n[s].id;s=(s+1)%r)n[s].dist=o++}},onClick:function(t,n){if(this.root!=t&&!this.busy){this.busy=!0,this.root=t,that=this,this.controller.onBeforeCompute(this.graph.getNode(t));var r=this.getNodeAndParentAngle(t);this.tagChildren(r.parent,t),this.parent=r.parent,this.compute("end");var i=r.theta-r.parent.endPos.theta;this.graph.eachNode(function(e){e.endPos.set(e.endPos.getp().add(c(i,0)))});var s=this.config.interpolation;n=e.merge({onComplete:e.empty},n||{}),this.fx.animate(e.merge({hideLabels:!0,modes:[s]},n,{onComplete:function(){that.busy=!1,n.onComplete()}}))}}}),$jit.RGraph.$extend=!0,function(n){n.Op=new t({Implements:d.Op}),n.Plot=new t({Implements:d.Plot}),n.Label={},n.Label.Native=new t({Implements:d.Label.Native}),n.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l={x:Math.round(r.x*u+s+f.width/2),y:Math.round(r.y*a+o+f.height/2)};e.setAttribute("x",l.x),e.setAttribute("y",l.y),n.onPlaceLabel(e,t)}}),n.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l={x:Math.round(r.x*u+s+f.width/2),y:Math.round(r.y*a+o+f.height/2)},c=e.style;c.left=l.x+"px",c.top=l.y+"px",c.display=this.fitsInCanvas(l,i)?"":"none",n.onPlaceLabel(e,t)}}),n.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.circle.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.circle.contains(n,t,r)}},ellipse:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");this.nodeHelper.ellipse.render("fill",n,r,i,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.ellipse.contains(n,t,r,i)}},square:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.square.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.square.contains(n,t,r)}},rectangle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");this.nodeHelper.rectangle.render("fill",n,r,i,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.rectangle.contains(n,t,r,i)}},triangle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.triangle.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.triangle.contains(n,t,r)}},star:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.star.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.star.contains(n,t,r)}}}),n.Plot.EdgeTypes=new t({none:e.empty,line:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);this.edgeHelper.line.render(n,r,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.line.contains(n,r,t,this.edge.epsilon)}},arrow:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.getData("dim"),s=e.data.$direction,o=s&&s.length>1&&s[0]!=e.nodeFrom.id;this.edgeHelper.arrow.render(n,r,i,o,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.arrow.contains(n,r,t,this.edge.epsilon)}}})}($jit.RGraph),h.prototype.moebiusTransformation=function(e){var t=this.add(e),n=e.$conjugate().$prod(this);return n.x++,t.$div(n)},d.Util.moebiusTransformation=function(e,t,n,r,i){this.eachNode(e,function(e){for(var i=0;i<n.length;i++){var s=t[i].scale(-1),o=r?r:n[i];e.getPos(n[i]).set(e.getPos(o).getc().moebiusTransformation(s))}},i)}}(),function(){var e=navigator.userAgent,t=e.match(
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.ui.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-(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r),left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:(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.ui.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 f=this.relative_container.offset();u=[this.containment[0]+f.left,this.containment[1]+f.top,this.containment[2]+f.left,this.containment[3]+f.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[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 l=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?l-this.offset.click.top<u[1]||l-this.offset.click.top>u[3]?l-this.offset.click.top<u[1]?l+n.grid[1]:l-n.grid[1]:l:l;var c=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?c-this.offset.click.left<u[0]||c-this.offset.click.left>u[2]?c-this.offset.click.left<u[0]?c+n.grid[0]:c-n.grid[0]:c:c}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-d
)===0||v?(n.data("horizontalScroll")?i.css("left",u):i.css("top",c),t||n.mCustomScrollbar("callbacks",s,i)):n.data("horizontalScroll")?i.stop().animate({left:"-="+f},n.data("scrollInertia"),n.data("scrollEasing"),function(){t||n.mCustomScrollbar("callbacks",s,i)}):i.stop().animate({top:"-="+p},n.data("scrollInertia"),n.data("scrollEasing"),function(){t||n.mCustomScrollbar("callbacks",s,i)})},scrollTo:function(t,n){var r={moveDragger:!1,callback:!0},n=e.extend(r,n),i=e(this),s,o=i.find(".mCustomScrollBox"),u=o.children(".mCSB_container");if(!e(document).data("mCS-is-touch-device"))var a=i.find(".mCSB_draggerContainer"),f=a.children(".mCSB_dragger");var l;if(t){if(typeof t=="number")n.moveDragger?s=t:(l=t,s=Math.round(l/i.data("scrollAmount")));else if(typeof t=="string"){var c;t==="top"?c=0:t==="bottom"&&!i.data("horizontalScroll")?c=u.outerHeight()-o.height():t==="left"?c=0:t==="right"&&i.data("horizontalScroll")?c=u.outerWidth()-o.width():t==="first"?c=i.find(".mCSB_container").find(":first"):t==="last"?c=i.find(".mCSB_container").find(":last"):c=i.find(t),c.length===1?(i.data("horizontalScroll")?l=c.position().left:l=c.position().top,e(document).data("mCS-is-touch-device")?s=l:s=Math.ceil(l/i.data("scrollAmount"))):s=c}e(document).data("mCS-is-touch-device")?i.data("horizontalScroll")?o.stop().animate({scrollLeft:s},i.data("scrollInertia"),i.data("scrollEasing"),function(){n.callback&&i.mCustomScrollbar("callbacks",o,u)}):o.stop().animate({scrollTop:s},i.data("scrollInertia"),i.data("scrollEasing"),function(){n.callback&&i.mCustomScrollbar("callbacks",o,u)}):(i.data("horizontalScroll")?(s>=a.width()-f.width()&&(s=a.width()-f.width()),f.css("left",s)):(s>=a.height()-f.height()&&(s=a.height()-f.height()),f.css("top",s)),n.callback?i.mCustomScrollbar("scroll"):i.mCustomScrollbar("scroll",!0))}},callbacks:function(t,n){var r=e(this);if(!e(document).data("mCS-is-touch-device"))if(r.data("horizontalScroll")){var i=Math.round(n.position().left);i<0&&i<=t.width()-n.outerWidth()+r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else{var s=Math.round(n.position().top);s<0&&s<=t.height()-n.outerHeight()+r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else if(r.data("horizontalScroll")){var o=Math.round(t.scrollLeft());o>0&&o>=n.outerWidth()-r.width()-r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else{var u=Math.round(t.scrollTop());u>0&&u>=n.outerHeight()-r.height()-r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}}};e.fn.mCustomScrollbar=function(n){if(t[n])return t[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return t.init.apply(this,arguments);e.error("Method "+n+" does not exist")}}(jQuery),function(e){function t(t){var n=t||window.event,r=[].slice.call(arguments,1),i=0,s=!0,o=0,u=0;return t=e.event.fix(n),t.type="mousewheel",n.wheelDelta&&(i=n.wheelDelta/120),n.detail&&(i=-n.detail/3),u=i,n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS&&(u=0,o=-1*i),n.wheelDeltaY!==undefined&&(u=n.wheelDeltaY/120),n.wheelDeltaX!==undefined&&(o=-1*n.wheelDeltaX/120),r.unshift(t,i,o,u),(e.event.dispatch||e.event.handle).apply(this,r)}var n=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var r=n.length;r;)e.event.fixHooks[n[--r]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=n.length;e;)this.addEventListener(n[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=n.length;e;)this.removeEventListener(n[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery),function(){}.call(this),function(){}.call(this),function(){jQuery(function(){return $(".authenticated .best_in_place").best_in_place()})}.call(this),function(e){function t(t,n)